@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.
Files changed (50) hide show
  1. package/build/dist/lib/components.js +429 -180
  2. package/build/dist/lib/components.js.map +1 -1
  3. package/build/dist/lib/components.min.js +1 -1
  4. package/build/dist/lib/components.min.js.LICENSE.txt +2 -2
  5. package/build/dist/lib/components.min.js.map +1 -1
  6. package/build/dist/lib/hooks.js +84 -19
  7. package/build/dist/lib/hooks.js.map +1 -1
  8. package/build/dist/lib/hooks.min.js +1 -1
  9. package/build/dist/lib/hooks.min.js.map +1 -1
  10. package/build/dist/lib/index.debug.js +38 -38
  11. package/build/dist/lib/index.debug.min.js +1 -1
  12. package/build/dist/lib/index.debug.min.js.map +1 -1
  13. package/build/dist/lib/index.js +462 -193
  14. package/build/dist/lib/index.js.map +1 -1
  15. package/build/dist/lib/index.min.js +1 -1
  16. package/build/dist/lib/index.min.js.LICENSE.txt +2 -2
  17. package/build/dist/lib/index.min.js.map +1 -1
  18. package/build/dist/lib/standalone.js +539 -216
  19. package/build/dist/lib/standalone.js.map +1 -1
  20. package/build/dist/lib/standalone.min.js +1 -1
  21. package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
  22. package/build/dist/lib/standalone.min.js.map +1 -1
  23. package/build/dist/lib/style-guide.js +557 -190
  24. package/build/dist/lib/style-guide.js.map +1 -1
  25. package/build/dist/lib/style-guide.min.js +1 -1
  26. package/build/dist/lib/style-guide.min.js.LICENSE.txt +2 -2
  27. package/build/dist/lib/style-guide.min.js.map +1 -1
  28. package/build/dist/lib/styles-default-implementation.js +1 -1
  29. package/build/dist/lib/styles.css +1 -1
  30. package/build/dist/lib/styles.js +1 -1
  31. package/build/dist/lib/utils.js +459 -190
  32. package/build/dist/lib/utils.js.map +1 -1
  33. package/build/dist/lib/utils.min.js +1 -1
  34. package/build/dist/lib/utils.min.js.LICENSE.txt +1 -1
  35. package/build/dist/lib/utils.min.js.map +1 -1
  36. package/package.json +28 -28
  37. package/src/javascripts/api/index.ts +13 -1
  38. package/src/javascripts/domains/config/slice.ts +2 -1
  39. package/src/javascripts/domains/forms/selectors.ts +6 -8
  40. package/src/javascripts/domains/forms/slice.ts +1 -1
  41. package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +3 -1
  42. package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +62 -35
  43. package/src/javascripts/domains/translations/slice.ts +8 -1
  44. package/src/javascripts/lib/engine/index.tsx +3 -1
  45. package/src/javascripts/style-guide/states.js +47 -0
  46. package/src/javascripts/ui/components/entry/text-entry/hooks.ts +2 -2
  47. package/src/javascripts/ui/components/form-controls/wrapper.tsx +13 -3
  48. package/src/stylesheets/5-components/_input.scss +0 -5
  49. package/src/stylesheets/5-components/_options.scss +2 -2
  50. package/src/stylesheets/5-components/_translation-options.scss +23 -3
@@ -3104,13 +3104,15 @@ const configSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .createSl
3104
3104
  preChat,
3105
3105
  agentParticipant,
3106
3106
  userParticipant,
3107
- startChatIcon
3107
+ startChatIcon,
3108
+ locale
3108
3109
  }
