@jsonui/react 0.3.0 → 0.4.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 (62) hide show
  1. package/dist/cjs/index.js +787 -1709
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/MessageReceiver.d.ts +2 -0
  4. package/dist/cjs/types/MessageReceiverContext.d.ts +8 -0
  5. package/dist/cjs/types/ReduxProviders.d.ts +1 -9
  6. package/dist/cjs/types/ViewerWeb.d.ts +2 -10
  7. package/dist/cjs/types/Wrapper.d.ts +5 -3
  8. package/dist/cjs/types/index.d.ts +4 -3
  9. package/dist/cjs/types/stock/components/Fragment.d.ts +5 -3
  10. package/dist/cjs/types/stock/components/PrimitiveProp.d.ts +3 -2
  11. package/dist/cjs/types/stock/components/Text.d.ts +1 -1
  12. package/dist/cjs/types/stock/components/View.d.ts +1 -1
  13. package/dist/cjs/types/stories/JsonUI.stories.d.ts +3 -3
  14. package/dist/cjs/types/stories/MultiChild.stories.d.ts +5 -0
  15. package/dist/cjs/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
  16. package/dist/cjs/types/stories/ReduxTest.stories.d.ts +6 -0
  17. package/dist/cjs/types/stories/Simple.stories.d.ts +5 -0
  18. package/dist/cjs/types/stories/Table.stories.d.ts +5 -0
  19. package/dist/cjs/types/types.d.ts +23 -0
  20. package/dist/esm/index.js +787 -1711
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/types/MessageReceiver.d.ts +2 -0
  23. package/dist/esm/types/MessageReceiverContext.d.ts +8 -0
  24. package/dist/esm/types/ReduxProviders.d.ts +1 -9
  25. package/dist/esm/types/ViewerWeb.d.ts +2 -10
  26. package/dist/esm/types/Wrapper.d.ts +5 -3
  27. package/dist/esm/types/index.d.ts +4 -3
  28. package/dist/esm/types/stock/components/Fragment.d.ts +5 -3
  29. package/dist/esm/types/stock/components/PrimitiveProp.d.ts +3 -2
  30. package/dist/esm/types/stock/components/Text.d.ts +1 -1
  31. package/dist/esm/types/stock/components/View.d.ts +1 -1
  32. package/dist/esm/types/stories/JsonUI.stories.d.ts +3 -3
  33. package/dist/esm/types/stories/MultiChild.stories.d.ts +5 -0
  34. package/dist/esm/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
  35. package/dist/esm/types/stories/ReduxTest.stories.d.ts +6 -0
  36. package/dist/esm/types/stories/Simple.stories.d.ts +5 -0
  37. package/dist/esm/types/stories/Table.stories.d.ts +5 -0
  38. package/dist/esm/types/types.d.ts +23 -0
  39. package/dist/index.d.ts +9 -18
  40. package/package.json +4 -4
  41. package/dist/cjs/types/indexModule.d.ts +0 -6
  42. package/dist/cjs/types/stock/components/FieldEdit.d.ts +0 -3
  43. package/dist/cjs/types/stock/components.d.ts +0 -20
  44. package/dist/cjs/types/stock/stockToRenderer.d.ts +0 -22
  45. package/dist/cjs/types/store/store.d.ts +0 -7
  46. package/dist/cjs/types/stories/Button.d.ts +0 -28
  47. package/dist/cjs/types/stories/Button.stories.d.ts +0 -8
  48. package/dist/cjs/types/stories/Header.d.ts +0 -12
  49. package/dist/cjs/types/stories/Header.stories.d.ts +0 -6
  50. package/dist/cjs/types/stories/Page.d.ts +0 -3
  51. package/dist/cjs/types/stories/Page.stories.d.ts +0 -6
  52. package/dist/esm/types/indexModule.d.ts +0 -6
  53. package/dist/esm/types/stock/components/FieldEdit.d.ts +0 -3
  54. package/dist/esm/types/stock/components.d.ts +0 -20
  55. package/dist/esm/types/stock/stockToRenderer.d.ts +0 -22
  56. package/dist/esm/types/store/store.d.ts +0 -7
  57. package/dist/esm/types/stories/Button.d.ts +0 -28
  58. package/dist/esm/types/stories/Button.stories.d.ts +0 -8
  59. package/dist/esm/types/stories/Header.d.ts +0 -12
  60. package/dist/esm/types/stories/Header.stories.d.ts +0 -6
  61. package/dist/esm/types/stories/Page.d.ts +0 -3
  62. package/dist/esm/types/stories/Page.stories.d.ts +0 -6
package/dist/cjs/index.js CHANGED
@@ -9,60 +9,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
- /*! *****************************************************************************
13
- Copyright (c) Microsoft Corporation.
14
-
15
- Permission to use, copy, modify, and/or distribute this software for any
16
- purpose with or without fee is hereby granted.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
19
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
21
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
- PERFORMANCE OF THIS SOFTWARE.
25
- ***************************************************************************** */
26
- /* global Reflect, Promise */
27
-
28
- var extendStatics = function(d, b) {
29
- extendStatics = Object.setPrototypeOf ||
30
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
32
- return extendStatics(d, b);
33
- };
34
-
35
- function __extends(d, b) {
36
- if (typeof b !== "function" && b !== null)
37
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
38
- extendStatics(d, b);
39
- function __() { this.constructor = d; }
40
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
41
- }
42
-
43
- var __assign$1 = function() {
44
- __assign$1 = Object.assign || function __assign(t) {
45
- for (var s, i = 1, n = arguments.length; i < n; i++) {
46
- s = arguments[i];
47
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48
- }
49
- return t;
50
- };
51
- return __assign$1.apply(this, arguments);
52
- };
53
-
54
- function __rest$1(s, e) {
55
- var t = {};
56
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
57
- t[p] = s[p];
58
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
59
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
60
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
61
- t[p[i]] = s[p[i]];
62
- }
63
- return t;
64
- }
65
-
66
12
  var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
67
13
 
68
14
  var jsxRuntime$1 = {exports: {}};
@@ -75,7 +21,7 @@ object-assign
75
21
  @license MIT
76
22
  */
77
23
  /* eslint-disable no-unused-vars */
78
- var getOwnPropertySymbols$2 = Object.getOwnPropertySymbols;
24
+ var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
79
25
  var hasOwnProperty$f = Object.prototype.hasOwnProperty;
80
26
  var propIsEnumerable$1 = Object.prototype.propertyIsEnumerable;
81
27
 
@@ -145,8 +91,8 @@ var objectAssign$1 = shouldUseNative$1() ? Object.assign : function (target, sou
145
91
  }
146
92
  }
147
93
 
