@seamly/web-ui 19.0.0-beta.2 → 19.0.0-beta.3

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.
@@ -193,6 +193,13 @@ module.exports = __webpack_require__(8933);
193
193
 
194
194
  /***/ }),
195
195
 
196
+ /***/ 1864:
197
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
198
+
199
+ module.exports = __webpack_require__(3383);
200
+
201
+ /***/ }),
202
+
196
203
  /***/ 4943:
197
204
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
198
205
 
@@ -13361,6 +13368,16 @@ var parent = __webpack_require__(4426);
13361
13368
  module.exports = parent;
13362
13369
 
13363
13370
 
13371
+ /***/ }),
13372
+
13373
+ /***/ 3383:
13374
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
13375
+
13376
+ var parent = __webpack_require__(5999);
13377
+
13378
+ module.exports = parent;
13379
+
13380
+
13364
13381
  /***/ }),
13365
13382
 
13366
13383
  /***/ 4471:
@@ -20286,6 +20303,20 @@ const omit = (obj, keys) => {
20286
20303
  return accum;
20287
20304
  }, {});
20288
20305
  };
20306
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js
20307
+ var object_assign = __webpack_require__(1864);
20308
+ var assign_default = /*#__PURE__*/__webpack_require__.n(object_assign);
20309
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/date/now.js
20310
+ var now = __webpack_require__(1128);
20311
+ var now_default = /*#__PURE__*/__webpack_require__.n(now);
20312
+ ;// CONCATENATED MODULE: ./src/javascripts/lib/id.js
20313
+
20314
+
20315
+ function randomId() {
20316
+ var _context;
20317
+
20318
+ return '_' + (Number(slice_default()(_context = String(Math.random())).call(_context, 2)) + now_default()() + Math.round(performance.now())).toString(36);
20319
+ }
20289
20320
  ;// CONCATENATED MODULE: ./src/javascripts/lib/redux-helpers/index.js
20290
20321
 
20291
20322
 