3109
3110
  }) => {
3110
3111
  state.preChatEvents = preChat.map(payload => ({
3111
3112
  type: 'message',
3112
3113
  payload
3113
3114
  }));
3115
+ state.context.locale = locale;
3114
3116
  state.agentParticipant = agentParticipant;
3115
3117
  state.userParticipant = userParticipant;
3116
3118
  state.startChatIcon = startChatIcon;
@@ -5476,7 +5478,13 @@ const translationSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__/* .cre
5476
5478
  const feature = (_a = payload === null || payload === void 0 ? void 0 : payload.features) === null || _a === void 0 ? void 0 : _a.translation;
5477
5479
  if (!feature) return;
5478
5480
  state.isAvailable = feature.enabled === true;
5479
- state.languages = feature.languages;
5481
+ state.languages = [...feature.languages].sort((a, b) => {
5482
+ if (a.locale === payload.locale) return -1;
5483
+ if (b.locale === payload.locale) return 1;
5484
+ return a.nativeName.localeCompare(b.nativeName, undefined, {
5485
+ sensitivity: 'base'
5486
+ });
5487
+ });
5480
5488
  }).addCase(domains_store_slice__WEBPACK_IMPORTED_MODULE_2__/* .setHistory */ .JB, (state, {
5481
5489
  payload
5482
5490
  }) => {
@@ -8207,15 +8215,52 @@ var compat_module = __webpack_require__(8661);
8207
8215
  var batch = __webpack_require__(9256);
8208
8216
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/components/Context.js
8209
8217
 
8210
- const Context_ReactReduxContext = /*#__PURE__*/(0,compat_module.createContext)(null);
8218
+ const ContextKey = Symbol.for(`react-redux-context-${compat_module.version}`);
8219
+ const gT = globalThis;
8220
+
8221
+ function getContext() {
8222
+ let realContext = gT[ContextKey];
8211
8223
 
8212
- if (false) {}
8224
+ if (!realContext) {
8225
+ realContext = (0,compat_module.createContext)(null);
8226
+
8227
+ if (false) {}
8228
+
8229
+ gT[ContextKey] = realContext;
8230
+ }
8231
+
8232
+ return realContext;
8233
+ }
8213
8234
 
8235
+ const Context_ReactReduxContext = /*#__PURE__*/new Proxy({}, /*#__PURE__*/new Proxy({}, {
8236
+ get(_, handler) {
8237
+ const target = getContext(); // @ts-ignore
8238
+
8239
+ return (_target, ...args) => Reflect[handler](target, ...args);
8240
+ }
8241
+
8242
+ }));
8214
8243
  /* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
8215
8244
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useReduxContext.js
8216
8245
 
8217
8246
 
8218
8247
 
8248
+ /**
8249
+ * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
8250
+ * hook that you should usually not need to call directly.
8251
+ *
8252
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
8253
+ * @returns {Function} A `useReduxContext` hook bound to the specified context.
8254
+ */
8255
+ function createReduxContextHook(context = Context_ReactReduxContext) {
8256
+ return function useReduxContext() {
8257
+ const contextValue = (0,compat_module.useContext)(context);
8258
+
8259
+ if (false) {}
8260
+
8261
+ return contextValue;
8262
+ };
8263
+ }
8219
8264
  /**
8220
8265
  * A hook to access the value of the `ReactReduxContext`. This is a low-level
8221
8266
  * hook that you should usually not need to call directly.
@@ -8232,13 +8277,8 @@ if (false) {}
8232
8277
  * return <div>{store.getState()}</div>
8233
8278
  * }
8234
8279
  */
8235
- function useReduxContext_useReduxContext() {
8236
- const contextValue = (0,compat_module.useContext)(Context_ReactReduxContext);
8237
-
8238
- if (false) {}
8239
8280
 
8240
- return contextValue;
8241
- }
8281
+ const useReduxContext_useReduxContext = /*#__PURE__*/createReduxContextHook();
8242
8282
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/utils/useSyncExternalStore.js
8243
8283
  const useSyncExternalStore_notInitialized = () => {
8244
8284
  throw new Error('uSES not initialized!');
@@ -8263,16 +8303,37 @@ const refEquality = (a, b) => a === b;
8263
8303
 
8264
8304
 
8265
8305
  function createSelectorHook(context = Context_ReactReduxContext) {
8266
- const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
8267
- return function useSelector(selector, equalityFn = refEquality) {
8306
+ const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : createReduxContextHook(context);
8307
+ return function useSelector(selector, equalityFnOrOptions = {}) {
8308
+ const {
8309
+ equalityFn = refEquality,
8310
+ stabilityCheck = undefined,
8311
+ noopCheck = undefined
8312
+ } = typeof equalityFnOrOptions === 'function' ? {
8313
+ equalityFn: equalityFnOrOptions
8314
+ } : equalityFnOrOptions;
8315
+
8268
8316
  if (false) {}
8269
8317
 
8270
8318
  const {
8271
8319
  store,
8272
8320
  subscription,
8273
- getServerState
8321
+ getServerState,
8322
+ stabilityCheck: globalStabilityCheck,
8323
+ noopCheck: globalNoopCheck
8274
8324
  } = useReduxContext();
8275
- const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);
8325
+ const firstRun = (0,compat_module.useRef)(true);
8326
+ const wrappedSelector = (0,compat_module.useCallback)({
8327
+ [selector.name](state) {
8328
+ const selected = selector(state);
8329
+
8330
+ if (false) {}
8331
+
8332
+ return selected;
8333
+ }
8334
+
8335
+ }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
8336
+ const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
8276
8337
  (0,compat_module.useDebugValue)(selectedState);
8277
8338
  return selectedState;
8278
8339
  };
@@ -8859,16 +8920,20 @@ function Provider({
8859
8920
  store,
8860
8921
  context,
8861
8922
  children,
8862
- serverState
8923
+ serverState,
8924
+ stabilityCheck = 'once',
8925
+ noopCheck = 'once'
8863
8926
  }) {
8864
8927
  const contextValue = useMemo(() => {
8865
8928
  const subscription = createSubscription(store);
8866
8929
  return {
8867
8930
  store,
8868
8931
  subscription,
8869
- getServerState: serverState ? () => serverState : undefined
8932
+ getServerState: serverState ? () => serverState : undefined,
8933
+ stabilityCheck,
8934
+ noopCheck
8870
8935
  };
8871
- }, [store, serverState]);
8936
+ }, [store, serverState, stabilityCheck, noopCheck]);
8872
8937
  const previousState = useMemo(() => store.getState(), [store]);
8873
8938
  useIsomorphicLayoutEffect(() => {
8874
8939
  const {
@@ -8897,7 +8962,6 @@ function Provider({
8897
8962
  ;// CONCATENATED MODULE: ./node_modules/react-redux/es/hooks/useStore.js
8898
8963
 
8899
8964
 
8900
-
8901
8965
  /**
8902
8966
  * Hook factory, which creates a `useStore` hook bound to a given context.
8903
8967
  *
@@ -8907,7 +8971,8 @@ function Provider({
8907
8971
 
8908
8972
  function createStoreHook(context = Context_ReactReduxContext) {
8909
8973
  const useReduxContext = // @ts-ignore
8910
- context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,compat_module.useContext)(context);
8974
+ context === Context_ReactReduxContext ? useReduxContext_useReduxContext : // @ts-ignore
8975
+ createReduxContextHook(context);
8911
8976
  return function useStore() {
8912
8977
  const {
8913
8978
  store