@seamly/web-ui 25.1.0 → 25.2.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.
Files changed (29) hide show
  1. package/build/dist/lib/index.debug.js +279 -116
  2. package/build/dist/lib/index.debug.js.map +1 -1
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.debug.min.js.LICENSE.txt +2 -2
  5. package/build/dist/lib/index.debug.min.js.map +1 -1
  6. package/build/dist/lib/index.js +846 -691
  7. package/build/dist/lib/index.js.map +1 -1
  8. package/build/dist/lib/index.min.js +1 -1
  9. package/build/dist/lib/index.min.js.LICENSE.txt +2 -2
  10. package/build/dist/lib/index.min.js.map +1 -1
  11. package/build/dist/lib/style-guide.js +1300 -41
  12. package/build/dist/lib/style-guide.js.map +1 -1
  13. package/build/dist/lib/style-guide.min.js +1 -1
  14. package/build/dist/lib/style-guide.min.js.map +1 -1
  15. package/build/dist/lib/styles.css +1 -1
  16. package/package.json +16 -16
  17. package/src/javascripts/core/domains/store/slice.ts +1 -0
  18. package/src/javascripts/core/domains/store/store.types.ts +1 -0
  19. package/src/javascripts/core/ui/components/conversation/conversation.tsx +5 -2
  20. package/src/javascripts/core/ui/components/conversation/loader.tsx +12 -2
  21. package/src/javascripts/core/ui/components/entry/text-entry/index.tsx +2 -2
  22. package/src/javascripts/core/ui/components/entry/upload/index.tsx +2 -2
  23. package/src/javascripts/core/ui/components/layout/chat.tsx +21 -1
  24. package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +20 -5
  25. package/src/javascripts/core/ui/components/warnings/prompt.tsx +2 -2
  26. package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +11 -2
  27. package/src/javascripts/core/ui/hooks/seamly-hooks.ts +2 -1
  28. package/src/javascripts/core/ui/hooks/seamly-state-hooks.ts +4 -1
  29. package/src/stylesheets/5-components/_conversation.scss +6 -2
@@ -78,10 +78,16 @@ __webpack_require__.r(__webpack_exports__);
78
78
 
79
79
 
80
80
 
81
+ // src/immerImports.ts
82
+
83
+
84
+ // src/index.ts
81
85
 
82
- // src/createDraftSafeSelector.ts
83
86
 
87
+ // src/reselectImports.ts
84
88
 