@@ -20298,10 +20329,12 @@ const omit = (obj, keys) => {
20298
20329
 
20299
20330
 
20300
20331
 
20332
+
20301
20333
  function redux_helpers_ownKeys(object, enumerableOnly) { var keys = keys_default()(object); if ((get_own_property_symbols_default())) { var symbols = get_own_property_symbols_default()(object); if (enumerableOnly) { symbols = filter_default()(symbols).call(symbols, function (sym) { return get_own_property_descriptor_default()(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
20302
20334
 
20303
20335
  function redux_helpers_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; for_each_default()(_context2 = redux_helpers_ownKeys(Object(source), true)).call(_context2, function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if ((get_own_property_descriptors_default())) { define_properties_default()(target, get_own_property_descriptors_default()(source)); } else { var _context3; for_each_default()(_context3 = redux_helpers_ownKeys(Object(source))).call(_context3, function (key) { define_property_default()(target, key, get_own_property_descriptor_default()(source, key)); }); } } return target; }
20304
20336
 
20337
+
20305
20338
  const SLICE_DELIMITER = '/';
20306
20339
  const DOMAIN_DELIMITER = '//';
20307
20340
  function prefixType(prefix, fn, delimiter = '/') {
@@ -20314,7 +20347,9 @@ function createAction(type, identityReducer = payload => ({
20314
20347
  type
20315
20348
  }, identityReducer(...params));
20316
20349
 
20317
- action.toString = () => type.toString();
20350
+ action.toString = () => String(type);
20351
+
20352
+ action.match = obj => (obj === null || obj === void 0 ? void 0 : obj.type) === String(type);
20318
20353
 
20319
20354
  return action;
20320
20355
  }
@@ -20340,16 +20375,70 @@ function createActions(baseType, ...args) {
20340
20375
  const create = prefixType(baseType, createAction, SLICE_DELIMITER);
20341
20376
  return map_default()(handlers).call(handlers, handler => create(...handler));
20342
20377
  }
20343
- function createThunk(type, thunkCreator) {
20344
- const fn = (...args) => {
20345
- const thunk = thunkCreator(...args);
20346
- thunk.type = type;
20347
- return thunk;
20348
- };
20378
+ function createThunk(type, payloadCreator) {
20379
+ const [pending, fulfilled, rejected] = createActions(type, {
20380
+ pending: (arg, requestId) => ({
20381
+ meta: {
20382
+ arg,
20383
+ requestId,
20384
+ status: 'pending'
20385
+ }
20386
+ }),
20387
+ fulfilled: (arg, payload, requestId) => ({
20388
+ payload,
20389
+ meta: {
20390
+ arg,
20391
+ requestId,
20392
+ status: 'fulfilled'
20393
+ }
20394
+ }),
20395
+ rejected: (arg, error, requestId) => ({
20396
+ error,
20397
+ meta: {
20398
+ arg,
20399
+ requestId,
20400
+ status: 'rejected',
20401
+ error: String(error)
20402
+ }
20403
+ })
20404
+ });
20405
+
20406
+ const thunkCreator = arg => (dispatch, getState, extra) => {
20407
+ const requestId = randomId();
20408
+
20409
+ const promise = (async () => {
20410
+ let finalAction;
20349
20411
 
20350
- fn.toString = () => type;
20412
+ try {
20413
+ dispatch(pending(arg, requestId));
20414
+ const prms = payloadCreator(arg, {
20415
+ dispatch,
20416
+ getState,
20417
+ extra
20418
+ });
20419
+ const result = await prms;
20420
+ finalAction = fulfilled(arg, result, requestId);
20421
+ } catch (error) {
20422
+ finalAction = rejected(arg, error, requestId);
20423
+ }
20424
+
20425
+ dispatch(finalAction);
20426
+ return finalAction;
20427
+ })();
20428
+
20429
+ return assign_default()(promise, {
20430
+ type,
20431
+ arg,
20432
+ requestId
20433
+ });
20434
+ };
20351
20435
 
20352
- return fn;
20436
+ return assign_default()(thunkCreator, {
20437
+ type,
20438
+ pending,
20439
+ fulfilled,
20440
+ rejected
20441
+ });
20353
20442
  }
20354
20443
  function createReducer(domain, handlers = {}, defaultState) {
20355
20444
  const reducer = (state, action) => {
@@ -21641,7 +21730,6 @@ function createMutex() {
21641
21730
 
21642
21731
  const {
21643
21732
  createAction: i18n_utils_createAction,
21644
- createActions: utils_createActions,
21645
21733
  createThunk: i18n_utils_createThunk,
21646
21734
  createReducer: i18n_utils_createReducer,
21647
21735
  selectState: utils_selectState
@@ -21660,38 +21748,19 @@ const selectLocale = createSelector(utils_selectState, state => state.locale);
21660
21748
  const setInitialLocale = i18n_utils_createAction('setInitialLocale', locale => ({
21661
21749
  locale
21662
21750
  }));
21663
- const [setLocaleStart, setLocaleResolve, setLocaleReject] = utils_createActions('setLocale', {
21664
- start: locale => ({
21665
- locale
21666
- }),
21667
- resolve: (locale, translations) => ({
21668
- locale,
21669
- translations
21670
- }),
21671
- reject: (locale, error) => ({
21672
- locale,
21673
- error
21674
- })
21675
- });
21676
21751
  const mutex = createMutex();
21677
- const setLocale = i18n_utils_createThunk('setLocale', locale => async (dispatch, getState, {
21678
- api
21752
+ const setLocale = i18n_utils_createThunk('setLocale', async (locale, {
21753
+ getState,
21754
+ extra: {
21755
+ api
21756
+ }
21679
21757
  }) => {
21680
- await mutex.runExclusively(async () => {
21681
- const currentLocale = selectLocale(getState());
21682
-
21683
- if (currentLocale === locale) {
21684
- return;
21758
+ return mutex.runExclusively(() => {
21759
+ if (locale === selectLocale(getState())) {
21760
+ return undefined;
21685
21761
  }
21686
21762
 
21687
- dispatch(setLocaleStart(locale));
21688
-
21689
- try {
21690
- const translations = await api.getTranslations(locale);
21691
- dispatch(setLocaleResolve(locale, translations));
21692
- } catch (error) {
21693
- dispatch(setLocaleReject(locale, error));
21694
- }
21763
+ return api.getTranslations(locale);
21695
21764
  });
21696
21765
  });
21697
21766
  ;// CONCATENATED MODULE: ./node_modules/@ultraq/icu-message-formatter/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
@@ -22438,15 +22507,23 @@ const defaultState = {
22438
22507
  }) => i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22439
22508
  initialLocale: locale
22440
22509
  }),
22441
- [setLocaleStart]: state => i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22510
+ [setLocale.pending]: state => i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22442
22511
  isLoading: true
22443
22512
  }),
22444
- [setLocaleResolve]: (state, {
22445
- locale,
22446
- translations
22513
+ [setLocale.fulfilled]: (state, {
22514
+ payload: translations,
22515
+ meta: {
22516
+ arg: locale
22517
+ }
22447
22518
  }) => {
22448
22519
  var _context, _context2;
22449
22520
 
22521
+ if (!translations) {
22522
+ return i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22523
+ isLoading: false
22524
+ });
22525
+ }
22526
+
22450
22527
  return i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22451
22528
  isLoading: false,
22452
22529
  locale,
@@ -22455,7 +22532,7 @@ const defaultState = {
22455
22532
  }), {})
22456
22533
  });
22457
22534
  },
22458
- [setLocaleReject]: state => i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22535
+ [setLocale.rejected]: state => i18n_reducer_objectSpread(i18n_reducer_objectSpread({}, state), {}, {
22459
22536
  isLoading: false
22460
22537
  })
22461
22538
  }, defaultState));
@@ -22694,20 +22771,9 @@ const useFileUploads = () => {
22694
22771
  isComplete: every_default()(currentUploads).call(currentUploads, file => file.complete)
22695
22772
  };
22696
22773
  };
22697
- // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/date/now.js
22698
- var now = __webpack_require__(1128);
22699
- var now_default = /*#__PURE__*/__webpack_require__.n(now);
22700
22774
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
22701
22775
  var trim = __webpack_require__(5843);
22702
22776
  var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
22703
- ;// CONCATENATED MODULE: ./src/javascripts/lib/id.js
22704
-
22705
-
22706
- function randomId() {
22707
- var _context;
22708
-
22709
- return '_' + (Number(slice_default()(_context = String(Math.random())).call(_context, 2)) + now_default()() + Math.round(performance.now())).toString(36);
22710
- }
22711
22777
  ;// CONCATENATED MODULE: ./src/javascripts/ui/hooks/utility-hooks.js
22712
22778
 
22713
22779
 
@@ -22957,8 +23023,11 @@ const {
22957
23023
  const setHasResponded = app_utils_createAction('setHasResponded', hasResponded => ({
22958
23024
  hasResponded
22959
23025
  }));
22960
- const actions_initialize = app_utils_createThunk('initialize', config => async (dispatch, getState, {
22961
- api
23026
+ const actions_initialize = app_utils_createThunk('initialize', async (config, {
23027
+ dispatch,
23028
+ extra: {
23029
+ api
23030
+ }
22962
23031
  }) => {
22963
23032
  try {
22964
23033
  var _config$context;
@@ -24353,19 +24422,19 @@ const Icon = ({
24353
24422
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/utils.js
24354
24423
 
24355
24424
  const {
24356
- createActions: translations_utils_createActions,
24425
+ createActions: utils_createActions,
24357
24426
  createReducer: translations_utils_createReducer,
24358
24427
  selectState: translations_utils_selectState
24359
24428
  } = createDomain('translations');
24360
24429
  ;// CONCATENATED MODULE: ./src/javascripts/domains/translations/actions.js
24361
24430
 
24362
- const [enable, disable] = translations_utils_createActions('translate', {
24431
+ const [enable, disable] = utils_createActions('translate', {
24363
24432
  enable: locale => ({
24364
24433
  locale
24365
24434
  }),
24366
24435
  disable: () => ({})
24367
24436
  });
24368
- const [enableEvent, disableEvent] = translations_utils_createActions('event', {
24437
+ const [enableEvent, disableEvent] = utils_createActions('event', {
24369
24438
  enable: payloadId => ({
24370
24439
  payloadId
24371
24440
  }),
@@ -25121,11 +25190,11 @@ function updateFormControl(state, formId, name, controlState) {
25121
25190
 
25122
25191
 
25123
25192
  // EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js/object/assign.js
25124
- var object_assign = __webpack_require__(2088);
25193
+ var core_js_object_assign = __webpack_require__(2088);
25125
25194
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime-corejs3/helpers/esm/extends.js
25126
25195
 
25127
25196
  function _extends() {
25128
- _extends = object_assign || function (target) {
25197
+ _extends = core_js_object_assign || function (target) {
25129
25198
  for (var i = 1; i < arguments.length; i++) {
25130
25199
  var source = arguments[i];
25131
25200
 
@@ -33606,11 +33675,21 @@ class ConversationProducer {
33606
33675
  }
33607
33676
  ;// CONCATENATED MODULE: ./src/javascripts/lib/store/providers/session-storage.js
33608
33677
 
33678
+
33609
33679
  function store(key) {
33610
33680
  const KEY = 'cvco.' + key;
33611
33681
  return {
33612
33682
  get() {
33613
- return JSON.parse(sessionStorage.getItem(KEY));
33683
+ var _context;
33684
+
33685
+ const candidates = [KEY, slice_default()(_context = KEY.split('.')).call(_context, 0, -1).join('.')];
33686
+ let val;
33687
+
33688
+ do {
33689
+ val = sessionStorage.getItem(candidates[0]);
33690
+ } while (candidates.shift() && !val);
33691
+
33692
+ return JSON.parse(val);
33614
33693
  },
33615
33694
 
33616
33695
  set(value) {