@seamly/web-ui 22.1.0 → 22.2.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/components.js +429 -180
- 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.LICENSE.txt +2 -2
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +84 -19
- 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 +38 -38
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +462 -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.LICENSE.txt +2 -2
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +539 -216
- 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.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +557 -190
- 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.LICENSE.txt +2 -2
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/styles-default-implementation.js +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/styles.js +1 -1
- package/build/dist/lib/utils.js +459 -190
- 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.LICENSE.txt +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +28 -28
- package/src/javascripts/api/index.ts +13 -1
- package/src/javascripts/domains/config/slice.ts +2 -1
- package/src/javascripts/domains/forms/selectors.ts +6 -8
- package/src/javascripts/domains/forms/slice.ts +1 -1
- package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +3 -1
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +62 -35
- package/src/javascripts/domains/translations/slice.ts +8 -1
- package/src/javascripts/lib/engine/index.tsx +3 -1
- package/src/javascripts/style-guide/states.js +47 -0
- package/src/javascripts/ui/components/entry/text-entry/hooks.ts +2 -2
- package/src/javascripts/ui/components/form-controls/wrapper.tsx +13 -3
- package/src/stylesheets/5-components/_input.scss +0 -5
- package/src/stylesheets/5-components/_options.scss +2 -2
- package/src/stylesheets/5-components/_translation-options.scss +23 -3
package/build/dist/lib/index.js
CHANGED
|
@@ -1331,10 +1331,10 @@ var store = __webpack_require__(5465);
|
|
|
1331
1331
|
(module.exports = function (key, value) {
|
|
1332
1332
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1333
1333
|
})('versions', []).push({
|
|
1334
|
-
version: '3.
|
|
1334
|
+
version: '3.31.1',
|
|
1335
1335
|
mode: IS_PURE ? 'pure' : 'global',
|
|
1336
1336
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
1337
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
1337
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE',
|
|
1338
1338
|
source: 'https://github.com/zloirock/core-js'
|
|
1339
1339
|
});
|
|
1340
1340
|
|
|
@@ -1609,7 +1609,7 @@ var toIntegerOrInfinity = __webpack_require__(9303);
|
|
|
1609
1609
|
var addToUnscopables = __webpack_require__(1223);
|
|
1610
1610
|
|
|
1611
1611
|
// `Array.prototype.at` method
|
|
1612
|
-
// https://
|
|
1612
|
+
// https://tc39.es/ecma262/#sec-array.prototype.at
|
|
1613
1613
|
$({ target: 'Array', proto: true }, {
|
|
1614
1614
|
at: function at(index) {
|
|
1615
1615
|
var O = toObject(this);
|
|
@@ -3762,6 +3762,7 @@ _ConversationConnector_connectionListeners = new WeakMap(), _ConversationConnect
|
|
|
3762
3762
|
return !complete;
|
|
3763
3763
|
}), "f");
|
|
3764
3764
|
};
|
|
3765
|
+
/* harmony default export */ const conversation_connector = (ConversationConnector);
|
|
3765
3766
|
;// CONCATENATED MODULE: ./src/javascripts/api/index.ts
|
|
3766
3767
|
var api_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
3767
3768
|
function adopt(value) {
|
|
@@ -3801,6 +3802,14 @@ var api_classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet ||
|
|
|
3801
3802
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3802
3803
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
3803
3804
|
};
|
|
3805
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
3806
|
+
var t = {};
|
|
3807
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
3808
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3809
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
3810
|
+
}
|
|
3811
|
+
return t;
|
|
3812
|
+
};
|
|
3804
3813
|
var _API_instances, _API_ready, _API_externalId, _API_conversationAuthToken, _API_layoutMode, _API_config, _API_getAccessToken, _API_setAccessToken, _API_setConversationUrl, _API_getChannelTopic, _API_setChannelTopic, _API_getLocale, _API_getUrlPrefix, _API_updateUrls, _API_createConversation, _API_getEnvironment;
|
|
3805
3814
|
|
|
3806
3815
|
|
|
@@ -3888,7 +3897,7 @@ class API {
|
|
|
3888
3897
|
_API_conversationAuthToken.set(this, void 0);
|
|
3889
3898
|
_API_layoutMode.set(this, void 0);
|
|
3890
3899
|
_API_config.set(this, void 0);
|
|
3891
|
-
this.conversation = new
|
|
3900
|
+
this.conversation = new conversation_connector();
|
|
3892
3901
|
_API_getLocale.set(this, locale => locale || this.locale);
|
|
3893
3902
|
this.store = objectStore(`${namespace}.connection${context.locale ? `.${context.locale}` : ''}`, config.storageProvider || store);
|
|
3894
3903
|
this.connectionInfo = {
|
|
@@ -4161,6 +4170,7 @@ class API {
|
|
|
4161
4170
|
this.conversation.pushToChannel(command, buildPayload(command, payload), 10000);
|
|
4162
4171
|
}
|
|
4163
4172
|
sendContext(context) {
|
|
4173
|
+
var _a;
|
|
4164
4174
|
const {
|
|
4165
4175
|
locale,
|
|
4166
4176
|
variables
|
|
@@ -4182,7 +4192,15 @@ class API {
|
|
|
4182
4192
|
if (Object.keys(payload).length === 0 && payload.constructor === Object) {
|
|
4183
4193
|
return;
|
|
4184
4194
|
}
|
|
4185
|
-
|
|
4195
|
+
// Destructure the server locale from the payload
|
|
4196
|
+
const {
|
|
4197
|
+
locale: _
|
|
4198
|
+
} = payload,
|
|
4199
|
+
restPayload = __rest(payload, ["locale"]);
|
|
4200
|
+
const configLocale = (_a = api_classPrivateFieldGet(this, _API_config, "f").context) === null || _a === void 0 ? void 0 : _a.locale;
|
|
4201
|
+
this.send('context', Object.assign(Object.assign({}, configLocale ? {
|
|
4202
|
+
locale: configLocale
|
|
4203
|
+
} : {}), restPayload), false);
|
|
4186
4204
|
}
|
|
4187
4205
|
}
|
|
4188
4206
|
_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() {
|
|
@@ -4259,7 +4277,7 @@ _API_ready = new WeakMap(), _API_externalId = new WeakMap(), _API_conversationAu
|
|
|
4259
4277
|
return {
|
|
4260
4278
|
clientName: "@seamly/web-ui",
|
|
4261
4279
|
clientVariant: api_classPrivateFieldGet(this, _API_layoutMode, "f"),
|
|
4262
|
-
clientVersion: "22.
|
|
4280
|
+
clientVersion: "22.2.0",
|
|
4263
4281
|
currentUrl: window.location.toString(),
|
|
4264
4282
|
screenResolution: `${window.screen.width}x${window.screen.height}`,
|
|
4265
4283
|
timezone: getTimeZone(),
|
|
@@ -4295,15 +4313,52 @@ const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip d
|
|
|
4295
4313
|
const getBatch = () => batch;
|
|
4296
4314
|
;// CONCATENATED MODULE: ./node_modules/react-redux/es/components/Context.js
|
|
4297
4315
|
|
|
4298
|
-
const
|
|
4316
|
+
const ContextKey = Symbol.for(`react-redux-context-${compat_module.version}`);
|
|
4317
|
+
const gT = globalThis;
|
|
4318
|
+
|
|
4319
|
+
function getContext() {
|
|
4320
|
+
let realContext = gT[ContextKey];
|
|
4321
|
+
|
|
4322
|
+
if (!realContext) {
|
|
4323
|
+
realContext = (0,compat_module.createContext)(null);
|
|
4324
|
+
|
|
4325
|
+
if (false) {}
|
|
4326
|
+
|
|
4327
|
+
gT[ContextKey] = realContext;
|
|
4328
|
+
}
|
|
4299
4329
|
|
|
4300
|
-
|
|
4330
|
+
return realContext;
|
|
4331
|
+
}
|
|
4332
|
+
|
|
4333
|
+
const Context_ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, {
|
|
4334
|
+
get(_, handler) {
|
|
4335
|
+
const target = getContext(); // @ts-ignore
|
|
4336
|
+
|
|
4337
|
+
return (_target, ...args) => Reflect[handler](target, ...args);
|
|
4338
|
+
}
|
|
4301
4339
|
|
|
4340
|
+
}));
|
|
4302
4341
|
/* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
|
|
4303
4342
|
;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useReduxContext.js
|
|
4304
4343
|
|
|
4305
4344
|
|
|
4306
4345
|
|
|
4346
|
+
/**
|
|
4347
|
+
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
|
|
4348
|
+
* hook that you should usually not need to call directly.
|
|
4349
|
+
*
|
|
4350
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
4351
|
+
* @returns {Function} A `useReduxContext` hook bound to the specified context.
|
|
4352
|
+
*/
|
|
4353
|
+
function createReduxContextHook(context = Context_ReactReduxContext) {
|
|
4354
|
+
return function useReduxContext() {
|
|
4355
|
+
const contextValue = (0,compat_module.useContext)(context);
|
|
4356
|
+
|
|
4357
|
+
if (false) {}
|
|
4358
|
+
|
|
4359
|
+
return contextValue;
|
|
4360
|
+
};
|
|
4361
|
+
}
|
|
4307
4362
|
/**
|
|
4308
4363
|
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
4309
4364
|
* hook that you should usually not need to call directly.
|
|
@@ -4320,13 +4375,8 @@ if (false) {}
|
|
|
4320
4375
|
* return <div>{store.getState()}</div>
|
|
4321
4376
|
* }
|
|
4322
4377
|
*/
|
|
4323
|
-
function useReduxContext_useReduxContext() {
|
|
4324
|
-
const contextValue = (0,compat_module.useContext)(Context_ReactReduxContext);
|
|
4325
|
-
|
|
4326
|
-
if (false) {}
|
|
4327
4378
|
|
|
4328
|
-
|
|
4329
|
-
}
|
|
4379
|
+
const useReduxContext_useReduxContext = /*#__PURE__*/createReduxContextHook();
|
|
4330
4380
|
;// CONCATENATED MODULE: ./node_modules/react-redux/es/utils/useSyncExternalStore.js
|
|
4331
4381
|
const useSyncExternalStore_notInitialized = () => {
|
|
4332
4382
|
throw new Error('uSES not initialized!');
|
|
@@ -4351,16 +4401,37 @@ const refEquality = (a, b) => a === b;
|
|
|
4351
4401
|
|
|
4352
4402
|
|
|
4353
4403
|
function createSelectorHook(context = Context_ReactReduxContext) {
|
|
4354
|
-
const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : (
|
|
4355
|
-
return function useSelector(selector,
|
|
4404
|
+
const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : createReduxContextHook(context);
|
|
4405
|
+
return function useSelector(selector, equalityFnOrOptions = {}) {
|
|
4406
|
+
const {
|
|
4407
|
+
equalityFn = refEquality,
|
|
4408
|
+
stabilityCheck = undefined,
|
|
4409
|
+
noopCheck = undefined
|
|
4410
|
+
} = typeof equalityFnOrOptions === 'function' ? {
|
|
4411
|
+
equalityFn: equalityFnOrOptions
|
|
4412
|
+
} : equalityFnOrOptions;
|
|
4413
|
+
|
|
4356
4414
|
if (false) {}
|
|
4357
4415
|
|
|
4358
4416
|
const {
|
|
4359
4417
|
store,
|
|
4360
4418
|
subscription,
|
|
4361
|
-
getServerState
|
|
4419
|
+
getServerState,
|
|
4420
|
+
stabilityCheck: globalStabilityCheck,
|
|
4421
|
+
noopCheck: globalNoopCheck
|
|
4362
4422
|
} = useReduxContext();
|
|
4363
|
-
const
|
|
4423
|
+
const firstRun = (0,compat_module.useRef)(true);
|
|
4424
|
+
const wrappedSelector = (0,compat_module.useCallback)({
|
|
4425
|
+
[selector.name](state) {
|
|
4426
|
+
const selected = selector(state);
|
|
4427
|
+
|
|
4428
|
+
if (false) {}
|
|
4429
|
+
|
|
4430
|
+
return selected;
|
|
4431
|
+
}
|
|
4432
|
+
|
|
4433
|
+
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
|
|
4434
|
+
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
|
|
4364
4435
|
(0,compat_module.useDebugValue)(selectedState);
|
|
4365
4436
|
return selectedState;
|
|
4366
4437
|
};
|
|
@@ -4947,16 +5018,20 @@ function Provider({
|
|
|
4947
5018
|
store,
|
|
4948
5019
|
context,
|
|
4949
5020
|
children,
|
|
4950
|
-
serverState
|
|
5021
|
+
serverState,
|
|
5022
|
+
stabilityCheck = 'once',
|
|
5023
|
+
noopCheck = 'once'
|
|
4951
5024
|
}) {
|
|
4952
5025
|
const contextValue = (0,compat_module.useMemo)(() => {
|
|
4953
5026
|
const subscription = Subscription_createSubscription(store);
|
|
4954
5027
|
return {
|
|
4955
5028
|
store,
|
|
4956
5029
|
subscription,
|
|
4957
|
-
getServerState: serverState ? () => serverState : undefined
|
|
5030
|
+
getServerState: serverState ? () => serverState : undefined,
|
|
5031
|
+
stabilityCheck,
|
|
5032
|
+
noopCheck
|
|
4958
5033
|
};
|
|
4959
|
-
}, [store, serverState]);
|
|
5034
|
+
}, [store, serverState, stabilityCheck, noopCheck]);
|
|
4960
5035
|
const previousState = (0,compat_module.useMemo)(() => store.getState(), [store]);
|
|
4961
5036
|
useIsomorphicLayoutEffect_useIsomorphicLayoutEffect(() => {
|
|
4962
5037
|
const {
|
|
@@ -4985,7 +5060,6 @@ function Provider({
|
|
|
4985
5060
|
;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useStore.js
|
|
4986
5061
|
|
|
4987
5062
|
|
|
4988
|
-
|
|
4989
5063
|
/**
|
|
4990
5064
|
* Hook factory, which creates a `useStore` hook bound to a given context.
|
|
4991
5065
|
*
|
|
@@ -4995,7 +5069,8 @@ function Provider({
|
|
|
4995
5069
|
|
|
4996
5070
|
function createStoreHook(context = Context_ReactReduxContext) {
|
|
4997
5071
|
const useReduxContext = // @ts-ignore
|
|
4998
|
-
context === Context_ReactReduxContext ? useReduxContext_useReduxContext :
|
|
5072
|
+
context === Context_ReactReduxContext ? useReduxContext_useReduxContext : // @ts-ignore
|
|
5073
|
+
createReduxContextHook(context);
|
|
4999
5074
|
return function useStore() {
|
|
5000
5075
|
const {
|
|
5001
5076
|
store
|
|
@@ -9433,7 +9508,7 @@ const {
|
|
|
9433
9508
|
} = storeSlice.actions;
|
|
9434
9509
|
/* harmony default export */ const store_slice = (storeSlice.reducer);
|
|
9435
9510
|
;// CONCATENATED MODULE: ./src/javascripts/domains/config/slice.ts
|
|
9436
|
-
var
|
|
9511
|
+
var slice_rest = undefined && undefined.__rest || function (s, e) {
|
|
9437
9512
|
var t = {};
|
|
9438
9513
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
9439
9514
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -9476,7 +9551,7 @@ const updateState = (state, config) => {
|
|
|
9476
9551
|
{
|
|
9477
9552
|
messages
|
|
9478
9553
|
} = _a,
|
|
9479
|
-
partialConfig =
|
|
9554
|
+
partialConfig = slice_rest(_a, ["messages"]);
|
|
9480
9555
|
let newState = state;
|
|
9481
9556
|
if (Object.keys(partialConfig).length > 0) {
|
|
9482
9557
|
newState = Object.assign(Object.assign({}, newState), partialConfig);
|
|
@@ -9510,13 +9585,15 @@ const configSlice = createSlice({
|
|
|
9510
9585
|
preChat,
|
|
9511
9586
|
agentParticipant,
|
|
9512
9587
|
userParticipant,
|
|
9513
|
-
startChatIcon
|
|
9588
|
+
startChatIcon,
|
|
9589
|
+
locale
|
|
9514
9590
|
}
|
|
9515
9591
|
}) => {
|
|
9516
9592
|
state.preChatEvents = preChat.map(payload => ({
|
|
9517
9593
|
type: 'message',
|
|
9518
9594
|
payload
|
|
9519
9595
|
}));
|
|
9596
|
+
state.context.locale = locale;
|
|
9520
9597
|
state.agentParticipant = agentParticipant;
|
|
9521
9598
|
state.userParticipant = userParticipant;
|
|
9522
9599
|
state.startChatIcon = startChatIcon;
|
|
@@ -9958,7 +10035,13 @@ const translationSlice = createSlice({
|
|
|
9958
10035
|
const feature = (_a = payload === null || payload === void 0 ? void 0 : payload.features) === null || _a === void 0 ? void 0 : _a.translation;
|
|
9959
10036
|
if (!feature) return;
|
|
9960
10037
|
state.isAvailable = feature.enabled === true;
|
|
9961
|
-
state.languages = feature.languages
|
|
10038
|
+
state.languages = [...feature.languages].sort((a, b) => {
|
|
10039
|
+
if (a.locale === payload.locale) return -1;
|
|
10040
|
+
if (b.locale === payload.locale) return 1;
|
|
10041
|
+
return a.nativeName.localeCompare(b.nativeName, undefined, {
|
|
10042
|
+
sensitivity: 'base'
|
|
10043
|
+
});
|
|
10044
|
+
});
|
|
9962
10045
|
}).addCase(setHistory, (state, {
|
|
9963
10046
|
payload
|
|
9964
10047
|
}) => {
|
|
@@ -13236,7 +13319,7 @@ const TimeIndicator = ({
|
|
|
13236
13319
|
/* harmony default export */ const time_indicator = (TimeIndicator);
|
|
13237
13320
|
;// CONCATENATED MODULE: ./node_modules/tabbable/dist/index.esm.js
|
|
13238
13321
|
/*!
|
|
13239
|
-
* tabbable 6.
|
|
13322
|
+
* tabbable 6.2.0
|
|
13240
13323
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
13241
13324
|
*/
|
|
13242
13325
|
// NOTE: separate `:not()` selectors has broader browser support than the newer
|
|
@@ -13416,7 +13499,27 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
|
|
|
13416
13499
|
}
|
|
13417
13500
|
return candidates;
|
|
13418
13501
|
};
|
|
13419
|
-
|
|
13502
|
+
|
|
13503
|
+
/**
|
|
13504
|
+
* @private
|
|
13505
|
+
* Determines if the node has an explicitly specified `tabindex` attribute.
|
|
13506
|
+
* @param {HTMLElement} node
|
|
13507
|
+
* @returns {boolean} True if so; false if not.
|
|
13508
|
+
*/
|
|
13509
|
+
var hasTabIndex = function hasTabIndex(node) {
|
|
13510
|
+
return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
|
|
13511
|
+
};
|
|
13512
|
+
|
|
13513
|
+
/**
|
|
13514
|
+
* Determine the tab index of a given node.
|
|
13515
|
+
* @param {HTMLElement} node
|
|
13516
|
+
* @returns {number} Tab order (negative, 0, or positive number).
|
|
13517
|
+
* @throws {Error} If `node` is falsy.
|
|
13518
|
+
*/
|
|
13519
|
+
var getTabIndex = function getTabIndex(node) {
|
|
13520
|
+
if (!node) {
|
|
13521
|
+
throw new Error('No node provided');
|
|
13522
|
+
}
|
|
13420
13523
|
if (node.tabIndex < 0) {
|
|
13421
13524
|
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
13422
13525
|
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
@@ -13425,16 +13528,28 @@ var getTabindex = function getTabindex(node, isScope) {
|
|
|
13425
13528
|
// order, consider their tab index to be 0.
|
|
13426
13529
|
// Also browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
13427
13530
|
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
13428
|
-
|
|
13429
|
-
// isScope is positive for custom element with shadow root or slot that by default
|
|
13430
|
-
// have tabIndex -1, but need to be sorted by document order in order for their
|
|
13431
|
-
// content to be inserted in the correct position
|
|
13432
|
-
if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
|
|
13531
|
+
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
13433
13532
|
return 0;
|
|
13434
13533
|
}
|
|
13435
13534
|
}
|
|
13436
13535
|
return node.tabIndex;
|
|
13437
13536
|
};
|
|
13537
|
+
|
|
13538
|
+
/**
|
|
13539
|
+
* Determine the tab index of a given node __for sort order purposes__.
|
|
13540
|
+
* @param {HTMLElement} node
|
|
13541
|
+
* @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
|
|
13542
|
+
* has tabIndex -1, but needs to be sorted by document order in order for its content to be
|
|
13543
|
+
* inserted into the correct sort position.
|
|
13544
|
+
* @returns {number} Tab order (negative, 0, or positive number).
|
|
13545
|
+
*/
|
|
13546
|
+
var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
|
|
13547
|
+
var tabIndex = getTabIndex(node);
|
|
13548
|
+
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
13549
|
+
return 0;
|
|
13550
|
+
}
|
|
13551
|
+
return tabIndex;
|
|
13552
|
+
};
|
|
13438
13553
|
var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
|
|
13439
13554
|
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
13440
13555
|
};
|
|
@@ -13677,7 +13792,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
|
|
|
13677
13792
|
return true;
|
|
13678
13793
|
};
|
|
13679
13794
|
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
|
|
13680
|
-
if (isNonTabbableRadio(node) ||
|
|
13795
|
+
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
13681
13796
|
return false;
|
|
13682
13797
|
}
|
|
13683
13798
|
return true;
|
|
@@ -13702,7 +13817,7 @@ var sortByOrder = function sortByOrder(candidates) {
|
|
|
13702
13817
|
candidates.forEach(function (item, i) {
|
|
13703
13818
|
var isScope = !!item.scopeParent;
|
|
13704
13819
|
var element = isScope ? item.scopeParent : item;
|
|
13705
|
-
var candidateTabindex =
|
|
13820
|
+
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
13706
13821
|
var elements = isScope ? sortByOrder(item.candidates) : element;
|
|
13707
13822
|
if (candidateTabindex === 0) {
|
|
13708
13823
|
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
@@ -13721,32 +13836,32 @@ var sortByOrder = function sortByOrder(candidates) {
|
|
|
13721
13836
|
return acc;
|
|
13722
13837
|
}, []).concat(regularTabbables);
|
|
13723
13838
|
};
|
|
13724
|
-
var tabbable = function tabbable(
|
|
13839
|
+
var tabbable = function tabbable(container, options) {
|
|
13725
13840
|
options = options || {};
|
|
13726
13841
|
var candidates;
|
|
13727
13842
|
if (options.getShadowRoot) {
|
|
13728
|
-
candidates = getCandidatesIteratively([
|
|
13843
|
+
candidates = getCandidatesIteratively([container], options.includeContainer, {
|
|
13729
13844
|
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
13730
13845
|
flatten: false,
|
|
13731
13846
|
getShadowRoot: options.getShadowRoot,
|
|
13732
13847
|
shadowRootFilter: isValidShadowRootTabbable
|
|
13733
13848
|
});
|
|
13734
13849
|
} else {
|
|
13735
|
-
candidates = getCandidates(
|
|
13850
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
13736
13851
|
}
|
|
13737
13852
|
return sortByOrder(candidates);
|
|
13738
13853
|
};
|
|
13739
|
-
var focusable = function focusable(
|
|
13854
|
+
var focusable = function focusable(container, options) {
|
|
13740
13855
|
options = options || {};
|
|
13741
13856
|
var candidates;
|
|
13742
13857
|
if (options.getShadowRoot) {
|
|
13743
|
-
candidates = getCandidatesIteratively([
|
|
13858
|
+
candidates = getCandidatesIteratively([container], options.includeContainer, {
|
|
13744
13859
|
filter: isNodeMatchingSelectorFocusable.bind(null, options),
|
|
13745
13860
|
flatten: true,
|
|
13746
13861
|
getShadowRoot: options.getShadowRoot
|
|
13747
13862
|
});
|
|
13748
13863
|
} else {
|
|
13749
|
-
candidates = getCandidates(
|
|
13864
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
|
|
13750
13865
|
}
|
|
13751
13866
|
return candidates;
|
|
13752
13867
|
};
|
|
@@ -13777,7 +13892,7 @@ var isFocusable = function isFocusable(node, options) {
|
|
|
13777
13892
|
|
|
13778
13893
|
;// CONCATENATED MODULE: ./node_modules/focus-trap/dist/focus-trap.esm.js
|
|
13779
13894
|
/*!
|
|
13780
|
-
* focus-trap 7.
|
|
13895
|
+
* focus-trap 7.5.2
|
|
13781
13896
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
13782
13897
|
*/
|
|
13783
13898
|
|
|
@@ -13863,10 +13978,10 @@ var isSelectableInput = function isSelectableInput(node) {
|
|
|
13863
13978
|
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
13864
13979
|
};
|
|
13865
13980
|
var isEscapeEvent = function isEscapeEvent(e) {
|
|
13866
|
-
return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
|
|
13981
|
+
return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
|
|
13867
13982
|
};
|
|
13868
13983
|
var isTabEvent = function isTabEvent(e) {
|
|
13869
|
-
return e.key === 'Tab' || e.keyCode === 9;
|
|
13984
|
+
return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
|
|
13870
13985
|
};
|
|
13871
13986
|
|
|
13872
13987
|
// checks for TAB by default
|
|
@@ -13950,8 +14065,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
13950
14065
|
// container: HTMLElement,
|
|
13951
14066
|
// tabbableNodes: Array<HTMLElement>, // empty if none
|
|
13952
14067
|
// focusableNodes: Array<HTMLElement>, // empty if none
|
|
13953
|
-
//
|
|
13954
|
-
//
|
|
14068
|
+
// posTabIndexesFound: boolean,
|
|
14069
|
+
// firstTabbableNode: HTMLElement|undefined,
|
|
14070
|
+
// lastTabbableNode: HTMLElement|undefined,
|
|
14071
|
+
// firstDomTabbableNode: HTMLElement|undefined,
|
|
14072
|
+
// lastDomTabbableNode: HTMLElement|undefined,
|
|
13955
14073
|
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
13956
14074
|
// }>}
|
|
13957
14075
|
containerGroups: [],
|
|
@@ -13968,7 +14086,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
13968
14086
|
paused: false,
|
|
13969
14087
|
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
13970
14088
|
// has been delayed during activation
|
|
13971
|
-
delayInitialFocusTimer: undefined
|
|
14089
|
+
delayInitialFocusTimer: undefined,
|
|
14090
|
+
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
14091
|
+
recentNavEvent: undefined
|
|
13972
14092
|
};
|
|
13973
14093
|
var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
|
|
13974
14094
|
|
|
@@ -13987,7 +14107,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
13987
14107
|
/**
|
|
13988
14108
|
* Finds the index of the container that contains the element.
|
|
13989
14109
|
* @param {HTMLElement} element
|
|
13990
|
-
* @param {Event} [event]
|
|
14110
|
+
* @param {Event} [event] If available, and `element` isn't directly found in any container,
|
|
14111
|
+
* the event's composed path is used to see if includes any known trap containers in the
|
|
14112
|
+
* case where the element is inside a Shadow DOM.
|
|
13991
14113
|
* @returns {number} Index of the container in either `state.containers` or
|
|
13992
14114
|
* `state.containerGroups` (the order/length of these lists are the same); -1
|
|
13993
14115
|
* if the element isn't found.
|
|
@@ -14082,14 +14204,41 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14082
14204
|
var tabbableNodes = tabbable(container, config.tabbableOptions);
|
|
14083
14205
|
|
|
14084
14206
|
// NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
|
|
14085
|
-
// are a superset of tabbable nodes
|
|
14207
|
+
// are a superset of tabbable nodes since nodes with negative `tabindex` attributes
|
|
14208
|
+
// are focusable but not tabbable
|
|
14086
14209
|
var focusableNodes = focusable(container, config.tabbableOptions);
|
|
14210
|
+
var firstTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[0] : undefined;
|
|
14211
|
+
var lastTabbableNode = tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : undefined;
|
|
14212
|
+
var firstDomTabbableNode = focusableNodes.find(function (node) {
|
|
14213
|
+
return isTabbable(node);
|
|
14214
|
+
});
|
|
14215
|
+
var lastDomTabbableNode = focusableNodes.slice().reverse().find(function (node) {
|
|
14216
|
+
return isTabbable(node);
|
|
14217
|
+
});
|
|
14218
|
+
var posTabIndexesFound = !!tabbableNodes.find(function (node) {
|
|
14219
|
+
return getTabIndex(node) > 0;
|
|
14220
|
+
});
|
|
14087
14221
|
return {
|
|
14088
14222
|
container: container,
|
|
14089
14223
|
tabbableNodes: tabbableNodes,
|
|
14090
14224
|
focusableNodes: focusableNodes,
|
|
14091
|
-
|
|
14092
|
-
|
|
14225
|
+
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
14226
|
+
posTabIndexesFound: posTabIndexesFound,
|
|
14227
|
+
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
14228
|
+
firstTabbableNode: firstTabbableNode,
|
|
14229
|
+
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
14230
|
+
lastTabbableNode: lastTabbableNode,
|
|
14231
|
+
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
14232
|
+
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
14233
|
+
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
14234
|
+
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
|
|
14235
|
+
// to address an edge case related to positive tabindex support, this seems like a much easier,
|
|
14236
|
+
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
14237
|
+
// be avoided anyway...
|
|
14238
|
+
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
14239
|
+
firstDomTabbableNode: firstDomTabbableNode,
|
|
14240
|
+
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
14241
|
+
lastDomTabbableNode: lastDomTabbableNode,
|
|
14093
14242
|
/**
|
|
14094
14243
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
14095
14244
|
* in this container, if any.
|
|
@@ -14100,30 +14249,24 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14100
14249
|
*/
|
|
14101
14250
|
nextTabbableNode: function nextTabbableNode(node) {
|
|
14102
14251
|
var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
14103
|
-
|
|
14104
|
-
// from the DOM order), this __will not work__ because the list of focusableNodes,
|
|
14105
|
-
// while it contains tabbable nodes, does not sort its nodes in any order other
|
|
14106
|
-
// than DOM order, because it can't: Where would you place focusable (but not
|
|
14107
|
-
// tabbable) nodes in that order? They have no order, because they aren't tabbale...
|
|
14108
|
-
// Support for positive tabindex is already broken and hard to manage (possibly
|
|
14109
|
-
// not supportable, TBD), so this isn't going to make things worse than they
|
|
14110
|
-
// already are, and at least makes things better for the majority of cases where
|
|
14111
|
-
// tabindex is either 0/unset or negative.
|
|
14112
|
-
// FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
|
|
14113
|
-
var nodeIdx = focusableNodes.findIndex(function (n) {
|
|
14114
|
-
return n === node;
|
|
14115
|
-
});
|
|
14252
|
+
var nodeIdx = tabbableNodes.indexOf(node);
|
|
14116
14253
|
if (nodeIdx < 0) {
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14254
|
+
// either not tabbable nor focusable, or was focused but not tabbable (negative tabindex):
|
|
14255
|
+
// since `node` should at least have been focusable, we assume that's the case and mimic
|
|
14256
|
+
// what browsers do, which is set focus to the next node in __document position order__,
|
|
14257
|
+
// regardless of positive tabindexes, if any -- and for reasons explained in the NOTE
|
|
14258
|
+
// above related to `firstDomTabbable` and `lastDomTabbable` properties, we fall back to
|
|
14259
|
+
// basic DOM order
|
|
14260
|
+
if (forward) {
|
|
14261
|
+
return focusableNodes.slice(focusableNodes.indexOf(node) + 1).find(function (el) {
|
|
14262
|
+
return isTabbable(el);
|
|
14263
|
+
});
|
|
14264
|
+
}
|
|
14265
|
+
return focusableNodes.slice(0, focusableNodes.indexOf(node)).reverse().find(function (el) {
|
|
14266
|
+
return isTabbable(el);
|
|
14122
14267
|
});
|
|
14123
14268
|
}
|
|
14124
|
-
return
|
|
14125
|
-
return isTabbable(n, config.tabbableOptions);
|
|
14126
|
-
});
|
|
14269
|
+
return tabbableNodes[nodeIdx + (forward ? 1 : -1)];
|
|
14127
14270
|
}
|
|
14128
14271
|
};
|
|
14129
14272
|
});
|
|
@@ -14136,6 +14279,19 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14136
14279
|
) {
|
|
14137
14280
|
throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
|
|
14138
14281
|
}
|
|
14282
|
+
|
|
14283
|
+
// NOTE: Positive tabindexes are only properly supported in single-container traps because
|
|
14284
|
+
// doing it across multiple containers where tabindexes could be all over the place
|
|
14285
|
+
// would require Tabbable to support multiple containers, would require additional
|
|
14286
|
+
// specialized Shadow DOM support, and would require Tabbable's multi-container support
|
|
14287
|
+
// to look at those containers in document position order rather than user-provided
|
|
14288
|
+
// order (as they are treated in Focus-trap, for legacy reasons). See discussion on
|
|
14289
|
+
// https://github.com/focus-trap/focus-trap/issues/375 for more details.
|
|
14290
|
+
if (state.containerGroups.find(function (g) {
|
|
14291
|
+
return g.posTabIndexesFound;
|
|
14292
|
+
}) && state.containerGroups.length > 1) {
|
|
14293
|
+
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
14294
|
+
}
|
|
14139
14295
|
};
|
|
14140
14296
|
var tryFocus = function tryFocus(node) {
|
|
14141
14297
|
if (node === false) {
|
|
@@ -14151,6 +14307,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14151
14307
|
node.focus({
|
|
14152
14308
|
preventScroll: !!config.preventScroll
|
|
14153
14309
|
});
|
|
14310
|
+
// NOTE: focus() API does not trigger focusIn event so set MRU node manually
|
|
14154
14311
|
state.mostRecentlyFocusedNode = node;
|
|
14155
14312
|
if (isSelectableInput(node)) {
|
|
14156
14313
|
node.select();
|
|
@@ -14161,64 +14318,23 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14161
14318
|
return node ? node : node === false ? false : previousActiveElement;
|
|
14162
14319
|
};
|
|
14163
14320
|
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
returnFocus: config.returnFocusOnDeactivate
|
|
14182
|
-
});
|
|
14183
|
-
return;
|
|
14184
|
-
}
|
|
14185
|
-
|
|
14186
|
-
// This is needed for mobile devices.
|
|
14187
|
-
// (If we'll only let `click` events through,
|
|
14188
|
-
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
14189
|
-
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
14190
|
-
// allow the click outside the trap to take place
|
|
14191
|
-
return;
|
|
14192
|
-
}
|
|
14193
|
-
|
|
14194
|
-
// otherwise, prevent the click
|
|
14195
|
-
e.preventDefault();
|
|
14196
|
-
};
|
|
14197
|
-
|
|
14198
|
-
// In case focus escapes the trap for some strange reason, pull it back in.
|
|
14199
|
-
var checkFocusIn = function checkFocusIn(e) {
|
|
14200
|
-
var target = getActualTarget(e);
|
|
14201
|
-
var targetContained = findContainerIndex(target, e) >= 0;
|
|
14202
|
-
|
|
14203
|
-
// In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
14204
|
-
if (targetContained || target instanceof Document) {
|
|
14205
|
-
if (targetContained) {
|
|
14206
|
-
state.mostRecentlyFocusedNode = target;
|
|
14207
|
-
}
|
|
14208
|
-
} else {
|
|
14209
|
-
// escaped! pull it back in to where it just left
|
|
14210
|
-
e.stopImmediatePropagation();
|
|
14211
|
-
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
14212
|
-
}
|
|
14213
|
-
};
|
|
14214
|
-
|
|
14215
|
-
// Hijack key nav events on the first and last focusable nodes of the trap,
|
|
14216
|
-
// in order to prevent focus from escaping. If it escapes for even a
|
|
14217
|
-
// moment it can end up scrolling the page and causing confusion so we
|
|
14218
|
-
// kind of need to capture the action at the keydown phase.
|
|
14219
|
-
var checkKeyNav = function checkKeyNav(event) {
|
|
14220
|
-
var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
14221
|
-
var target = getActualTarget(event);
|
|
14321
|
+
/**
|
|
14322
|
+
* Finds the next node (in either direction) where focus should move according to a
|
|
14323
|
+
* keyboard focus-in event.
|
|
14324
|
+
* @param {Object} params
|
|
14325
|
+
* @param {Node} [params.target] Known target __from which__ to navigate, if any.
|
|
14326
|
+
* @param {KeyboardEvent|FocusEvent} [params.event] Event to use if `target` isn't known (event
|
|
14327
|
+
* will be used to determine the `target`). Ignored if `target` is specified.
|
|
14328
|
+
* @param {boolean} [params.isBackward] True if focus should move backward.
|
|
14329
|
+
* @returns {Node|undefined} The next node, or `undefined` if a next node couldn't be
|
|
14330
|
+
* determined given the current state of the trap.
|
|
14331
|
+
*/
|
|
14332
|
+
var findNextNavNode = function findNextNavNode(_ref2) {
|
|
14333
|
+
var target = _ref2.target,
|
|
14334
|
+
event = _ref2.event,
|
|
14335
|
+
_ref2$isBackward = _ref2.isBackward,
|
|
14336
|
+
isBackward = _ref2$isBackward === void 0 ? false : _ref2$isBackward;
|
|
14337
|
+
target = target || getActualTarget(event);
|
|
14222
14338
|
updateTabbableNodes();
|
|
14223
14339
|
var destinationNode = null;
|
|
14224
14340
|
if (state.tabbableGroups.length > 0) {
|
|
@@ -14241,8 +14357,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14241
14357
|
// REVERSE
|
|
14242
14358
|
|
|
14243
14359
|
// is the target the first tabbable node in a group?
|
|
14244
|
-
var startOfGroupIndex = findIndex(state.tabbableGroups, function (
|
|
14245
|
-
var firstTabbableNode =
|
|
14360
|
+
var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
|
|
14361
|
+
var firstTabbableNode = _ref3.firstTabbableNode;
|
|
14246
14362
|
return target === firstTabbableNode;
|
|
14247
14363
|
});
|
|
14248
14364
|
if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
|
|
@@ -14260,7 +14376,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14260
14376
|
// the LAST group if it's the first tabbable node of the FIRST group)
|
|
14261
14377
|
var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
|
|
14262
14378
|
var destinationGroup = state.tabbableGroups[destinationGroupIndex];
|
|
14263
|
-
destinationNode = destinationGroup.lastTabbableNode;
|
|
14379
|
+
destinationNode = getTabIndex(target) >= 0 ? destinationGroup.lastTabbableNode : destinationGroup.lastDomTabbableNode;
|
|
14264
14380
|
} else if (!isTabEvent(event)) {
|
|
14265
14381
|
// user must have customized the nav keys so we have to move focus manually _within_
|
|
14266
14382
|
// the active group: do this based on the order determined by tabbable()
|
|
@@ -14270,8 +14386,8 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14270
14386
|
// FORWARD
|
|
14271
14387
|
|
|
14272
14388
|
// is the target the last tabbable node in a group?
|
|
14273
|
-
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (
|
|
14274
|
-
var lastTabbableNode =
|
|
14389
|
+
var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref4) {
|
|
14390
|
+
var lastTabbableNode = _ref4.lastTabbableNode;
|
|
14275
14391
|
return target === lastTabbableNode;
|
|
14276
14392
|
});
|
|
14277
14393
|
if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
|
|
@@ -14289,7 +14405,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14289
14405
|
// group if it's the last tabbable node of the LAST group)
|
|
14290
14406
|
var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
|
|
14291
14407
|
var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
|
|
14292
|
-
destinationNode = _destinationGroup.firstTabbableNode;
|
|
14408
|
+
destinationNode = getTabIndex(target) >= 0 ? _destinationGroup.firstTabbableNode : _destinationGroup.firstDomTabbableNode;
|
|
14293
14409
|
} else if (!isTabEvent(event)) {
|
|
14294
14410
|
// user must have customized the nav keys so we have to move focus manually _within_
|
|
14295
14411
|
// the active group: do this based on the order determined by tabbable()
|
|
@@ -14301,6 +14417,153 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
14301
14417
|
// NOTE: the fallbackFocus option does not support returning false to opt-out
|
|
14302
14418
|
destinationNode = getNodeForOption('fallbackFocus');
|
|
14303
14419
|
}
|
|
14420
|
+
return destinationNode;
|
|
14421
|
+
};
|
|
14422
|
+
|
|
14423
|
+
// This needs to be done on mousedown and touchstart instead of click
|
|
14424
|
+
// so that it precedes the focus event.
|
|
14425
|
+
var checkPointerDown = function checkPointerDown(e) {
|
|
14426
|
+
var target = getActualTarget(e);
|
|
14427
|
+
if (findContainerIndex(target, e) >= 0) {
|
|
14428
|
+
// allow the click since it ocurred inside the trap
|
|
14429
|
+
return;
|
|
14430
|
+
}
|
|
14431
|
+
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
14432
|
+
// immediately deactivate the trap
|
|
14433
|
+
trap.deactivate({
|
|
14434
|
+
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
14435
|
+
// which will result in the outside click setting focus to the node
|
|
14436
|
+
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
14437
|
+
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
14438
|
+
// on activation (or the configured `setReturnFocus` node), whether the
|
|
14439
|
+
// outside click was on a focusable node or not
|
|
14440
|
+
returnFocus: config.returnFocusOnDeactivate
|
|
14441
|
+
});
|
|
14442
|
+
return;
|
|
14443
|
+
}
|
|
14444
|
+
|
|
14445
|
+
// This is needed for mobile devices.
|
|
14446
|
+
// (If we'll only let `click` events through,
|
|
14447
|
+
// then on mobile they will be blocked anyways if `touchstart` is blocked.)
|
|
14448
|
+
if (valueOrHandler(config.allowOutsideClick, e)) {
|
|
14449
|
+
// allow the click outside the trap to take place
|
|
14450
|
+
return;
|
|
14451
|
+
}
|
|
14452
|
+
|
|
14453
|
+
// otherwise, prevent the click
|
|
14454
|
+
e.preventDefault();
|
|
14455
|
+
};
|
|
14456
|
+
|
|
14457
|
+
// In case focus escapes the trap for some strange reason, pull it back in.
|
|
14458
|
+
// NOTE: the focusIn event is NOT cancelable, so if focus escapes, it may cause unexpected
|
|
14459
|
+
// scrolling if the node that got focused was out of view; there's nothing we can do to
|
|
14460
|
+
// prevent that from happening by the time we discover that focus escaped
|
|
14461
|
+
var checkFocusIn = function checkFocusIn(event) {
|
|
14462
|
+
var target = getActualTarget(event);
|
|
14463
|
+
var targetContained = findContainerIndex(target, event) >= 0;
|
|
14464
|
+
|
|
14465
|
+
// In Firefox when you Tab out of an iframe the Document is briefly focused.
|
|
14466
|
+
if (targetContained || target instanceof Document) {
|
|
14467
|
+
if (targetContained) {
|
|
14468
|
+
state.mostRecentlyFocusedNode = target;
|
|
14469
|
+
}
|
|
14470
|
+
} else {
|
|
14471
|
+
// escaped! pull it back in to where it just left
|
|
14472
|
+
event.stopImmediatePropagation();
|
|
14473
|
+
|
|
14474
|
+
// focus will escape if the MRU node had a positive tab index and user tried to nav forward;
|
|
14475
|
+
// it will also escape if the MRU node had a 0 tab index and user tried to nav backward
|
|
14476
|
+
// toward a node with a positive tab index
|
|
14477
|
+
var nextNode; // next node to focus, if we find one
|
|
14478
|
+
var navAcrossContainers = true;
|
|
14479
|
+
if (state.mostRecentlyFocusedNode) {
|
|
14480
|
+
if (getTabIndex(state.mostRecentlyFocusedNode) > 0) {
|
|
14481
|
+
// MRU container index must be >=0 otherwise we wouldn't have it as an MRU node...
|
|
14482
|
+
var mruContainerIdx = findContainerIndex(state.mostRecentlyFocusedNode);
|
|
14483
|
+
// there MAY not be any tabbable nodes in the container if there are at least 2 containers
|
|
14484
|
+
// and the MRU node is focusable but not tabbable (focus-trap requires at least 1 container
|
|
14485
|
+
// with at least one tabbable node in order to function, so this could be the other container
|
|
14486
|
+
// with nothing tabbable in it)
|
|
14487
|
+
var tabbableNodes = state.containerGroups[mruContainerIdx].tabbableNodes;
|
|
14488
|
+
if (tabbableNodes.length > 0) {
|
|
14489
|
+
// MRU tab index MAY not be found if the MRU node is focusable but not tabbable
|
|
14490
|
+
var mruTabIdx = tabbableNodes.findIndex(function (node) {
|
|
14491
|
+
return node === state.mostRecentlyFocusedNode;
|
|
14492
|
+
});
|
|
14493
|
+
if (mruTabIdx >= 0) {
|
|
14494
|
+
if (config.isKeyForward(state.recentNavEvent)) {
|
|
14495
|
+
if (mruTabIdx + 1 < tabbableNodes.length) {
|
|
14496
|
+
nextNode = tabbableNodes[mruTabIdx + 1];
|
|
14497
|
+
navAcrossContainers = false;
|
|
14498
|
+
}
|
|
14499
|
+
// else, don't wrap within the container as focus should move to next/previous
|
|
14500
|
+
// container
|
|
14501
|
+
} else {
|
|
14502
|
+
if (mruTabIdx - 1 >= 0) {
|
|
14503
|
+
nextNode = tabbableNodes[mruTabIdx - 1];
|
|
14504
|
+
navAcrossContainers = false;
|
|
14505
|
+
}
|
|
14506
|
+
// else, don't wrap within the container as focus should move to next/previous
|
|
14507
|
+
// container
|
|
14508
|
+
}
|
|
14509
|
+
// else, don't find in container order without considering direction too
|
|
14510
|
+
}
|
|
14511
|
+
}
|
|
14512
|
+
// else, no tabbable nodes in that container (which means we must have at least one other
|
|
14513
|
+
// container with at least one tabbable node in it, otherwise focus-trap would've thrown
|
|
14514
|
+
// an error the last time updateTabbableNodes() was run): find next node among all known
|
|
14515
|
+
// containers
|
|
14516
|
+
} else {
|
|
14517
|
+
// check to see if there's at least one tabbable node with a positive tab index inside
|
|
14518
|
+
// the trap because focus seems to escape when navigating backward from a tabbable node
|
|
14519
|
+
// with tabindex=0 when this is the case (instead of wrapping to the tabbable node with
|
|
14520
|
+
// the greatest positive tab index like it should)
|
|
14521
|
+
if (!state.containerGroups.some(function (g) {
|
|
14522
|
+
return g.tabbableNodes.some(function (n) {
|
|
14523
|
+
return getTabIndex(n) > 0;
|
|
14524
|
+
});
|
|
14525
|
+
})) {
|
|
14526
|
+
// no containers with tabbable nodes with positive tab indexes which means the focus
|
|
14527
|
+
// escaped for some other reason and we should just execute the fallback to the
|
|
14528
|
+
// MRU node or initial focus node, if any
|
|
14529
|
+
navAcrossContainers = false;
|
|
14530
|
+
}
|
|
14531
|
+
}
|
|
14532
|
+
} else {
|
|
14533
|
+
// no MRU node means we're likely in some initial condition when the trap has just
|
|
14534
|
+
// been activated and initial focus hasn't been given yet, in which case we should
|
|
14535
|
+
// fall through to trying to focus the initial focus node, which is what should
|
|
14536
|
+
// happen below at this point in the logic
|
|
14537
|
+
navAcrossContainers = false;
|
|
14538
|
+
}
|
|
14539
|
+
if (navAcrossContainers) {
|
|
14540
|
+
nextNode = findNextNavNode({
|
|
14541
|
+
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
14542
|
+
// outside the trap causing the focus escape we're trying to fix)
|
|
14543
|
+
target: state.mostRecentlyFocusedNode,
|
|
14544
|
+
isBackward: config.isKeyBackward(state.recentNavEvent)
|
|
14545
|
+
});
|
|
14546
|
+
}
|
|
14547
|
+
if (nextNode) {
|
|
14548
|
+
tryFocus(nextNode);
|
|
14549
|
+
} else {
|
|
14550
|
+
tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
|
|
14551
|
+
}
|
|
14552
|
+
}
|
|
14553
|
+
state.recentNavEvent = undefined; // clear
|
|
14554
|
+
};
|
|
14555
|
+
|
|
14556
|
+
// Hijack key nav events on the first and last focusable nodes of the trap,
|
|
14557
|
+
// in order to prevent focus from escaping. If it escapes for even a
|
|
14558
|
+
// moment it can end up scrolling the page and causing confusion so we
|
|
14559
|
+
// kind of need to capture the action at the keydown phase.
|
|
14560
|
+
var checkKeyNav = function checkKeyNav(event) {
|
|
14561
|
+
var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
14562
|
+
state.recentNavEvent = event;
|
|
14563
|
+
var destinationNode = findNextNavNode({
|
|
14564
|
+
event: event,
|
|
14565
|
+
isBackward: isBackward
|
|
14566
|
+
});
|
|
14304
14567
|
if (destinationNode) {
|
|
14305
14568
|
if (isTabEvent(event)) {
|
|
14306
14569
|
// since tab natively moves focus, we wouldn't have a destination node unless we
|
|
@@ -15187,7 +15450,7 @@ const SeamlyActivityMonitor = ({ children }) => {
|
|
|
15187
15450
|
// It is important to use keyUp here as focus may be set from outside the
|
|
15188
15451
|
// chat container via keyboard. In this case the keyDown handler would not
|
|
15189
15452
|
// be fired inside the container on the initial focus event.
|
|
15190
|
-
return ((0,jsx_runtime_namespaceObject.jsx)("div",
|
|
15453
|
+
return ((0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('activity-monitor'), tabIndex: -1, onMouseDown: onActivityHandler, onKeyUp: onActivityHandler, onTouchStart: onActivityHandler, onMouseMove: onActivityHandler, onWheel: onActivityHandler, onPointerDown: onActivityHandler, onPointerMove: onActivityHandler, children: (0,jsx_runtime_namespaceObject.jsx)(seamly_activity_event_context.Provider, { value: onActivityHandler, children: children }) }));
|
|
15191
15454
|
};
|
|
15192
15455
|
/* harmony default export */ const seamly_activity_monitor = (SeamlyActivityMonitor);
|
|
15193
15456
|
|
|
@@ -15594,7 +15857,7 @@ const SeamlyFileUpload = ({ children }) => {
|
|
|
15594
15857
|
uploadHandle,
|
|
15595
15858
|
}));
|
|
15596
15859
|
}, [addImageToSessionStorage, addUploadBubble, api, dispatch, t]);
|
|
15597
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(seamly_file_upload_context.Provider,
|
|
15860
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(seamly_file_upload_context.Provider, { value: onUploadFileHandler, children: children }));
|
|
15598
15861
|
};
|
|
15599
15862
|
/* harmony default export */ const seamly_file_upload = (SeamlyFileUpload);
|
|
15600
15863
|
|
|
@@ -15985,7 +16248,7 @@ const SeamlyCore = ({ store, children, eventBus, api }) => {
|
|
|
15985
16248
|
(0,hooks_.useErrorBoundary)((error) => {
|
|
15986
16249
|
store.dispatch(catchError(error));
|
|
15987
16250
|
});
|
|
15988
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(components_Provider,
|
|
16251
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(components_Provider, { store: store, children: (0,jsx_runtime_namespaceObject.jsx)(SeamlyEventBusContext.Provider, { value: eventBus, children: (0,jsx_runtime_namespaceObject.jsx)(SeamlyApiContext.Provider, { value: api, children: (0,jsx_runtime_namespaceObject.jsx)(seamly_live_region, { children: (0,jsx_runtime_namespaceObject.jsx)(seamly_chat, { children: (0,jsx_runtime_namespaceObject.jsxs)(component_filter, { children: [(0,jsx_runtime_namespaceObject.jsx)(seamly_initializer, {}), (0,jsx_runtime_namespaceObject.jsx)(seamly_event_subscriber, {}), (0,jsx_runtime_namespaceObject.jsx)(seamly_read_state, {}), (0,jsx_runtime_namespaceObject.jsx)(seamly_new_notifications, {}), (0,jsx_runtime_namespaceObject.jsx)(seamly_idle_detach_counter, {}), (0,jsx_runtime_namespaceObject.jsxs)(seamly_activity_monitor, { children: [(0,jsx_runtime_namespaceObject.jsx)(seamly_instance_functions_loader, {}), (0,jsx_runtime_namespaceObject.jsx)(seamly_file_upload, { children: children })] })] }) }) }) }) }) }));
|
|
15989
16252
|
};
|
|
15990
16253
|
/* harmony default export */ const seamly_core = (SeamlyCore);
|
|
15991
16254
|
|
|
@@ -16046,9 +16309,9 @@ const useDebounce = (value, delay = 20) => {
|
|
|
16046
16309
|
const getState = ({
|
|
16047
16310
|
forms
|
|
16048
16311
|
}) => forms;
|
|
16049
|
-
const getFormById = es_createSelector(getState, (_, {
|
|
16312
|
+
const getFormById = es_createSelector([getState, (_, {
|
|
16050
16313
|
formId
|
|
16051
|
-
}) => formId, (forms, formId) => forms[formId]);
|
|
16314
|
+
}) => formId], (forms, formId) => forms[formId]);
|
|
16052
16315
|
const getFormControlsByFormId = es_createSelector(getFormById, form => (form === null || form === void 0 ? void 0 : form.controls) || {});
|
|
16053
16316
|
const getFormValuesByFormId = es_createSelector(getFormControlsByFormId, controls => {
|
|
16054
16317
|
const valuesObj = {};
|
|
@@ -16059,15 +16322,15 @@ const getFormValuesByFormId = es_createSelector(getFormControlsByFormId, control
|
|
|
16059
16322
|
});
|
|
16060
16323
|
return valuesObj;
|
|
16061
16324
|
});
|
|
16062
|
-
const getControlValueByName = es_createSelector(getFormControlsByFormId, (_, {
|
|
16325
|
+
const getControlValueByName = es_createSelector([getFormControlsByFormId, (_, {
|
|
16063
16326
|
name
|
|
16064
|
-
}) => name, (controls, name) => {
|
|
16327
|
+
}) => name], (controls, name) => {
|
|
16065
16328
|
var _a;
|
|
16066
16329
|
return (_a = controls[name]) === null || _a === void 0 ? void 0 : _a.value;
|
|
16067
16330
|
});
|
|
16068
|
-
const getControlTouchedByName = es_createSelector(getFormControlsByFormId, (_, {
|
|
16331
|
+
const getControlTouchedByName = es_createSelector([getFormControlsByFormId, (_, {
|
|
16069
16332
|
name
|
|
16070
|
-
}) => name, (controls, name) => {
|
|
16333
|
+
}) => name], (controls, name) => {
|
|
16071
16334
|
var _a;
|
|
16072
16335
|
return (_a = controls[name]) === null || _a === void 0 ? void 0 : _a.touched;
|
|
16073
16336
|
});
|
|
@@ -16262,7 +16525,7 @@ const useEntryTextTranslation = controlName => {
|
|
|
16262
16525
|
text: (text === null || text === void 0 ? void 0 : text.label) || t('input.inputLabelText'),
|
|
16263
16526
|
limit: !(text === null || text === void 0 ? void 0 : text.label) && hasCharacterLimit ? characterLimit : null
|
|
16264
16527
|
}), [t, hasCharacterLimit, characterLimit, text === null || text === void 0 ? void 0 : text.label]);
|
|
16265
|
-
const labelClass = (0,hooks_.useMemo)(() => (text === null || text === void 0 ? void 0 : text.label) ? '
|
|
16528
|
+
const labelClass = (0,hooks_.useMemo)(() => (text === null || text === void 0 ? void 0 : text.label) ? 'label' : 'visually-hidden', [text === null || text === void 0 ? void 0 : text.label]);
|
|
16266
16529
|
return {
|
|
16267
16530
|
placeholder,
|
|
16268
16531
|
label,
|
|
@@ -16307,14 +16570,14 @@ function AbortTransactionButton() {
|
|
|
16307
16570
|
});
|
|
16308
16571
|
clearEntryAbortTransaction();
|
|
16309
16572
|
};
|
|
16310
|
-
return ((0,jsx_runtime_namespaceObject.jsx)("li",
|
|
16573
|
+
return ((0,jsx_runtime_namespaceObject.jsx)("li", { className: css_className([
|
|
16311
16574
|
'cvco-conversation__item',
|
|
16312
16575
|
'cvco-conversation__item--abort-transaction',
|
|
16313
|
-
])
|
|
16576
|
+
]), children: (0,jsx_runtime_namespaceObject.jsx)("button", { className: css_className([
|
|
16314
16577
|
'button',
|
|
16315
16578
|
'button--secondary',
|
|
16316
16579
|
'abort-transaction__button',
|
|
16317
|
-
]), type: "button", onClick: handleAbortTransaction
|
|
16580
|
+
]), type: "button", onClick: handleAbortTransaction, children: abortTransaction.label }) }));
|
|
16318
16581
|
}
|
|
16319
16582
|
|
|
16320
16583
|
;// CONCATENATED MODULE: external "preact/compat"
|
|
@@ -16389,7 +16652,7 @@ const Event = ({ event, newParticipant }) => {
|
|
|
16389
16652
|
if (newParticipant) {
|
|
16390
16653
|
classNames.push('conversation__item--new-participant');
|
|
16391
16654
|
}
|
|
16392
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)("li",
|
|
16655
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("li", { className: css_className(classNames), ref: containerRef, children: [event.timeIndicator && (0,jsx_runtime_namespaceObject.jsx)(time_indicator, { event: event }), (0,jsx_runtime_namespaceObject.jsx)(Component, { event: event, children: (0,jsx_runtime_namespaceObject.jsx)(SubComponent, { event: event }) })] }));
|
|
16393
16656
|
};
|
|
16394
16657
|
/* harmony default export */ const event_event = (Event);
|
|
16395
16658
|
|
|
@@ -16474,7 +16737,7 @@ const Conversation = () => {
|
|
|
16474
16737
|
e.preventDefault();
|
|
16475
16738
|
focusSkiplinkTarget();
|
|
16476
16739
|
};
|
|
16477
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [isOpen && ((0,jsx_runtime_namespaceObject.jsx)("a",
|
|
16740
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [isOpen && ((0,jsx_runtime_namespaceObject.jsx)("a", { className: css_className('skip-link'), href: `#${skiplinkTargetId}`, onClick: onClickHandler, children: t('skiplinkText') })), (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('chat__body'), children: (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('conversation__container'), children: [(0,jsx_runtime_namespaceObject.jsx)(privacy_disclaimer, {}), (0,jsx_runtime_namespaceObject.jsxs)("ol", { className: css_className('conversation'), children: [(0,jsx_runtime_namespaceObject.jsx)(component_filter, { children: (0,jsx_runtime_namespaceObject.jsx)(Events, {}) }), debouncedIsLoading ? (0,jsx_runtime_namespaceObject.jsx)(loader, {}) : null, (0,jsx_runtime_namespaceObject.jsx)(AbortTransactionButton, {})] })] }) })] }));
|
|
16478
16741
|
};
|
|
16479
16742
|
/* harmony default export */ const conversation = (Conversation);
|
|
16480
16743
|
|
|
@@ -16869,16 +17132,16 @@ const OptionsFrame = ({ className: givenClassName, children, onCancel, headingTe
|
|
|
16869
17132
|
(0,hooks_.useEffect)(() => {
|
|
16870
17133
|
focusElement(container.current);
|
|
16871
17134
|
}, [container]);
|
|
16872
|
-
return ((0,jsx_runtime_namespaceObject.jsx)("section",
|
|
17135
|
+
return ((0,jsx_runtime_namespaceObject.jsx)("section", { className: css_className('options', {
|
|
16873
17136
|
'options--right': position.horizontal === 'right',
|
|
16874
17137
|
'options--left': position.horizontal === 'left',
|
|
16875
17138
|
'options--top': position.vertical === 'top',
|
|
16876
17139
|
'options--bottom': position.vertical === 'bottom',
|
|
16877
|
-
}, givenClassName), "aria-labelledby": mainHeadingId, tabIndex: -1, ref: container
|
|
17140
|
+
}, givenClassName), "aria-labelledby": mainHeadingId, tabIndex: -1, ref: container, children: (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('options__body'), children: [(0,jsx_runtime_namespaceObject.jsx)("h2", { id: mainHeadingId, className: css_className('options__title'), children: headingText }), (0,jsx_runtime_namespaceObject.jsxs)("button", { type: "button", onClick: onCancelHandler, "aria-describedby": mainHeadingId, className: css_className('button', 'options__close'), ref: (btn) => {
|
|
16878
17141
|
if (cancelButtonRef) {
|
|
16879
17142
|
cancelButtonRef.current = btn;
|
|
16880
17143
|
}
|
|
16881
|
-
}
|
|
17144
|
+
}, children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: "close", size: "16", alt: "" }), (0,jsx_runtime_namespaceObject.jsx)("span", { children: cancelButtonText })] }), description ? ((0,jsx_runtime_namespaceObject.jsx)("p", { className: css_className('options__description'), id: descriptionId, children: description })) : null, (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('options__wrapper'), children: children })] }) }));
|
|
16882
17145
|
};
|
|
16883
17146
|
/* harmony default export */ const options_frame = (OptionsFrame);
|
|
16884
17147
|
|
|
@@ -17015,7 +17278,7 @@ function FormProvider(_a) {
|
|
|
17015
17278
|
console.error('"onSubmit" is required.');
|
|
17016
17279
|
return null;
|
|
17017
17280
|
}
|
|
17018
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(context_Provider, Object.assign({}, props, { value: contextValue
|
|
17281
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(context_Provider, Object.assign({}, props, { value: contextValue, children: children })));
|
|
17019
17282
|
}
|
|
17020
17283
|
|
|
17021
17284
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/form-controls/form.js
|
|
@@ -17081,8 +17344,8 @@ function error_Error({
|
|
|
17081
17344
|
|
|
17082
17345
|
|
|
17083
17346
|
|
|
17084
|
-
const FormControlWrapper = ({ contentHint, id, labelText, labelClass
|
|
17085
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [contentHint && ((0,jsx_runtime_namespaceObject.jsx)("span",
|
|
17347
|
+
const FormControlWrapper = ({ contentHint, id, labelText, labelClass, validity, errorText, children, }) => {
|
|
17348
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [contentHint && ((0,jsx_runtime_namespaceObject.jsx)("span", { id: `${id}-content-hint`, className: css_className('input__content-hint'), children: contentHint })), (0,jsx_runtime_namespaceObject.jsx)(error_Error, { id: `${id}-error`, error: !validity && errorText }), (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('form-control__wrapper'), children: [(0,jsx_runtime_namespaceObject.jsx)("label", { htmlFor: id, className: css_className(labelClass), children: labelText }), children] })] }));
|
|
17086
17349
|
};
|
|
17087
17350
|
/* harmony default export */ const wrapper = (FormControlWrapper);
|
|
17088
17351
|
|
|
@@ -17117,7 +17380,7 @@ function Input(_a) {
|
|
|
17117
17380
|
describedByIds.push(`${id}-error`);
|
|
17118
17381
|
}
|
|
17119
17382
|
// todo: destructure Field
|
|
17120
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(wrapper,
|
|
17383
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(wrapper, { id: id, contentHint: contentHint, validity: !hasError, errorText: error, labelText: labelText, labelClass: labelClass, children: (0,jsx_runtime_namespaceObject.jsx)("input", Object.assign({ id: id, name: name, type: type, "aria-invalid": hasError ? 'true' : 'false', "aria-describedby": describedByIds.join(' ') || null }, field, props)) }));
|
|
17121
17384
|
}
|
|
17122
17385
|
/* harmony default export */ const input = (Input);
|
|
17123
17386
|
|
|
@@ -17465,14 +17728,14 @@ const OptionsButton = () => {
|
|
|
17465
17728
|
|
|
17466
17729
|
|
|
17467
17730
|
|
|
17468
|
-
const TranslationOption = ({ label, checked, description, onChange, id, }) => {
|
|
17731
|
+
const TranslationOption = ({ label, checked, description, onChange, id, itemClassName, }) => {
|
|
17469
17732
|
const onKeyDown = (e) => {
|
|
17470
17733
|
if (e.code === 'Space' || e.code === 'Enter') {
|
|
17471
17734
|
e.preventDefault();
|
|
17472
17735
|
onChange();
|
|
17473
17736
|
}
|
|
17474
17737
|
};
|
|
17475
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)("li",
|
|
17738
|
+
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, { alt: "", name: "check", size: "16" }), label, " ", description && (0,jsx_runtime_namespaceObject.jsxs)("span", { children: ["(", description, ")"] })] }));
|
|
17476
17739
|
};
|
|
17477
17740
|
/* harmony default export */ const translation_option = (TranslationOption);
|
|
17478
17741
|
|
|
@@ -17484,12 +17747,13 @@ const TranslationOption = ({ label, checked, description, onChange, id, }) => {
|
|
|
17484
17747
|
|
|
17485
17748
|
|
|
17486
17749
|
|
|
17750
|
+
const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
|
|
17487
17751
|
const TranslationOptions = ({ onChange, describedById, }) => {
|
|
17488
17752
|
const { context: { locale: defaultLocale }, } = useConfig();
|
|
17489
17753
|
const { t } = useI18n();
|
|
17490
17754
|
const { focusContainer } = useTranslationsContainer();
|
|
17491
17755
|
const { languages, currentLocale, enableTranslations, disableTranslations } = useTranslations();
|
|
17492
|
-
const handleChange = (
|
|
17756
|
+
const handleChange = (locale) => () => {
|
|
17493
17757
|
if (locale === currentLocale || defaultLocale === locale) {
|
|
17494
17758
|
disableTranslations();
|
|
17495
17759
|
}
|
|
@@ -17499,22 +17763,25 @@ const TranslationOptions = ({ onChange, describedById, }) => {
|
|
|
17499
17763
|
onChange();
|
|
17500
17764
|
focusContainer();
|
|
17501
17765
|
};
|
|
17502
|
-
const
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
});
|
|
17511
|
-
}
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
|
|
17766
|
+
const { primaryLanguages, remainingLanguages } = (0,compat_namespaceObject.useMemo)(() => languages.reduce((acc, language) => {
|
|
17767
|
+
const isOriginal = language.locale === defaultLocale;
|
|
17768
|
+
const checked = isChecked(language, currentLocale, isOriginal);
|
|
17769
|
+
if (language.locale !== defaultLocale) {
|
|
17770
|
+
acc.remainingLanguages.push(Object.assign(Object.assign({}, language), { checked, isOriginal }));
|
|
17771
|
+
}
|
|
17772
|
+
const selectedIdx = acc.remainingLanguages.findIndex((l) => l.locale === currentLocale);
|
|
17773
|
+
if (isOriginal || (checked && selectedIdx > 4)) {
|
|
17774
|
+
acc.primaryLanguages.push(Object.assign(Object.assign({}, language), { checked, isOriginal }));
|
|
17775
|
+
}
|
|
17776
|
+
return acc;
|
|
17777
|
+
}, {
|
|
17778
|
+
primaryLanguages: [],
|
|
17779
|
+
remainingLanguages: [],
|
|
17780
|
+
}), [currentLocale, defaultLocale, languages]);
|
|
17781
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("ul", { "aria-describedby": describedById, role: "listbox", tabIndex: -1, className: css_className('translation-options'), children: [primaryLanguages.map(({ locale, nativeName, checked, isOriginal }, idx) => ((0,jsx_runtime_namespaceObject.jsx)(translation_option, { id: locale, label: nativeName, checked: checked, description: isOriginal && t('translations.settings.original'), onChange: handleChange(locale), itemClassName: css_className({
|
|
17782
|
+
'translation-options__item--original': isOriginal,
|
|
17783
|
+
'translation-options__item--selected': checked && idx !== 0,
|
|
17784
|
+
}) }, locale))), remainingLanguages.map(({ locale, nativeName, checked, isOriginal }) => ((0,jsx_runtime_namespaceObject.jsx)(translation_option, { id: locale, label: nativeName, checked: checked, description: isOriginal && t('translations.settings.original'), onChange: handleChange(locale) }, locale)))] }));
|
|
17518
17785
|
};
|
|
17519
17786
|
/* harmony default export */ const translation_options = (TranslationOptions);
|
|
17520
17787
|
|
|
@@ -17527,7 +17794,7 @@ const TranslationOptions = ({ onChange, describedById, }) => {
|
|
|
17527
17794
|
function TranslationsOptionsDialog({ onClose, position, }) {
|
|
17528
17795
|
const { t } = useI18n();
|
|
17529
17796
|
const descriptionId = useGeneratedId();
|
|
17530
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(options_frame,
|
|
17797
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(options_frame, { onCancel: onClose, headingText: t('translations.menu.title'), cancelButtonText: t('translations.settings.cancelButtonText'), description: t('translations.menu.description'), descriptionId: descriptionId, position: position, disableButtonFocusing: true, children: (0,jsx_runtime_namespaceObject.jsx)(translation_options, { describedById: descriptionId, onChange: onClose }) }));
|
|
17531
17798
|
}
|
|
17532
17799
|
/* harmony default export */ const options_dialog = (TranslationsOptionsDialog);
|
|
17533
17800
|
|
|
@@ -17567,11 +17834,11 @@ function TranslationsOptionsButton({ children, position = {
|
|
|
17567
17834
|
e.preventDefault();
|
|
17568
17835
|
}
|
|
17569
17836
|
};
|
|
17570
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)("div",
|
|
17837
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('translations__container'), onKeyDown: onMainKeyDownHandler, children: [(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, { transitionStartState: transitionStartStates.notRendered, isActive: menuIsOpen, children: (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('options__dialog'), role: "dialog", children: (0,jsx_runtime_namespaceObject.jsx)(options_dialog, { onClose: handleDialogClose, position: position }) }) }), (0,jsx_runtime_namespaceObject.jsx)("button", { type: "button", className: css_className([
|
|
17571
17838
|
'button',
|
|
17572
17839
|
'chat__options__button',
|
|
17573
17840
|
...classNames,
|
|
17574
|
-
]), id: toggleButtonId, onClick: handleToggleClick, onKeyDown: handleToggleKeyDown, ref: toggleButton, "aria-haspopup": "dialog", "aria-expanded": menuIsOpen
|
|
17841
|
+
]), id: toggleButtonId, onClick: handleToggleClick, onKeyDown: handleToggleKeyDown, ref: toggleButton, "aria-haspopup": "dialog", "aria-expanded": menuIsOpen, children: children })] }));
|
|
17575
17842
|
}
|
|
17576
17843
|
|
|
17577
17844
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/app-options/index.js
|
|
@@ -17641,7 +17908,7 @@ const UnreadMessagesButton = () => {
|
|
|
17641
17908
|
const { scrollToRef, unreadIds } = (0,hooks_.useContext)(chat_scroll_context);
|
|
17642
17909
|
const { isMinimized } = useVisibility();
|
|
17643
17910
|
const { t } = useI18n();
|
|
17644
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(in_out_transition,
|
|
17911
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(in_out_transition, { isActive: !!unreadIds.length && !isMinimized, children: (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('unread-messages'), children: (0,jsx_runtime_namespaceObject.jsxs)("button", { type: "button", className: css_className('button', 'button--primary'), onClick: scrollToRef, children: [t('message.unreadMessagesCount', { unreadCount: unreadIds.length }), (0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: "chevronDown", size: "32", alt: "" })] }) }) }));
|
|
17645
17912
|
};
|
|
17646
17913
|
/* harmony default export */ const unread_messages_button = (UnreadMessagesButton);
|
|
17647
17914
|
|
|
@@ -17789,13 +18056,13 @@ const ChatScrollProvider = ({ children }) => {
|
|
|
17789
18056
|
return acc;
|
|
17790
18057
|
}, {}), [events]);
|
|
17791
18058
|
const { scrollToRef, scrollToBottom, containerRef, unreadIds } = use_chat_scroll(eventRefs);
|
|
17792
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(chat_scroll_context.Provider,
|
|
18059
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(chat_scroll_context.Provider, { value: {
|
|
17793
18060
|
eventRefs,
|
|
17794
18061
|
unreadIds,
|
|
17795
18062
|
scrollToRef,
|
|
17796
18063
|
scrollToBottom,
|
|
17797
18064
|
containerRef,
|
|
17798
|
-
}
|
|
18065
|
+
}, children: (0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('chat__container'), children: [(0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('chat__container__scroll-area'), ref: containerRef, children: children }), (0,jsx_runtime_namespaceObject.jsx)(unread_messages_button, {})] }) }));
|
|
17799
18066
|
};
|
|
17800
18067
|
/* harmony default export */ const chat_scroll_provider = (ChatScrollProvider);
|
|
17801
18068
|
|
|
@@ -18086,13 +18353,13 @@ function TextEntryForm({ controlName, skipLinkId }) {
|
|
|
18086
18353
|
// When a message is submitted, the keyboard should be prevented from closing on mobile devices
|
|
18087
18354
|
event.preventDefault();
|
|
18088
18355
|
};
|
|
18089
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)(form_controls_form,
|
|
18356
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)(form_controls_form, { className: css_className('entry-form'), disableValidationClasses: true, noValidate: "true", children: [(0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className([
|
|
18090
18357
|
'input--text__container',
|
|
18091
18358
|
...(reachedCharacterWarning && !reachedCharacterLimit
|
|
18092
18359
|
? ['character-warning']
|
|
18093
18360
|
: []),
|
|
18094
18361
|
...(reachedCharacterLimit ? ['character-exceeded'] : []),
|
|
18095
|
-
])
|
|
18362
|
+
]), children: [(0,jsx_runtime_namespaceObject.jsx)(input, { id: skipLinkId, type: "text", name: controlName, className: css_className('input__text'), autocomplete: "off", placeholder: placeholder, labelText: label, labelClass: css_className(labelClass), "aria-invalid": hasCharacterLimit ? reachedCharacterLimit : null, onKeyUp: handleKeyUp, onFocus: handleFocus }), (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('character-count'), children: reachedCharacterWarning && (0,jsx_runtime_namespaceObject.jsx)("span", { children: remainingChars }) })] }), (0,jsx_runtime_namespaceObject.jsx)("button", { className: css_className('button', 'input__submit'), type: "submit", onPointerDown: handlePointerDown, "aria-disabled": !hasValue || reachedCharacterLimit ? 'true' : null, children: (0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: "send", size: "32", alt: t('input.sendMessage') }) })] }));
|
|
18096
18363
|
}
|
|
18097
18364
|
|
|
18098
18365
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/entry/text-entry/index.js
|
|
@@ -18750,7 +19017,7 @@ const CollapseButton = () => {
|
|
|
18750
19017
|
|
|
18751
19018
|
const ChatStatus = ({ children, handleClose, title, closeButtonText, srCloseButtonText, id, }) => {
|
|
18752
19019
|
const headingId = useGeneratedId();
|
|
18753
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)("section",
|
|
19020
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)("section", { tabIndex: -1, id: id, "aria-labelledby": title ? headingId : undefined, className: css_className('chat-status', !title && 'chat-status--condensed'), children: [(0,jsx_runtime_namespaceObject.jsxs)("div", { className: css_className('chat-status__body'), children: [title ? ((0,jsx_runtime_namespaceObject.jsx)("h2", { className: css_className('chat-status__title'), id: headingId, children: title })) : null, children] }), typeof handleClose === 'function' && ((0,jsx_runtime_namespaceObject.jsxs)("button", { type: "button", onClick: handleClose, className: css_className('button', 'button--tertiary', 'chat-status__close'), children: [closeButtonText || (0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: "close", size: "16", alt: "" }), srCloseButtonText && ((0,jsx_runtime_namespaceObject.jsx)("span", { className: css_className('visually-hidden'), children: srCloseButtonText }))] }))] }));
|
|
18754
19021
|
};
|
|
18755
19022
|
/* harmony default export */ const chat_status = (ChatStatus);
|
|
18756
19023
|
|
|
@@ -18785,7 +19052,7 @@ function TranslationChatStatus() {
|
|
|
18785
19052
|
|
|
18786
19053
|
|
|
18787
19054
|
|
|
18788
|
-
const ChatStatusAction = ({ handleClick, icon, title, srButtonText, }) => ((0,jsx_runtime_namespaceObject.jsxs)("button",
|
|
19055
|
+
const ChatStatusAction = ({ handleClick, icon, title, srButtonText, }) => ((0,jsx_runtime_namespaceObject.jsxs)("button", { type: "button", onClick: handleClick, className: css_className('button', 'button--primary', 'chat-status__button'), children: [(0,jsx_runtime_namespaceObject.jsx)(layout_icon, { name: icon, size: "16", alt: "" }), title, srButtonText && ((0,jsx_runtime_namespaceObject.jsx)("span", { className: css_className('visually-hidden'), children: srButtonText }))] }));
|
|
18789
19056
|
/* harmony default export */ const chat_status_action = (ChatStatusAction);
|
|
18790
19057
|
|
|
18791
19058
|
;// CONCATENATED MODULE: ./src/javascripts/ui/components/translation-proposal/index.tsx
|
|
@@ -18799,7 +19066,7 @@ function TranslationProposal() {
|
|
|
18799
19066
|
if (!showProposal) {
|
|
18800
19067
|
return null;
|
|
18801
19068
|
}
|
|
18802
|
-
return ((0,jsx_runtime_namespaceObject.jsx)(chat_status,
|
|
19069
|
+
return ((0,jsx_runtime_namespaceObject.jsx)(chat_status, { handleClose: dismissTranslationProposal, srCloseButtonText: translationProposal.srDismissButtonText, id: id, title: translationProposal.titleLabel, children: (0,jsx_runtime_namespaceObject.jsx)(chat_status_action, { handleClick: activateTranslationProposal, icon: "newTranslation", title: translationProposal.buttonLabel }) }));
|
|
18803
19070
|
}
|
|
18804
19071
|
|
|
18805
19072
|
;// CONCATENATED MODULE: ./src/javascripts/domains/translations/components/translation-status.tsx
|
|
@@ -19104,7 +19371,7 @@ const WindowView = () => {
|
|
|
19104
19371
|
},
|
|
19105
19372
|
},
|
|
19106
19373
|
}), [continueChatText]);
|
|
19107
|
-
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [(0,jsx_runtime_namespaceObject.jsx)(window_open_button, { onClick: openChat }), (0,jsx_runtime_namespaceObject.jsx)(in_out_transition,
|
|
19374
|
+
return ((0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, { children: [(0,jsx_runtime_namespaceObject.jsx)(window_open_button, { onClick: openChat }), (0,jsx_runtime_namespaceObject.jsx)(in_out_transition, { isActive: preChat && !isOpen && !userHasResponded, exitAfter: getDelay(preChat, 'exitAfter'), enterDelay: getDelay(preChat, 'enterDelay'), transitionStartState: transitionStartStates.rendered, children: (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('unstarted-wrapper', 'unstarted-wrapper--window'), children: (0,jsx_runtime_namespaceObject.jsx)(PreChatMessages, {}) }) }), (0,jsx_runtime_namespaceObject.jsx)(in_out_transition, { isActive: continueChat && !isOpen && userHasResponded, exitAfter: getDelay(continueChat, 'exitAfter'), enterDelay: getDelay(continueChat, 'enterDelay'), transitionStartState: transitionStartStates.notRendered, children: (0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className('unstarted-wrapper', 'unstarted-wrapper--window', 'unstarted-wrapper--continue'), children: (0,jsx_runtime_namespaceObject.jsx)(event_text, { event: continueChatEvent }) }) }), (0,jsx_runtime_namespaceObject.jsx)(in_out_transition, { isActive: isOpen, transitionStartState: transitionStartStates.notRendered, children: (0,jsx_runtime_namespaceObject.jsx)(chat, { children: (0,jsx_runtime_namespaceObject.jsx)(chat_frame, { children: (0,jsx_runtime_namespaceObject.jsx)(conversation, {}) }) }) })] }));
|
|
19108
19375
|
};
|
|
19109
19376
|
/* harmony default export */ const window_view = (WindowView);
|
|
19110
19377
|
|
|
@@ -19319,7 +19586,7 @@ const View = ({ children }) => {
|
|
|
19319
19586
|
if (userHasResponded) {
|
|
19320
19587
|
classNames.push('app--user-responded');
|
|
19321
19588
|
}
|
|
19322
|
-
return (isVisible && ((0,jsx_runtime_namespaceObject.jsx)("div",
|
|
19589
|
+
return (isVisible && ((0,jsx_runtime_namespaceObject.jsx)("div", { className: css_className(classNames), lang: blockLang, tabIndex: -1, "data-nosnippet": true, style: { zIndex }, ref: containerElementRef, children: children || (0,jsx_runtime_namespaceObject.jsx)(ViewComponent, {}) })));
|
|
19323
19590
|
};
|
|
19324
19591
|
/* harmony default export */ const view = (View);
|
|
19325
19592
|
|
|
@@ -19409,14 +19676,16 @@ class Engine {
|
|
|
19409
19676
|
yield store.dispatch(initializeConfig());
|
|
19410
19677
|
try {
|
|
19411
19678
|
const { locale } = yield store.dispatch(initializeApp()).unwrap();
|
|
19412
|
-
|
|
19679
|
+
if (locale) {
|
|
19680
|
+
yield store.dispatch(setLocale(locale));
|
|
19681
|
+
}
|
|
19413
19682
|
}
|
|
19414
19683
|
catch (rejectedValueOrSerializedError) {
|
|
19415
19684
|
// nothing to do
|
|
19416
19685
|
}
|
|
19417
19686
|
store.dispatch(initializeVisibility());
|
|
19418
19687
|
if (View) {
|
|
19419
|
-
(0,external_preact_.render)((0,jsx_runtime_namespaceObject.jsx)(seamly_core,
|
|
19688
|
+
(0,external_preact_.render)((0,jsx_runtime_namespaceObject.jsx)(seamly_core, { eventBus: this.eventBus, store: store, api: this.api, children: (0,jsx_runtime_namespaceObject.jsx)(View, {}) }), this.parentElement);
|
|
19420
19689
|
}
|
|
19421
19690
|
else {
|
|
19422
19691
|
(0,external_preact_.render)((0,jsx_runtime_namespaceObject.jsx)(chat_app, { config: renderConfig, eventBus: this.eventBus, store: store, api: this.api }), this.parentElement);
|