89
+
90
+ // src/createDraftSafeSelector.ts
85
91
  var createDraftSafeSelectorCreator = (...args) => {
86
92
  const createSelector2 = (0,reselect__WEBPACK_IMPORTED_MODULE_2__.createSelectorCreator)(...args);
87
93
  const createDraftSafeSelector2 = Object.assign((...args2) => {
@@ -96,11 +102,10 @@ var createDraftSafeSelectorCreator = (...args) => {
96
102
  };
97
103
  var createDraftSafeSelector = /* @__PURE__ */ createDraftSafeSelectorCreator(reselect__WEBPACK_IMPORTED_MODULE_2__.weakMapMemoize);
98
104
 
99
- // src/configureStore.ts
105
+ // src/reduxImports.ts
100
106
 
101
107
 
102
108
  // src/devtoolsExtension.ts
103
-
104
109
  var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
105
110
  if (arguments.length === 0) return void 0;
106
111
  if (typeof arguments[0] === "object") return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
@@ -115,9 +120,6 @@ var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_
115
120
  // src/getDefaultMiddleware.ts
116
121
 
117
122
 
118
- // src/createAction.ts
119
-
120
-
121
123
  // src/tsHelpers.ts
122
124
  var hasMatchFunction = (v) => {
123
125
  return v && typeof v.match === "function";
@@ -185,7 +187,6 @@ function createActionCreatorInvariantMiddleware(options = {}) {
185
187
  }
186
188
 
187
189
  // src/utils.ts
188
-
189
190
  function getTimeMeasureUtils(maxDelay, fnName) {
190
191
  let elapsed = 0;
191
192
  return {
@@ -368,7 +369,6 @@ function createImmutableStateInvariantMiddleware(options = {}) {
368
369
  }
369
370
 
370
371
  // src/serializableStateInvariantMiddleware.ts
371
-
372
372
  function isPlain(val) {
373
373
  const type = typeof val;
374
374
  return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || (0,redux__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(val);
@@ -669,9 +669,6 @@ function configureStore(options) {
669
669
  return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
670
670
  }
671
671
 
672
- // src/createReducer.ts
673
-
674
-
675
672
  // src/mapBuilders.ts
676
673
  function executeReducerBuilderCallback(builderCallback) {
677
674
  const actionsMap = {};
@@ -739,6 +736,7 @@ function executeReducerBuilderCallback(builderCallback) {
739
736
  }
740
737
 
741
738
  // src/createReducer.ts
739
+ (0,immer__WEBPACK_IMPORTED_MODULE_1__.setUseStrictIteration)(false);
742
740
  function isStateFunction(x) {
743
741
  return typeof x === "function";
744
742
  }
@@ -1414,7 +1412,6 @@ function createSelectorsFactory() {
1414
1412
  }
1415
1413
 
1416
1414
  // src/entities/state_adapter.ts
1417
-
1418
1415
  var isDraftTyped = immer__WEBPACK_IMPORTED_MODULE_1__.isDraft;
1419
1416
  function createSingleArgumentStateOperator(mutator) {
1420
1417
  const operator = createStateOperator((_, state) => mutator(state));
@@ -1443,7 +1440,6 @@ function createStateOperator(mutator) {
1443
1440
  }
1444
1441
 
1445
1442
  // src/entities/utils.ts
1446
-
1447
1443
  function selectIdValue(entity, selectId) {
1448
1444
  const key = selectId(entity);
1449
1445
  if ( true && key === void 0) {
@@ -1640,7 +1636,13 @@ function createSortedStateAdapter(selectId, comparer) {
1640
1636
  function addManyMutably(newEntities, state, existingIds) {
1641
1637
  newEntities = ensureEntitiesArray(newEntities);
1642
1638
  const existingKeys = new Set(existingIds ?? getCurrent(state.ids));
1643
- const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));
1639
+ const addedKeys = /* @__PURE__ */ new Set();
1640
+ const models = newEntities.filter((model) => {
1641
+ const modelId = selectIdValue(model, selectId);
1642
+ const notAdded = !addedKeys.has(modelId);
1643
+ if (notAdded) addedKeys.add(modelId);
1644
+ return !existingKeys.has(modelId) && notAdded;
1645
+ });
1644
1646
  if (models.length !== 0) {
1645
1647
  mergeFunction(state, models);
1646
1648
  }
@@ -1649,11 +1651,15 @@ function createSortedStateAdapter(selectId, comparer) {
1649
1651
  return setManyMutably([entity], state);
1650
1652
  }
1651
1653
  function setManyMutably(newEntities, state) {
1654
+ let deduplicatedEntities = {};
1652
1655
  newEntities = ensureEntitiesArray(newEntities);
1653
1656
  if (newEntities.length !== 0) {
1654
1657
  for (const item of newEntities) {
1655
- delete state.entities[selectId(item)];
1658
+ const entityId = selectId(item);
1659
+ deduplicatedEntities[entityId] = item;
1660
+ delete state.entities[entityId];
1656
1661
  }
1662
+ newEntities = ensureEntitiesArray(deduplicatedEntities);
1657
1663
  mergeFunction(state, newEntities);
1658
1664
  }
1659
1665
  }
@@ -1783,9 +1789,6 @@ function createEntityAdapter(options = {}) {
1783
1789
  };
1784
1790
  }
1785
1791
 
1786
- // src/listenerMiddleware/index.ts
1787
-
1788
-
1789
1792
  // src/listenerMiddleware/exceptions.ts
1790
1793
  var task = "task";
1791
1794
  var listener = "listener";
@@ -2022,9 +2025,11 @@ var cancelActiveListeners = (entry) => {
2022
2025
  abortControllerWithReason(controller, listenerCancelled);
2023
2026
  });
2024
2027
  };
2025
- var createClearListenerMiddleware = (listenerMap) => {
2028
+ var createClearListenerMiddleware = (listenerMap, executingListeners) => {
2026
2029
  return () => {
2027
- listenerMap.forEach(cancelActiveListeners);
2030
+ for (const listener2 of executingListeners.keys()) {
2031
+ cancelActiveListeners(listener2);
2032
+ }
2028
2033
  listenerMap.clear();
2029
2034
  };
2030
2035
  };
@@ -2049,6 +2054,19 @@ var defaultErrorHandler = (...args) => {
2049
2054
  };
2050
2055
  var createListenerMiddleware = (middlewareOptions = {}) => {
2051
2056
  const listenerMap = /* @__PURE__ */ new Map();
2057
+ const executingListeners = /* @__PURE__ */ new Map();
2058
+ const trackExecutingListener = (entry) => {
2059
+ const count = executingListeners.get(entry) ?? 0;
2060
+ executingListeners.set(entry, count + 1);
2061
+ };
2062
+ const untrackExecutingListener = (entry) => {
2063
+ const count = executingListeners.get(entry) ?? 1;
2064
+ if (count === 1) {
2065
+ executingListeners.delete(entry);
2066
+ } else {
2067
+ executingListeners.set(entry, count - 1);
2068
+ }
2069
+ };
2052
2070
  const {
2053
2071
  extra,
2054
2072
  onError = defaultErrorHandler
@@ -2090,6 +2108,7 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
2090
2108
  const autoJoinPromises = [];
2091
2109
  try {
2092
2110
  entry.pending.add(internalTaskController);
2111
+ trackExecutingListener(entry);
2093
2112
  await Promise.resolve(entry.effect(
2094
2113
  action,
2095
2114
  // Use assign() rather than ... to avoid extra helper functions added to bundle
@@ -2132,10 +2151,11 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
2132
2151
  } finally {
2133
2152
  await Promise.all(autoJoinPromises);
2134
2153
  abortControllerWithReason(internalTaskController, listenerCompleted);
2154
+ untrackExecutingListener(entry);
2135
2155
  entry.pending.delete(internalTaskController);
2136
2156
  }
2137
2157
  };
2138
- const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
2158
+ const clearListenerMiddleware = createClearListenerMiddleware(listenerMap, executingListeners);
2139
2159
  const middleware = (api) => (next) => (action) => {
2140
2160
  if (!(0,redux__WEBPACK_IMPORTED_MODULE_0__.isAction)(action)) {
2141
2161
  return next(action);
@@ -2193,7 +2213,6 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
2193
2213
  };
2194
2214
 
2195
2215
  // src/dynamicMiddleware/index.ts
2196
-
2197
2216
  var createMiddlewareEntry = (middleware) => ({
2198
2217
  middleware,
2199
2218
  applied: /* @__PURE__ */ new Map()
@@ -5823,10 +5842,10 @@ var SHARED = '__core-js_shared__';
5823
5842
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
5824
5843
 
5825
5844
  (store.versions || (store.versions = [])).push({
5826
- version: '3.45.1',
5845
+ version: '3.46.0',
5827
5846
  mode: IS_PURE ? 'pure' : 'global',
5828
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
5829
- license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
5847
+ copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
5848
+ license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE',
5830
5849
  source: 'https://github.com/zloirock/core-js'
5831
5850
  });
5832
5851
 
@@ -7301,7 +7320,7 @@ __webpack_require__.r(__webpack_exports__);
7301
7320
  /* harmony export */ });
7302
7321
  /* harmony import */ var tabbable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tabbable */ "./node_modules/tabbable/dist/index.esm.js");
7303
7322
  /*!
7304
- * focus-trap 7.6.5
7323
+ * focus-trap 7.6.6
7305
7324
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7306
7325
  */
7307
7326
 
@@ -8320,6 +8339,7 @@ __webpack_require__.r(__webpack_exports__);
8320
8339
  /* harmony export */ produce: () => (/* binding */ produce),
8321
8340
  /* harmony export */ produceWithPatches: () => (/* binding */ produceWithPatches),
8322
8341
  /* harmony export */ setAutoFreeze: () => (/* binding */ setAutoFreeze),
8342
+ /* harmony export */ setUseStrictIteration: () => (/* binding */ setUseStrictIteration),
8323
8343
  /* harmony export */ setUseStrictShallowCopy: () => (/* binding */ setUseStrictShallowCopy)
8324
8344
  /* harmony export */ });
8325
8345
  // src/utils/env.ts
@@ -8380,26 +8400,34 @@ function isDraftable(value) {
8380
8400
  return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
8381
8401
  }
8382
8402
  var objectCtorString = Object.prototype.constructor.toString();
8403
+ var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
8383
8404
  function isPlainObject(value) {
8384
8405
  if (!value || typeof value !== "object")
8385
8406
  return false;
8386
- const proto = getPrototypeOf(value);
8387
- if (proto === null) {
8407
+ const proto = Object.getPrototypeOf(value);
8408
+ if (proto === null || proto === Object.prototype)
8388
8409
  return true;
8389
- }
8390
8410
  const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
8391
8411
  if (Ctor === Object)
8392
8412
  return true;
8393
- return typeof Ctor == "function" && Function.toString.call(Ctor) === objectCtorString;
8413
+ if (typeof Ctor !== "function")
8414
+ return false;
8415
+ let ctorString = cachedCtorStrings.get(Ctor);
8416
+ if (ctorString === void 0) {
8417
+ ctorString = Function.toString.call(Ctor);
8418
+ cachedCtorStrings.set(Ctor, ctorString);
8419
+ }
8420
+ return ctorString === objectCtorString;
8394
8421
  }
8395
8422
  function original(value) {
8396
8423
  if (!isDraft(value))
8397
8424
  die(15, value);
8398
8425
  return value[DRAFT_STATE].base_;
8399
8426
  }
8400
- function each(obj, iter) {
8427
+ function each(obj, iter, strict = true) {
8401
8428
  if (getArchtype(obj) === 0 /* Object */) {
8402
- Reflect.ownKeys(obj).forEach((key) => {
8429
+ const keys = strict ? Reflect.ownKeys(obj) : Object.keys(obj);
8430
+ keys.forEach((key) => {
8403
8431
  iter(key, obj[key], obj);
8404
8432
  });
8405
8433
  } else {
@@ -8486,10 +8514,10 @@ function freeze(obj, deep = false) {
8486
8514
  return obj;
8487
8515
  if (getArchtype(obj) > 1) {
8488
8516
  Object.defineProperties(obj, {
8489
- set: { value: dontMutateFrozenCollections },
8490
- add: { value: dontMutateFrozenCollections },
8491
- clear: { value: dontMutateFrozenCollections },
8492
- delete: { value: dontMutateFrozenCollections }
8517
+ set: dontMutateMethodOverride,
8518
+ add: dontMutateMethodOverride,
8519
+ clear: dontMutateMethodOverride,
8520
+ delete: dontMutateMethodOverride
8493
8521
  });
8494
8522
  }
8495
8523
  Object.freeze(obj);
@@ -8500,7 +8528,12 @@ function freeze(obj, deep = false) {
8500
8528
  function dontMutateFrozenCollections() {
8501
8529
  die(2);
8502
8530
  }
8531
+ var dontMutateMethodOverride = {
8532
+ value: dontMutateFrozenCollections
8533
+ };
8503
8534
  function isFrozen(obj) {
8535
+ if (obj === null || typeof obj !== "object")
8536
+ return true;
8504
8537
  return Object.isFrozen(obj);
8505
8538
  }
8506
8539
 
@@ -8598,11 +8631,13 @@ function processResult(result, scope) {
8598
8631
  function finalize(rootScope, value, path) {
8599
8632
  if (isFrozen(value))
8600
8633
  return value;
8634
+ const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();
8601
8635
  const state = value[DRAFT_STATE];
8602
8636
  if (!state) {
8603
8637
  each(
8604
8638
  value,
8605
- (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)
8639
+ (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),
8640
+ useStrictIteration
8606
8641
  );
8607
8642
  return value;
8608
8643
  }
@@ -8625,7 +8660,16 @@ function finalize(rootScope, value, path) {
8625
8660
  }
8626
8661
  each(
8627
8662
  resultEach,
8628
- (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)
8663
+ (key, childValue) => finalizeProperty(
8664
+ rootScope,
8665
+ state,
8666
+ result,
8667
+ key,
8668
+ childValue,
8669
+ path,
8670
+ isSet2
8671
+ ),
8672
+ useStrictIteration
8629
8673
  );
8630
8674
  maybeFreeze(rootScope, result, false);
8631
8675
  if (path && rootScope.patches_) {
@@ -8640,6 +8684,16 @@ function finalize(rootScope, value, path) {
8640
8684
  return state.copy_;
8641
8685
  }
8642
8686
  function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {
8687
+ if (childValue == null) {
8688
+ return;
8689
+ }
8690
+ if (typeof childValue !== "object" && !targetIsSet) {
8691
+ return;
8692
+ }
8693
+ const childIsFrozen = isFrozen(childValue);
8694
+ if (childIsFrozen && !targetIsSet) {
8695
+ return;
8696
+ }
8643
8697
  if ( true && childValue === targetObject)
8644
8698
  die(5);
8645
8699
  if (isDraft(childValue)) {
@@ -8654,10 +8708,13 @@ function finalizeProperty(rootScope, parentState, targetObject, prop, childValue
8654
8708
  } else if (targetIsSet) {
8655
8709
  targetObject.add(childValue);
8656
8710
  }
8657
- if (isDraftable(childValue) && !isFrozen(childValue)) {
8711
+ if (isDraftable(childValue) && !childIsFrozen) {
8658
8712
  if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
8659
8713
  return;
8660
8714
  }
8715
+ if (parentState && parentState.base_ && parentState.base_[prop] === childValue && childIsFrozen) {
8716
+ return;
8717
+ }
8661
8718
  finalize(rootScope, childValue);
8662
8719
  if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))
8663
8720
  maybeFreeze(rootScope, childValue);
@@ -8858,6 +8915,7 @@ var Immer2 = class {
8858
8915
  constructor(config) {
8859
8916
  this.autoFreeze_ = true;
8860
8917
  this.useStrictShallowCopy_ = false;
8918
+ this.useStrictIteration_ = true;
8861
8919
  /**
8862
8920
  * The `produce` function takes a value and a "recipe function" (whose
8863
8921
  * return value often depends on the base state). The recipe function is
@@ -8939,6 +8997,8 @@ var Immer2 = class {
8939
8997
  this.setAutoFreeze(config.autoFreeze);
8940
8998
  if (typeof config?.useStrictShallowCopy === "boolean")
8941
8999
  this.setUseStrictShallowCopy(config.useStrictShallowCopy);
9000
+ if (typeof config?.useStrictIteration === "boolean")
9001
+ this.setUseStrictIteration(config.useStrictIteration);
8942
9002
  }
8943
9003
  createDraft(base) {
8944
9004
  if (!isDraftable(base))
@@ -8975,6 +9035,18 @@ var Immer2 = class {
8975
9035
  setUseStrictShallowCopy(value) {
8976
9036
  this.useStrictShallowCopy_ = value;
8977
9037
  }
9038
+ /**
9039
+ * Pass false to use faster iteration that skips non-enumerable properties
9040
+ * but still handles symbols for compatibility.
9041
+ *
9042
+ * By default, strict iteration is enabled (includes all own properties).
9043
+ */
9044
+ setUseStrictIteration(value) {
9045
+ this.useStrictIteration_ = value;
9046
+ }
9047
+ shouldUseStrictIteration() {
9048
+ return this.useStrictIteration_;
9049
+ }
8978
9050
  applyPatches(base, patches) {
8979
9051
  let i;
8980
9052
  for (i = patches.length - 1; i >= 0; i--) {
@@ -9015,17 +9087,23 @@ function currentImpl(value) {
9015
9087
  return value;
9016
9088
  const state = value[DRAFT_STATE];
9017
9089
  let copy;
9090
+ let strict = true;
9018
9091
  if (state) {
9019
9092
  if (!state.modified_)
9020
9093
  return state.base_;
9021
9094
  state.finalized_ = true;
9022
9095
  copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
9096
+ strict = state.scope_.immer_.shouldUseStrictIteration();
9023
9097
  } else {
9024
9098
  copy = shallowCopy(value, true);
9025
9099
  }
9026
- each(copy, (key, childValue) => {
9027
- set(copy, key, currentImpl(childValue));
9028
- });
9100
+ each(
9101
+ copy,
9102
+ (key, childValue) => {
9103
+ set(copy, key, currentImpl(childValue));
9104
+ },
9105
+ strict
9106
+ );
9029
9107
  if (state) {
9030
9108
  state.finalized_ = false;
9031
9109
  }
@@ -9528,6 +9606,9 @@ var setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer);
9528
9606
  var setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(
9529
9607
  immer
9530
9608
  );
9609
+ var setUseStrictIteration = /* @__PURE__ */ immer.setUseStrictIteration.bind(
9610
+ immer
9611
+ );
9531
9612
  var applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);
9532
9613
  var createDraft = /* @__PURE__ */ immer.createDraft.bind(immer);
9533
9614
  var finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer);
@@ -12671,7 +12752,7 @@ __webpack_require__.r(__webpack_exports__);
12671
12752
  /* harmony export */ tabbable: () => (/* binding */ tabbable)
12672
12753
  /* harmony export */ });
12673
12754
  /*!
12674
- * tabbable 6.2.0
12755
+ * tabbable 6.3.0
12675
12756
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
12676
12757
  */
12677
12758
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -12698,7 +12779,7 @@ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (elemen
12698
12779
  * @returns {boolean} True if inert itself or by way of being in an inert ancestor.
12699
12780
  * False if `node` is falsy.
12700
12781
  */
12701
- var isInert = function isInert(node, lookUp) {
12782
+ var _isInert = function isInert(node, lookUp) {
12702
12783
  var _node$getAttribute;
12703
12784
  if (lookUp === void 0) {
12704
12785
  lookUp = true;
@@ -12714,7 +12795,7 @@ var isInert = function isInert(node, lookUp) {
12714
12795
  // code works for any kind of node
12715
12796
  // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
12716
12797
  // so it likely would not support `:is([inert] *)` either...
12717
- var result = inert || lookUp && node && isInert(node.parentNode); // recursive
12798
+ var result = inert || lookUp && node && _isInert(node.parentNode); // recursive
12718
12799
 
12719
12800
  return result;
12720
12801
  };
@@ -12742,7 +12823,7 @@ var isContentEditable = function isContentEditable(node) {
12742
12823
  var getCandidates = function getCandidates(el, includeContainer, filter) {
12743
12824
  // even if `includeContainer=false`, we still have to check it for inertness because
12744
12825
  // if it's inert, all its children are inert
12745
- if (isInert(el)) {
12826
+ if (_isInert(el)) {
12746
12827
  return [];
12747
12828
  }
12748
12829
  var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
@@ -12787,12 +12868,12 @@ var getCandidates = function getCandidates(el, includeContainer, filter) {
12787
12868
  * @param {IterativeOptions} options
12788
12869
  * @returns {Array.<Element|CandidateScope>}
12789
12870
  */
12790
- var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
12871
+ var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
12791
12872
  var candidates = [];
12792
12873
  var elementsToCheck = Array.from(elements);
12793
12874
  while (elementsToCheck.length) {
12794
12875
  var element = elementsToCheck.shift();
12795
- if (isInert(element, false)) {
12876
+ if (_isInert(element, false)) {
12796
12877
  // no need to look up since we're drilling down
12797
12878
  // anything inside this container will also be inert
12798
12879
  continue;
@@ -12801,7 +12882,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
12801
12882
  // add shadow dom slot scope (slot itself cannot be focusable)
12802
12883
  var assigned = element.assignedElements();
12803
12884
  var content = assigned.length ? assigned : element.children;
12804
- var nestedCandidates = getCandidatesIteratively(content, true, options);
12885
+ var nestedCandidates = _getCandidatesIteratively(content, true, options);
12805
12886
  if (options.flatten) {
12806
12887
  candidates.push.apply(candidates, nestedCandidates);
12807
12888
  } else {
@@ -12825,7 +12906,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
12825
12906
  // no inert look up because we're already drilling down and checking for inertness
12826
12907
  // on the way down, so all containers to this root node should have already been
12827
12908
  // vetted as non-inert
12828
- var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
12909
+ var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
12829
12910
  if (shadowRoot && validShadowRoot) {
12830
12911
  // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
12831
12912
  // shadow exists, so look at light dom children as fallback BUT create a scope for any
@@ -12833,7 +12914,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
12833
12914
  // children of the web component element (which has the shadow), in the light dom, but
12834
12915
  // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
12835
12916
  // _after_ we return from this recursive call
12836
- var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
12917
+ var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
12837
12918
  if (options.flatten) {
12838
12919
  candidates.push.apply(candidates, _nestedCandidates);
12839
12920
  } else {
@@ -13010,6 +13091,28 @@ var isZeroArea = function isZeroArea(node) {
13010
13091
  var isHidden = function isHidden(node, _ref) {
13011
13092
  var displayCheck = _ref.displayCheck,
13012
13093
  getShadowRoot = _ref.getShadowRoot;
13094
+ if (displayCheck === 'full-native') {
13095
+ if ('checkVisibility' in node) {
13096
+ // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
13097
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
13098
+ var visible = node.checkVisibility({
13099
+ // Checking opacity might be desirable for some use cases, but natively,
13100
+ // opacity zero elements _are_ focusable and tabbable.
13101
+ checkOpacity: false,
13102
+ opacityProperty: false,
13103
+ contentVisibilityAuto: true,
13104
+ visibilityProperty: true,
13105
+ // This is an alias for `visibilityProperty`. Contemporary browsers
13106
+ // support both. However, this alias has wider browser support (Chrome
13107
+ // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
13108
+ // we include it anyway.
13109
+ checkVisibilityCSS: true
13110
+ });
13111
+ return !visible;
13112
+ }
13113
+ // Fall through to manual visibility checks
13114
+ }
13115
+
13013
13116
  // NOTE: visibility will be `undefined` if node is detached from the document
13014
13117
  // (see notes about this further down), which means we will consider it visible
13015
13118
  // (this is legacy behavior from a very long way back)
@@ -13023,7 +13126,10 @@ var isHidden = function isHidden(node, _ref) {
13023
13126
  if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
13024
13127
  return true;
13025
13128
  }
13026
- if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
13129
+ if (!displayCheck || displayCheck === 'full' ||
13130
+ // full-native can run this branch when it falls through in case
13131
+ // Element#checkVisibility is unsupported
13132
+ displayCheck === 'full-native' || displayCheck === 'legacy-full') {
13027
13133
  if (typeof getShadowRoot === 'function') {
13028
13134
  // figure out if we should consider the node to be in an undisclosed shadow and use the
13029
13135
  // 'non-zero-area' fallback
@@ -13136,7 +13242,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
13136
13242
  // we must do an inert look up to filter out any elements inside an inert ancestor
13137
13243
  // because we're limited in the type of selectors we can use in JSDom (see related
13138
13244
  // note related to `candidateSelectors`)
13139
- isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
13245
+ _isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
13140
13246
  // For a details element with a summary, the summary element gets the focus
13141
13247
  isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
13142
13248
  return false;
@@ -13149,7 +13255,7 @@ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(opt
13149
13255
  }
13150
13256
  return true;
13151
13257
  };
13152
- var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
13258
+ var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {
13153
13259
  var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
13154
13260
  if (isNaN(tabIndex) || tabIndex >= 0) {
13155
13261
  return true;
@@ -13163,14 +13269,14 @@ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNod
13163
13269
  * @param {Array.<Element|CandidateScope>} candidates
13164
13270
  * @returns Element[]
13165
13271
  */
13166
- var sortByOrder = function sortByOrder(candidates) {
13272
+ var _sortByOrder = function sortByOrder(candidates) {
13167
13273
  var regularTabbables = [];
13168
13274
  var orderedTabbables = [];
13169
13275
  candidates.forEach(function (item, i) {
13170
13276
  var isScope = !!item.scopeParent;
13171
13277
  var element = isScope ? item.scopeParent : item;
13172
13278
  var candidateTabindex = getSortOrderTabIndex(element, isScope);
13173
- var elements = isScope ? sortByOrder(item.candidates) : element;
13279
+ var elements = isScope ? _sortByOrder(item.candidates) : element;
13174
13280
  if (candidateTabindex === 0) {
13175
13281
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
13176
13282
  } else {
@@ -13192,22 +13298,22 @@ var tabbable = function tabbable(container, options) {
13192
13298
  options = options || {};
13193
13299
  var candidates;
13194
13300
  if (options.getShadowRoot) {
13195
- candidates = getCandidatesIteratively([container], options.includeContainer, {
13301
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
13196
13302
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
13197
13303
  flatten: false,
13198
13304
  getShadowRoot: options.getShadowRoot,
13199
- shadowRootFilter: isValidShadowRootTabbable
13305
+ shadowRootFilter: isShadowRootTabbable
13200
13306
  });
13201
13307
  } else {
13202
13308
  candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
13203
13309
  }
13204
- return sortByOrder(candidates);
13310
+ return _sortByOrder(candidates);
13205
13311
  };
13206
13312
  var focusable = function focusable(container, options) {
13207
13313
  options = options || {};
13208
13314
  var candidates;
13209
13315
  if (options.getShadowRoot) {
13210
- candidates = getCandidatesIteratively([container], options.includeContainer, {
13316
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
13211
13317
  filter: isNodeMatchingSelectorFocusable.bind(null, options),
13212
13318
  flatten: true,
13213
13319
  getShadowRoot: options.getShadowRoot
@@ -14485,7 +14591,7 @@ class API {
14485
14591
  return {
14486
14592
  clientName: "@seamly/web-ui",
14487
14593
  clientVariant: this.#layoutMode,
14488
- clientVersion: "25.1.0",
14594
+ clientVersion: "25.2.0-beta.2",
14489
14595
  currentUrl: window.location.toString(),
14490
14596
  screenResolution: `${window.screen.width}x${window.screen.height}`,
14491
14597
  timezone: (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getTimeZone)(),
@@ -16643,6 +16749,7 @@ const initialStoreState = {
16643
16749
  subTitle: ''
16644
16750
  },
16645
16751
  historyLoaded: false,
16752
+ skiplinkElementId: (0,lib_id__WEBPACK_IMPORTED_MODULE_10__.randomId)(),
16646
16753
  skiplinkTargetId: (0,lib_id__WEBPACK_IMPORTED_MODULE_10__.randomId)(),
16647
16754
  optionsButtonId: (0,lib_id__WEBPACK_IMPORTED_MODULE_10__.randomId)(),
16648
16755
  headerCollapseButtonId: (0,lib_id__WEBPACK_IMPORTED_MODULE_10__.randomId)(),
@@ -19664,7 +19771,8 @@ const Conversation = () => {
19664
19771
  const {
19665
19772
  isOpen
19666
19773
  } = (0,domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_3__.useVisibility)();
19667
- const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplink)();
19774
+ const skiplinkElementId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplinkElement)();
19775
+ const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplinkTarget)();
19668
19776
  const focusSkiplinkTarget = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplinkTargetFocusing)();
19669
19777
  const onClickHandler = e => {
19670
19778
  e.preventDefault();
@@ -19672,6 +19780,7 @@ const Conversation = () => {
19672
19780
  };
19673
19781
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment, {
19674
19782
  children: [isOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("a", {
19783
+ id: skiplinkElementId,
19675
19784
  className: (0,lib_css__WEBPACK_IMPORTED_MODULE_4__.className)('skip-link'),
19676
19785
  href: `#${skiplinkTargetId}`,
19677
19786
  onClick: onClickHandler,
@@ -21821,39 +21930,58 @@ __webpack_require__.r(__webpack_exports__);
21821
21930
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21822
21931
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
21823
21932
  /* harmony export */ });
21824
- /* harmony import */ var lib_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lib/css */ "./src/javascripts/core/lib/css.ts");
21825
- /* harmony import */ var ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ui/hooks/seamly-hooks */ "./src/javascripts/core/ui/hooks/seamly-hooks.ts");
21826
- /* harmony import */ var _event_event_participant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./event/event-participant */ "./src/javascripts/core/ui/components/conversation/event/event-participant.tsx");
21827
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/preact/compat/jsx-runtime.mjs");
21933
+ /* harmony import */ var domains_i18n_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! domains/i18n/hooks */ "./src/javascripts/core/domains/i18n/hooks.ts");
21934
+ /* harmony import */ var lib_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lib/css */ "./src/javascripts/core/lib/css.ts");
21935
+ /* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! preact/hooks */ "preact/hooks");
21936
+ /* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(preact_hooks__WEBPACK_IMPORTED_MODULE_2__);
21937
+ /* harmony import */ var ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ui/hooks/seamly-hooks */ "./src/javascripts/core/ui/hooks/seamly-hooks.ts");
21938
+ /* harmony import */ var _event_event_participant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./event/event-participant */ "./src/javascripts/core/ui/components/conversation/event/event-participant.tsx");
21939
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/preact/compat/jsx-runtime.mjs");
21940
+
21941
+
21828
21942
 
21829
21943
 
21830
21944
 
21831
21945
 
21832
21946
  const Loader = () => {
21833
21947
  const {
21834
- id
21835
- } = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_1__.useSeamlyCurrentAgent)() || {};
21836
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("li", {
21837
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('conversation__item', 'conversation__item--source-agent'),
21838
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
21839
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('message', 'message--source-agent', 'message--type-loading'),
21840
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_event_event_participant__WEBPACK_IMPORTED_MODULE_2__["default"], {
21948
+ t
21949
+ } = (0,domains_i18n_hooks__WEBPACK_IMPORTED_MODULE_0__.useI18n)();
21950
+ const {
21951
+ sendPolite
21952
+ } = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_3__.useLiveRegion)();
21953
+ const {
21954
+ id,
21955
+ name
21956
+ } = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_3__.useSeamlyCurrentAgent)() || {};
21957
+ (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
21958
+ if (name) {
21959
+ sendPolite(t('typing.srText', {
21960
+ name
21961
+ }));
21962
+ }
21963
+ }, [name, sendPolite, t]);
21964
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("li", {
21965
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('conversation__item', 'conversation__item--source-agent'),
21966
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
21967
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('message', 'message--source-agent', 'message--type-loading'),
21968
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_event_event_participant__WEBPACK_IMPORTED_MODULE_4__["default"], {
21841
21969
  eventPayload: {
21842
21970
  fromClient: false,
21843
21971
  participant: id
21844
21972
  }
21845
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
21846
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('message__body'),
21847
- children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
21848
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('loader'),
21849
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
21850
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('loader__part', 'one')
21851
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
21852
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('loader__part', 'two')
21853
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
21854
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('loader__part', 'three')
21855
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
21856
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_0__.className)('loader__part', 'four')
21973
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
21974
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('message__body'),
21975
+ children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("span", {
21976
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('loader'),
21977
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
21978
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('loader__part', 'one')
21979
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
21980
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('loader__part', 'two')
21981
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
21982
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('loader__part', 'three')
21983
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
21984
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_1__.className)('loader__part', 'four')
21857
21985
  })]
21858
21986
  })
21859
21987
  })]
@@ -23578,7 +23706,7 @@ function TextEntry({
23578
23706
  isOpen,
23579
23707
  setVisibility
23580
23708
  } = (0,domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_2__.useVisibility)();
23581
- const skipLinkId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplink)();
23709
+ const skipLinkId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplinkTarget)();
23582
23710
  const focusSkipLinkTarget = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplinkTargetFocusing)();
23583
23711
  const {
23584
23712
  sendMessage
@@ -23973,7 +24101,7 @@ const Upload = () => {
23973
24101
  sendPolite,
23974
24102
  sendAssertive
23975
24103
  } = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useLiveRegion)();
23976
- const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplink)();
24104
+ const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplinkTarget)();
23977
24105
  const focusSkiplinkTarget = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_6__.useSkiplinkTargetFocusing)();
23978
24106
  // This hook should be refactored at some point
23979
24107
  const {
@@ -24633,15 +24761,17 @@ __webpack_require__.r(__webpack_exports__);
24633
24761
  /* harmony import */ var domains_config_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! domains/config/hooks */ "./src/javascripts/core/domains/config/hooks.ts");
24634
24762
  /* harmony import */ var domains_i18n_hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! domains/i18n/hooks */ "./src/javascripts/core/domains/i18n/hooks.ts");
24635
24763
  /* harmony import */ var domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! domains/visibility/hooks */ "./src/javascripts/core/domains/visibility/hooks.ts");
24636
- /* harmony import */ var lib_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lib/css */ "./src/javascripts/core/lib/css.ts");
24637
- /* harmony import */ var preact_compat__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! preact/compat */ "preact/compat");
24638
- /* harmony import */ var preact_compat__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(preact_compat__WEBPACK_IMPORTED_MODULE_6__);
24639
- /* harmony import */ var ui_components_suggestions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ui/components/suggestions */ "./src/javascripts/core/ui/components/suggestions/index.tsx");
24640
- /* harmony import */ var ui_hooks_component_helper_hooks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ui/hooks/component-helper-hooks */ "./src/javascripts/core/ui/hooks/component-helper-hooks.ts");
24641
- /* harmony import */ var ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ui/hooks/focus-helper-hooks */ "./src/javascripts/core/ui/hooks/focus-helper-hooks.ts");
24642
- /* harmony import */ var ui_hooks_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ui/hooks/seamly-state-hooks */ "./src/javascripts/core/ui/hooks/seamly-state-hooks.ts");
24643
- /* harmony import */ var ui_hooks_utility_hooks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ui/hooks/utility-hooks */ "./src/javascripts/core/ui/hooks/utility-hooks.ts");
24644
- /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/preact/compat/jsx-runtime.mjs");
24764
+ /* harmony import */ var focus_trap__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! focus-trap */ "./node_modules/focus-trap/dist/focus-trap.esm.js");
24765
+ /* harmony import */ var lib_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lib/css */ "./src/javascripts/core/lib/css.ts");
24766
+ /* harmony import */ var preact_compat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! preact/compat */ "preact/compat");
24767
+ /* harmony import */ var preact_compat__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(preact_compat__WEBPACK_IMPORTED_MODULE_7__);
24768
+ /* harmony import */ var ui_components_suggestions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ui/components/suggestions */ "./src/javascripts/core/ui/components/suggestions/index.tsx");
24769
+ /* harmony import */ var ui_hooks_component_helper_hooks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ui/hooks/component-helper-hooks */ "./src/javascripts/core/ui/hooks/component-helper-hooks.ts");
24770
+ /* harmony import */ var ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ui/hooks/focus-helper-hooks */ "./src/javascripts/core/ui/hooks/focus-helper-hooks.ts");
24771
+ /* harmony import */ var ui_hooks_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ui/hooks/seamly-state-hooks */ "./src/javascripts/core/ui/hooks/seamly-state-hooks.ts");
24772
+ /* harmony import */ var ui_hooks_utility_hooks__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ui/hooks/utility-hooks */ "./src/javascripts/core/ui/hooks/utility-hooks.ts");
24773
+ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/preact/compat/jsx-runtime.mjs");
24774
+
24645
24775
 
24646
24776
 
24647
24777
 
@@ -24655,25 +24785,27 @@ __webpack_require__.r(__webpack_exports__);
24655
24785
 
24656
24786
 
24657
24787
 
24658
- const Chat = (0,preact_compat__WEBPACK_IMPORTED_MODULE_6__.forwardRef)(({
24788
+ const Chat = (0,preact_compat__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({
24659
24789
  children,
24660
24790
  className: givenClassName = ''
24661
24791
  }, forwardedRef) => {
24792
+ const focusTrap = (0,preact_compat__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);
24662
24793
  const {
24663
24794
  closeChat,
24664
24795
  isOpen,
24665
24796
  isVisible
24666
24797
  } = (0,domains_visibility_hooks__WEBPACK_IMPORTED_MODULE_4__.useVisibility)();
24667
- const focusWindowOpenButton = (0,ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_9__.useWindowOpenButtonFocusing)();
24798
+ const focusWindowOpenButton = (0,ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_10__.useWindowOpenButtonFocusing)();
24668
24799
  const {
24669
24800
  namespace,
24670
24801
  layoutMode
24671
24802
  } = (0,domains_config_hooks__WEBPACK_IMPORTED_MODULE_2__.useConfig)();
24672
24803
  const {
24673
24804
  isInline
24674
- } = (0,ui_hooks_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_10__.useSeamlyLayoutMode)();
24675
- const appContainerClassNames = (0,ui_hooks_component_helper_hooks__WEBPACK_IMPORTED_MODULE_8__.useSeamlyAppContainerClassNames)();
24676
- const headingId = (0,ui_hooks_utility_hooks__WEBPACK_IMPORTED_MODULE_11__.useGeneratedId)();
24805
+ } = (0,ui_hooks_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_11__.useSeamlyLayoutMode)();
24806
+ const appContainerClassNames = (0,ui_hooks_component_helper_hooks__WEBPACK_IMPORTED_MODULE_9__.useSeamlyAppContainerClassNames)();
24807
+ const chatSectionId = (0,ui_hooks_utility_hooks__WEBPACK_IMPORTED_MODULE_12__.useGeneratedId)();
24808
+ const headingId = (0,ui_hooks_utility_hooks__WEBPACK_IMPORTED_MODULE_12__.useGeneratedId)();
24677
24809
  const userHasResponded = (0,domains_app_hooks__WEBPACK_IMPORTED_MODULE_1__.useUserHasResponded)();
24678
24810
  const {
24679
24811
  t
@@ -24695,21 +24827,36 @@ const Chat = (0,preact_compat__WEBPACK_IMPORTED_MODULE_6__.forwardRef)(({
24695
24827
  focusWindowOpenButton();
24696
24828
  }
24697
24829
  };
24698
- return isVisible && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("section", {
24699
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_5__.className)(classNames),
24830
+ (0,preact_compat__WEBPACK_IMPORTED_MODULE_7__.useEffect)(() => {
24831
+ if (isVisible && layoutMode === 'window') {
24832
+ focusTrap.current = (0,focus_trap__WEBPACK_IMPORTED_MODULE_5__.createFocusTrap)(`#${chatSectionId}`, {
24833
+ // We set the initialFocus to false, as the `WindowOpenButton` takes care of that
24834
+ initialFocus: false
24835
+ });
24836
+ focusTrap.current.activate();
24837
+ }
24838
+ return () => {
24839
+ if (focusTrap.current) {
24840
+ focusTrap.current.deactivate();
24841
+ }
24842
+ };
24843
+ }, [chatSectionId, isVisible, layoutMode]);
24844
+ return isVisible && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("section", {
24845
+ id: chatSectionId,
24846
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_6__.className)(classNames),
24700
24847
  onKeyDown: onKeyDownHandler,
24701
24848
  tabIndex: -1,
24702
24849
  ref: forwardedRef,
24703
24850
  role: layoutMode === 'window' ? 'dialog' : undefined,
24704
24851
  "aria-labelledby": headingId,
24705
- children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("h2", {
24706
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_5__.className)('chat__title', 'visually-hidden'),
24852
+ children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("h2", {
24853
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_6__.className)('chat__title', 'visually-hidden'),
24707
24854
  id: headingId,
24708
24855
  children: t('window.srModalLayoutLabel')
24709
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
24710
- className: (0,lib_css__WEBPACK_IMPORTED_MODULE_5__.className)('chat-wrapper'),
24856
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
24857
+ className: (0,lib_css__WEBPACK_IMPORTED_MODULE_6__.className)('chat-wrapper'),
24711
24858
  children: children
24712
- }), layoutMode === 'inline' && isOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ui_components_suggestions__WEBPACK_IMPORTED_MODULE_7__["default"], {
24859
+ }), layoutMode === 'inline' && isOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(ui_components_suggestions__WEBPACK_IMPORTED_MODULE_8__["default"], {
24713
24860
  isAside: true
24714
24861
  })]
24715
24862
  });
@@ -26538,6 +26685,7 @@ const WindowOpenButton = ({
26538
26685
  t
26539
26686
  } = (0,domains_i18n_hooks__WEBPACK_IMPORTED_MODULE_1__.useI18n)();
26540
26687
  const ariaLabel = hasConversation() ? t('window.openButton.srContinue') : t('window.openButton.srStart');
26688
+ const focusSkipLinkELement = (0,ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_9__.useSkiplinkElementFocusing)();
26541
26689
  const focusSkiplinkTarget = (0,ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_9__.useSkiplinkTargetFocusing)();
26542
26690
  const {
26543
26691
  isOpen
@@ -26546,10 +26694,17 @@ const WindowOpenButton = ({
26546
26694
  windowOpenButtonId
26547
26695
  } = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_11__.useSeamlyStateContext)();
26548
26696
  const count = (0,ui_hooks_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_12__.useSeamlyUnreadCount)();
26549
- const handleClick = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => {
26697
+ const handleClick = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_5__.useCallback)(event => {
26550
26698
  onClick();
26551
- focusSkiplinkTarget();
26552
- }, [focusSkiplinkTarget, onClick]);
26699
+ if (event.detail > 0) {
26700
+ // Mouse was used: focus the input element
26701
+ focusSkiplinkTarget();
26702
+ } else {
26703
+ // Keyboard was used: focus the skiplink element instead to improve
26704
+ // accessibility for keyboard users.
26705
+ focusSkipLinkELement();
26706
+ }
26707
+ }, [focusSkipLinkELement, focusSkiplinkTarget, onClick]);
26553
26708
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(ui_components_widgets_in_out_transition__WEBPACK_IMPORTED_MODULE_8__["default"], {
26554
26709
  isActive: !isOpen,
26555
26710
  transitionStartState: ui_components_widgets_in_out_transition__WEBPACK_IMPORTED_MODULE_8__.transitionStartStates.rendered,
@@ -26689,7 +26844,7 @@ const Prompt = ({
26689
26844
  children,
26690
26845
  title
26691
26846
  }) => {
26692
- const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_1__.useSkiplink)();
26847
+ const skiplinkTargetId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_1__.useSkiplinkTarget)();
26693
26848
  const containerHeadingId = (0,ui_hooks_seamly_hooks__WEBPACK_IMPORTED_MODULE_1__.useGeneratedId)();
26694
26849
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("section", {
26695
26850
  id: skiplinkTargetId,
@@ -27399,6 +27554,7 @@ __webpack_require__.r(__webpack_exports__);
27399
27554
  /* harmony export */ useElementFocusingById: () => (/* binding */ useElementFocusingById),
27400
27555
  /* harmony export */ useFocusIfSeamlyContainedFocus: () => (/* binding */ useFocusIfSeamlyContainedFocus),
27401
27556
  /* harmony export */ useSeamlyContainerElement: () => (/* binding */ useSeamlyContainerElement),
27557
+ /* harmony export */ useSkiplinkElementFocusing: () => (/* binding */ useSkiplinkElementFocusing),
27402
27558
  /* harmony export */ useSkiplinkTargetFocusing: () => (/* binding */ useSkiplinkTargetFocusing),
27403
27559
  /* harmony export */ useWindowOpenButtonFocusing: () => (/* binding */ useWindowOpenButtonFocusing)
27404
27560
  /* harmony export */ });
@@ -27436,8 +27592,12 @@ const useSeamlyContainerElement = () => {
27436
27592
  const useElementFocusingById = elementId => (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
27437
27593
  focusWithRaf(elementId);
27438
27594
  }, [elementId]);
27595
+ const useSkiplinkElementFocusing = () => {
27596
+ const skiplinkElementId = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplinkElement)();
27597
+ return useElementFocusingById(skiplinkElementId);
27598
+ };
27439
27599
  const useSkiplinkTargetFocusing = () => {
27440
- const skiplinkTargetId = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplink)();
27600
+ const skiplinkTargetId = (0,_seamly_state_hooks__WEBPACK_IMPORTED_MODULE_4__.useSkiplinkTarget)();
27441
27601
  return useElementFocusingById(skiplinkTargetId);
27442
27602
  };
27443
27603
  const useWindowOpenButtonFocusing = () => {
@@ -27726,7 +27886,8 @@ __webpack_require__.r(__webpack_exports__);
27726
27886
  /* harmony export */ useSeamlyServiceInfo: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSeamlyServiceInfo),
27727
27887
  /* harmony export */ useSeamlyStateContext: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSeamlyStateContext),
27728
27888
  /* harmony export */ useSeamlyUnreadCount: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSeamlyUnreadCount),
27729
- /* harmony export */ useSkiplink: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSkiplink),
27889
+ /* harmony export */ useSkiplinkElement: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSkiplinkElement),
27890
+ /* harmony export */ useSkiplinkTarget: () => (/* reexport safe */ _seamly_state_hooks__WEBPACK_IMPORTED_MODULE_8__.useSkiplinkTarget),
27730
27891
  /* harmony export */ useSkiplinkTargetFocusing: () => (/* reexport safe */ ui_hooks_focus_helper_hooks__WEBPACK_IMPORTED_MODULE_2__.useSkiplinkTargetFocusing)
27731
27892
  /* harmony export */ });
27732
27893
  /* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact/hooks */ "preact/hooks");
@@ -27945,7 +28106,8 @@ __webpack_require__.r(__webpack_exports__);
27945
28106
  /* harmony export */ useSeamlyServiceInfo: () => (/* binding */ useSeamlyServiceInfo),
27946
28107
  /* harmony export */ useSeamlyStateContext: () => (/* binding */ useSeamlyStateContext),
27947
28108
  /* harmony export */ useSeamlyUnreadCount: () => (/* binding */ useSeamlyUnreadCount),
27948
- /* harmony export */ useSkiplink: () => (/* binding */ useSkiplink)
28109
+ /* harmony export */ useSkiplinkElement: () => (/* binding */ useSkiplinkElement),
28110
+ /* harmony export */ useSkiplinkTarget: () => (/* binding */ useSkiplinkTarget)
27949
28111
  /* harmony export */ });
27950
28112
  /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "./node_modules/core-js/modules/esnext.iterator.constructor.js");
27951
28113
  /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);
@@ -28035,7 +28197,8 @@ const useSeamlyIsLoading = () => useSeamlyStateContext().isLoading;
28035
28197
  const useSeamlyHeaderData = () => useSeamlyStateContext().headerTitles;
28036
28198
  const useSeamlyUnreadCount = () => useSeamlyStateContext().unreadEvents;
28037
28199
  const useLoadedImageEventIds = () => useSeamlyStateContext().loadedImageEventIds;
28038
- const useSkiplink = () => useSeamlyStateContext().skiplinkTargetId;
28200
+ const useSkiplinkElement = () => useSeamlyStateContext().skiplinkElementId;
28201
+ const useSkiplinkTarget = () => useSeamlyStateContext().skiplinkTargetId;
28039
28202
  const useSeamlyParticipant = participantId => useSeamlyStateContext().participantInfo.participants[participantId];
28040
28203
  const useSeamlyServiceInfo = () => useSeamlyStateContext().serviceInfo;
28041
28204
  const selectLastMessageEventId = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__.createSelector)(selectEvents, events => {