148
- if (getOwnPropertySymbols$2) {
149
- symbols = getOwnPropertySymbols$2(from);
94
+ if (getOwnPropertySymbols$1) {
95
+ symbols = getOwnPropertySymbols$1(from);
150
96
  for (var i = 0; i < symbols.length; i++) {
151
97
  if (propIsEnumerable$1.call(from, symbols[i])) {
152
98
  to[symbols[i]] = from[symbols[i]];
@@ -1396,18 +1342,22 @@ if (process.env.NODE_ENV === 'production') {
1396
1342
  jsxRuntime$1.exports = reactJsxRuntime_development$1;
1397
1343
  }
1398
1344
 
1399
- var __assign = function() {
1400
- __assign = Object.assign || function __assign(t) {
1401
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1402
- s = arguments[i];
1403
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
1404
- }
1405
- return t;
1406
- };
1407
- return __assign.apply(this, arguments);
1408
- };
1345
+ /*! *****************************************************************************
1346
+ Copyright (c) Microsoft Corporation.
1409
1347
 
1410
- function __rest(s, e) {
1348
+ Permission to use, copy, modify, and/or distribute this software for any
1349
+ purpose with or without fee is hereby granted.
1350
+
1351
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1352
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1353
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1354
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1355
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1356
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1357
+ PERFORMANCE OF THIS SOFTWARE.
1358
+ ***************************************************************************** */
1359
+
1360
+ function __rest$1(s, e) {
1411
1361
  var t = {};
1412
1362
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1413
1363
  t[p] = s[p];
@@ -1417,85 +1367,35 @@ function __rest(s, e) {
1417
1367
  t[p[i]] = s[p[i]];
1418
1368
  }
1419
1369
  return t;
1420
- }
1421
-
1422
- function __awaiter(thisArg, _arguments, P, generator) {
1423
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1424
- return new (P || (P = Promise))(function (resolve, reject) {
1425
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1426
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1427
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1428
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1429
- });
1430
- }
1431
-
1432
- function __generator(thisArg, body) {
1433
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1434
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
1435
- function verb(n) { return function (v) { return step([n, v]); }; }
1436
- function step(op) {
1437
- if (f) throw new TypeError("Generator is already executing.");
1438
- while (_) try {
1439
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1440
- if (y = 0, t) op = [op[0] & 2, t.value];
1441
- switch (op[0]) {
1442
- case 0: case 1: t = op; break;
1443
- case 4: _.label++; return { value: op[1], done: false };
1444
- case 5: _.label++; y = op[1]; op = [0]; continue;
1445
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
1446
- default:
1447
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
1448
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
1449
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
1450
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
1451
- if (t[2]) _.ops.pop();
1452
- _.trys.pop(); continue;
1453
- }
1454
- op = body.call(thisArg, _);
1455
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
1456
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1457
- }
1458
- }
1459
-
1460
- function __spreadArray(to, from, pack) {
1461
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1462
- if (ar || !(i in from)) {
1463
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1464
- ar[i] = from[i];
1465
- }
1466
- }
1467
- return to.concat(ar || Array.prototype.slice.call(from));
1468
- }var Stock = /** @class */ (function () {
1469
- function Stock(newStock, Wrapper, reduxStore) {
1470
- var _this = this;
1471
- this.init = function (_a) {
1472
- var components = _a.components, functions = _a.functions;
1473
- _this.stock.components = __assign(__assign({}, _this.stock.components), components);
1474
- _this.stock.functions = __assign(__assign({}, _this.stock.functions), functions);
1370
+ }
1371
+
1372
+ class Stock {
1373
+ constructor(newStock, Wrapper, reduxStore) {
1374
+ this.init = ({ components, functions }) => {
1375
+ this.stock.components = Object.assign(Object.assign({}, this.stock.components), components);
1376
+ this.stock.functions = Object.assign(Object.assign({}, this.stock.functions), functions);
1475
1377
  };
1476
- this.registerComponent = function (key, value) {
1477
- if (!!key && typeof key === 'string' && key.length > 0 && !(key in _this.stock.components)) {
1478
- _this.stock.components[key] = value;
1378
+ this.registerComponent = (key, value) => {
1379
+ if (!!key && typeof key === 'string' && key.length > 0 && !(key in this.stock.components)) {
1380
+ this.stock.components[key] = value;
1479
1381
  }
1480
1382
  };
1481
- this.registerFunction = function (key, value) {
1482
- if (!!key && typeof key === 'string' && key.length > 0 && !(key in _this.stock.functions)) {
1483
- _this.stock.functions[key] = value;
1383
+ this.registerFunction = (key, value) => {
1384
+ if (!!key && typeof key === 'string' && key.length > 0 && !(key in this.stock.functions)) {
1385
+ this.stock.functions[key] = value;
1484
1386
  }
1485
1387
  };
1486
- this.callFunction = function (name, attr, props, callerArgs) {
1487
- if (!!attr && !!name && name in _this.stock.functions) {
1488
- var result = _this.stock.functions[name](attr, props, callerArgs, _this);
1388
+ this.callFunction = (name, attr, props, callerArgs) => {
1389
+ if (!!attr && !!name && name in this.stock.functions) {
1390
+ const result = this.stock.functions[name](attr, props, callerArgs, this);
1489
1391
  return result;
1490
1392
  }
1491
1393
  return null;
1492
1394
  };
1493
- this.getComponent = function (componentName) {
1494
- return !!componentName && componentName in _this.stock.components
1495
- ? _this.stock.components[componentName]
1496
- : // eslint-disable-next-line no-underscore-dangle
1497
- _this.stock.components._Undefined;
1498
- };
1395
+ this.getComponent = (componentName) => !!componentName && componentName in this.stock.components
1396
+ ? this.stock.components[componentName]
1397
+ : // eslint-disable-next-line no-underscore-dangle
1398
+ this.stock.components._Undefined;
1499
1399
  this.stock = {
1500
1400
  components: {},
1501
1401
  functions: {},
@@ -1505,8 +1405,42 @@ function __spreadArray(to, from, pack) {
1505
1405
  this.reduxStore = reduxStore;
1506
1406
  this.init(newStock);
1507
1407
  }
1508
- return Stock;
1509
- }());var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1408
+ }/*! *****************************************************************************
1409
+ Copyright (c) Microsoft Corporation.
1410
+
1411
+ Permission to use, copy, modify, and/or distribute this software for any
1412
+ purpose with or without fee is hereby granted.
1413
+
1414
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1415
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1416
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1417
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1418
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1419
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1420
+ PERFORMANCE OF THIS SOFTWARE.
1421
+ ***************************************************************************** */
1422
+
1423
+ function __rest(s, e) {
1424
+ var t = {};
1425
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1426
+ t[p] = s[p];
1427
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1428
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1429
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1430
+ t[p[i]] = s[p[i]];
1431
+ }
1432
+ return t;
1433
+ }
1434
+
1435
+ function __awaiter(thisArg, _arguments, P, generator) {
1436
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1437
+ return new (P || (P = Promise))(function (resolve, reject) {
1438
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1439
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1440
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1441
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1442
+ });
1443
+ }var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1510
1444
 
1511
1445
  function getDefaultExportFromCjs (x) {
1512
1446
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -1516,7 +1450,7 @@ object-assign
1516
1450
  @license MIT
1517
1451
  */
1518
1452
  /* eslint-disable no-unused-vars */
1519
- var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
1453
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1520
1454
  var hasOwnProperty$d = Object.prototype.hasOwnProperty;
1521
1455
  var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1522
1456
 
@@ -1586,8 +1520,8 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
1586
1520
  }
1587
1521
  }
1588
1522
 
1589
- if (getOwnPropertySymbols$1) {
1590
- symbols = getOwnPropertySymbols$1(from);
1523
+ if (getOwnPropertySymbols) {
1524
+ symbols = getOwnPropertySymbols(from);
1591
1525
  for (var i = 0; i < symbols.length; i++) {
1592
1526
  if (propIsEnumerable.call(from, symbols[i])) {
1593
1527
  to[symbols[i]] = from[symbols[i]];
@@ -3801,7 +3735,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
3801
3735
  * // Replace `_.memoize.Cache`.
3802
3736
  * _.memoize.Cache = WeakMap;
3803
3737
  */
3804
- function memoize$1$1(func, resolver) {
3738
+ function memoize$1(func, resolver) {
3805
3739
  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
3806
3740
  throw new TypeError(FUNC_ERROR_TEXT);
3807
3741
  }
@@ -3817,14 +3751,14 @@ function memoize$1$1(func, resolver) {
3817
3751
  memoized.cache = cache.set(key, result) || cache;
3818
3752
  return result;
3819
3753
  };
3820
- memoized.cache = new (memoize$1$1.Cache || MapCache$2);
3754
+ memoized.cache = new (memoize$1.Cache || MapCache$2);
3821
3755
  return memoized;
3822
3756
  }
3823
3757
 
3824
3758
  // Expose `MapCache`.
3825
- memoize$1$1.Cache = MapCache$2;
3759
+ memoize$1.Cache = MapCache$2;
3826
3760
 
3827
- var memoize_1 = memoize$1$1;var memoize$2 = memoize_1;
3761
+ var memoize_1 = memoize$1;var memoize$2 = memoize_1;
3828
3762
 
3829
3763
  /** Used as the maximum memoize cache size. */
3830
3764
  var MAX_MEMOIZE_SIZE = 500;
@@ -6393,31 +6327,38 @@ var hasOwnProperty$3$1 = Object.hasOwnProperty || function (obj, key) {
6393
6327
  return key in obj;
6394
6328
  };
6395
6329
 
6396
- var traverse$3 = traverse$4.exports;var SEPARATOR = '/';
6397
- var STORE_ERROR_POSTFIX = '.error';
6398
- var PATH_MODIFIERS_KEY = '$pathModifiers';
6399
- var MODIFIER_KEY = '$modifier';
6400
- var ACTION_KEY = '$action';
6401
- var PERSIST_STORAGE_KEY = '$persistStores';
6402
- var PERSIST_STORAGE_NAMES = ['data'];
6403
- var REF_ASSETS = '$assetsRef';
6404
- var REF_LOCALES = '$locales';
6405
- var REF_VALIDATES = '$validations';
6406
- var STYLE_WEB_NAME = 'styleWeb';
6407
- var STYLE_RN_NAME = 'styleRN';
6408
- var REDUX_FUNCTIONS = ['set', 'get'];
6409
- var PATHNAME = 'path';
6410
- var SIMPLE_DATA_TYPES = ['string', 'number', 'boolean', 'null'];
6411
- var V_CHILDREN_NAME = '$children';
6412
- var V_COMP_NAME = '$comp';
6413
- var LIST_SEMAPHORE = '$isList';
6414
- var LIST_ITEM = '$listItem';
6415
- var LIST_PAGE = '$page';
6416
- var LIST_ITEM_PER_PAGE = '$itemPerPage';
6417
- var LIST_LENGTH = '$listLength';
6418
- var LIST_ITEM_PER_PAGE_DEFAULT = 10;
6419
- // TODO currentPaths maybe need to modify to ___currentPaths
6420
- var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,PERSIST_STORAGE_KEY:PERSIST_STORAGE_KEY,PERSIST_STORAGE_NAMES:PERSIST_STORAGE_NAMES,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT});var jsonpointer = {};var hasExcape = /~/;
6330
+ var traverse$3 = traverse$4.exports;const SEPARATOR = '/';
6331
+ const STORE_ERROR_POSTFIX = '.error';
6332
+ const PATH_MODIFIERS_KEY = '$pathModifiers';
6333
+ const MODIFIER_KEY = '$modifier';
6334
+ const ACTION_KEY = '$action';
6335
+ const PERSIST_STORAGE_KEY = '$persistStores';
6336
+ const PERSIST_STORAGE_NAMES = ['data'];
6337
+ const REF_ASSETS = '$assetsRef';
6338
+ const REF_LOCALES = '$locales';
6339
+ const REF_VALIDATES = '$validations';
6340
+ const STYLE_WEB_NAME = 'styleWeb';
6341
+ const STYLE_RN_NAME = 'styleRN';
6342
+ const REDUX_GET_FUNCTION = 'get';
6343
+ const REDUX_SET_FUNCTION = 'set';
6344
+ const REDUX_FUNCTIONS = [REDUX_GET_FUNCTION, REDUX_SET_FUNCTION];
6345
+ const PATHNAME = 'path';
6346
+ const SIMPLE_DATA_TYPES = ['string', 'number', 'boolean', 'null'];
6347
+ const V_CHILDREN_NAME = '$children';
6348
+ const V_COMP_NAME = '$comp';
6349
+ const LIST_SEMAPHORE = '$isList';
6350
+ const LIST_ITEM = '$listItem';
6351
+ const LIST_PAGE = '$page';
6352
+ const LIST_ITEM_PER_PAGE = '$itemPerPage';
6353
+ const LIST_LENGTH = '$listLength';
6354
+ const LIST_ITEM_PER_PAGE_DEFAULT = 10;
6355
+ const REDUX_PATHS = '$$reduxPaths';
6356
+ const V_CHILDREN_PREFIX = '$child';
6357
+ const PARENT_PROP_NAME = '__parentprop';
6358
+ const CURRENT_PATH_NAME = '__currentPaths';
6359
+ const PRIMITIVE_COMP_NAME = '_PrimitiveProp'; // TODO check all literal and replace with this constant
6360
+ const FRAGMENT_COMP_NAME = 'Fragment'; // TODO check all literal and replace with this constant
6361
+ var constants=/*#__PURE__*/Object.freeze({__proto__:null,SEPARATOR:SEPARATOR,STORE_ERROR_POSTFIX:STORE_ERROR_POSTFIX,PATH_MODIFIERS_KEY:PATH_MODIFIERS_KEY,MODIFIER_KEY:MODIFIER_KEY,ACTION_KEY:ACTION_KEY,PERSIST_STORAGE_KEY:PERSIST_STORAGE_KEY,PERSIST_STORAGE_NAMES:PERSIST_STORAGE_NAMES,REF_ASSETS:REF_ASSETS,REF_LOCALES:REF_LOCALES,REF_VALIDATES:REF_VALIDATES,STYLE_WEB_NAME:STYLE_WEB_NAME,STYLE_RN_NAME:STYLE_RN_NAME,REDUX_GET_FUNCTION:REDUX_GET_FUNCTION,REDUX_SET_FUNCTION:REDUX_SET_FUNCTION,REDUX_FUNCTIONS:REDUX_FUNCTIONS,PATHNAME:PATHNAME,SIMPLE_DATA_TYPES:SIMPLE_DATA_TYPES,V_CHILDREN_NAME:V_CHILDREN_NAME,V_COMP_NAME:V_COMP_NAME,LIST_SEMAPHORE:LIST_SEMAPHORE,LIST_ITEM:LIST_ITEM,LIST_PAGE:LIST_PAGE,LIST_ITEM_PER_PAGE:LIST_ITEM_PER_PAGE,LIST_LENGTH:LIST_LENGTH,LIST_ITEM_PER_PAGE_DEFAULT:LIST_ITEM_PER_PAGE_DEFAULT,REDUX_PATHS:REDUX_PATHS,V_CHILDREN_PREFIX:V_CHILDREN_PREFIX,PARENT_PROP_NAME:PARENT_PROP_NAME,CURRENT_PATH_NAME:CURRENT_PATH_NAME,PRIMITIVE_COMP_NAME:PRIMITIVE_COMP_NAME,FRAGMENT_COMP_NAME:FRAGMENT_COMP_NAME});var jsonpointer = {};var hasExcape = /~/;
6421
6362
  var escapeMatcher = /~[01]/g;
6422
6363
  function escapeReplacer (m) {
6423
6364
  switch (m) {
@@ -7727,7 +7668,7 @@ function constant$1$1(value) {
7727
7668
  }
7728
7669
 
7729
7670
  var constant_1$1 = constant$1$1;var constant$2 = constant_1$1,
7730
- defineProperty$4 = _defineProperty$5,
7671
+ defineProperty$3 = _defineProperty$5,
7731
7672
  identity$1$1 = identity_1$1;
7732
7673
 
7733
7674
  /**
@@ -7738,8 +7679,8 @@ var constant_1$1 = constant$1$1;var constant$2 = constant_1$1,
7738
7679
  * @param {Function} string The `toString` result.
7739
7680
  * @returns {Function} Returns `func`.
7740
7681
  */
7741
- var baseSetToString$1$1 = !defineProperty$4 ? identity$1$1 : function(func, string) {
7742
- return defineProperty$4(func, 'toString', {
7682
+ var baseSetToString$1$1 = !defineProperty$3 ? identity$1$1 : function(func, string) {
7683
+ return defineProperty$3(func, 'toString', {
7743
7684
  'configurable': true,
7744
7685
  'enumerable': false,
7745
7686
  'value': constant$2(string),
@@ -7996,35 +7937,32 @@ var pullAll_1 = pullAll$1;var baseRest$3 = _baseRest$1,
7996
7937
  */
7997
7938
  var pull = baseRest$3(pullAll);
7998
7939
 
7999
- var pull_1 = pull;var findLastIndex = function (arr, func) {
8000
- var reverseIdx = __spreadArray([], arr, true).reverse().findIndex(func);
7940
+ var pull_1 = pull;const findLastIndex = (arr, func) => {
7941
+ const reverseIdx = [...arr].reverse().findIndex(func);
8001
7942
  return reverseIdx === -1 ? reverseIdx : arr.length - (reverseIdx + 1);
8002
7943
  };
8003
- var drop = function (arr, n) {
8004
- if (n === void 0) { n = 1; }
8005
- return arr.slice(n);
8006
- };
8007
- var isNumber = function (a) { return typeof a === 'number'; };
8008
- var jsonPointerGet = function (json, path) {
7944
+ const drop = (arr, n = 1) => arr.slice(n);
7945
+ const isNumber = (a) => typeof a === 'number';
7946
+ const jsonPointerGet = (json, path) => {
8009
7947
  if (json === undefined || path === null || path === undefined || typeof path !== 'string')
8010
7948
  return undefined;
8011
7949
  if (path === SEPARATOR /* || path === '' same effect */)
8012
7950
  return json;
8013
7951
  try {
8014
- return jsonpointer.get(json, path.startsWith(SEPARATOR) ? path : "".concat(SEPARATOR).concat(path));
7952
+ return jsonpointer.get(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`);
8015
7953
  }
8016
7954
  catch (e) {
8017
7955
  return undefined;
8018
7956
  }
8019
7957
  };
8020
- var jsonPointerSet = function (json, path, value) {
7958
+ const jsonPointerSet = (json, path, value) => {
8021
7959
  if (json === undefined || path === null || path === undefined || typeof path !== 'string')
8022
7960
  return json;
8023
7961
  if (path === SEPARATOR || path === '') {
8024
7962
  return value;
8025
7963
  }
8026
7964
  try {
8027
- jsonpointer.set(json, path.startsWith(SEPARATOR) ? path : "".concat(SEPARATOR).concat(path), value);
7965
+ jsonpointer.set(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`, value);
8028
7966
  return json;
8029
7967
  // eslint-disable-next-line no-empty
8030
7968
  }
@@ -8032,47 +7970,48 @@ var jsonPointerSet = function (json, path, value) {
8032
7970
  return json;
8033
7971
  }
8034
7972
  };
8035
- var pathArrayToPathString = function (array) {
8036
- return array.map(function (i, index) { return (Number.isInteger(i) ? "[".concat(i, "]") : "".concat(index > 0 ? '.' : '').concat(i)); }).join('');
8037
- };
8038
- var pathArrayToJsonPointer = function (array) { return "/".concat(array.join('/')); };
7973
+ const pathArrayToPathString = (array) => array.map((i, index) => (Number.isInteger(i) ? `[${i}]` : `${index > 0 ? '.' : ''}${i}`)).join('');
7974
+ const pathArrayToJsonPointer = (array) => `/${array.join('/')}`;
8039
7975
  function isOnlyObject(item) {
8040
7976
  return !!item && typeof item === 'object' && !Array.isArray(item);
8041
7977
  }
8042
- var mergePath = function (target, newState) {
7978
+ const mergePath = (target, newState) => {
8043
7979
  if (!newState || typeof newState !== 'object')
8044
7980
  return target;
8045
- var newTarget = cloneDeep_1(target);
8046
- Object.entries(newState).forEach(function (_a) {
8047
- var key = _a[0], value = _a[1];
7981
+ let newTarget = cloneDeep_1(target);
7982
+ Object.entries(newState).forEach(([key, value]) => {
8048
7983
  newTarget = jsonPointerSet(newTarget, key, value);
8049
7984
  });
8050
7985
  return newTarget;
8051
7986
  };
8052
7987
  // eslint-disable-next-line import/prefer-default-export
8053
- var changeRelativePath = function (path) {
8054
- var pathArray = path.split(SEPARATOR);
7988
+ const changeRelativePath = (path) => {
7989
+ let pathArray = path.split(SEPARATOR);
8055
7990
  // remove last /
8056
7991
  if (pathArray && pathArray.length > 1 && pathArray[pathArray.length - 1] === '' && !(pathArray.length === 2 && pathArray[0] === '')) {
8057
7992
  pathArray.pop();
8058
7993
  }
8059
7994
  // the last / is meaningful
8060
- var absolutepathIndex = findLastIndex(pathArray, function (i) { return i === ''; });
7995
+ const absolutepathIndex = findLastIndex(pathArray, (i) => i === '');
8061
7996
  if (absolutepathIndex > 0) {
8062
7997
  pathArray = drop(pathArray, absolutepathIndex);
8063
7998
  }
8064
7999
  // all . need to remove because is just pointing the prev level
8065
8000
  pathArray = pull_1(pathArray, '.');
8066
- var count = 0;
8067
- var relativepathIndex = -1;
8001
+ let count = 0;
8002
+ let relativepathIndex = -1;
8068
8003
  do {
8069
8004
  count += 1;
8070
- relativepathIndex = findIndex_1(pathArray, function (i) { return i === '..'; });
8005
+ relativepathIndex = findIndex_1(pathArray, (i) => i === '..');
8071
8006
  if (relativepathIndex !== -1) {
8072
8007
  pathArray.splice(relativepathIndex, 1);
8073
8008
  pathArray.splice(relativepathIndex - 1, 1);
8074
8009
  }
8075
8010
  } while (relativepathIndex !== -1 && count < 100);
8011
+ pathArray = pull_1(pathArray, '..');
8012
+ if (pathArray.length === 1 && pathArray[0] !== '') {
8013
+ pathArray = ['', ...pathArray];
8014
+ }
8076
8015
  return pathArray.join(SEPARATOR);
8077
8016
  };
8078
8017
  /**
@@ -8080,58 +8019,53 @@ var changeRelativePath = function (path) {
8080
8019
  * @param target
8081
8020
  * @param ...sources
8082
8021
  */
8083
- function mergeDeep(target) {
8084
- var _a, _b;
8085
- var sources = [];
8086
- for (var _i = 1; _i < arguments.length; _i++) {
8087
- sources[_i - 1] = arguments[_i];
8088
- }
8022
+ function mergeDeep(target, ...sources) {
8089
8023
  if (!sources.length)
8090
8024
  return target;
8091
- var source = sources.shift();
8025
+ const source = sources.shift();
8092
8026
  if (isOnlyObject(target) && isOnlyObject(source)) {
8093
8027
  // eslint-disable-next-line no-restricted-syntax
8094
- for (var key in source) {
8028
+ for (const key in source) {
8095
8029
  if (isOnlyObject(source[key])) {
8096
8030
  if (!target[key])
8097
- Object.assign(target, (_a = {}, _a[key] = {}, _a));
8031
+ Object.assign(target, { [key]: {} });
8098
8032
  mergeDeep(target[key], source[key]);
8099
8033
  }
8100
8034
  else {
8101
- Object.assign(target, (_b = {}, _b[key] = source[key], _b));
8035
+ Object.assign(target, { [key]: source[key] });
8102
8036
  }
8103
8037
  }
8104
8038
  }
8105
- return mergeDeep.apply(void 0, __spreadArray([target], sources, false));
8039
+ return mergeDeep(target, ...sources);
8106
8040
  }
8107
- var collectObjMerge = function (refConst, json) {
8108
- var res = {};
8041
+ const collectObjMerge = (refConst, json) => {
8042
+ const res = {};
8109
8043
  if (refConst && json && typeof json === 'object') {
8110
- var refs_1 = [];
8044
+ const refs = [];
8111
8045
  // eslint-disable-next-line func-names
8112
8046
  traverse$3(json).forEach(function (x) {
8113
8047
  if (x && !!x[refConst] && !!this && !this.circular) {
8114
- refs_1.push(x[refConst]);
8048
+ refs.push(x[refConst]);
8115
8049
  }
8116
8050
  });
8117
- refs_1.filter(function (i) { return !!i; }).forEach(function (i) { return mergeDeep(res, i); });
8051
+ refs.filter((i) => !!i).forEach((i) => mergeDeep(res, i));
8118
8052
  }
8119
8053
  return res;
8120
8054
  };
8121
- var collectObjToArray = function (refConst, json) {
8055
+ const collectObjToArray = (refConst, json) => {
8122
8056
  if (refConst && json && typeof json === 'object') {
8123
- var refs_2 = [];
8057
+ const refs = [];
8124
8058
  // eslint-disable-next-line func-names
8125
8059
  traverse$3(json).forEach(function (x) {
8126
8060
  if (x && !!x[refConst] && !!this && !this.circular) {
8127
- refs_2.push(x[refConst]);
8061
+ refs.push(x[refConst]);
8128
8062
  }
8129
8063
  });
8130
- return refs_2;
8064
+ return refs;
8131
8065
  }
8132
8066
  return [];
8133
8067
  };
8134
- var isCircular = function (d) {
8068
+ const isCircular = (d) => {
8135
8069
  try {
8136
8070
  JSON.stringify(d);
8137
8071
  }
@@ -8139,121 +8073,116 @@ var isCircular = function (d) {
8139
8073
  return true;
8140
8074
  }
8141
8075
  return false;
8142
- };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isCircular:isCircular});var actionBuilder = function (props, stock) {
8143
- var paths = [];
8144
- props.parentComp; var propsNew = __rest(props
8145
- // eslint-disable-next-line func-names
8146
- , ["parentComp"]);
8147
- // eslint-disable-next-line func-names
8148
- traverse$3(propsNew).forEach(function (x) {
8149
- if (!!x &&
8150
- !!x[ACTION_KEY] &&
8151
- // && !c.REDUX_FUNCTIONS.includes(x[c.ACTION_KEY])
8152
- !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
8153
- paths.push({ path: this.path, level: this.level });
8154
- }
8155
- });
8156
- orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
8157
- var _a, _b, functionName, functionParams;
8158
- return __generator(this, function (_c) {
8159
- _a = traverse$3(props).get(i.path), _b = ACTION_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
8160
- traverse$3(props).set(i.path, function () {
8161
- var callerArgs = [];
8162
- for (var _i = 0; _i < arguments.length; _i++) {
8163
- callerArgs[_i] = arguments[_i];
8076
+ };var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isCircular:isCircular});const getFilteredPath = (_a, func) => {
8077
+ var _b = PARENT_PROP_NAME; _a[_b]; var propsNew = __rest(_a, [_b + ""]);
8078
+ const paths = [];
8079
+ function* jsonTraverse(o) {
8080
+ const memory = new Set();
8081
+ function* innerTraversal(oo, path = []) {
8082
+ var _a;
8083
+ if (memory.has(oo)) {
8084
+ return; // circular
8085
+ }
8086
+ memory.add(oo);
8087
+ // eslint-disable-next-line no-restricted-syntax
8088
+ for (const i of Object.keys(oo)) {
8089
+ const itemPath = path.concat(i);
8090
+ if (itemPath && itemPath.length > 1 && typeof oo[i] === 'object' && ((_a = oo[i]) === null || _a === void 0 ? void 0 : _a[V_COMP_NAME])) {
8091
+ // eslint-disable-next-line no-continue
8092
+ continue;
8164
8093
  }
8165
- return __awaiter(void 0, void 0, void 0, function () {
8166
- return __generator(this, function (_a) {
8167
- switch (_a.label) {
8168
- case 0: return [4 /*yield*/, stock.callFunction(functionName, functionParams, props, callerArgs)];
8169
- case 1:
8170
- _a.sent();
8171
- return [2 /*return*/];
8172
- }
8173
- });
8174
- });
8175
- });
8176
- return [2 /*return*/];
8177
- });
8178
- }); });
8179
- };
8180
- var modifierBuilder = function (props, stock) {
8181
- var paths = [];
8182
- props.parentComp; var propsNew = __rest(props
8183
- // eslint-disable-next-line func-names
8184
- , ["parentComp"]);
8185
- // eslint-disable-next-line func-names
8186
- traverse$3(propsNew).forEach(function (x) {
8187
- if (!!x && !!x[MODIFIER_KEY] && !REDUX_FUNCTIONS.includes(x[MODIFIER_KEY]) && !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
8188
- paths.push({ path: this.path, level: this.level });
8094
+ if (i === PARENT_PROP_NAME || i === CURRENT_PATH_NAME || i === LIST_ITEM) {
8095
+ // eslint-disable-next-line no-continue
8096
+ continue;
8097
+ }
8098
+ if (func({ key: i, value: oo[i], path, parent: oo, level: path.length })) {
8099
+ yield { key: i, value: oo[i], path, parent: oo, level: path.length };
8100
+ }
8101
+ if (oo[i] !== null && typeof oo[i] === 'object') {
8102
+ yield* innerTraversal(oo[i], itemPath);
8103
+ }
8104
+ }
8189
8105
  }
8106
+ yield* innerTraversal(o);
8107
+ }
8108
+ // eslint-disable-next-line no-restricted-syntax
8109
+ for (const filteredvalue of jsonTraverse(propsNew)) {
8110
+ paths.push(filteredvalue);
8111
+ }
8112
+ return paths;
8113
+ };
8114
+ const actionBuilder = (props, stock) => {
8115
+ const _a = props, _b = PARENT_PROP_NAME; _a[_b]; const propsNew = __rest(_a, [_b + ""]);
8116
+ const paths = getFilteredPath(propsNew, ({ key }) => key === ACTION_KEY);
8117
+ orderBy_1(paths, ['level'], ['desc']).forEach((i) => __awaiter(void 0, void 0, void 0, function* () {
8118
+ const _c = traverse$3(props).get(i.path), _d = ACTION_KEY, functionName = _c[_d], functionParams = __rest(_c, [_d + ""]);
8119
+ traverse$3(props).set(i.path, (...callerArgs) => __awaiter(void 0, void 0, void 0, function* () {
8120
+ yield stock.callFunction(functionName, functionParams, props, callerArgs);
8121
+ }));
8122
+ }));
8123
+ };
8124
+ const calculatePropsFromModifier = (props, stock) => {
8125
+ const reduxPaths = [];
8126
+ const _a = props, _b = PARENT_PROP_NAME; _a[_b]; const propsNew = __rest(_a, [_b + ""]);
8127
+ const paths = getFilteredPath(propsNew, ({ key }) => key === MODIFIER_KEY);
8128
+ orderBy_1(paths, ['level'], ['desc']).forEach((i) => __awaiter(void 0, void 0, void 0, function* () {
8129
+ const _c = traverse$3(props).get(i.path), _d = MODIFIER_KEY, functionName = _c[_d], functionParams = __rest(_c, [_d + ""]);
8130
+ if (typeof functionName === 'string' && functionName === REDUX_GET_FUNCTION) {
8131
+ reduxPaths.push(functionParams);
8132
+ }
8133
+ traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
8134
+ }));
8135
+ return reduxPaths.map((i) => {
8136
+ return { store: i === null || i === void 0 ? void 0 : i.store, path: i === null || i === void 0 ? void 0 : i.path };
8190
8137
  });
8191
- orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
8192
- var _a, _b, functionName, functionParams;
8193
- return __generator(this, function (_c) {
8194
- _a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
8195
- traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
8196
- return [2 /*return*/];
8197
- });
8198
- }); });
8199
8138
  };
8200
- var pathModifierBuilder = function (props, pathModifier) {
8201
- var currentPaths = __assign({}, props.currentPaths);
8202
- var modified = false;
8139
+ const getCurrentPaths = (props, pathModifier) => {
8140
+ const currentPaths = Object.assign({}, props[CURRENT_PATH_NAME]);
8203
8141
  if (pathModifier && Object.keys(pathModifier).length !== 0) {
8204
- Object.keys(pathModifier).forEach(function (key) {
8205
- var _a, _b;
8142
+ Object.keys(pathModifier).forEach((key) => {
8206
8143
  if (!!key && !!pathModifier[key] && pathModifier[key][PATHNAME] !== undefined && pathModifier[key][PATHNAME] !== null) {
8207
- var path = pathModifier[key][PATHNAME];
8208
- var parent_1 = currentPaths[key];
8209
- modified = true;
8210
- if ("".concat(path).startsWith(SEPARATOR) || !(parent_1 && parent_1[PATHNAME])) {
8211
- currentPaths[key] = (_a = {}, _a[PATHNAME] = path, _a);
8144
+ const path = pathModifier[key][PATHNAME];
8145
+ const parent = currentPaths[key];
8146
+ if (`${path}`.startsWith(SEPARATOR) || !(parent && parent[PATHNAME])) {
8147
+ currentPaths[key] = { [PATHNAME]: path };
8212
8148
  }
8213
8149
  else {
8214
- currentPaths[key] = (_b = {}, _b[PATHNAME] = changeRelativePath("".concat(parent_1[PATHNAME]).concat(SEPARATOR).concat(path)), _b);
8150
+ currentPaths[key] = { [PATHNAME]: changeRelativePath(`${parent[PATHNAME]}${SEPARATOR}${path}`) };
8215
8151
  }
8216
- if (!!currentPaths[key] && !"".concat(currentPaths[key][PATHNAME]).startsWith(SEPARATOR)) {
8217
- currentPaths[key][PATHNAME] = "".concat(SEPARATOR).concat(currentPaths[key][PATHNAME]);
8152
+ if (!!currentPaths[key] && !`${currentPaths[key][PATHNAME]}`.startsWith(SEPARATOR)) {
8153
+ currentPaths[key][PATHNAME] = `${SEPARATOR}${currentPaths[key][PATHNAME]}`;
8218
8154
  }
8219
8155
  }
8220
8156
  });
8221
8157
  }
8222
- return modified ? { currentPaths: currentPaths } : undefined;
8158
+ return currentPaths;
8223
8159
  };
8224
- var getWrapperProps = function (props, parentComp) {
8225
- var _a, _b;
8226
- if (props && Array.isArray(props)) {
8227
- return _a = {},
8228
- _a[V_COMP_NAME] = 'Fragment',
8229
- _a[V_CHILDREN_NAME] = props,
8230
- _a;
8231
- }
8232
- var res = __assign(__assign({}, (SIMPLE_DATA_TYPES.includes(typeof props) ? {} : props)), (_b = { parentComp: parentComp }, _b[V_COMP_NAME] = SIMPLE_DATA_TYPES.includes(typeof props) || props === undefined || props === null ? '_PrimitiveProp' : props[V_COMP_NAME], _b[V_CHILDREN_NAME] = SIMPLE_DATA_TYPES.includes(typeof props) || props === undefined || props === null ? props : props[V_CHILDREN_NAME], _b));
8233
- // eslint-disable-next-line no-restricted-syntax
8234
- for (var i in res)
8235
- if (typeof res[i] === 'undefined')
8236
- delete res[i];
8237
- return res;
8160
+ const normalisePrimitives = (props, parentComp) => {
8161
+ if (!!props && Array.isArray(props)) {
8162
+ return { [V_COMP_NAME]: FRAGMENT_COMP_NAME, [V_CHILDREN_NAME]: props, [PARENT_PROP_NAME]: parentComp };
8163
+ }
8164
+ if (props === null || SIMPLE_DATA_TYPES.includes(typeof props)) {
8165
+ return { [V_COMP_NAME]: PRIMITIVE_COMP_NAME, [V_CHILDREN_NAME]: props, [PARENT_PROP_NAME]: parentComp };
8166
+ }
8167
+ return Object.assign(Object.assign({}, props), { [PARENT_PROP_NAME]: parentComp });
8238
8168
  };
8239
- var genChildenFromListItem = function (props, stock) {
8240
- var _a, _b;
8241
- var page = !!props[LIST_PAGE] && isNumber(props[LIST_PAGE]) ? props[LIST_PAGE] : 0;
8242
- var listLength = !!props[LIST_LENGTH] && isNumber(props[LIST_LENGTH]) ? props[LIST_LENGTH] : undefined;
8243
- var itemPerPage = !!props[LIST_ITEM_PER_PAGE] && isNumber(props[LIST_ITEM_PER_PAGE]) ? props[LIST_ITEM_PER_PAGE] : undefined;
8244
- var listItem = props[LIST_ITEM];
8169
+ const genChildenFromListItem = (props, stock) => {
8170
+ let page = !!props[LIST_PAGE] && isNumber(props[LIST_PAGE]) ? props[LIST_PAGE] : 0;
8171
+ let listLength = !!props[LIST_LENGTH] && isNumber(props[LIST_LENGTH]) ? props[LIST_LENGTH] : undefined;
8172
+ let itemPerPage = !!props[LIST_ITEM_PER_PAGE] && isNumber(props[LIST_ITEM_PER_PAGE]) ? props[LIST_ITEM_PER_PAGE] : undefined;
8173
+ const listItem = props[LIST_ITEM];
8245
8174
  if (!listItem)
8246
8175
  return undefined;
8247
- var currentPaths = props.currentPaths;
8176
+ const currentPaths = props[CURRENT_PATH_NAME];
8248
8177
  if (!currentPaths)
8249
8178
  return undefined;
8250
- var store = Object.keys(currentPaths)[0];
8179
+ const store = Object.keys(currentPaths)[0];
8251
8180
  if (!store)
8252
8181
  return undefined;
8253
- var path = currentPaths[store].path;
8182
+ const { path } = currentPaths[store];
8254
8183
  if (currentPaths && !listLength) {
8255
8184
  if (path) {
8256
- var list = stock.callFunction('get', { store: store, path: path });
8185
+ const list = stock.callFunction('get', { store, path });
8257
8186
  listLength = !!list && Array.isArray(list) ? list.length : 0;
8258
8187
  }
8259
8188
  }
@@ -8263,45 +8192,80 @@ var genChildenFromListItem = function (props, stock) {
8263
8192
  page = Number.isInteger(page) && page >= 0 ? page : 0;
8264
8193
  itemPerPage = !!itemPerPage && Number.isInteger(itemPerPage) && itemPerPage >= 0 ? itemPerPage : 0;
8265
8194
  listLength = !!listLength && Number.isInteger(listLength) && listLength >= 0 ? listLength : 0;
8266
- var offset = page * itemPerPage <= listLength ? page * itemPerPage : 0;
8267
- var children = [];
8195
+ const offset = page * itemPerPage <= listLength ? page * itemPerPage : 0;
8196
+ const children = [];
8268
8197
  // eslint-disable-next-line no-plusplus
8269
- for (var i = offset; i < listLength && i < offset + itemPerPage; i++) {
8270
- children.push(__assign(__assign({}, listItem), (_a = {}, _a[PATH_MODIFIERS_KEY] = (_b = {},
8271
- _b[store] = {
8272
- path: ".".concat(SEPARATOR).concat(i),
8273
- },
8274
- _b), _a)));
8198
+ for (let i = offset; i < listLength && i < offset + itemPerPage; i++) {
8199
+ children.push(Object.assign(Object.assign({}, listItem), { [PATH_MODIFIERS_KEY]: {
8200
+ [store]: {
8201
+ path: `.${SEPARATOR}${i}`,
8202
+ },
8203
+ } }));
8275
8204
  }
8276
8205
  return children.length > 0 ? children : undefined;
8277
8206
  };
8278
- var getRootWrapperProps = function (props, stock) {
8279
- var newProps = __assign({}, props);
8280
- modifierBuilder(newProps, stock);
8207
+ const getRootWrapperProps = (props, stock) => {
8208
+ const newProps = Object.assign({}, props);
8209
+ const subscriberPaths = calculatePropsFromModifier(newProps, stock);
8281
8210
  actionBuilder(newProps, stock);
8282
8211
  if (newProps[LIST_SEMAPHORE]) {
8283
8212
  newProps[V_CHILDREN_NAME] = genChildenFromListItem(newProps, stock);
8284
8213
  }
8214
+ newProps.subscriberPaths = subscriberPaths;
8285
8215
  return newProps;
8286
8216
  };
8287
- var getChildrensForRoot = function (props, children, Wrapper) {
8288
- var _a = props; _a.parentComp; var _b = V_CHILDREN_NAME; _a[_b]; var newParentComp = __rest(_a, ["parentComp", _b + ""]);
8217
+ const isChildrenProps = (propName) => !!propName && typeof propName === 'string' && propName.startsWith(V_CHILDREN_PREFIX);
8218
+ const getParentProps = (props) => {
8219
+ return props && typeof props === 'object' && !Array.isArray(props)
8220
+ ? Object.keys(props)
8221
+ .filter((key) => !isChildrenProps(key) && key !== PARENT_PROP_NAME)
8222
+ .reduce((newObj, key) => {
8223
+ // eslint-disable-next-line no-param-reassign
8224
+ newObj[key] = props[key];
8225
+ return newObj;
8226
+ }, {})
8227
+ : {};
8228
+ };
8229
+ const getPropsChildrenFilter = ({ props, filter }) => props && typeof props === 'object' && !Array.isArray(props)
8230
+ ? Object.keys(props)
8231
+ .filter((key) => ((filter === 'withoutChildren' && !isChildrenProps(key)) || (filter === 'onlyChildren' && isChildrenProps(key))) && key !== PARENT_PROP_NAME)
8232
+ .reduce((newObj, key) => {
8233
+ // eslint-disable-next-line no-param-reassign
8234
+ newObj[key] = props[key];
8235
+ return newObj;
8236
+ }, {})
8237
+ : {};
8238
+ const getChildrensForRoot = (props, children, Wrapper) => {
8289
8239
  // eslint-disable-next-line no-nested-ternary
8290
8240
  if (!!props && Array.isArray(children)) {
8291
- return children.map(function (childrenItem, index) {
8241
+ return children.map((childrenItem, index) => {
8292
8242
  // eslint-disable-next-line react/no-array-index-key
8293
- return jsxRuntime.exports.jsx(Wrapper, __assign({}, getWrapperProps(childrenItem, newParentComp)), index);
8243
+ return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(childrenItem, getParentProps(props)) }, index);
8294
8244
  });
8295
8245
  }
8296
8246
  if (!!props && !!children) {
8297
- return jsxRuntime.exports.jsx(Wrapper, __assign({}, getWrapperProps(children, newParentComp)), void 0);
8247
+ return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(children, getParentProps(props)) }, void 0);
8248
+ }
8249
+ return undefined;
8250
+ };
8251
+ const generateChildren = (props, { Wrapper }) => props[V_COMP_NAME] !== '_PrimitiveProp' ? getChildrensForRoot(props, props[V_CHILDREN_NAME], Wrapper) : props[V_CHILDREN_NAME];
8252
+ const generateNewChildren = (props, { Wrapper }) => {
8253
+ // eslint-disable-next-line no-nested-ternary
8254
+ if (props) {
8255
+ if (Array.isArray(props)) {
8256
+ return props.map((childrenItem, index) => {
8257
+ // eslint-disable-next-line react/no-array-index-key
8258
+ return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(childrenItem, getParentProps(props)) }, index);
8259
+ });
8260
+ }
8261
+ return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(props, getParentProps(props)) }, void 0);
8298
8262
  }
8299
8263
  return undefined;
8300
8264
  };
8301
- var generateChildren = function (props, _a) {
8302
- var Wrapper = _a.Wrapper;
8303
- return props[V_COMP_NAME] !== '_PrimitiveProp' ? getChildrensForRoot(props, props[V_CHILDREN_NAME], Wrapper) : props[V_CHILDREN_NAME];
8304
- };var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,actionBuilder:actionBuilder,modifierBuilder:modifierBuilder,pathModifierBuilder:pathModifierBuilder,getWrapperProps:getWrapperProps,getRootWrapperProps:getRootWrapperProps,getChildrensForRoot:getChildrensForRoot,generateChildren:generateChildren});var ajv = {exports: {}};var core$2 = {};var validate = {};var boolSchema = {};var errors = {};var codegen = {};var code$1 = {};(function (exports) {
8265
+ const removeTechnicalProps = (changeableProps) => {
8266
+ const _a = changeableProps, _b = PARENT_PROP_NAME; _a[_b]; const _c = STYLE_WEB_NAME; _a[_c]; const _d = V_COMP_NAME; _a[_d]; const _e = PATH_MODIFIERS_KEY; _a[_e]; const _f = CURRENT_PATH_NAME; _a[_f]; const _g = PATH_MODIFIERS_KEY; _a[_g]; const _h = LIST_SEMAPHORE; _a[_h]; const _j = LIST_ITEM; _a[_j]; const _k = LIST_PAGE; _a[_k]; const _l = LIST_ITEM_PER_PAGE; _a[_l]; const _m = LIST_LENGTH; _a[_m]; const newProps = __rest(_a, [_b + "", "style", _c + "", _d + "", _e + "", _f + "", "subscriberPaths", _g + "", _h + "", _j + "", _k + "", _l + "", _m + ""]);
8267
+ return newProps;
8268
+ };var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,getFilteredPath:getFilteredPath,actionBuilder:actionBuilder,calculatePropsFromModifier:calculatePropsFromModifier,getCurrentPaths:getCurrentPaths,normalisePrimitives:normalisePrimitives,getRootWrapperProps:getRootWrapperProps,isChildrenProps:isChildrenProps,getParentProps:getParentProps,getPropsChildrenFilter:getPropsChildrenFilter,getChildrensForRoot:getChildrensForRoot,generateChildren:generateChildren,generateNewChildren:generateNewChildren,removeTechnicalProps:removeTechnicalProps});var ajv = {exports: {}};var core$2 = {};var validate = {};var boolSchema = {};var errors = {};var codegen = {};var code$1 = {};(function (exports) {
8305
8269
  Object.defineProperty(exports, "__esModule", { value: true });
8306
8270
  exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
8307
8271
  class _CodeOrName {
@@ -15226,7 +15190,7 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
15226
15190
 
15227
15191
  return str
15228
15192
 
15229
- };var I18nSchema = {
15193
+ };const I18nSchema = {
15230
15194
  $id: 'http://example.com/schemas/schema.json',
15231
15195
  type: 'object',
15232
15196
  additionalProperties: {
@@ -15251,28 +15215,26 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
15251
15215
  },
15252
15216
  minProperties: 1,
15253
15217
  };
15254
- var I18n = /** @class */ (function () {
15218
+ class I18n {
15255
15219
  // eslint-disable-next-line consistent-this
15256
- function I18n(_a) {
15257
- var _this = this;
15258
- var _b = _a.language, language = _b === void 0 ? 'en' : _b, resources = _a.resources, nonExistsHandler = _a.nonExistsHandler, _c = _a.keyPrefix, keyPrefix = _c === void 0 ? '{{' : _c, _d = _a.keyPostfix, keyPostfix = _d === void 0 ? '}}' : _d;
15259
- this.getLocales = function () { return (_this.language.includes('-') ? _this.language.split('-') : _this.language.split('_') || [])[0]; };
15260
- this.t = function (key, options, language) {
15220
+ constructor({ language = 'en', resources, nonExistsHandler, keyPrefix = '{{', keyPostfix = '}}' }) {
15221
+ this.getLocales = () => (this.language.includes('-') ? this.language.split('-') : this.language.split('_') || [])[0];
15222
+ this.t = (key, options, language) => {
15261
15223
  if (!(typeof key === 'string')) {
15262
15224
  return key;
15263
15225
  }
15264
- if (!_this.resources || (!_this.resources && !_this.language && !language) || !_this.resources["".concat(_this.availableLanguageKey || language)]) {
15226
+ if (!this.resources || (!this.resources && !this.language && !language) || !this.resources[`${this.availableLanguageKey || language}`]) {
15265
15227
  return key;
15266
15228
  }
15267
- var value = _this.resources["".concat(_this.availableLanguageKey || language)].translation[key];
15229
+ const value = this.resources[`${this.availableLanguageKey || language}`].translation[key];
15268
15230
  if (value === undefined) {
15269
- if (_this.nonExistsHandler && typeof _this.nonExistsHandler === 'function') {
15270
- return _this.nonExistsHandler(key);
15231
+ if (this.nonExistsHandler && typeof this.nonExistsHandler === 'function') {
15232
+ return this.nonExistsHandler(key);
15271
15233
  }
15272
15234
  return key;
15273
15235
  }
15274
15236
  if (options) {
15275
- return src(value, options, [_this.keyPrefix, _this.keyPostfix]);
15237
+ return src(value, options, [this.keyPrefix, this.keyPostfix]);
15276
15238
  }
15277
15239
  return value;
15278
15240
  };
@@ -15280,9 +15242,9 @@ var I18n = /** @class */ (function () {
15280
15242
  this.nonExistsHandler = nonExistsHandler;
15281
15243
  this.keyPrefix = keyPrefix;
15282
15244
  this.keyPostfix = keyPostfix;
15283
- var ajv = new Ajv();
15284
- var validate = ajv.compile(I18nSchema);
15285
- var isValid = validate(resources);
15245
+ const ajv = new Ajv();
15246
+ const validate = ajv.compile(I18nSchema);
15247
+ const isValid = validate(resources);
15286
15248
  if (isValid) {
15287
15249
  this.resources = resources;
15288
15250
  }
@@ -15294,84 +15256,49 @@ var I18n = /** @class */ (function () {
15294
15256
  this.availableLanguageKey = this.getLocales();
15295
15257
  }
15296
15258
  }
15297
- return I18n;
15298
- }());var StockContext = React.createContext(null);
15299
- var PathModifierContext = React.createContext({});var getState = function (state) { return state === null || state === void 0 ? void 0 : state.root; };
15300
- var getValue$3 = function (state, store, path) { return jsonPointerGet(state[store], path) || null; };
15301
- var getStateValue$1 = function (globalState, _a, currentPaths) {
15302
- var store = _a.store, path = _a.path, _b = _a.isError, isError = _b === void 0 ? false : _b;
15303
- var state = getState(globalState);
15259
+ }const StockContext = React.createContext(null);
15260
+ const PathModifierContext = React.createContext({});const getState = (state) => state === null || state === void 0 ? void 0 : state.root;
15261
+ const getValue$3 = (state, store, path) => jsonPointerGet(state[store], path) || null;
15262
+ const getStateValue$1 = (globalState, { store, path, isError = false }, currentPaths) => {
15263
+ const state = getState(globalState);
15304
15264
  if (state && store && path) {
15305
- var convertedPath = currentPaths && currentPaths[store] && currentPaths[store].path ? changeRelativePath("".concat(currentPaths[store].path).concat(SEPARATOR).concat(path)) : path;
15306
- return getValue$3(state, "".concat(store).concat(isError ? STORE_ERROR_POSTFIX : ''), convertedPath);
15265
+ const convertedPath = currentPaths && currentPaths[store] && currentPaths[store].path ? changeRelativePath(`${currentPaths[store].path}${SEPARATOR}${path}`) : path;
15266
+ return getValue$3(state, `${store}${isError ? STORE_ERROR_POSTFIX : ''}`, convertedPath);
15307
15267
  }
15308
15268
  return null;
15309
15269
  };
15310
- var genAllStateProps = function (globalState, props) {
15311
- var currentPaths = props.currentPaths;
15312
- var result = {};
15313
- var paths = [];
15314
- props.parentComp; var propsNew = __rest(props
15315
- // eslint-disable-next-line func-names
15316
- , ["parentComp"]);
15317
- // eslint-disable-next-line func-names
15318
- traverse$3(propsNew).forEach(function (x) {
15319
- if (!!x && !!x[MODIFIER_KEY] && x[MODIFIER_KEY] === 'get' && !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
15320
- paths.push({ path: this.path, level: this.level });
15321
- }
15322
- });
15323
- orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
15324
- var _a, _b, functionName, functionParams, value, jsonata, expression;
15325
- return __generator(this, function (_c) {
15326
- _a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
15327
- if (functionName === 'get' && functionParams.store && functionParams.path) {
15328
- value = getStateValue$1(globalState, functionParams, currentPaths);
15329
- if (functionParams.jsonataDef) {
15330
- try {
15331
- jsonata = require('jsonata');
15332
- expression = jsonata(functionParams.jsonataDef);
15333
- value = expression.evaluate(value);
15334
- }
15335
- catch (error) {
15336
- // eslint-disable-next-line no-console
15337
- console.error('jsonata error', error, functionParams.jsonataDef);
15338
- }
15339
- }
15340
- // traverse(result).set(i.path, value)
15341
- result[pathArrayToJsonPointer(i.path)] = value;
15342
- }
15343
- return [2 /*return*/];
15344
- });
15345
- }); });
15346
- return result;
15347
- };var DATA_UPDATE = 'DATA_UPDATE';
15348
- var PURGE$1 = 'PURGE';
15349
- var set$1 = function (payload) { return ({
15270
+ const compSelectorHook = (currentPaths, subscriberPaths) => (state) => {
15271
+ if (typeof subscriberPaths === 'object' && Array.isArray(subscriberPaths) && (subscriberPaths === null || subscriberPaths === void 0 ? void 0 : subscriberPaths.length) > 0) {
15272
+ return subscriberPaths.map((subscriberPath) => getStateValue$1(state, subscriberPath, currentPaths));
15273
+ }
15274
+ // TODO isError, currentPaths, root need to solve propperly
15275
+ return undefined;
15276
+ };const DATA_UPDATE = 'DATA_UPDATE';
15277
+ const PURGE$1 = 'PURGE';
15278
+ const set$1 = (payload) => ({
15350
15279
  type: DATA_UPDATE,
15351
- payload: payload,
15352
- }); };
15353
- var purge = function (payload) { return ({
15280
+ payload,
15281
+ });
15282
+ const purge = (payload) => ({
15354
15283
  type: PURGE$1,
15355
- payload: payload,
15356
- }); };var getStateValue = function (attr, _a, callerArgs, stock) {
15357
- var _b = _a === void 0 ? {} : _a, currentPaths = _b.currentPaths;
15358
- var store = attr.store, path = attr.path;
15359
- var state = stock.reduxStore.getState();
15360
- return getStateValue$1(state, { store: store, path: path }, currentPaths);
15284
+ payload,
15285
+ });const getStateValue = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
15286
+ const { store, path } = attr;
15287
+ const state = stock.reduxStore.getState();
15288
+ return getStateValue$1(state, { store, path }, currentPaths);
15361
15289
  };
15362
- var get = function (attr, _a, callerArgs, stock) {
15363
- var _b = _a === void 0 ? {} : _a, currentPaths = _b.currentPaths;
15364
- var store = attr.store, path = attr.path;
15365
- var state = stock.reduxStore.getState();
15366
- return getStateValue$1(state, { store: store, path: path }, currentPaths);
15290
+ const get = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
15291
+ const { store, path } = attr;
15292
+ const state = stock.reduxStore.getState();
15293
+ return getStateValue$1(state, { store, path }, currentPaths);
15367
15294
  };
15368
- var set = function (attr, props, callerArgs, stock) {
15369
- stock.reduxStore.dispatch(set$1(__assign(__assign({}, attr), { value: attr && attr.value !== undefined ? attr.value : callerArgs[0], currentPaths: props.currentPaths, stock: stock })));
15295
+ const set = (attr, props, callerArgs, stock) => {
15296
+ stock.reduxStore.dispatch(set$1(Object.assign(Object.assign({}, attr), { value: attr && attr.value !== undefined ? attr.value : callerArgs[0], [CURRENT_PATH_NAME]: props[CURRENT_PATH_NAME], stock })));
15370
15297
  };
15371
15298
  var functions = {
15372
- getStateValue: getStateValue,
15373
- get: get,
15374
- set: set,
15299
+ getStateValue,
15300
+ get,
15301
+ set,
15375
15302
  };/**
15376
15303
  * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
15377
15304
  *
@@ -15405,7 +15332,7 @@ var ActionTypes$1 = {
15405
15332
  * @param {any} obj The object to inspect.
15406
15333
  * @returns {boolean} True if the argument appears to be a plain object.
15407
15334
  */
15408
- function isPlainObject$4(obj) {
15335
+ function isPlainObject$3(obj) {
15409
15336
  if (typeof obj !== 'object' || obj === null) return false;
15410
15337
  var proto = obj;
15411
15338
 
@@ -15481,7 +15408,7 @@ function kindOf$1(val) {
15481
15408
  * @param {String} message The warning message.
15482
15409
  * @returns {void}
15483
15410
  */
15484
- function warning$2(message) {
15411
+ function warning$1(message) {
15485
15412
  /* eslint-disable no-console */
15486
15413
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
15487
15414
  console.error(message);
@@ -15506,7 +15433,7 @@ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
15506
15433
  return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
15507
15434
  }
15508
15435
 
15509
- if (!isPlainObject$4(inputState)) {
15436
+ if (!isPlainObject$3(inputState)) {
15510
15437
  return "The " + argumentName + " has unexpected type of \"" + kindOf$1(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
15511
15438
  }
15512
15439
 
@@ -15568,7 +15495,7 @@ function combineReducers(reducers) {
15568
15495
 
15569
15496
  if (process.env.NODE_ENV !== 'production') {
15570
15497
  if (typeof reducers[key] === 'undefined') {
15571
- warning$2("No reducer provided for key \"" + key + "\"");
15498
+ warning$1("No reducer provided for key \"" + key + "\"");
15572
15499
  }
15573
15500
  }
15574
15501
 
@@ -15607,7 +15534,7 @@ function combineReducers(reducers) {
15607
15534
  var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
15608
15535
 
15609
15536
  if (warningMessage) {
15610
- warning$2(warningMessage);
15537
+ warning$1(warningMessage);
15611
15538
  }
15612
15539
  }
15613
15540
 
@@ -15642,7 +15569,7 @@ function combineReducers(reducers) {
15642
15569
  function isCrushed$1() {}
15643
15570
 
15644
15571
  if (process.env.NODE_ENV !== 'production' && typeof isCrushed$1.name === 'string' && isCrushed$1.name !== 'isCrushed') {
15645
- warning$2('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
15572
+ warning$1('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
15646
15573
  }function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
15647
15574
  inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
15648
15575
  outbound) {
@@ -15877,11 +15804,11 @@ var pick = flatRest(function(object, paths) {
15877
15804
  return object == null ? {} : basePick(object, paths);
15878
15805
  });
15879
15806
 
15880
- var pick_1 = pick;var SetTransform = createTransform(function (inboundState, key) {
15807
+ var pick_1 = pick;const SetTransform = createTransform((inboundState, key) => {
15881
15808
  if (key !== 'root')
15882
15809
  return inboundState;
15883
15810
  return pick_1(inboundState, PERSIST_STORAGE_NAMES);
15884
- }, function (outboundState, key) {
15811
+ }, (outboundState, key) => {
15885
15812
  if (key !== 'root')
15886
15813
  return outboundState;
15887
15814
  return pick_1(outboundState, PERSIST_STORAGE_NAMES);
@@ -15891,81 +15818,80 @@ var persistConfig = {
15891
15818
  whitelist: ['root'],
15892
15819
  transforms: [SetTransform],
15893
15820
  };function n$3(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$3(n){return !!n&&!!n[Q]}function t$2(n){return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v$3(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v$3(n)?3:0}function u$1(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f$3(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c$3(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v$3(n){return q$3&&n instanceof Set}function p$3(n){return n.o||n.t}function l$3(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d$3(n,e){return void 0===e&&(e=!1),y$3(n)||r$3(n)||!t$2(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h$3),Object.freeze(n),e&&i(n,(function(n,r){return d$3(r,!0)}),!0),n)}function h$3(){n$3(2);}function y$3(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$3(r){var t=tn[r];return t||n$3(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n$3(0),U}function j(n,r){r&&(b$3("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g$3(n),n.p.forEach(S),n.p=null;}function g$3(n){n===U&&(U=n.l);}function w$3(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b$3("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n$3(4)),t$2(r)&&(r=M(e,r),e.l||x$3(e,r)),e.u&&b$3("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H$1?r:void 0}function M(n,r,t){if(y$3(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A$3(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x$3(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l$3(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A$3(n,e,o,r,i,t)})),x$3(n,o,!1),t&&n.u&&b$3("Patches").R(e,t,n.u,n.s);}return e.o}function A$3(e,i,o,a,c,s){if("production"!==process.env.NODE_ENV&&c===o&&n$3(5),r$3(c)){var v=M(e,c,s&&i&&3!==i.i&&!u$1(i.D,a)?s.concat(a):void 0);if(f$3(o,a,v),!r$3(v))return;e.m=!1;}if(t$2(c)&&!y$3(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x$3(e,c);}}function x$3(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d$3(r,t);}function z$3(n,r){var t=n[Q];return (t?p$3(t):n)[r]}function I$1(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k$3(n){n.P||(n.P=!0,n.l&&k$3(n.l));}function E$1(n){n.o||(n.o=l$3(n.t));}function R(n,r,t){var e=s(r)?b$3("MapSet").N(r,t):v$3(r)?b$3("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$3("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D$1(e){return r$3(e)||n$3(22,e),function n(r){if(!t$2(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b$3("ES5").K(u)))return u.t;u.I=!0,e=F$1(r,c),u.I=!1;}else e=F$1(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f$3(e,r,n(t));})),3===c?new Set(e):e}(e)}function F$1(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l$3(n)}var G$1,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q$3="undefined"!=typeof Set,B$1="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H$1=W?Symbol.for("immer-nothing"):((G$1={})["immer-nothing"]=!0,G$1),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p$3(n);if(!u$1(e,r))return function(n,r,t){var e,i=I$1(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t$2(i)?i:i===z$3(n.t,r)?(E$1(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p$3(n)},ownKeys:function(n){return Reflect.ownKeys(p$3(n))},set:function(n,r,t){var e=I$1(p$3(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z$3(p$3(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c$3(t,i)&&(void 0!==t||u$1(n.t,r)))return !0;E$1(n),k$3(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z$3(n.t,r)||r in n.t?(n.D[r]=!1,E$1(n),k$3(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p$3(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n$3(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$3(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$3(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$3(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B$1,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n$3(6),void 0!==o&&"function"!=typeof o&&n$3(7),t$2(r)){var c=w$3(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g$3(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H$1&&(f=void 0),e.F&&d$3(f,!0),o){var p=[],l=[];b$3("Patches").M(r,f,p,l),o(p,l);}return f}n$3(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t$2(e)||n$3(8),r$3(e)&&(e=D$1(e));var i=w$3(this),o=R(this,e,void 0);return o[Q].C=!0,g$3(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n$3(9),e.I&&n$3(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B$1&&n$3(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$3("Patches").$;return r$3(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
15894
- var pathConverter = function (path) { return path.replace(/\./g, SEPARATOR); };
15895
- var errorConverter = function (errors) {
15896
- var res = {};
15821
+ const pathConverter = (path) => path.replace(/\./g, SEPARATOR);
15822
+ const errorConverter = (errors) => {
15823
+ const res = {};
15897
15824
  if (errors) {
15898
- errors.forEach(function (i) {
15825
+ errors.forEach((i) => {
15899
15826
  if (i.keyword === 'required') {
15900
- jsonpointer.set(res, "".concat(pathConverter("".concat(i.instancePath, ".").concat(i.params.missingProperty)), "/-"), i.message);
15827
+ jsonpointer.set(res, `${pathConverter(`${i.instancePath}.${i.params.missingProperty}`)}/-`, i.message);
15901
15828
  }
15902
15829
  else {
15903
- jsonpointer.set(res, "".concat(pathConverter(i.instancePath), "/-"), i.message);
15830
+ jsonpointer.set(res, `${pathConverter(i.instancePath)}/-`, i.message);
15904
15831
  }
15905
15832
  });
15906
15833
  }
15907
15834
  return res;
15908
15835
  };
15909
- var validateJSON = function (schema, store, data) {
15910
- var ajv = new Ajv({ allErrors: true });
15911
- var validate = ajv.compile(schema);
15912
- var valid = validate(data);
15836
+ const validateJSON = (schema, store, data) => {
15837
+ const ajv = new Ajv({ allErrors: true });
15838
+ const validate = ajv.compile(schema);
15839
+ const valid = validate(data);
15913
15840
  return {
15914
- store: "".concat(store).concat(STORE_ERROR_POSTFIX),
15915
- valid: valid,
15841
+ store: `${store}${STORE_ERROR_POSTFIX}`,
15842
+ valid,
15916
15843
  value: valid ? null : errorConverter(validate.errors),
15917
15844
  };
15918
- };var initialState$1 = {};
15919
- var validateNewState = function (stock, newState, actionStore, actionPath) {
15845
+ };const initialState$1 = {};
15846
+ const validateNewState = (stock, newState, actionStore, actionPath) => {
15920
15847
  if (stock === null || stock === void 0 ? void 0 : stock.validations) {
15921
- stock.validations.forEach(function (validateItem) {
15922
- if (validateItem.store === actionStore && "".concat(actionPath).startsWith(validateItem.path)) {
15848
+ stock.validations.forEach((validateItem) => {
15849
+ if (validateItem.store === actionStore && `${actionPath}`.startsWith(validateItem.path)) {
15923
15850
  if (validateItem.schema) {
15924
- var stateToBeValidated = jsonPointerGet(newState, "".concat(SEPARATOR).concat(actionStore).concat(validateItem.path));
15925
- var errors = validateJSON(validateItem.schema, actionStore, stateToBeValidated);
15851
+ const stateToBeValidated = jsonPointerGet(newState, `${SEPARATOR}${actionStore}${validateItem.path}`);
15852
+ const errors = validateJSON(validateItem.schema, actionStore, stateToBeValidated);
15926
15853
  // console.log('matched validator', `${c.SEPARATOR}${errors.store}${validateItem.path}`, errors)
15927
15854
  // eslint-disable-next-line no-param-reassign
15928
- newState = jsonPointerSet(newState, "".concat(SEPARATOR).concat(errors.store).concat(validateItem.path), errors.value);
15855
+ newState = jsonPointerSet(newState, `${SEPARATOR}${errors.store}${validateItem.path}`, errors.value);
15929
15856
  }
15930
15857
  }
15931
15858
  });
15932
15859
  }
15933
15860
  };
15934
- var reducer = function (state, action) {
15935
- if (state === void 0) { state = initialState$1; }
15861
+ const reducer = (state = initialState$1, action) => {
15936
15862
  switch (action === null || action === void 0 ? void 0 : action.type) {
15937
15863
  case DATA_UPDATE: {
15938
- var _a = (action === null || action === void 0 ? void 0 : action.payload) || {}, _b = _a.store, store_1 = _b === void 0 ? undefined : _b, _c = _a.path, path = _c === void 0 ? undefined : _c, _d = _a.value, value_1 = _d === void 0 ? undefined : _d, _e = _a.jsonataDef, jsonataDef_1 = _e === void 0 ? undefined : _e, _f = _a.currentPaths, currentPaths = _f === void 0 ? undefined : _f, _g = _a.stock, stock_1 = _g === void 0 ? undefined : _g;
15939
- if (store_1 && path && !isCircular(value_1)) {
15940
- var storekey = "".concat(store_1);
15941
- var convertedPath_1 = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
15942
- ? changeRelativePath("".concat(currentPaths[storekey].path).concat(SEPARATOR).concat(path))
15864
+ const { store = undefined, path = undefined, value = undefined, jsonataDef = undefined, [CURRENT_PATH_NAME]: currentPaths = undefined, stock = undefined, } = (action === null || action === void 0 ? void 0 : action.payload) || {};
15865
+ if (store && path && !isCircular(value)) {
15866
+ const storekey = `${store}`;
15867
+ let convertedPath = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
15868
+ ? changeRelativePath(`${currentPaths[storekey].path}${SEPARATOR}${path}`)
15943
15869
  : changeRelativePath(path);
15944
- convertedPath_1 = convertedPath_1.startsWith(SEPARATOR) ? convertedPath_1 : "".concat(SEPARATOR).concat(convertedPath_1);
15945
- var absolutePathWithStoreKey_1 = "".concat(SEPARATOR).concat(storekey).concat(convertedPath_1);
15946
- var newState = produce(state, function (draft) {
15947
- if (jsonataDef_1) {
15870
+ convertedPath = convertedPath.startsWith(SEPARATOR) ? convertedPath : `${SEPARATOR}${convertedPath}`;
15871
+ const absolutePathWithStoreKey = `${SEPARATOR}${storekey}${convertedPath}`;
15872
+ const newState = produce(state, (draft) => {
15873
+ if (jsonataDef) {
15948
15874
  try {
15949
15875
  // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
15950
- var jsonata = require('jsonata');
15951
- var expression = jsonata(jsonataDef_1);
15952
- var newValue = expression.evaluate(value_1);
15876
+ const jsonata = require('jsonata');
15877
+ const expression = jsonata(jsonataDef);
15878
+ const newValue = expression.evaluate(value);
15953
15879
  // eslint-disable-next-line no-param-reassign
15954
- draft = jsonPointerSet(draft, absolutePathWithStoreKey_1, newValue);
15880
+ draft = jsonPointerSet(draft, absolutePathWithStoreKey, newValue);
15955
15881
  }
15956
15882
  catch (error) {
15957
15883
  // eslint-disable-next-line no-console
15958
- console.error('jsonata error', error, jsonataDef_1);
15884
+ console.error('jsonata error', error, jsonataDef);
15959
15885
  // eslint-disable-next-line no-param-reassign
15960
- draft = jsonPointerSet(draft, absolutePathWithStoreKey_1, value_1);
15886
+ draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
15961
15887
  }
15962
15888
  }
15963
15889
  else {
15964
15890
  // eslint-disable-next-line no-param-reassign
15965
- draft = jsonPointerSet(draft, absolutePathWithStoreKey_1, value_1);
15891
+ draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
15966
15892
  }
15967
15893
  // if validatior has match, need to validate it synchronously
15968
- validateNewState(stock_1, draft, store_1, convertedPath_1);
15894
+ validateNewState(stock, draft, store, convertedPath);
15969
15895
  });
15970
15896
  return newState;
15971
15897
  }
@@ -15977,19 +15903,11 @@ var reducer = function (state, action) {
15977
15903
  default:
15978
15904
  return state;
15979
15905
  }
15980
- };var rootReducer = combineReducers({ root: reducer });var deletePersistDataStore = function (attr, props, callerArgs, stock) { return __awaiter(void 0, void 0, void 0, function () {
15981
- return __generator(this, function (_a) {
15982
- switch (_a.label) {
15983
- case 0:
15984
- stock.reduxStore.dispatch(purge(null));
15985
- return [4 /*yield*/, stock.callFunction('reloadApp', {})];
15986
- case 1:
15987
- _a.sent();
15988
- return [2 /*return*/];
15989
- }
15990
- });
15991
- }); };
15992
- var appRootFunctions = { deletePersistDataStore: deletePersistDataStore };
15906
+ };const rootReducer = combineReducers({ root: reducer });const deletePersistDataStore = (attr, props, callerArgs, stock) => __awaiter(void 0, void 0, void 0, function* () {
15907
+ stock.reduxStore.dispatch(purge(null));
15908
+ yield stock.callFunction('reloadApp', {});
15909
+ });
15910
+ const appRootFunctions = { deletePersistDataStore };
15993
15911
 
15994
15912
  /**
15995
15913
  * A faster alternative to `Function#apply`, this function invokes `func`
@@ -16435,7 +16353,7 @@ var _getNative = getNative$3;
16435
16353
 
16436
16354
  var getNative$2 = _getNative;
16437
16355
 
16438
- var defineProperty$3 = (function() {
16356
+ var defineProperty$2 = (function() {
16439
16357
  try {
16440
16358
  var func = getNative$2(Object, 'defineProperty');
16441
16359
  func({}, '', {});
@@ -16443,10 +16361,10 @@ var defineProperty$3 = (function() {
16443
16361
  } catch (e) {}
16444
16362
  }());
16445
16363
 
16446
- var _defineProperty$4 = defineProperty$3;
16364
+ var _defineProperty$4 = defineProperty$2;
16447
16365
 
16448
16366
  var constant = constant_1,
16449
- defineProperty$2 = _defineProperty$4,
16367
+ defineProperty$1 = _defineProperty$4,
16450
16368
  identity$1 = identity_1;
16451
16369
 
16452
16370
  /**
@@ -16457,8 +16375,8 @@ var constant = constant_1,
16457
16375
  * @param {Function} string The `toString` result.
16458
16376
  * @returns {Function} Returns `func`.
16459
16377
  */
16460
- var baseSetToString$1 = !defineProperty$2 ? identity$1 : function(func, string) {
16461
- return defineProperty$2(func, 'toString', {
16378
+ var baseSetToString$1 = !defineProperty$1 ? identity$1 : function(func, string) {
16379
+ return defineProperty$1(func, 'toString', {
16462
16380
  'configurable': true,
16463
16381
  'enumerable': false,
16464
16382
  'value': constant(string),
@@ -17209,7 +17127,7 @@ Stack$1.prototype.set = stackSet;
17209
17127
 
17210
17128
  var _Stack = Stack$1;
17211
17129
 
17212
- var defineProperty$1 = _defineProperty$4;
17130
+ var defineProperty = _defineProperty$4;
17213
17131
 
17214
17132
  /**
17215
17133
  * The base implementation of `assignValue` and `assignMergeValue` without
@@ -17221,8 +17139,8 @@ var defineProperty$1 = _defineProperty$4;
17221
17139
  * @param {*} value The value to assign.
17222
17140
  */
17223
17141
  function baseAssignValue$3(object, key, value) {
17224
- if (key == '__proto__' && defineProperty$1) {
17225
- defineProperty$1(object, key, {
17142
+ if (key == '__proto__' && defineProperty) {
17143
+ defineProperty(object, key, {
17226
17144
  'configurable': true,
17227
17145
  'enumerable': true,
17228
17146
  'value': value,
@@ -17828,7 +17746,7 @@ var objectCtorString = funcToString.call(Object);
17828
17746
  * _.isPlainObject(Object.create(null));
17829
17747
  * // => true
17830
17748
  */
17831
- function isPlainObject$3(value) {
17749
+ function isPlainObject$2(value) {
17832
17750
  if (!isObjectLike$1(value) || baseGetTag$1(value) != objectTag$1) {
17833
17751
  return false;
17834
17752
  }
@@ -17841,7 +17759,7 @@ function isPlainObject$3(value) {
17841
17759
  funcToString.call(Ctor) == objectCtorString;
17842
17760
  }
17843
17761
 
17844
- var isPlainObject_1 = isPlainObject$3;
17762
+ var isPlainObject_1 = isPlainObject$2;
17845
17763
 
17846
17764
  var baseGetTag = _baseGetTag,
17847
17765
  isLength = isLength_1,
@@ -18308,7 +18226,7 @@ var assignMergeValue$1 = _assignMergeValue,
18308
18226
  isBuffer = isBuffer$2.exports,
18309
18227
  isFunction = isFunction_1,
18310
18228
  isObject$3 = isObject_1,
18311
- isPlainObject$2 = isPlainObject_1,
18229
+ isPlainObject$1 = isPlainObject_1,
18312
18230
  isTypedArray = isTypedArray_1,
18313
18231
  safeGet$1 = _safeGet,
18314
18232
  toPlainObject = toPlainObject_1;
@@ -18368,7 +18286,7 @@ function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, s
18368
18286
  newValue = [];
18369
18287
  }
18370
18288
  }
18371
- else if (isPlainObject$2(srcValue) || isArguments(srcValue)) {
18289
+ else if (isPlainObject$1(srcValue) || isArguments(srcValue)) {
18372
18290
  newValue = objValue;
18373
18291
  if (isArguments(objValue)) {
18374
18292
  newValue = toPlainObject(objValue);
@@ -18604,31 +18522,33 @@ var defaultsDeep = baseRest(function(args) {
18604
18522
 
18605
18523
  var defaultsDeep_1 = defaultsDeep;
18606
18524
 
18607
- function Text(props) {
18608
- return jsxRuntime$1.exports.jsx("p", __assign$1({}, props, { children: props.value || props.children }), void 0);
18525
+ function Text(_a) {
18526
+ var { value } = _a, _b = constants.V_CHILDREN_NAME, children = _a[_b], props = __rest$1(_a, ["value", typeof _b === "symbol" ? _b : _b + ""]);
18527
+ const stock = React.useContext(StockContext);
18528
+ return jsxRuntime$1.exports.jsx("p", Object.assign({}, props, { children: wrapperUtil.generateNewChildren(value || children, stock) }), void 0);
18609
18529
  }
18610
18530
 
18611
18531
  function Button(props) {
18612
18532
  // eslint-disable-next-line react/button-has-type
18613
- return jsxRuntime$1.exports.jsx("button", __assign$1({}, props), void 0);
18533
+ return jsxRuntime$1.exports.jsx("button", Object.assign({}, props), void 0);
18614
18534
  }
18615
18535
 
18616
18536
  function Edit(props) {
18617
- var handleChange = function (event) {
18537
+ const handleChange = (event) => {
18618
18538
  props === null || props === void 0 ? void 0 : props.onChange(event.target.value);
18619
18539
  };
18620
- var fieldErrors = props.fieldErrors, validation = props.validation, value = props.value, label = props.label, origHelpertext = props.helperText; props.onChange; var ownProps = __rest$1(props, ["fieldErrors", "validation", "value", "label", "helperText", "onChange"]);
18621
- var error = !!fieldErrors;
18622
- var helperText = origHelpertext;
18540
+ const { fieldErrors, validation, value, label, helperText: origHelpertext, onChange } = props, ownProps = __rest$1(props, ["fieldErrors", "validation", "value", "label", "helperText", "onChange"]);
18541
+ let error = !!fieldErrors;
18542
+ let helperText = origHelpertext;
18623
18543
  if (error && fieldErrors) {
18624
18544
  helperText = fieldErrors && Array.isArray(fieldErrors) ? fieldErrors.join(', ') : fieldErrors;
18625
18545
  }
18626
18546
  if (validation && value && validation.jsonataDef) {
18627
- var isValid = true;
18547
+ let isValid = true;
18628
18548
  try {
18629
18549
  // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
18630
- var jsonata = require('jsonata');
18631
- var expression = jsonata(validation.jsonataDef);
18550
+ const jsonata = require('jsonata');
18551
+ const expression = jsonata(validation.jsonataDef);
18632
18552
  isValid = expression.evaluate(value);
18633
18553
  }
18634
18554
  catch (err) {
@@ -18641,19 +18561,21 @@ function Edit(props) {
18641
18561
  helperText = validation.fieldErrors && Array.isArray(validation.fieldErrors) ? validation.fieldErrors.join(', ') : validation.fieldErrors;
18642
18562
  }
18643
18563
  }
18644
- return (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx("p", __assign$1({ style: { fontSize: 20, color: error ? 'red' : undefined } }, { children: label }), void 0), jsxRuntime$1.exports.jsx("input", __assign$1({}, ownProps, { value: value || '', onChange: handleChange }), void 0), jsxRuntime$1.exports.jsx("p", __assign$1({ style: { fontSize: 10, color: error ? 'red' : undefined } }, { children: helperText }), void 0)] }, void 0));
18564
+ return (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx("p", Object.assign({ style: { fontSize: 20, color: error ? 'red' : undefined } }, { children: label }), void 0), jsxRuntime$1.exports.jsx("input", Object.assign({}, ownProps, { value: value || '', onChange: handleChange }), void 0), jsxRuntime$1.exports.jsx("p", Object.assign({ style: { fontSize: 10, color: error ? 'red' : undefined } }, { children: helperText }), void 0)] }, void 0));
18645
18565
  }
18646
18566
 
18647
- function View(props) {
18648
- return jsxRuntime$1.exports.jsx("div", __assign$1({}, props, { style: undefined }), void 0);
18567
+ function View(_a) {
18568
+ var _b = constants.V_CHILDREN_NAME, children = _a[_b], props = __rest$1(_a, [typeof _b === "symbol" ? _b : _b + ""]);
18569
+ const stock = React.useContext(StockContext);
18570
+ return jsxRuntime$1.exports.jsx("div", Object.assign({}, props, { children: wrapperUtil.generateNewChildren(children, stock) }), void 0);
18649
18571
  }
18650
18572
 
18651
18573
  function Image(props) {
18652
- var src = props.src;
18653
- return jsxRuntime$1.exports.jsx("img", __assign$1({ alt: "" }, props, { src: src && src.uri ? src.uri : src }), void 0);
18574
+ const { src } = props;
18575
+ return jsxRuntime$1.exports.jsx("img", Object.assign({ alt: "" }, props, { src: src && src.uri ? src.uri : src }), void 0);
18654
18576
  }
18655
18577
 
18656
- var styles = {
18578
+ const styles = {
18657
18579
  label: {
18658
18580
  backgroundColor: '#ffffaa',
18659
18581
  borderColor: '#666666',
@@ -18674,45 +18596,41 @@ var styles = {
18674
18596
  display: 'block',
18675
18597
  },
18676
18598
  };
18677
- var getName = function (props) {
18599
+ const getName = (props) => {
18678
18600
  if (props && props[constants.V_COMP_NAME]) {
18679
18601
  return props[constants.V_COMP_NAME];
18680
18602
  }
18681
18603
  return 'Unknown';
18682
18604
  };
18683
- var getLabel = function (props) { return (jsxRuntime$1.exports.jsx("span", __assign$1({ style: styles.labelCont }, { children: jsxRuntime$1.exports.jsx("span", __assign$1({ style: styles.label }, { children: getName(props) }), void 0) }), void 0)); };
18684
- /** @class */ ((function (_super) {
18685
- __extends(InfoBox, _super);
18686
- function InfoBox(props) {
18687
- var _this = _super.call(this, props) || this;
18688
- _this.counter = 0;
18689
- _this.counter = 1;
18690
- return _this;
18691
- }
18692
- InfoBox.prototype.componentDidMount = function () {
18605
+ const getLabel = (props) => (jsxRuntime$1.exports.jsx("span", Object.assign({ style: styles.labelCont }, { children: jsxRuntime$1.exports.jsx("span", Object.assign({ style: styles.label }, { children: getName(props) }), void 0) }), void 0));
18606
+ class InfoBox extends React__default["default"].PureComponent {
18607
+ constructor(props) {
18608
+ super(props);
18609
+ this.counter = 0;
18610
+ this.counter = 1;
18611
+ }
18612
+ componentDidMount() {
18693
18613
  this.counter += 1;
18694
- };
18695
- InfoBox.prototype.componentDidUpdate = function () {
18614
+ }
18615
+ componentDidUpdate() {
18696
18616
  this.counter += 1;
18697
- };
18698
- InfoBox.prototype.render = function () {
18699
- var id = this.props.id;
18700
- var filter = this.props.filter;
18701
- var component = this.props[constants.V_COMP_NAME];
18617
+ }
18618
+ render() {
18619
+ const { id } = this.props;
18620
+ const { filter } = this.props;
18621
+ const component = this.props[constants.V_COMP_NAME];
18702
18622
  if (!component || component === '_PrimitiveProp') {
18703
18623
  return null;
18704
18624
  }
18705
18625
  if (filter && Array.isArray(filter) && Object.keys(filter).length !== 0 && !filter.includes(id)) {
18706
18626
  return null;
18707
18627
  }
18708
- // const { children, stock, parentComp, ...newProps } = this.props
18709
- return (jsxRuntime$1.exports.jsx("span", __assign$1({ style: styles.labelCont }, { children: jsxRuntime$1.exports.jsxs("span", __assign$1({ style: styles.label }, { children: ["rendered: ", this.counter] }), void 0) }), void 0));
18710
- };
18711
- return InfoBox;
18712
- })(React__default["default"].PureComponent));
18628
+ return (jsxRuntime$1.exports.jsx("span", Object.assign({ style: styles.labelCont }, { children: jsxRuntime$1.exports.jsxs("span", Object.assign({ style: styles.label }, { children: ["rendered: ", this.counter] }), void 0) }), void 0));
18629
+ }
18630
+ }
18713
18631
 
18714
18632
  function Undefined(props) {
18715
- return (jsxRuntime$1.exports.jsx("p", __assign$1({ style: {
18633
+ return (jsxRuntime$1.exports.jsx("p", Object.assign({ style: {
18716
18634
  flex: 1,
18717
18635
  minWidth: 100,
18718
18636
  minHeight: 20,
@@ -18722,34 +18640,34 @@ function Undefined(props) {
18722
18640
  } }, { children: getLabel(props) }), void 0));
18723
18641
  }
18724
18642
 
18725
- function PrimitiveProp(_a) {
18726
- var children = _a.children;
18643
+ function PrimitiveProp({ [constants.V_CHILDREN_NAME]: children }) {
18727
18644
  return jsxRuntime$1.exports.jsx("span", { children: !constants.SIMPLE_DATA_TYPES.includes(typeof children) || typeof children === 'boolean' ? JSON.stringify(children) : children }, void 0);
18728
18645
  }
18729
18646
 
18730
- var Fragment = function (_a) {
18731
- var children = _a.children;
18732
- return children;
18647
+ const Fragment = (_a) => {
18648
+ var _b = constants.V_CHILDREN_NAME, props = _a[_b]; __rest$1(_a, [typeof _b === "symbol" ? _b : _b + ""]);
18649
+ const stock = React.useContext(StockContext);
18650
+ return jsxRuntime$1.exports.jsx(jsxRuntime$1.exports.Fragment, { children: wrapperUtil.generateNewChildren(props, stock) }, void 0);
18733
18651
  };
18734
18652
 
18735
- var Components = {
18736
- View: View,
18653
+ const Components = {
18654
+ View,
18737
18655
  _PrimitiveProp: PrimitiveProp,
18738
18656
  _Undefined: Undefined,
18739
- Fragment: Fragment,
18740
- Image: Image,
18741
- Text: Text,
18742
- Button: Button,
18743
- Edit: Edit,
18657
+ Fragment,
18658
+ Image,
18659
+ Text,
18660
+ Button,
18661
+ Edit,
18744
18662
  };
18745
18663
 
18746
18664
  // eslint-disable-next-line import/prefer-default-export
18747
- var getStock = function (stockInit, model, Wrapper, reduxStore) {
18748
- var stock = new Stock(defaultsDeep_1(stockInit, {
18665
+ const getStock = (stockInit, model, Wrapper, reduxStore) => {
18666
+ const stock = new Stock(defaultsDeep_1(stockInit, {
18749
18667
  components: Components,
18750
- functions: functions,
18668
+ functions,
18751
18669
  }), Wrapper, reduxStore);
18752
- var i18n = new I18n({
18670
+ const i18n = new I18n({
18753
18671
  language: (navigator.languages && navigator.languages[0]) || // Chrome / Firefox
18754
18672
  navigator.language || // All browsers
18755
18673
  navigator.userLanguage,
@@ -18757,18 +18675,18 @@ var getStock = function (stockInit, model, Wrapper, reduxStore) {
18757
18675
  });
18758
18676
  // get Validations
18759
18677
  stock.validations = util$1.collectObjToArray(constants.REF_VALIDATES, model);
18760
- stock.registerFunction('t', function (p) { return i18n.t(p.keys, p.options); });
18761
- stock.registerFunction('test', function () { return 'Test is ok'; });
18678
+ stock.registerFunction('t', (p) => i18n.t(p.keys, p.options));
18679
+ stock.registerFunction('test', () => 'Test is ok');
18762
18680
  return stock;
18763
18681
  };
18764
- var stock = {
18682
+ const stock = {
18765
18683
  components: Components,
18766
- functions: functions,
18684
+ functions,
18767
18685
  };
18768
18686
 
18769
18687
  var propTypes = {exports: {}};
18770
18688
 
18771
- var reactIs$3 = {exports: {}};
18689
+ var reactIs$2 = {exports: {}};
18772
18690
 
18773
18691
  var reactIs_production_min$2 = {};
18774
18692
 
@@ -18969,9 +18887,9 @@ reactIs_development$2.typeOf = typeOf;
18969
18887
  }
18970
18888
 
18971
18889
  if (process.env.NODE_ENV === 'production') {
18972
- reactIs$3.exports = reactIs_production_min$2;
18890
+ reactIs$2.exports = reactIs_production_min$2;
18973
18891
  } else {
18974
- reactIs$3.exports = reactIs_development$2;
18892
+ reactIs$2.exports = reactIs_development$2;
18975
18893
  }
18976
18894
 
18977
18895
  /**
@@ -19096,7 +19014,7 @@ var checkPropTypes_1 = checkPropTypes$1;
19096
19014
  * LICENSE file in the root directory of this source tree.
19097
19015
  */
19098
19016
 
19099
- var ReactIs$1 = reactIs$3.exports;
19017
+ var ReactIs$1 = reactIs$2.exports;
19100
19018
  var assign$1 = objectAssign$1;
19101
19019
 
19102
19020
  var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
@@ -19768,7 +19686,7 @@ var factoryWithThrowingShims = function() {
19768
19686
  */
19769
19687
 
19770
19688
  if (process.env.NODE_ENV !== 'production') {
19771
- var ReactIs = reactIs$3.exports;
19689
+ var ReactIs = reactIs$2.exports;
19772
19690
 
19773
19691
  // By explicitly using `prop-types` you are opting into new development behavior.
19774
19692
  // http://fb.me/prop-types-in-prod
@@ -19985,40 +19903,7 @@ if (process.env.NODE_ENV !== 'production') {
19985
19903
  };
19986
19904
  }
19987
19905
 
19988
- function _extends() {
19989
- _extends = Object.assign || function (target) {
19990
- for (var i = 1; i < arguments.length; i++) {
19991
- var source = arguments[i];
19992
-
19993
- for (var key in source) {
19994
- if (Object.prototype.hasOwnProperty.call(source, key)) {
19995
- target[key] = source[key];
19996
- }
19997
- }
19998
- }
19999
-
20000
- return target;
20001
- };
20002
-
20003
- return _extends.apply(this, arguments);
20004
- }
20005
-
20006
- function _objectWithoutPropertiesLoose$1(source, excluded) {
20007
- if (source == null) return {};
20008
- var target = {};
20009
- var sourceKeys = Object.keys(source);
20010
- var key, i;
20011
-
20012
- for (i = 0; i < sourceKeys.length; i++) {
20013
- key = sourceKeys[i];
20014
- if (excluded.indexOf(key) >= 0) continue;
20015
- target[key] = source[key];
20016
- }
20017
-
20018
- return target;
20019
- }
20020
-
20021
- var reactIs$2 = {exports: {}};
19906
+ var reactIs$1 = {exports: {}};
20022
19907
 
20023
19908
  var reactIs_production_min$1 = {};
20024
19909
 
@@ -20219,39 +20104,12 @@ reactIs_development$1.typeOf = typeOf;
20219
20104
  }
20220
20105
 
20221
20106
  if (process.env.NODE_ENV === 'production') {
20222
- reactIs$2.exports = reactIs_production_min$1;
20107
+ reactIs$1.exports = reactIs_production_min$1;
20223
20108
  } else {
20224
- reactIs$2.exports = reactIs_development$1;
20109
+ reactIs$1.exports = reactIs_development$1;
20225
20110
  }
20226
20111
 
20227
- var reactIs$1 = reactIs$2.exports;
20228
-
20229
- /**
20230
- * Copyright 2015, Yahoo! Inc.
20231
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
20232
- */
20233
- var REACT_STATICS = {
20234
- childContextTypes: true,
20235
- contextType: true,
20236
- contextTypes: true,
20237
- defaultProps: true,
20238
- displayName: true,
20239
- getDefaultProps: true,
20240
- getDerivedStateFromError: true,
20241
- getDerivedStateFromProps: true,
20242
- mixins: true,
20243
- propTypes: true,
20244
- type: true
20245
- };
20246
- var KNOWN_STATICS = {
20247
- name: true,
20248
- length: true,
20249
- prototype: true,
20250
- caller: true,
20251
- callee: true,
20252
- arguments: true,
20253
- arity: true
20254
- };
20112
+ var reactIs = reactIs$1.exports;
20255
20113
  var FORWARD_REF_STATICS = {
20256
20114
  '$$typeof': true,
20257
20115
  render: true,
@@ -20268,65 +20126,8 @@ var MEMO_STATICS = {
20268
20126
  type: true
20269
20127
  };
20270
20128
  var TYPE_STATICS = {};
20271
- TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
20272
- TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
20273
-
20274
- function getStatics(component) {
20275
- // React v16.11 and below
20276
- if (reactIs$1.isMemo(component)) {
20277
- return MEMO_STATICS;
20278
- } // React v16.12 and above
20279
-
20280
-
20281
- return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
20282
- }
20283
-
20284
- var defineProperty = Object.defineProperty;
20285
- var getOwnPropertyNames = Object.getOwnPropertyNames;
20286
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
20287
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
20288
- var getPrototypeOf = Object.getPrototypeOf;
20289
- var objectPrototype = Object.prototype;
20290
- function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
20291
- if (typeof sourceComponent !== 'string') {
20292
- // don't hoist over string (html) components
20293
- if (objectPrototype) {
20294
- var inheritedComponent = getPrototypeOf(sourceComponent);
20295
-
20296
- if (inheritedComponent && inheritedComponent !== objectPrototype) {
20297
- hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
20298
- }
20299
- }
20300
-
20301
- var keys = getOwnPropertyNames(sourceComponent);
20302
-
20303
- if (getOwnPropertySymbols) {
20304
- keys = keys.concat(getOwnPropertySymbols(sourceComponent));
20305
- }
20306
-
20307
- var targetStatics = getStatics(targetComponent);
20308
- var sourceStatics = getStatics(sourceComponent);
20309
-
20310
- for (var i = 0; i < keys.length; ++i) {
20311
- var key = keys[i];
20312
-
20313
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
20314
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
20315
-
20316
- try {
20317
- // Avoid failures from read-only properties
20318
- defineProperty(targetComponent, key, descriptor);
20319
- } catch (e) {}
20320
- }
20321
- }
20322
- }
20323
-
20324
- return targetComponent;
20325
- }
20326
-
20327
- var hoistNonReactStatics_cjs = hoistNonReactStatics;
20328
-
20329
- var reactIs = {exports: {}};
20129
+ TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
20130
+ TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
20330
20131
 
20331
20132
  var reactIs_production_min = {};
20332
20133
 
@@ -20568,400 +20369,26 @@ reactIs_development.typeOf = typeOf;
20568
20369
  })();
20569
20370
  }
20570
20371
 
20571
- if (process.env.NODE_ENV === 'production') {
20572
- reactIs.exports = reactIs_production_min;
20573
- } else {
20574
- reactIs.exports = reactIs_development;
20575
- }
20576
-
20577
- var _excluded$2 = ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"],
20578
- _excluded2 = ["reactReduxForwardedRef"];
20579
-
20580
- var EMPTY_ARRAY = [];
20581
- var NO_SUBSCRIPTION_ARRAY = [null, null];
20372
+ if (process.env.NODE_ENV === 'production') ;
20582
20373
 
20583
- var stringifyComponent = function stringifyComponent(Comp) {
20584
- try {
20585
- return JSON.stringify(Comp);
20586
- } catch (err) {
20587
- return String(Comp);
20374
+ function is(x, y) {
20375
+ if (x === y) {
20376
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
20377
+ } else {
20378
+ return x !== x && y !== y;
20588
20379
  }
20589
- };
20590
-
20591
- function storeStateUpdatesReducer(state, action) {
20592
- var updateCount = state[1];
20593
- return [action.payload, updateCount + 1];
20594
- }
20595
-
20596
- function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
20597
- useIsomorphicLayoutEffect(function () {
20598
- return effectFunc.apply(void 0, effectArgs);
20599
- }, dependencies);
20600
20380
  }
20601
20381
 
20602
- function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {
20603
- // We want to capture the wrapper props and child props we used for later comparisons
20604
- lastWrapperProps.current = wrapperProps;
20605
- lastChildProps.current = actualChildProps;
20606
- renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
20382
+ function shallowEqual(objA, objB) {
20383
+ if (is(objA, objB)) return true;
20607
20384
 
20608
- if (childPropsFromStoreUpdate.current) {
20609
- childPropsFromStoreUpdate.current = null;
20610
- notifyNestedSubs();
20385
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
20386
+ return false;
20611
20387
  }
20612
- }
20613
-
20614
- function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {
20615
- // If we're not subscribed to the store, nothing to do here
20616
- if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts
20617
20388
 
20618
- var didUnsubscribe = false;
20619
- var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
20620
-
20621
- var checkForUpdates = function checkForUpdates() {
20622
- if (didUnsubscribe) {
20623
- // Don't run stale listeners.
20624
- // Redux doesn't guarantee unsubscriptions happen until next dispatch.
20625
- return;
20626
- }
20627
-
20628
- var latestStoreState = store.getState();
20629
- var newChildProps, error;
20630
-
20631
- try {
20632
- // Actually run the selector with the most recent store state and wrapper props
20633
- // to determine what the child props should be
20634
- newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
20635
- } catch (e) {
20636
- error = e;
20637
- lastThrownError = e;
20638
- }
20639
-
20640
- if (!error) {
20641
- lastThrownError = null;
20642
- } // If the child props haven't changed, nothing to do here - cascade the subscription update
20643
-
20644
-
20645
- if (newChildProps === lastChildProps.current) {
20646
- if (!renderIsScheduled.current) {
20647
- notifyNestedSubs();
20648
- }
20649
- } else {
20650
- // Save references to the new child props. Note that we track the "child props from store update"
20651
- // as a ref instead of a useState/useReducer because we need a way to determine if that value has
20652
- // been processed. If this went into useState/useReducer, we couldn't clear out the value without
20653
- // forcing another re-render, which we don't want.
20654
- lastChildProps.current = newChildProps;
20655
- childPropsFromStoreUpdate.current = newChildProps;
20656
- renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render
20657
-
20658
- forceComponentUpdateDispatch({
20659
- type: 'STORE_UPDATED',
20660
- payload: {
20661
- error: error
20662
- }
20663
- });
20664
- }
20665
- }; // Actually subscribe to the nearest connected ancestor (or store)
20666
-
20667
-
20668
- subscription.onStateChange = checkForUpdates;
20669
- subscription.trySubscribe(); // Pull data from the store after first render in case the store has
20670
- // changed since we began.
20671
-
20672
- checkForUpdates();
20673
-
20674
- var unsubscribeWrapper = function unsubscribeWrapper() {
20675
- didUnsubscribe = true;
20676
- subscription.tryUnsubscribe();
20677
- subscription.onStateChange = null;
20678
-
20679
- if (lastThrownError) {
20680
- // It's possible that we caught an error due to a bad mapState function, but the
20681
- // parent re-rendered without this component and we're about to unmount.
20682
- // This shouldn't happen as long as we do top-down subscriptions correctly, but
20683
- // if we ever do those wrong, this throw will surface the error in our tests.
20684
- // In that case, throw the error from here so it doesn't get lost.
20685
- throw lastThrownError;
20686
- }
20687
- };
20688
-
20689
- return unsubscribeWrapper;
20690
- }
20691
-
20692
- var initStateUpdates = function initStateUpdates() {
20693
- return [null, 0];
20694
- };
20695
-
20696
- function connectAdvanced(
20697
- /*
20698
- selectorFactory is a func that is responsible for returning the selector function used to
20699
- compute new props from state, props, and dispatch. For example:
20700
- export default connectAdvanced((dispatch, options) => (state, props) => ({
20701
- thing: state.things[props.thingId],
20702
- saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
20703
- }))(YourComponent)
20704
- Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
20705
- outside of their selector as an optimization. Options passed to connectAdvanced are passed to
20706
- the selectorFactory, along with displayName and WrappedComponent, as the second argument.
20707
- Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
20708
- props. Do not use connectAdvanced directly without memoizing results between calls to your
20709
- selector, otherwise the Connect component will re-render on every state or props change.
20710
- */
20711
- selectorFactory, // options object:
20712
- _ref) {
20713
- if (_ref === void 0) {
20714
- _ref = {};
20715
- }
20716
-
20717
- var _ref2 = _ref,
20718
- _ref2$getDisplayName = _ref2.getDisplayName,
20719
- getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
20720
- return "ConnectAdvanced(" + name + ")";
20721
- } : _ref2$getDisplayName,
20722
- _ref2$methodName = _ref2.methodName,
20723
- methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
20724
- _ref2$renderCountProp = _ref2.renderCountProp,
20725
- renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
20726
- _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
20727
- shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
20728
- _ref2$storeKey = _ref2.storeKey,
20729
- storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
20730
- _ref2$withRef = _ref2.withRef,
20731
- withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
20732
- _ref2$forwardRef = _ref2.forwardRef,
20733
- forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,
20734
- _ref2$context = _ref2.context,
20735
- context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,
20736
- connectOptions = _objectWithoutPropertiesLoose$1(_ref2, _excluded$2);
20737
-
20738
- if (process.env.NODE_ENV !== 'production') {
20739
- if (renderCountProp !== undefined) {
20740
- throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");
20741
- }
20742
-
20743
- if (withRef) {
20744
- throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');
20745
- }
20746
-
20747
- var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + "React.createContext(), and pass the context object to React Redux's Provider and specific components" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';
20748
-
20749
- if (storeKey !== 'store') {
20750
- throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);
20751
- }
20752
- }
20753
-
20754
- var Context = context;
20755
- return function wrapWithConnect(WrappedComponent) {
20756
- if (process.env.NODE_ENV !== 'production' && !reactIs.exports.isValidElementType(WrappedComponent)) {
20757
- throw new Error("You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent)));
20758
- }
20759
-
20760
- var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
20761
- var displayName = getDisplayName(wrappedComponentName);
20762
-
20763
- var selectorFactoryOptions = _extends({}, connectOptions, {
20764
- getDisplayName: getDisplayName,
20765
- methodName: methodName,
20766
- renderCountProp: renderCountProp,
20767
- shouldHandleStateChanges: shouldHandleStateChanges,
20768
- storeKey: storeKey,
20769
- displayName: displayName,
20770
- wrappedComponentName: wrappedComponentName,
20771
- WrappedComponent: WrappedComponent
20772
- });
20773
-
20774
- var pure = connectOptions.pure;
20775
-
20776
- function createChildSelector(store) {
20777
- return selectorFactory(store.dispatch, selectorFactoryOptions);
20778
- } // If we aren't running in "pure" mode, we don't want to memoize values.
20779
- // To avoid conditionally calling hooks, we fall back to a tiny wrapper
20780
- // that just executes the given callback immediately.
20781
-
20782
-
20783
- var usePureOnlyMemo = pure ? React.useMemo : function (callback) {
20784
- return callback();
20785
- };
20786
-
20787
- function ConnectFunction(props) {
20788
- var _useMemo = React.useMemo(function () {
20789
- // Distinguish between actual "data" props that were passed to the wrapper component,
20790
- // and values needed to control behavior (forwarded refs, alternate context instances).
20791
- // To maintain the wrapperProps object reference, memoize this destructuring.
20792
- var reactReduxForwardedRef = props.reactReduxForwardedRef,
20793
- wrapperProps = _objectWithoutPropertiesLoose$1(props, _excluded2);
20794
-
20795
- return [props.context, reactReduxForwardedRef, wrapperProps];
20796
- }, [props]),
20797
- propsContext = _useMemo[0],
20798
- reactReduxForwardedRef = _useMemo[1],
20799
- wrapperProps = _useMemo[2];
20800
-
20801
- var ContextToUse = React.useMemo(function () {
20802
- // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
20803
- // Memoize the check that determines which context instance we should use.
20804
- return propsContext && propsContext.Consumer && reactIs.exports.isContextConsumer( /*#__PURE__*/React__default["default"].createElement(propsContext.Consumer, null)) ? propsContext : Context;
20805
- }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
20806
-
20807
- var contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
20808
- // We'll check to see if it _looks_ like a Redux store first.
20809
- // This allows us to pass through a `store` prop that is just a plain value.
20810
-
20811
- var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
20812
- var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
20813
-
20814
- if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {
20815
- throw new Error("Could not find \"store\" in the context of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + "or pass a custom React context provider to <Provider> and the corresponding " + ("React context consumer to " + displayName + " in connect options."));
20816
- } // Based on the previous check, one of these must be true
20817
-
20818
-
20819
- var store = didStoreComeFromProps ? props.store : contextValue.store;
20820
- var childPropsSelector = React.useMemo(function () {
20821
- // The child props selector needs the store reference as an input.
20822
- // Re-create this selector whenever the store changes.
20823
- return createChildSelector(store);
20824
- }, [store]);
20825
-
20826
- var _useMemo2 = React.useMemo(function () {
20827
- if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
20828
- // connected to the store via props shouldn't use subscription from context, or vice versa.
20829
-
20830
- // This Subscription's source should match where store came from: props vs. context. A component
20831
- // connected to the store via props shouldn't use subscription from context, or vice versa.
20832
- var subscription = createSubscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
20833
- // the middle of the notification loop, where `subscription` will then be null. This can
20834
- // probably be avoided if Subscription's listeners logic is changed to not call listeners
20835
- // that have been unsubscribed in the middle of the notification loop.
20836
-
20837
- // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
20838
- // the middle of the notification loop, where `subscription` will then be null. This can
20839
- // probably be avoided if Subscription's listeners logic is changed to not call listeners
20840
- // that have been unsubscribed in the middle of the notification loop.
20841
- var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
20842
- return [subscription, notifyNestedSubs];
20843
- }, [store, didStoreComeFromProps, contextValue]),
20844
- subscription = _useMemo2[0],
20845
- notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,
20846
- // and memoize that value to avoid unnecessary context updates.
20847
-
20848
-
20849
- var overriddenContextValue = React.useMemo(function () {
20850
- if (didStoreComeFromProps) {
20851
- // This component is directly subscribed to a store from props.
20852
- // We don't want descendants reading from this store - pass down whatever
20853
- // the existing context value is from the nearest connected ancestor.
20854
- return contextValue;
20855
- } // Otherwise, put this component's subscription instance into context, so that
20856
- // connected descendants won't update until after this component is done
20857
-
20858
-
20859
- return _extends({}, contextValue, {
20860
- subscription: subscription
20861
- });
20862
- }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update
20863
- // causes a change to the calculated child component props (or we caught an error in mapState)
20864
-
20865
- var _useReducer = React.useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),
20866
- _useReducer$ = _useReducer[0],
20867
- previousStateUpdateResult = _useReducer$[0],
20868
- forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards
20869
-
20870
-
20871
- if (previousStateUpdateResult && previousStateUpdateResult.error) {
20872
- throw previousStateUpdateResult.error;
20873
- } // Set up refs to coordinate values between the subscription effect and the render logic
20874
-
20875
-
20876
- var lastChildProps = React.useRef();
20877
- var lastWrapperProps = React.useRef(wrapperProps);
20878
- var childPropsFromStoreUpdate = React.useRef();
20879
- var renderIsScheduled = React.useRef(false);
20880
- var actualChildProps = usePureOnlyMemo(function () {
20881
- // Tricky logic here:
20882
- // - This render may have been triggered by a Redux store update that produced new child props
20883
- // - However, we may have gotten new wrapper props after that
20884
- // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
20885
- // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
20886
- // So, we'll use the child props from store update only if the wrapper props are the same as last time.
20887
- if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
20888
- return childPropsFromStoreUpdate.current;
20889
- } // TODO We're reading the store directly in render() here. Bad idea?
20890
- // This will likely cause Bad Things (TM) to happen in Concurrent Mode.
20891
- // Note that we do this because on renders _not_ caused by store updates, we need the latest store state
20892
- // to determine what the child props should be.
20893
-
20894
-
20895
- return childPropsSelector(store.getState(), wrapperProps);
20896
- }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
20897
- // about useLayoutEffect in SSR, so we try to detect environment and fall back to
20898
- // just useEffect instead to avoid the warning, since neither will run anyway.
20899
-
20900
- useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes
20901
-
20902
- useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.
20903
- // We memoize the elements for the rendered child component as an optimization.
20904
-
20905
- var renderedWrappedComponent = React.useMemo(function () {
20906
- return /*#__PURE__*/React__default["default"].createElement(WrappedComponent, _extends({}, actualChildProps, {
20907
- ref: reactReduxForwardedRef
20908
- }));
20909
- }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
20910
- // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
20911
-
20912
- var renderedChild = React.useMemo(function () {
20913
- if (shouldHandleStateChanges) {
20914
- // If this component is subscribed to store updates, we need to pass its own
20915
- // subscription instance down to our descendants. That means rendering the same
20916
- // Context instance, and putting a different value into the context.
20917
- return /*#__PURE__*/React__default["default"].createElement(ContextToUse.Provider, {
20918
- value: overriddenContextValue
20919
- }, renderedWrappedComponent);
20920
- }
20921
-
20922
- return renderedWrappedComponent;
20923
- }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
20924
- return renderedChild;
20925
- } // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed.
20926
-
20927
-
20928
- var Connect = pure ? React__default["default"].memo(ConnectFunction) : ConnectFunction;
20929
- Connect.WrappedComponent = WrappedComponent;
20930
- Connect.displayName = ConnectFunction.displayName = displayName;
20931
-
20932
- if (forwardRef) {
20933
- var forwarded = React__default["default"].forwardRef(function forwardConnectRef(props, ref) {
20934
- return /*#__PURE__*/React__default["default"].createElement(Connect, _extends({}, props, {
20935
- reactReduxForwardedRef: ref
20936
- }));
20937
- });
20938
- forwarded.displayName = displayName;
20939
- forwarded.WrappedComponent = WrappedComponent;
20940
- return hoistNonReactStatics_cjs(forwarded, WrappedComponent);
20941
- }
20942
-
20943
- return hoistNonReactStatics_cjs(Connect, WrappedComponent);
20944
- };
20945
- }
20946
-
20947
- function is(x, y) {
20948
- if (x === y) {
20949
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
20950
- } else {
20951
- return x !== x && y !== y;
20952
- }
20953
- }
20954
-
20955
- function shallowEqual(objA, objB) {
20956
- if (is(objA, objB)) return true;
20957
-
20958
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
20959
- return false;
20960
- }
20961
-
20962
- var keysA = Object.keys(objA);
20963
- var keysB = Object.keys(objB);
20964
- if (keysA.length !== keysB.length) return false;
20389
+ var keysA = Object.keys(objA);
20390
+ var keysB = Object.keys(objB);
20391
+ if (keysA.length !== keysB.length) return false;
20965
20392
 
20966
20393
  for (var i = 0; i < keysA.length; i++) {
20967
20394
  if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
@@ -20972,395 +20399,6 @@ function shallowEqual(objA, objB) {
20972
20399
  return true;
20973
20400
  }
20974
20401
 
20975
- function bindActionCreators(actionCreators, dispatch) {
20976
- var boundActionCreators = {};
20977
-
20978
- var _loop = function _loop(key) {
20979
- var actionCreator = actionCreators[key];
20980
-
20981
- if (typeof actionCreator === 'function') {
20982
- boundActionCreators[key] = function () {
20983
- return dispatch(actionCreator.apply(void 0, arguments));
20984
- };
20985
- }
20986
- };
20987
-
20988
- for (var key in actionCreators) {
20989
- _loop(key);
20990
- }
20991
-
20992
- return boundActionCreators;
20993
- }
20994
-
20995
- /**
20996
- * @param {any} obj The object to inspect.
20997
- * @returns {boolean} True if the argument appears to be a plain object.
20998
- */
20999
- function isPlainObject$1(obj) {
21000
- if (typeof obj !== 'object' || obj === null) return false;
21001
- var proto = Object.getPrototypeOf(obj);
21002
- if (proto === null) return true;
21003
- var baseProto = proto;
21004
-
21005
- while (Object.getPrototypeOf(baseProto) !== null) {
21006
- baseProto = Object.getPrototypeOf(baseProto);
21007
- }
21008
-
21009
- return proto === baseProto;
21010
- }
21011
-
21012
- /**
21013
- * Prints a warning in the console if it exists.
21014
- *
21015
- * @param {String} message The warning message.
21016
- * @returns {void}
21017
- */
21018
- function warning$1(message) {
21019
- /* eslint-disable no-console */
21020
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
21021
- console.error(message);
21022
- }
21023
- /* eslint-enable no-console */
21024
-
21025
-
21026
- try {
21027
- // This error was thrown as a convenience so that if you enable
21028
- // "break on all exceptions" in your console,
21029
- // it would pause the execution at this line.
21030
- throw new Error(message);
21031
- /* eslint-disable no-empty */
21032
- } catch (e) {}
21033
- /* eslint-enable no-empty */
21034
-
21035
- }
21036
-
21037
- function verifyPlainObject(value, displayName, methodName) {
21038
- if (!isPlainObject$1(value)) {
21039
- warning$1(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
21040
- }
21041
- }
21042
-
21043
- function wrapMapToPropsConstant(getConstant) {
21044
- return function initConstantSelector(dispatch, options) {
21045
- var constant = getConstant(dispatch, options);
21046
-
21047
- function constantSelector() {
21048
- return constant;
21049
- }
21050
-
21051
- constantSelector.dependsOnOwnProps = false;
21052
- return constantSelector;
21053
- };
21054
- } // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
21055
- // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
21056
- // whether mapToProps needs to be invoked when props have changed.
21057
- //
21058
- // A length of one signals that mapToProps does not depend on props from the parent component.
21059
- // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
21060
- // therefore not reporting its length accurately..
21061
-
21062
- function getDependsOnOwnProps(mapToProps) {
21063
- return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
21064
- } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
21065
- // this function wraps mapToProps in a proxy function which does several things:
21066
- //
21067
- // * Detects whether the mapToProps function being called depends on props, which
21068
- // is used by selectorFactory to decide if it should reinvoke on props changes.
21069
- //
21070
- // * On first call, handles mapToProps if returns another function, and treats that
21071
- // new function as the true mapToProps for subsequent calls.
21072
- //
21073
- // * On first call, verifies the first result is a plain object, in order to warn
21074
- // the developer that their mapToProps function is not returning a valid result.
21075
- //
21076
-
21077
- function wrapMapToPropsFunc(mapToProps, methodName) {
21078
- return function initProxySelector(dispatch, _ref) {
21079
- var displayName = _ref.displayName;
21080
-
21081
- var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
21082
- return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
21083
- }; // allow detectFactoryAndVerify to get ownProps
21084
-
21085
-
21086
- proxy.dependsOnOwnProps = true;
21087
-
21088
- proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
21089
- proxy.mapToProps = mapToProps;
21090
- proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
21091
- var props = proxy(stateOrDispatch, ownProps);
21092
-
21093
- if (typeof props === 'function') {
21094
- proxy.mapToProps = props;
21095
- proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
21096
- props = proxy(stateOrDispatch, ownProps);
21097
- }
21098
-
21099
- if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
21100
- return props;
21101
- };
21102
-
21103
- return proxy;
21104
- };
21105
- }
21106
-
21107
- function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
21108
- return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;
21109
- }
21110
- function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
21111
- return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {
21112
- return {
21113
- dispatch: dispatch
21114
- };
21115
- }) : undefined;
21116
- }
21117
- function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
21118
- return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {
21119
- return bindActionCreators(mapDispatchToProps, dispatch);
21120
- }) : undefined;
21121
- }
21122
- var defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
21123
-
21124
- function whenMapStateToPropsIsFunction(mapStateToProps) {
21125
- return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;
21126
- }
21127
- function whenMapStateToPropsIsMissing(mapStateToProps) {
21128
- return !mapStateToProps ? wrapMapToPropsConstant(function () {
21129
- return {};
21130
- }) : undefined;
21131
- }
21132
- var defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
21133
-
21134
- function defaultMergeProps(stateProps, dispatchProps, ownProps) {
21135
- return _extends({}, ownProps, stateProps, dispatchProps);
21136
- }
21137
- function wrapMergePropsFunc(mergeProps) {
21138
- return function initMergePropsProxy(dispatch, _ref) {
21139
- var displayName = _ref.displayName,
21140
- pure = _ref.pure,
21141
- areMergedPropsEqual = _ref.areMergedPropsEqual;
21142
- var hasRunOnce = false;
21143
- var mergedProps;
21144
- return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
21145
- var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
21146
-
21147
- if (hasRunOnce) {
21148
- if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
21149
- } else {
21150
- hasRunOnce = true;
21151
- mergedProps = nextMergedProps;
21152
- if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
21153
- }
21154
-
21155
- return mergedProps;
21156
- };
21157
- };
21158
- }
21159
- function whenMergePropsIsFunction(mergeProps) {
21160
- return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
21161
- }
21162
- function whenMergePropsIsOmitted(mergeProps) {
21163
- return !mergeProps ? function () {
21164
- return defaultMergeProps;
21165
- } : undefined;
21166
- }
21167
- var defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
21168
-
21169
- function verify(selector, methodName, displayName) {
21170
- if (!selector) {
21171
- throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
21172
- } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
21173
- if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
21174
- warning$1("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
21175
- }
21176
- }
21177
- }
21178
-
21179
- function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
21180
- verify(mapStateToProps, 'mapStateToProps', displayName);
21181
- verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
21182
- verify(mergeProps, 'mergeProps', displayName);
21183
- }
21184
-
21185
- var _excluded$1 = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
21186
- function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
21187
- return function impureFinalPropsSelector(state, ownProps) {
21188
- return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
21189
- };
21190
- }
21191
- function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
21192
- var areStatesEqual = _ref.areStatesEqual,
21193
- areOwnPropsEqual = _ref.areOwnPropsEqual,
21194
- areStatePropsEqual = _ref.areStatePropsEqual;
21195
- var hasRunAtLeastOnce = false;
21196
- var state;
21197
- var ownProps;
21198
- var stateProps;
21199
- var dispatchProps;
21200
- var mergedProps;
21201
-
21202
- function handleFirstCall(firstState, firstOwnProps) {
21203
- state = firstState;
21204
- ownProps = firstOwnProps;
21205
- stateProps = mapStateToProps(state, ownProps);
21206
- dispatchProps = mapDispatchToProps(dispatch, ownProps);
21207
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
21208
- hasRunAtLeastOnce = true;
21209
- return mergedProps;
21210
- }
21211
-
21212
- function handleNewPropsAndNewState() {
21213
- stateProps = mapStateToProps(state, ownProps);
21214
- if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
21215
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
21216
- return mergedProps;
21217
- }
21218
-
21219
- function handleNewProps() {
21220
- if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
21221
- if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
21222
- mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
21223
- return mergedProps;
21224
- }
21225
-
21226
- function handleNewState() {
21227
- var nextStateProps = mapStateToProps(state, ownProps);
21228
- var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
21229
- stateProps = nextStateProps;
21230
- if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
21231
- return mergedProps;
21232
- }
21233
-
21234
- function handleSubsequentCalls(nextState, nextOwnProps) {
21235
- var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
21236
- var stateChanged = !areStatesEqual(nextState, state);
21237
- state = nextState;
21238
- ownProps = nextOwnProps;
21239
- if (propsChanged && stateChanged) return handleNewPropsAndNewState();
21240
- if (propsChanged) return handleNewProps();
21241
- if (stateChanged) return handleNewState();
21242
- return mergedProps;
21243
- }
21244
-
21245
- return function pureFinalPropsSelector(nextState, nextOwnProps) {
21246
- return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
21247
- };
21248
- } // TODO: Add more comments
21249
- // If pure is true, the selector returned by selectorFactory will memoize its results,
21250
- // allowing connectAdvanced's shouldComponentUpdate to return false if final
21251
- // props have not changed. If false, the selector will always return a new
21252
- // object and shouldComponentUpdate will always return true.
21253
-
21254
- function finalPropsSelectorFactory(dispatch, _ref2) {
21255
- var initMapStateToProps = _ref2.initMapStateToProps,
21256
- initMapDispatchToProps = _ref2.initMapDispatchToProps,
21257
- initMergeProps = _ref2.initMergeProps,
21258
- options = _objectWithoutPropertiesLoose$1(_ref2, _excluded$1);
21259
-
21260
- var mapStateToProps = initMapStateToProps(dispatch, options);
21261
- var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
21262
- var mergeProps = initMergeProps(dispatch, options);
21263
-
21264
- if (process.env.NODE_ENV !== 'production') {
21265
- verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
21266
- }
21267
-
21268
- var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
21269
- return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
21270
- }
21271
-
21272
- var _excluded = ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"];
21273
- /*
21274
- connect is a facade over connectAdvanced. It turns its args into a compatible
21275
- selectorFactory, which has the signature:
21276
-
21277
- (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
21278
-
21279
- connect passes its args to connectAdvanced as options, which will in turn pass them to
21280
- selectorFactory each time a Connect component instance is instantiated or hot reloaded.
21281
-
21282
- selectorFactory returns a final props selector from its mapStateToProps,
21283
- mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
21284
- mergePropsFactories, and pure args.
21285
-
21286
- The resulting final props selector is called by the Connect component instance whenever
21287
- it receives new props or store state.
21288
- */
21289
-
21290
- function match$1(arg, factories, name) {
21291
- for (var i = factories.length - 1; i >= 0; i--) {
21292
- var result = factories[i](arg);
21293
- if (result) return result;
21294
- }
21295
-
21296
- return function (dispatch, options) {
21297
- throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
21298
- };
21299
- }
21300
-
21301
- function strictEqual(a, b) {
21302
- return a === b;
21303
- } // createConnect with default args builds the 'official' connect behavior. Calling it with
21304
- // different options opens up some testing and extensibility scenarios
21305
-
21306
-
21307
- function createConnect(_temp) {
21308
- var _ref = _temp === void 0 ? {} : _temp,
21309
- _ref$connectHOC = _ref.connectHOC,
21310
- connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,
21311
- _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
21312
- mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,
21313
- _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
21314
- mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,
21315
- _ref$mergePropsFactor = _ref.mergePropsFactories,
21316
- mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,
21317
- _ref$selectorFactory = _ref.selectorFactory,
21318
- selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;
21319
-
21320
- return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
21321
- if (_ref2 === void 0) {
21322
- _ref2 = {};
21323
- }
21324
-
21325
- var _ref3 = _ref2,
21326
- _ref3$pure = _ref3.pure,
21327
- pure = _ref3$pure === void 0 ? true : _ref3$pure,
21328
- _ref3$areStatesEqual = _ref3.areStatesEqual,
21329
- areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
21330
- _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
21331
- areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,
21332
- _ref3$areStatePropsEq = _ref3.areStatePropsEqual,
21333
- areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,
21334
- _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
21335
- areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,
21336
- extraOptions = _objectWithoutPropertiesLoose$1(_ref3, _excluded);
21337
-
21338
- var initMapStateToProps = match$1(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
21339
- var initMapDispatchToProps = match$1(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
21340
- var initMergeProps = match$1(mergeProps, mergePropsFactories, 'mergeProps');
21341
- return connectHOC(selectorFactory, _extends({
21342
- // used in error messages
21343
- methodName: 'connect',
21344
- // used to compute Connect's displayName from the wrapped component's displayName.
21345
- getDisplayName: function getDisplayName(name) {
21346
- return "Connect(" + name + ")";
21347
- },
21348
- // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
21349
- shouldHandleStateChanges: Boolean(mapStateToProps),
21350
- // passed through to selectorFactory
21351
- initMapStateToProps: initMapStateToProps,
21352
- initMapDispatchToProps: initMapDispatchToProps,
21353
- initMergeProps: initMergeProps,
21354
- pure: pure,
21355
- areStatesEqual: areStatesEqual,
21356
- areOwnPropsEqual: areOwnPropsEqual,
21357
- areStatePropsEqual: areStatePropsEqual,
21358
- areMergedPropsEqual: areMergedPropsEqual
21359
- }, extraOptions));
21360
- };
21361
- }
21362
- var connect = /*#__PURE__*/createConnect();
21363
-
21364
20402
  /**
21365
20403
  * A hook to access the value of the `ReactReduxContext`. This is a low-level
21366
20404
  * hook that you should usually not need to call directly.
@@ -21428,6 +20466,201 @@ function createStoreHook(context) {
21428
20466
 
21429
20467
  var useStore = /*#__PURE__*/createStoreHook();
21430
20468
 
20469
+ /**
20470
+ * Hook factory, which creates a `useDispatch` hook bound to a given context.
20471
+ *
20472
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
20473
+ * @returns {Function} A `useDispatch` hook bound to the specified context.
20474
+ */
20475
+
20476
+ function createDispatchHook(context) {
20477
+ if (context === void 0) {
20478
+ context = ReactReduxContext;
20479
+ }
20480
+
20481
+ var useStore$1 = context === ReactReduxContext ? useStore : createStoreHook(context);
20482
+ return function useDispatch() {
20483
+ var store = useStore$1();
20484
+ return store.dispatch;
20485
+ };
20486
+ }
20487
+ /**
20488
+ * A hook to access the redux `dispatch` function.
20489
+ *
20490
+ * @returns {any|function} redux store's `dispatch` function
20491
+ *
20492
+ * @example
20493
+ *
20494
+ * import React, { useCallback } from 'react'
20495
+ * import { useDispatch } from 'react-redux'
20496
+ *
20497
+ * export const CounterComponent = ({ value }) => {
20498
+ * const dispatch = useDispatch()
20499
+ * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
20500
+ * return (
20501
+ * <div>
20502
+ * <span>{value}</span>
20503
+ * <button onClick={increaseCounter}>Increase counter</button>
20504
+ * </div>
20505
+ * )
20506
+ * }
20507
+ */
20508
+
20509
+ var useDispatch = /*#__PURE__*/createDispatchHook();
20510
+
20511
+ var refEquality = function refEquality(a, b) {
20512
+ return a === b;
20513
+ };
20514
+
20515
+ function useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {
20516
+ var _useReducer = React.useReducer(function (s) {
20517
+ return s + 1;
20518
+ }, 0),
20519
+ forceRender = _useReducer[1];
20520
+
20521
+ var subscription = React.useMemo(function () {
20522
+ return createSubscription(store, contextSub);
20523
+ }, [store, contextSub]);
20524
+ var latestSubscriptionCallbackError = React.useRef();
20525
+ var latestSelector = React.useRef();
20526
+ var latestStoreState = React.useRef();
20527
+ var latestSelectedState = React.useRef();
20528
+ var storeState = store.getState();
20529
+ var selectedState;
20530
+
20531
+ try {
20532
+ if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {
20533
+ var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references
20534
+
20535
+ if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {
20536
+ selectedState = newSelectedState;
20537
+ } else {
20538
+ selectedState = latestSelectedState.current;
20539
+ }
20540
+ } else {
20541
+ selectedState = latestSelectedState.current;
20542
+ }
20543
+ } catch (err) {
20544
+ if (latestSubscriptionCallbackError.current) {
20545
+ err.message += "\nThe error may be correlated with this previous error:\n" + latestSubscriptionCallbackError.current.stack + "\n\n";
20546
+ }
20547
+
20548
+ throw err;
20549
+ }
20550
+
20551
+ useIsomorphicLayoutEffect(function () {
20552
+ latestSelector.current = selector;
20553
+ latestStoreState.current = storeState;
20554
+ latestSelectedState.current = selectedState;
20555
+ latestSubscriptionCallbackError.current = undefined;
20556
+ });
20557
+ useIsomorphicLayoutEffect(function () {
20558
+ function checkForUpdates() {
20559
+ try {
20560
+ var newStoreState = store.getState(); // Avoid calling selector multiple times if the store's state has not changed
20561
+
20562
+ if (newStoreState === latestStoreState.current) {
20563
+ return;
20564
+ }
20565
+
20566
+ var _newSelectedState = latestSelector.current(newStoreState);
20567
+
20568
+ if (equalityFn(_newSelectedState, latestSelectedState.current)) {
20569
+ return;
20570
+ }
20571
+
20572
+ latestSelectedState.current = _newSelectedState;
20573
+ latestStoreState.current = newStoreState;
20574
+ } catch (err) {
20575
+ // we ignore all errors here, since when the component
20576
+ // is re-rendered, the selectors are called again, and
20577
+ // will throw again, if neither props nor store state
20578
+ // changed
20579
+ latestSubscriptionCallbackError.current = err;
20580
+ }
20581
+
20582
+ forceRender();
20583
+ }
20584
+
20585
+ subscription.onStateChange = checkForUpdates;
20586
+ subscription.trySubscribe();
20587
+ checkForUpdates();
20588
+ return function () {
20589
+ return subscription.tryUnsubscribe();
20590
+ };
20591
+ }, [store, subscription]);
20592
+ return selectedState;
20593
+ }
20594
+ /**
20595
+ * Hook factory, which creates a `useSelector` hook bound to a given context.
20596
+ *
20597
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
20598
+ * @returns {Function} A `useSelector` hook bound to the specified context.
20599
+ */
20600
+
20601
+
20602
+ function createSelectorHook(context) {
20603
+ if (context === void 0) {
20604
+ context = ReactReduxContext;
20605
+ }
20606
+
20607
+ var useReduxContext$1 = context === ReactReduxContext ? useReduxContext : function () {
20608
+ return React.useContext(context);
20609
+ };
20610
+ return function useSelector(selector, equalityFn) {
20611
+ if (equalityFn === void 0) {
20612
+ equalityFn = refEquality;
20613
+ }
20614
+
20615
+ if (process.env.NODE_ENV !== 'production') {
20616
+ if (!selector) {
20617
+ throw new Error("You must pass a selector to useSelector");
20618
+ }
20619
+
20620
+ if (typeof selector !== 'function') {
20621
+ throw new Error("You must pass a function as a selector to useSelector");
20622
+ }
20623
+
20624
+ if (typeof equalityFn !== 'function') {
20625
+ throw new Error("You must pass a function as an equality function to useSelector");
20626
+ }
20627
+ }
20628
+
20629
+ var _useReduxContext = useReduxContext$1(),
20630
+ store = _useReduxContext.store,
20631
+ contextSub = _useReduxContext.subscription;
20632
+
20633
+ var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);
20634
+ React.useDebugValue(selectedState);
20635
+ return selectedState;
20636
+ };
20637
+ }
20638
+ /**
20639
+ * A hook to access the redux store's state. This hook takes a selector function
20640
+ * as an argument. The selector is called with the store state.
20641
+ *
20642
+ * This hook takes an optional equality comparison function as the second parameter
20643
+ * that allows you to customize the way the selected state is compared to determine
20644
+ * whether the component needs to be re-rendered.
20645
+ *
20646
+ * @param {Function} selector the selector function
20647
+ * @param {Function=} equalityFn the function that will be used to determine equality
20648
+ *
20649
+ * @returns {any} the selected state
20650
+ *
20651
+ * @example
20652
+ *
20653
+ * import React from 'react'
20654
+ * import { useSelector } from 'react-redux'
20655
+ *
20656
+ * export const CounterComponent = () => {
20657
+ * const counter = useSelector(state => state.counter)
20658
+ * return <div>{counter}</div>
20659
+ * }
20660
+ */
20661
+
20662
+ var useSelector = /*#__PURE__*/createSelectorHook();
20663
+
21431
20664
  // with standard React renderers (ReactDOM, React Native)
21432
20665
 
21433
20666
  setBatch(reactDom.unstable_batchedUpdates);
@@ -22536,25 +21769,47 @@ function persistStore(store, options, cb) {
22536
21769
  return persistor;
22537
21770
  }
22538
21771
 
22539
- var Providers = /** @class */ (function (_super) {
22540
- __extends(Providers, _super);
22541
- function Providers(props) {
22542
- var _this = _super.call(this, props) || this;
22543
- var reducerConfig = __assign$1(__assign$1({}, persistConfig), { storage: default_1 });
22544
- _this.disabledPersist = props.disabledPersist || false;
22545
- var persistedReducer = _this.disabledPersist ? rootReducer : persistReducer(reducerConfig, rootReducer);
22546
- _this.store = createStore(persistedReducer, { root: props.defaultValues },
21772
+ class Providers extends React__default["default"].Component {
21773
+ constructor(props) {
21774
+ super(props);
21775
+ const reducerConfig = Object.assign(Object.assign({}, persistConfig), { storage: default_1 });
21776
+ this.disabledPersist = props.disabledPersist || false;
21777
+ const persistedReducer = this.disabledPersist ? rootReducer : persistReducer(reducerConfig, rootReducer);
21778
+ this.store = createStore(persistedReducer, { root: props.defaultValues },
22547
21779
  // eslint-disable-next-line no-underscore-dangle
22548
21780
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
22549
- _this.persistor = persistStore(_this.store);
22550
- return _this;
21781
+ this.persistor = persistStore(this.store);
21782
+ }
21783
+ render() {
21784
+ const { children } = this.props;
21785
+ return (jsxRuntime$1.exports.jsx(Provider, Object.assign({ store: this.store }, { children: this.disabledPersist ? (children) : (jsxRuntime$1.exports.jsx(PersistGate, Object.assign({ loading: null, persistor: this.persistor }, { children: children }), void 0)) }), void 0));
21786
+ }
21787
+ }
21788
+
21789
+ class MessageHandler {
21790
+ constructor() {
21791
+ this.set = (newFunc) => {
21792
+ this.updateDefaultValueHandler = newFunc;
21793
+ };
21794
+ this.get = () => {
21795
+ return this.updateDefaultValueHandler;
21796
+ };
22551
21797
  }
22552
- Providers.prototype.render = function () {
22553
- var children = this.props.children;
22554
- return (jsxRuntime$1.exports.jsx(Provider, __assign$1({ store: this.store }, { children: this.disabledPersist ? (children) : (jsxRuntime$1.exports.jsx(PersistGate, __assign$1({ loading: null, persistor: this.persistor }, { children: children }), void 0)) }), void 0));
21798
+ }
21799
+ const MessageHandlerContext = React.createContext(null);
21800
+
21801
+ const MessageReceiver = () => {
21802
+ const dispatch = useDispatch();
21803
+ const messageHandler = React.useContext(MessageHandlerContext);
21804
+ const changeDefaultValue = ({ store, path, value }) => {
21805
+ // TODO maybe need to export from core
21806
+ dispatch({ type: 'DATA_UPDATE', payload: { store, value, path } });
22555
21807
  };
22556
- return Providers;
22557
- }(React__default["default"].Component));
21808
+ React.useEffect(() => {
21809
+ messageHandler === null || messageHandler === void 0 ? void 0 : messageHandler.set(changeDefaultValue);
21810
+ }, [messageHandler, dispatch]);
21811
+ return null;
21812
+ };
22558
21813
 
22559
21814
  /*
22560
21815
 
@@ -22579,7 +21834,7 @@ styleSheet.flush()
22579
21834
 
22580
21835
  */
22581
21836
  // $FlowFixMe
22582
- function sheetForTag$1(tag) {
21837
+ function sheetForTag(tag) {
22583
21838
  if (tag.sheet) {
22584
21839
  // $FlowFixMe
22585
21840
  return tag.sheet;
@@ -22596,7 +21851,7 @@ function sheetForTag$1(tag) {
22596
21851
  }
22597
21852
  }
22598
21853
 
22599
- function createStyleElement$1(options) {
21854
+ function createStyleElement(options) {
22600
21855
  var tag = document.createElement('style');
22601
21856
  tag.setAttribute('data-emotion', options.key);
22602
21857
 
@@ -22609,7 +21864,7 @@ function createStyleElement$1(options) {
22609
21864
  return tag;
22610
21865
  }
22611
21866
 
22612
- var StyleSheet$1 = /*#__PURE__*/function () {
21867
+ var StyleSheet = /*#__PURE__*/function () {
22613
21868
  function StyleSheet(options) {
22614
21869
  var _this = this;
22615
21870
 
@@ -22656,7 +21911,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
22656
21911
  // it's 1 in dev because we insert source maps that map a single rule to a location
22657
21912
  // and you can only have one source map per style tag
22658
21913
  if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
22659
- this._insertTag(createStyleElement$1(this));
21914
+ this._insertTag(createStyleElement(this));
22660
21915
  }
22661
21916
 
22662
21917
  var tag = this.tags[this.tags.length - 1];
@@ -22674,7 +21929,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
22674
21929
  }
22675
21930
 
22676
21931
  if (this.isSpeedy) {
22677
- var sheet = sheetForTag$1(tag);
21932
+ var sheet = sheetForTag(tag);
22678
21933
 
22679
21934
  try {
22680
21935
  // this is the ultrafast version, works across browsers
@@ -23471,7 +22726,7 @@ var weakMemoize = function weakMemoize(func) {
23471
22726
  };
23472
22727
  };
23473
22728
 
23474
- function memoize$1(fn) {
22729
+ function memoize(fn) {
23475
22730
  var cache = Object.create(null);
23476
22731
  return function (arg) {
23477
22732
  if (cache[arg] === undefined) cache[arg] = fn(arg);
@@ -23674,7 +22929,7 @@ var incorrectImportAlarm = function incorrectImportAlarm(element, index, childre
23674
22929
 
23675
22930
  var isBrowser$3 = typeof document !== 'undefined';
23676
22931
  var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
23677
- return memoize$1(function () {
22932
+ return memoize(function () {
23678
22933
  var cache = {};
23679
22934
  return function (name) {
23680
22935
  return cache[name];
@@ -23853,7 +23108,7 @@ var createCache = function createCache(options) {
23853
23108
 
23854
23109
  var cache = {
23855
23110
  key: key,
23856
- sheet: new StyleSheet$1({
23111
+ sheet: new StyleSheet({
23857
23112
  key: key,
23858
23113
  container: container,
23859
23114
  nonce: options.nonce,
@@ -24021,14 +23276,6 @@ var unitlessKeys = {
24021
23276
  strokeWidth: 1
24022
23277
  };
24023
23278
 
24024
- function memoize(fn) {
24025
- var cache = Object.create(null);
24026
- return function (arg) {
24027
- if (cache[arg] === undefined) cache[arg] = fn(arg);
24028
- return cache[arg];
24029
- };
24030
- }
24031
-
24032
23279
  var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
24033
23280
  var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
24034
23281
  var hyphenateRegex = /[A-Z]|^ms/g;
@@ -24471,158 +23718,6 @@ if (process.env.NODE_ENV !== 'production') {
24471
23718
  Emotion.displayName = 'EmotionCssPropInternal';
24472
23719
  }
24473
23720
 
24474
- /*
24475
-
24476
- Based off glamor's StyleSheet, thanks Sunil ❤️
24477
-
24478
- high performance StyleSheet for css-in-js systems
24479
-
24480
- - uses multiple style tags behind the scenes for millions of rules
24481
- - uses `insertRule` for appending in production for *much* faster performance
24482
-
24483
- // usage
24484
-
24485
- import { StyleSheet } from '@emotion/sheet'
24486
-
24487
- let styleSheet = new StyleSheet({ key: '', container: document.head })
24488
-
24489
- styleSheet.insert('#box { border: 1px solid red; }')
24490
- - appends a css rule into the stylesheet
24491
-
24492
- styleSheet.flush()
24493
- - empties the stylesheet of all its contents
24494
-
24495
- */
24496
- // $FlowFixMe
24497
- function sheetForTag(tag) {
24498
- if (tag.sheet) {
24499
- // $FlowFixMe
24500
- return tag.sheet;
24501
- } // this weirdness brought to you by firefox
24502
-
24503
- /* istanbul ignore next */
24504
-
24505
-
24506
- for (var i = 0; i < document.styleSheets.length; i++) {
24507
- if (document.styleSheets[i].ownerNode === tag) {
24508
- // $FlowFixMe
24509
- return document.styleSheets[i];
24510
- }
24511
- }
24512
- }
24513
-
24514
- function createStyleElement(options) {
24515
- var tag = document.createElement('style');
24516
- tag.setAttribute('data-emotion', options.key);
24517
-
24518
- if (options.nonce !== undefined) {
24519
- tag.setAttribute('nonce', options.nonce);
24520
- }
24521
-
24522
- tag.appendChild(document.createTextNode(''));
24523
- tag.setAttribute('data-s', '');
24524
- return tag;
24525
- }
24526
-
24527
- var StyleSheet = /*#__PURE__*/function () {
24528
- function StyleSheet(options) {
24529
- var _this = this;
24530
-
24531
- this._insertTag = function (tag) {
24532
- var before;
24533
-
24534
- if (_this.tags.length === 0) {
24535
- if (_this.insertionPoint) {
24536
- before = _this.insertionPoint.nextSibling;
24537
- } else if (_this.prepend) {
24538
- before = _this.container.firstChild;
24539
- } else {
24540
- before = _this.before;
24541
- }
24542
- } else {
24543
- before = _this.tags[_this.tags.length - 1].nextSibling;
24544
- }
24545
-
24546
- _this.container.insertBefore(tag, before);
24547
-
24548
- _this.tags.push(tag);
24549
- };
24550
-
24551
- this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
24552
- this.tags = [];
24553
- this.ctr = 0;
24554
- this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
24555
-
24556
- this.key = options.key;
24557
- this.container = options.container;
24558
- this.prepend = options.prepend;
24559
- this.insertionPoint = options.insertionPoint;
24560
- this.before = null;
24561
- }
24562
-
24563
- var _proto = StyleSheet.prototype;
24564
-
24565
- _proto.hydrate = function hydrate(nodes) {
24566
- nodes.forEach(this._insertTag);
24567
- };
24568
-
24569
- _proto.insert = function insert(rule) {
24570
- // the max length is how many rules we have per style tag, it's 65000 in speedy mode
24571
- // it's 1 in dev because we insert source maps that map a single rule to a location
24572
- // and you can only have one source map per style tag
24573
- if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
24574
- this._insertTag(createStyleElement(this));
24575
- }
24576
-
24577
- var tag = this.tags[this.tags.length - 1];
24578
-
24579
- if (process.env.NODE_ENV !== 'production') {
24580
- var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
24581
-
24582
- if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
24583
- // this would only cause problem in speedy mode
24584
- // but we don't want enabling speedy to affect the observable behavior
24585
- // so we report this error at all times
24586
- console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
24587
- }
24588
- this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
24589
- }
24590
-
24591
- if (this.isSpeedy) {
24592
- var sheet = sheetForTag(tag);
24593
-
24594
- try {
24595
- // this is the ultrafast version, works across browsers
24596
- // the big drawback is that the css won't be editable in devtools
24597
- sheet.insertRule(rule, sheet.cssRules.length);
24598
- } catch (e) {
24599
- if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
24600
- console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
24601
- }
24602
- }
24603
- } else {
24604
- tag.appendChild(document.createTextNode(rule));
24605
- }
24606
-
24607
- this.ctr++;
24608
- };
24609
-
24610
- _proto.flush = function flush() {
24611
- // $FlowFixMe
24612
- this.tags.forEach(function (tag) {
24613
- return tag.parentNode && tag.parentNode.removeChild(tag);
24614
- });
24615
- this.tags = [];
24616
- this.ctr = 0;
24617
-
24618
- if (process.env.NODE_ENV !== 'production') {
24619
- this._alreadyInsertedOrderInsensitiveRule = false;
24620
- }
24621
- };
24622
-
24623
- return StyleSheet;
24624
- }();
24625
-
24626
23721
  var pkg = {
24627
23722
  name: "@emotion/react",
24628
23723
  version: "11.7.1",
@@ -24964,50 +24059,47 @@ if (process.env.NODE_ENV !== 'production') {
24964
24059
  }
24965
24060
  }
24966
24061
 
24967
- var printObj = function (obj) { return (typeof obj === 'string' ? obj : JSON.stringify(obj)); };
24968
- var ErrorBoundary = /** @class */ (function (_super) {
24969
- __extends(ErrorBoundary, _super);
24970
- function ErrorBoundary(props) {
24971
- var _this = _super.call(this, props) || this;
24972
- _this.state = { hasError: false, error: null };
24973
- return _this;
24062
+ const printObj = (obj) => (typeof obj === 'string' ? obj : JSON.stringify(obj));
24063
+ class ErrorBoundary extends React__default["default"].Component {
24064
+ constructor(props) {
24065
+ super(props);
24066
+ this.state = { hasError: false, error: null };
24974
24067
  }
24975
- ErrorBoundary.getDerivedStateFromError = function (error) {
24068
+ static getDerivedStateFromError(error) {
24976
24069
  return {
24977
24070
  hasError: true,
24978
24071
  error: error && error.message ? error.message : error,
24979
24072
  };
24980
- };
24981
- ErrorBoundary.prototype.componentDidCatch = function (error, info) {
24073
+ }
24074
+ componentDidCatch(error, info) {
24982
24075
  this.setState({ didInfo: info.componentStack });
24983
- };
24984
- ErrorBoundary.prototype.render = function () {
24985
- var _a = this.state, hasError = _a.hasError, error = _a.error, didInfo = _a.didInfo;
24986
- var _b = this.props, type = _b.type, id = _b.id, children = _b.children;
24076
+ }
24077
+ render() {
24078
+ const { hasError, error, didInfo } = this.state;
24079
+ const { type, id, children } = this.props;
24987
24080
  if (hasError) {
24988
24081
  if (type === 'component') {
24989
- return (jsxRuntime$1.exports.jsx("div", __assign$1({ style: {
24082
+ return (jsxRuntime$1.exports.jsx("div", Object.assign({ style: {
24990
24083
  flex: 1,
24991
24084
  flexDirection: 'column',
24992
24085
  borderColor: 'orange',
24993
24086
  borderWidth: 2,
24994
- } }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div", __assign$1({ style: { backgroundColor: 'red', alignItems: 'center' } }, { children: jsxRuntime$1.exports.jsxs("p", __assign$1({ style: { fontSize: 12, padding: 2 } }, { children: [id, "Error:"] }), void 0) }), void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsxs("p", __assign$1({ style: { fontSize: 10, padding: 2 } }, { children: [" ", printObj(error)] }), void 0) }, void 0)] }, void 0) }), void 0));
24087
+ } }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div", Object.assign({ style: { backgroundColor: 'red', alignItems: 'center' } }, { children: jsxRuntime$1.exports.jsxs("p", Object.assign({ style: { fontSize: 12, padding: 2 } }, { children: [id, "Error:"] }), void 0) }), void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsxs("p", Object.assign({ style: { fontSize: 10, padding: 2 } }, { children: [" ", printObj(error)] }), void 0) }, void 0)] }, void 0) }), void 0));
24995
24088
  }
24996
- return (jsxRuntime$1.exports.jsx("div", __assign$1({ style: { flexDirection: 'column', margin: 20, height: '100%' } }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div", __assign$1({ style: {
24089
+ return (jsxRuntime$1.exports.jsx("div", Object.assign({ style: { flexDirection: 'column', margin: 20, height: '100%' } }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div", Object.assign({ style: {
24997
24090
  flex: 1,
24998
24091
  backgroundColor: 'red',
24999
24092
  padding: 10,
25000
24093
  alignItems: 'center',
25001
- } }, { children: jsxRuntime$1.exports.jsxs("p", __assign$1({ style: { fontSize: 30 } }, { children: ["Error type:", type, id] }), void 0) }), void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsx("p", __assign$1({ style: { fontSize: 20, marginTop: 30 } }, { children: printObj(error) }), void 0) }, void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsx("p", __assign$1({ style: { marginTop: 20 } }, { children: printObj(didInfo) }), void 0) }, void 0)] }, void 0) }), void 0));
24094
+ } }, { children: jsxRuntime$1.exports.jsxs("p", Object.assign({ style: { fontSize: 30 } }, { children: ["Error type:", type, id] }), void 0) }), void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsx("p", Object.assign({ style: { fontSize: 20, marginTop: 30 } }, { children: printObj(error) }), void 0) }, void 0), jsxRuntime$1.exports.jsx("div", { children: jsxRuntime$1.exports.jsx("p", Object.assign({ style: { marginTop: 20 } }, { children: printObj(didInfo) }), void 0) }, void 0)] }, void 0) }), void 0));
25002
24095
  }
25003
24096
  return children;
25004
- };
25005
- return ErrorBoundary;
25006
- }(React__default["default"].Component));
24097
+ }
24098
+ }
25007
24099
 
25008
- var genStyle = function (props) {
25009
- var parentComp = props.parentComp;
25010
- var style = __assign$1(__assign$1({ display: 'flex', flexDirection: 'column' }, props.style), props[constants.STYLE_WEB_NAME]);
24100
+ const getWebStyle = (props) => {
24101
+ const { [constants.PARENT_PROP_NAME]: parentComp } = props;
24102
+ const style = Object.assign(Object.assign({ display: 'flex', flexDirection: 'column' }, props.style), props[constants.STYLE_WEB_NAME]);
25011
24103
  if (style && style.borderWidth && !style.borderStyle) {
25012
24104
  style.borderStyle = 'solid';
25013
24105
  }
@@ -25018,84 +24110,70 @@ var genStyle = function (props) {
25018
24110
  parentComp.style.flex < 1
25019
24111
  // if smaller or larger, noesn't matter
25020
24112
  ) {
25021
- style.height = "100%";
25022
- style.width = "100%";
24113
+ style.height = `100%`;
24114
+ style.width = `100%`;
25023
24115
  }
25024
24116
  else if (!style.height) {
25025
- style.height = "".concat(style.flex * 100, "%");
24117
+ style.height = `${style.flex * 100}%`;
25026
24118
  }
25027
24119
  }
25028
24120
  return style;
25029
24121
  };
25030
- var getStyleForWeb = function (props, component) {
25031
- if (props === void 0) { props = {}; }
25032
- return component === 'View' ? genStyle(props) : __assign$1(__assign$1({}, props.style), props[constants.STYLE_WEB_NAME]);
25033
- };
25034
- function Wrapper(props) {
25035
- var _a = props, _b = constants.V_COMP_NAME, component = _a[_b], id = _a.id, _c = constants.PATH_MODIFIERS_KEY, pathModifiers = _a[_c];
25036
- var stock = React.useContext(StockContext);
25037
- var _d = wrapperUtil.getRootWrapperProps(props, stock), currentPaths = _d.currentPaths, ownProps = __rest$1(_d, ["currentPaths"]);
24122
+ const getStyle = (props = {}, component) => component === 'View' ? getWebStyle(props) : Object.assign(Object.assign({}, props.style), props[constants.STYLE_WEB_NAME]);
24123
+ function Wrapper({ props: origProps }) {
24124
+ const newCurrentPaths = React.useContext(PathModifierContext);
24125
+ const stock = React.useContext(StockContext);
24126
+ const props = Object.assign(Object.assign({}, wrapperUtil.normalisePrimitives(origProps)), { [constants.CURRENT_PATH_NAME]: wrapperUtil.getCurrentPaths(Object.assign(Object.assign({}, origProps), { [constants.CURRENT_PATH_NAME]: newCurrentPaths }), origProps === null || origProps === void 0 ? void 0 : origProps[constants.PATH_MODIFIERS_KEY]) });
24127
+ const { [constants.V_COMP_NAME]: component } = props;
24128
+ const ownProps = wrapperUtil.getRootWrapperProps(props, stock);
24129
+ // TODO isError
24130
+ useSelector(compSelectorHook(props[constants.CURRENT_PATH_NAME], ownProps.subscriberPaths), shallowEqual);
25038
24131
  if (!stock) {
25039
24132
  return null;
25040
24133
  }
25041
- var Comp = stock.getComponent(component);
25042
- var infobox = false;
24134
+ const Comp = stock.getComponent(component);
24135
+ const infobox = false;
25043
24136
  if (!Comp) {
25044
24137
  // eslint-disable-next-line no-throw-literal
25045
- throw "The Component(".concat(component, ") is not available");
24138
+ throw `The Component(${component}) is not available`;
25046
24139
  }
25047
- var newStyle = ownProps.style || ownProps[constants.STYLE_WEB_NAME] ? getStyleForWeb(ownProps, component) : undefined;
25048
- return (jsxRuntime$1.exports.jsx(ErrorBoundary, __assign$1({ type: "wrapper", id: id }, { children: jsxRuntime$1.exports.jsx(ClassNames, { children: function (_a) {
25049
- var css = _a.css, cx = _a.cx;
24140
+ const newStyle = ownProps.style || ownProps[constants.STYLE_WEB_NAME] ? getStyle(ownProps, component) : undefined;
24141
+ return (jsxRuntime$1.exports.jsx(ErrorBoundary, Object.assign({ type: "wrapper", id: props.id }, { children: jsxRuntime$1.exports.jsx(ClassNames, { children: ({ css, cx }) => {
25050
24142
  ownProps.className = newStyle ? cx(css(newStyle)) : undefined;
25051
- var _b = ownProps; _b.parentComp; _b.style; var _c = constants.STYLE_WEB_NAME; _b[_c]; var _d = constants.V_COMP_NAME; _b[_d]; var _e = constants.V_CHILDREN_NAME; _b[_e]; var _f = constants.PATH_MODIFIERS_KEY; _b[_f]; var newProps = __rest$1(_b, ["parentComp", "style", typeof _c === "symbol" ? _c : _c + "", typeof _d === "symbol" ? _d : _d + "", typeof _e === "symbol" ? _e : _e + "", typeof _f === "symbol" ? _f : _f + ""]);
25052
- return pathModifiers ? (jsxRuntime$1.exports.jsxs(PathModifierContext.Provider, __assign$1({ value: currentPaths }, { children: [jsxRuntime$1.exports.jsx(Comp, __assign$1({}, newProps, { children: wrapperUtil.generateChildren(ownProps, stock) }), void 0), infobox ] }), void 0)) : (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx(Comp, __assign$1({}, newProps, { children: wrapperUtil.generateChildren(ownProps, stock) }), void 0), infobox ] }, void 0));
24143
+ const newProps = wrapperUtil.removeTechnicalProps(ownProps);
24144
+ // children was {wrapperUtil.generateChildren(ownProps, stock)}
24145
+ return ownProps[constants.PATH_MODIFIERS_KEY] ? (jsxRuntime$1.exports.jsxs(PathModifierContext.Provider, Object.assign({ value: props[constants.CURRENT_PATH_NAME] }, { children: [jsxRuntime$1.exports.jsx(Comp, Object.assign({}, newProps), void 0), infobox ] }), void 0)) : (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx(Comp, Object.assign({}, newProps), void 0), infobox ] }, void 0));
25053
24146
  } }, void 0) }), void 0));
25054
24147
  }
25055
- var ReduxWrapper = connect(genAllStateProps, null, function (stateProps, dispatchProps, ownProps) { return util$1.mergePath(ownProps, stateProps); }, {
25056
- areStatePropsEqual: function (next, prev) {
25057
- // eslint-disable-next-line no-restricted-syntax
25058
- for (var _i = 0, _a = Object.entries(next); _i < _a.length; _i++) {
25059
- var _b = _a[_i], key = _b[0], value = _b[1];
25060
- if (value !== prev[key]) {
25061
- return false;
25062
- }
25063
- }
25064
- return true;
25065
- },
25066
- })(Wrapper);
25067
- function WrapperOuter(props) {
25068
- var currentPaths = React.useContext(PathModifierContext);
25069
- var newProps = __assign$1(__assign$1(__assign$1({}, props), { currentPaths: currentPaths }), wrapperUtil.pathModifierBuilder(__assign$1(__assign$1({}, props), { currentPaths: currentPaths }), props[constants.PATH_MODIFIERS_KEY]));
25070
- return jsxRuntime$1.exports.jsx(ReduxWrapper, __assign$1({}, newProps), void 0);
25071
- }
25072
24148
 
25073
- var Renderer = function (_a) {
25074
- var model = _a.model, stockInit = _a.stockInit, reduxStore = _a.reduxStore;
25075
- var stock = React.useMemo(function () { return getStock(stockInit, model, WrapperOuter, reduxStore); }, [stockInit, model, reduxStore]);
24149
+ const Renderer = ({ model, stockInit, reduxStore }) => {
24150
+ const stock = React.useMemo(() => getStock(stockInit, model, Wrapper, reduxStore), [stockInit, model, reduxStore]);
25076
24151
  if (model === undefined) {
25077
24152
  return null;
25078
24153
  }
25079
- return (jsxRuntime$1.exports.jsx(StockContext.Provider, __assign$1({ value: stock }, { children: jsxRuntime$1.exports.jsx(PathModifierContext.Provider, __assign$1({ value: {} }, { children: jsxRuntime$1.exports.jsx(WrapperOuter, __assign$1({}, wrapperUtil.getWrapperProps(model)), void 0) }), void 0) }), void 0));
24154
+ return (jsxRuntime$1.exports.jsx(StockContext.Provider, Object.assign({ value: stock }, { children: jsxRuntime$1.exports.jsxs(PathModifierContext.Provider, Object.assign({ value: {} }, { children: [jsxRuntime$1.exports.jsx(MessageReceiver, {}, void 0), jsxRuntime$1.exports.jsx(Wrapper, { props: model }, void 0)] }), void 0) }), void 0));
25080
24155
  };
25081
- var rendererFunc = function (props) {
25082
- var reduxStore = useStore();
25083
- return (jsxRuntime$1.exports.jsx(ErrorBoundary, __assign$1({ type: "rendererFunc" }, { children: jsxRuntime$1.exports.jsx(Renderer, __assign$1({}, props, { reduxStore: reduxStore }), void 0) }), void 0));
24156
+ const rendererFunc = (props) => {
24157
+ // TODO remove this and merge to Renderer
24158
+ const reduxStore = useStore();
24159
+ return (jsxRuntime$1.exports.jsx(ErrorBoundary, Object.assign({ type: "rendererFunc" }, { children: jsxRuntime$1.exports.jsx(Renderer, Object.assign({}, props, { reduxStore: reduxStore }), void 0) }), void 0));
25084
24160
  };
25085
24161
 
25086
- function Viewer(_a) {
25087
- var model = _a.model, components = _a.components, functions = _a.functions;
25088
- var stockInit = {
25089
- components: __assign$1(__assign$1({}, stock.components), components),
25090
- functions: __assign$1(__assign$1(__assign$1({}, stock.functions), appRootFunctions), functions),
24162
+ function Viewer({ model, components, functions }) {
24163
+ const stockInit = {
24164
+ components: Object.assign(Object.assign({}, stock.components), components),
24165
+ functions: Object.assign(Object.assign(Object.assign({}, stock.functions), appRootFunctions), functions),
25091
24166
  };
25092
24167
  return jsxRuntime$1.exports.jsx(rendererFunc, { model: model, stockInit: stockInit }, void 0);
25093
24168
  }
25094
- function ViewerWeb(props) {
25095
- return (jsxRuntime$1.exports.jsx(ErrorBoundary, __assign$1({ type: "viewer" }, { children: jsxRuntime$1.exports.jsx(Providers, __assign$1({ defaultValues: props.defaultValues, disabledPersist: props.disabledPersist }, { children: jsxRuntime$1.exports.jsx(Viewer, __assign$1({}, props), void 0) }), void 0) }), void 0));
24169
+ function ViewerWeb(_a) {
24170
+ var { defaultValues, disabledPersist } = _a, props = __rest$1(_a, ["defaultValues", "disabledPersist"]);
24171
+ return (jsxRuntime$1.exports.jsx(ErrorBoundary, Object.assign({ type: "viewer" }, { children: jsxRuntime$1.exports.jsx(Providers, Object.assign({ defaultValues: defaultValues, disabledPersist: disabledPersist }, { children: jsxRuntime$1.exports.jsx(Viewer, Object.assign({}, props), void 0) }), void 0) }), void 0));
25096
24172
  }
25097
24173
 
25098
- var JsonUI = function (props) { return jsxRuntime$1.exports.jsx(ViewerWeb, __assign$1({}, props), void 0); };
24174
+ const JsonUI = (props) => jsxRuntime$1.exports.jsx(ViewerWeb, Object.assign({}, props), void 0);
25099
24175
 
25100
24176
  exports.JsonUI = JsonUI;
24177
+ exports.MessageHandler = MessageHandler;
24178
+ exports.MessageHandlerContext = MessageHandlerContext;
25101
24179
  //# sourceMappingURL=index.js.map