@jsonui/react 0.2.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.
- package/dist/cjs/index.js +792 -1705
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/MessageReceiver.d.ts +2 -0
- package/dist/cjs/types/MessageReceiverContext.d.ts +8 -0
- package/dist/cjs/types/ReduxProviders.d.ts +1 -9
- package/dist/cjs/types/ViewerWeb.d.ts +2 -10
- package/dist/cjs/types/Wrapper.d.ts +5 -3
- package/dist/cjs/types/index.d.ts +4 -3
- package/dist/cjs/types/stock/components/Fragment.d.ts +5 -3
- package/dist/cjs/types/stock/components/PrimitiveProp.d.ts +3 -2
- package/dist/cjs/types/stock/components/Text.d.ts +1 -1
- package/dist/cjs/types/stock/components/View.d.ts +1 -1
- package/dist/cjs/types/stories/JsonUI.stories.d.ts +3 -3
- package/dist/cjs/types/stories/MultiChild.stories.d.ts +5 -0
- package/dist/cjs/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
- package/dist/cjs/types/stories/ReduxTest.stories.d.ts +6 -0
- package/dist/cjs/types/stories/Simple.stories.d.ts +5 -0
- package/dist/cjs/types/stories/Table.stories.d.ts +5 -0
- package/dist/cjs/types/types.d.ts +23 -0
- package/dist/esm/index.js +792 -1707
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/MessageReceiver.d.ts +2 -0
- package/dist/esm/types/MessageReceiverContext.d.ts +8 -0
- package/dist/esm/types/ReduxProviders.d.ts +1 -9
- package/dist/esm/types/ViewerWeb.d.ts +2 -10
- package/dist/esm/types/Wrapper.d.ts +5 -3
- package/dist/esm/types/index.d.ts +4 -3
- package/dist/esm/types/stock/components/Fragment.d.ts +5 -3
- package/dist/esm/types/stock/components/PrimitiveProp.d.ts +3 -2
- package/dist/esm/types/stock/components/Text.d.ts +1 -1
- package/dist/esm/types/stock/components/View.d.ts +1 -1
- package/dist/esm/types/stories/JsonUI.stories.d.ts +3 -3
- package/dist/esm/types/stories/MultiChild.stories.d.ts +5 -0
- package/dist/esm/types/stories/PartialValueUpdateTest/PushNotificationTest.stories.d.ts +5 -0
- package/dist/esm/types/stories/ReduxTest.stories.d.ts +6 -0
- package/dist/esm/types/stories/Simple.stories.d.ts +5 -0
- package/dist/esm/types/stories/Table.stories.d.ts +5 -0
- package/dist/esm/types/types.d.ts +23 -0
- package/dist/index.d.ts +9 -18
- package/package.json +4 -4
- package/dist/cjs/types/indexModule.d.ts +0 -6
- package/dist/cjs/types/stock/components/FieldEdit.d.ts +0 -3
- package/dist/cjs/types/stock/components.d.ts +0 -20
- package/dist/cjs/types/stock/stockToRenderer.d.ts +0 -22
- package/dist/cjs/types/store/store.d.ts +0 -7
- package/dist/cjs/types/stories/Button.d.ts +0 -28
- package/dist/cjs/types/stories/Button.stories.d.ts +0 -8
- package/dist/cjs/types/stories/Header.d.ts +0 -12
- package/dist/cjs/types/stories/Header.stories.d.ts +0 -6
- package/dist/cjs/types/stories/Page.d.ts +0 -3
- package/dist/cjs/types/stories/Page.stories.d.ts +0 -6
- package/dist/esm/types/indexModule.d.ts +0 -6
- package/dist/esm/types/stock/components/FieldEdit.d.ts +0 -3
- package/dist/esm/types/stock/components.d.ts +0 -20
- package/dist/esm/types/stock/stockToRenderer.d.ts +0 -22
- package/dist/esm/types/store/store.d.ts +0 -7
- package/dist/esm/types/stories/Button.d.ts +0 -28
- package/dist/esm/types/stories/Button.stories.d.ts +0 -8
- package/dist/esm/types/stories/Header.d.ts +0 -12
- package/dist/esm/types/stories/Header.stories.d.ts +0 -6
- package/dist/esm/types/stories/Page.d.ts +0 -3
- 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$
|
|
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$
|
|
149
|
-
symbols = getOwnPropertySymbols$
|
|
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
|
-
|
|
1400
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
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 =
|
|
1477
|
-
if (!!key && typeof key === 'string' && key.length > 0 && !(key in
|
|
1478
|
-
|
|
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 =
|
|
1482
|
-
if (!!key && typeof key === 'string' && key.length > 0 && !(key in
|
|
1483
|
-
|
|
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 =
|
|
1487
|
-
if (!!attr && !!name && name in
|
|
1488
|
-
|
|
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 =
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
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
|
-
|
|
1509
|
-
|
|
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
|
|
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
|
|
1590
|
-
symbols = getOwnPropertySymbols
|
|
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
|
|
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
|
|
3754
|
+
memoized.cache = new (memoize$1.Cache || MapCache$2);
|
|
3821
3755
|
return memoized;
|
|
3822
3756
|
}
|
|
3823
3757
|
|
|
3824
3758
|
// Expose `MapCache`.
|
|
3825
|
-
memoize$1
|
|
3759
|
+
memoize$1.Cache = MapCache$2;
|
|
3826
3760
|
|
|
3827
|
-
var memoize_1 = 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;
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
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$
|
|
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$
|
|
7742
|
-
return defineProperty$
|
|
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;
|
|
8000
|
-
|
|
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
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
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 :
|
|
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
|
-
|
|
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 :
|
|
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
|
-
|
|
8036
|
-
|
|
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
|
-
|
|
7978
|
+
const mergePath = (target, newState) => {
|
|
8043
7979
|
if (!newState || typeof newState !== 'object')
|
|
8044
7980
|
return target;
|
|
8045
|
-
|
|
8046
|
-
Object.entries(newState).forEach(
|
|
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
|
-
|
|
8054
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8067
|
-
|
|
8001
|
+
let count = 0;
|
|
8002
|
+
let relativepathIndex = -1;
|
|
8068
8003
|
do {
|
|
8069
8004
|
count += 1;
|
|
8070
|
-
relativepathIndex = findIndex_1(pathArray,
|
|
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,171 +8019,170 @@ 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
|
-
|
|
8025
|
+
const source = sources.shift();
|
|
8092
8026
|
if (isOnlyObject(target) && isOnlyObject(source)) {
|
|
8093
8027
|
// eslint-disable-next-line no-restricted-syntax
|
|
8094
|
-
for (
|
|
8028
|
+
for (const key in source) {
|
|
8095
8029
|
if (isOnlyObject(source[key])) {
|
|
8096
8030
|
if (!target[key])
|
|
8097
|
-
Object.assign(target,
|
|
8031
|
+
Object.assign(target, { [key]: {} });
|
|
8098
8032
|
mergeDeep(target[key], source[key]);
|
|
8099
8033
|
}
|
|
8100
8034
|
else {
|
|
8101
|
-
Object.assign(target,
|
|
8035
|
+
Object.assign(target, { [key]: source[key] });
|
|
8102
8036
|
}
|
|
8103
8037
|
}
|
|
8104
8038
|
}
|
|
8105
|
-
return mergeDeep
|
|
8039
|
+
return mergeDeep(target, ...sources);
|
|
8106
8040
|
}
|
|
8107
|
-
|
|
8108
|
-
|
|
8041
|
+
const collectObjMerge = (refConst, json) => {
|
|
8042
|
+
const res = {};
|
|
8109
8043
|
if (refConst && json && typeof json === 'object') {
|
|
8110
|
-
|
|
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
|
-
|
|
8048
|
+
refs.push(x[refConst]);
|
|
8115
8049
|
}
|
|
8116
8050
|
});
|
|
8117
|
-
|
|
8051
|
+
refs.filter((i) => !!i).forEach((i) => mergeDeep(res, i));
|
|
8118
8052
|
}
|
|
8119
8053
|
return res;
|
|
8120
8054
|
};
|
|
8121
|
-
|
|
8055
|
+
const collectObjToArray = (refConst, json) => {
|
|
8122
8056
|
if (refConst && json && typeof json === 'object') {
|
|
8123
|
-
|
|
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
|
-
|
|
8061
|
+
refs.push(x[refConst]);
|
|
8128
8062
|
}
|
|
8129
8063
|
});
|
|
8130
|
-
return
|
|
8064
|
+
return refs;
|
|
8131
8065
|
}
|
|
8132
8066
|
return [];
|
|
8133
|
-
};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});var actionBuilder = function (props, stock) {
|
|
8134
|
-
var paths = [];
|
|
8135
|
-
props.parentComp; var propsNew = __rest(props
|
|
8136
|
-
// eslint-disable-next-line func-names
|
|
8137
|
-
, ["parentComp"]);
|
|
8138
|
-
// eslint-disable-next-line func-names
|
|
8139
|
-
traverse$3(propsNew).forEach(function (x) {
|
|
8140
|
-
if (!!x &&
|
|
8141
|
-
!!x[ACTION_KEY] &&
|
|
8142
|
-
// && !c.REDUX_FUNCTIONS.includes(x[c.ACTION_KEY])
|
|
8143
|
-
!(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
|
|
8144
|
-
paths.push({ path: this.path, level: this.level });
|
|
8145
|
-
}
|
|
8146
|
-
});
|
|
8147
|
-
orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8148
|
-
var _a, _b, functionName, functionParams;
|
|
8149
|
-
return __generator(this, function (_c) {
|
|
8150
|
-
_a = traverse$3(props).get(i.path), _b = ACTION_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
8151
|
-
traverse$3(props).set(i.path, function () {
|
|
8152
|
-
var callerArgs = [];
|
|
8153
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8154
|
-
callerArgs[_i] = arguments[_i];
|
|
8155
|
-
}
|
|
8156
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
8157
|
-
return __generator(this, function (_a) {
|
|
8158
|
-
switch (_a.label) {
|
|
8159
|
-
case 0: return [4 /*yield*/, stock.callFunction(functionName, functionParams, props, callerArgs)];
|
|
8160
|
-
case 1:
|
|
8161
|
-
_a.sent();
|
|
8162
|
-
return [2 /*return*/];
|
|
8163
|
-
}
|
|
8164
|
-
});
|
|
8165
|
-
});
|
|
8166
|
-
});
|
|
8167
|
-
return [2 /*return*/];
|
|
8168
|
-
});
|
|
8169
|
-
}); });
|
|
8170
8067
|
};
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8068
|
+
const isCircular = (d) => {
|
|
8069
|
+
try {
|
|
8070
|
+
JSON.stringify(d);
|
|
8071
|
+
}
|
|
8072
|
+
catch (e) {
|
|
8073
|
+
return true;
|
|
8074
|
+
}
|
|
8075
|
+
return false;
|
|
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;
|
|
8093
|
+
}
|
|
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
|
+
}
|
|
8180
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 };
|
|
8181
8137
|
});
|
|
8182
|
-
orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8183
|
-
var _a, _b, functionName, functionParams;
|
|
8184
|
-
return __generator(this, function (_c) {
|
|
8185
|
-
_a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
8186
|
-
traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
|
|
8187
|
-
return [2 /*return*/];
|
|
8188
|
-
});
|
|
8189
|
-
}); });
|
|
8190
8138
|
};
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
var modified = false;
|
|
8139
|
+
const getCurrentPaths = (props, pathModifier) => {
|
|
8140
|
+
const currentPaths = Object.assign({}, props[CURRENT_PATH_NAME]);
|
|
8194
8141
|
if (pathModifier && Object.keys(pathModifier).length !== 0) {
|
|
8195
|
-
Object.keys(pathModifier).forEach(
|
|
8196
|
-
var _a, _b;
|
|
8142
|
+
Object.keys(pathModifier).forEach((key) => {
|
|
8197
8143
|
if (!!key && !!pathModifier[key] && pathModifier[key][PATHNAME] !== undefined && pathModifier[key][PATHNAME] !== null) {
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
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 };
|
|
8203
8148
|
}
|
|
8204
8149
|
else {
|
|
8205
|
-
currentPaths[key] =
|
|
8150
|
+
currentPaths[key] = { [PATHNAME]: changeRelativePath(`${parent[PATHNAME]}${SEPARATOR}${path}`) };
|
|
8206
8151
|
}
|
|
8207
|
-
if (!!currentPaths[key] &&
|
|
8208
|
-
currentPaths[key][PATHNAME] =
|
|
8152
|
+
if (!!currentPaths[key] && !`${currentPaths[key][PATHNAME]}`.startsWith(SEPARATOR)) {
|
|
8153
|
+
currentPaths[key][PATHNAME] = `${SEPARATOR}${currentPaths[key][PATHNAME]}`;
|
|
8209
8154
|
}
|
|
8210
8155
|
}
|
|
8211
8156
|
});
|
|
8212
8157
|
}
|
|
8213
|
-
return
|
|
8158
|
+
return currentPaths;
|
|
8214
8159
|
};
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
}
|
|
8223
|
-
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));
|
|
8224
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
8225
|
-
for (var i in res)
|
|
8226
|
-
if (typeof res[i] === 'undefined')
|
|
8227
|
-
delete res[i];
|
|
8228
|
-
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 });
|
|
8229
8168
|
};
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
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];
|
|
8236
8174
|
if (!listItem)
|
|
8237
8175
|
return undefined;
|
|
8238
|
-
|
|
8176
|
+
const currentPaths = props[CURRENT_PATH_NAME];
|
|
8239
8177
|
if (!currentPaths)
|
|
8240
8178
|
return undefined;
|
|
8241
|
-
|
|
8179
|
+
const store = Object.keys(currentPaths)[0];
|
|
8242
8180
|
if (!store)
|
|
8243
8181
|
return undefined;
|
|
8244
|
-
|
|
8182
|
+
const { path } = currentPaths[store];
|
|
8245
8183
|
if (currentPaths && !listLength) {
|
|
8246
8184
|
if (path) {
|
|
8247
|
-
|
|
8185
|
+
const list = stock.callFunction('get', { store, path });
|
|
8248
8186
|
listLength = !!list && Array.isArray(list) ? list.length : 0;
|
|
8249
8187
|
}
|
|
8250
8188
|
}
|
|
@@ -8254,45 +8192,80 @@ var genChildenFromListItem = function (props, stock) {
|
|
|
8254
8192
|
page = Number.isInteger(page) && page >= 0 ? page : 0;
|
|
8255
8193
|
itemPerPage = !!itemPerPage && Number.isInteger(itemPerPage) && itemPerPage >= 0 ? itemPerPage : 0;
|
|
8256
8194
|
listLength = !!listLength && Number.isInteger(listLength) && listLength >= 0 ? listLength : 0;
|
|
8257
|
-
|
|
8258
|
-
|
|
8195
|
+
const offset = page * itemPerPage <= listLength ? page * itemPerPage : 0;
|
|
8196
|
+
const children = [];
|
|
8259
8197
|
// eslint-disable-next-line no-plusplus
|
|
8260
|
-
for (
|
|
8261
|
-
children.push(
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
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
|
+
} }));
|
|
8266
8204
|
}
|
|
8267
8205
|
return children.length > 0 ? children : undefined;
|
|
8268
8206
|
};
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8207
|
+
const getRootWrapperProps = (props, stock) => {
|
|
8208
|
+
const newProps = Object.assign({}, props);
|
|
8209
|
+
const subscriberPaths = calculatePropsFromModifier(newProps, stock);
|
|
8272
8210
|
actionBuilder(newProps, stock);
|
|
8273
8211
|
if (newProps[LIST_SEMAPHORE]) {
|
|
8274
8212
|
newProps[V_CHILDREN_NAME] = genChildenFromListItem(newProps, stock);
|
|
8275
8213
|
}
|
|
8214
|
+
newProps.subscriberPaths = subscriberPaths;
|
|
8276
8215
|
return newProps;
|
|
8277
8216
|
};
|
|
8278
|
-
|
|
8279
|
-
|
|
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) => {
|
|
8280
8239
|
// eslint-disable-next-line no-nested-ternary
|
|
8281
8240
|
if (!!props && Array.isArray(children)) {
|
|
8282
|
-
return children.map(
|
|
8241
|
+
return children.map((childrenItem, index) => {
|
|
8283
8242
|
// eslint-disable-next-line react/no-array-index-key
|
|
8284
|
-
return jsxRuntime.exports.jsx(Wrapper,
|
|
8243
|
+
return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(childrenItem, getParentProps(props)) }, index);
|
|
8285
8244
|
});
|
|
8286
8245
|
}
|
|
8287
8246
|
if (!!props && !!children) {
|
|
8288
|
-
return jsxRuntime.exports.jsx(Wrapper,
|
|
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);
|
|
8289
8262
|
}
|
|
8290
8263
|
return undefined;
|
|
8291
8264
|
};
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
return
|
|
8295
|
-
};var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,actionBuilder:actionBuilder,
|
|
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) {
|
|
8296
8269
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8297
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;
|
|
8298
8271
|
class _CodeOrName {
|
|
@@ -15217,7 +15190,7 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
|
|
|
15217
15190
|
|
|
15218
15191
|
return str
|
|
15219
15192
|
|
|
15220
|
-
};
|
|
15193
|
+
};const I18nSchema = {
|
|
15221
15194
|
$id: 'http://example.com/schemas/schema.json',
|
|
15222
15195
|
type: 'object',
|
|
15223
15196
|
additionalProperties: {
|
|
@@ -15242,28 +15215,26 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
|
|
|
15242
15215
|
},
|
|
15243
15216
|
minProperties: 1,
|
|
15244
15217
|
};
|
|
15245
|
-
|
|
15218
|
+
class I18n {
|
|
15246
15219
|
// eslint-disable-next-line consistent-this
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
this.getLocales = function () { return (_this.language.includes('-') ? _this.language.split('-') : _this.language.split('_') || [])[0]; };
|
|
15251
|
-
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) => {
|
|
15252
15223
|
if (!(typeof key === 'string')) {
|
|
15253
15224
|
return key;
|
|
15254
15225
|
}
|
|
15255
|
-
if (!
|
|
15226
|
+
if (!this.resources || (!this.resources && !this.language && !language) || !this.resources[`${this.availableLanguageKey || language}`]) {
|
|
15256
15227
|
return key;
|
|
15257
15228
|
}
|
|
15258
|
-
|
|
15229
|
+
const value = this.resources[`${this.availableLanguageKey || language}`].translation[key];
|
|
15259
15230
|
if (value === undefined) {
|
|
15260
|
-
if (
|
|
15261
|
-
return
|
|
15231
|
+
if (this.nonExistsHandler && typeof this.nonExistsHandler === 'function') {
|
|
15232
|
+
return this.nonExistsHandler(key);
|
|
15262
15233
|
}
|
|
15263
15234
|
return key;
|
|
15264
15235
|
}
|
|
15265
15236
|
if (options) {
|
|
15266
|
-
return src(value, options, [
|
|
15237
|
+
return src(value, options, [this.keyPrefix, this.keyPostfix]);
|
|
15267
15238
|
}
|
|
15268
15239
|
return value;
|
|
15269
15240
|
};
|
|
@@ -15271,9 +15242,9 @@ var I18n = /** @class */ (function () {
|
|
|
15271
15242
|
this.nonExistsHandler = nonExistsHandler;
|
|
15272
15243
|
this.keyPrefix = keyPrefix;
|
|
15273
15244
|
this.keyPostfix = keyPostfix;
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15245
|
+
const ajv = new Ajv();
|
|
15246
|
+
const validate = ajv.compile(I18nSchema);
|
|
15247
|
+
const isValid = validate(resources);
|
|
15277
15248
|
if (isValid) {
|
|
15278
15249
|
this.resources = resources;
|
|
15279
15250
|
}
|
|
@@ -15285,84 +15256,49 @@ var I18n = /** @class */ (function () {
|
|
|
15285
15256
|
this.availableLanguageKey = this.getLocales();
|
|
15286
15257
|
}
|
|
15287
15258
|
}
|
|
15288
|
-
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
var store = _a.store, path = _a.path, _b = _a.isError, isError = _b === void 0 ? false : _b;
|
|
15294
|
-
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);
|
|
15295
15264
|
if (state && store && path) {
|
|
15296
|
-
|
|
15297
|
-
return getValue$3(state,
|
|
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);
|
|
15298
15267
|
}
|
|
15299
15268
|
return null;
|
|
15300
15269
|
};
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
if (!!x && !!x[MODIFIER_KEY] && x[MODIFIER_KEY] === 'get' && !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
|
|
15311
|
-
paths.push({ path: this.path, level: this.level });
|
|
15312
|
-
}
|
|
15313
|
-
});
|
|
15314
|
-
orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15315
|
-
var _a, _b, functionName, functionParams, value, jsonata, expression;
|
|
15316
|
-
return __generator(this, function (_c) {
|
|
15317
|
-
_a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
15318
|
-
if (functionName === 'get' && functionParams.store && functionParams.path) {
|
|
15319
|
-
value = getStateValue$1(globalState, functionParams, currentPaths);
|
|
15320
|
-
if (functionParams.jsonataDef) {
|
|
15321
|
-
try {
|
|
15322
|
-
jsonata = require('jsonata');
|
|
15323
|
-
expression = jsonata(functionParams.jsonataDef);
|
|
15324
|
-
value = expression.evaluate(value);
|
|
15325
|
-
}
|
|
15326
|
-
catch (error) {
|
|
15327
|
-
// eslint-disable-next-line no-console
|
|
15328
|
-
console.error('jsonata error', error, functionParams.jsonataDef);
|
|
15329
|
-
}
|
|
15330
|
-
}
|
|
15331
|
-
// traverse(result).set(i.path, value)
|
|
15332
|
-
result[pathArrayToJsonPointer(i.path)] = value;
|
|
15333
|
-
}
|
|
15334
|
-
return [2 /*return*/];
|
|
15335
|
-
});
|
|
15336
|
-
}); });
|
|
15337
|
-
return result;
|
|
15338
|
-
};var DATA_UPDATE = 'DATA_UPDATE';
|
|
15339
|
-
var PURGE$1 = 'PURGE';
|
|
15340
|
-
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) => ({
|
|
15341
15279
|
type: DATA_UPDATE,
|
|
15342
|
-
payload
|
|
15343
|
-
});
|
|
15344
|
-
|
|
15280
|
+
payload,
|
|
15281
|
+
});
|
|
15282
|
+
const purge = (payload) => ({
|
|
15345
15283
|
type: PURGE$1,
|
|
15346
|
-
payload
|
|
15347
|
-
});
|
|
15348
|
-
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
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);
|
|
15352
15289
|
};
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
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);
|
|
15358
15294
|
};
|
|
15359
|
-
|
|
15360
|
-
stock.reduxStore.dispatch(set$1(
|
|
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 })));
|
|
15361
15297
|
};
|
|
15362
15298
|
var functions = {
|
|
15363
|
-
getStateValue
|
|
15364
|
-
get
|
|
15365
|
-
set
|
|
15299
|
+
getStateValue,
|
|
15300
|
+
get,
|
|
15301
|
+
set,
|
|
15366
15302
|
};/**
|
|
15367
15303
|
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
|
15368
15304
|
*
|
|
@@ -15396,7 +15332,7 @@ var ActionTypes$1 = {
|
|
|
15396
15332
|
* @param {any} obj The object to inspect.
|
|
15397
15333
|
* @returns {boolean} True if the argument appears to be a plain object.
|
|
15398
15334
|
*/
|
|
15399
|
-
function isPlainObject$
|
|
15335
|
+
function isPlainObject$3(obj) {
|
|
15400
15336
|
if (typeof obj !== 'object' || obj === null) return false;
|
|
15401
15337
|
var proto = obj;
|
|
15402
15338
|
|
|
@@ -15472,7 +15408,7 @@ function kindOf$1(val) {
|
|
|
15472
15408
|
* @param {String} message The warning message.
|
|
15473
15409
|
* @returns {void}
|
|
15474
15410
|
*/
|
|
15475
|
-
function warning$
|
|
15411
|
+
function warning$1(message) {
|
|
15476
15412
|
/* eslint-disable no-console */
|
|
15477
15413
|
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
15478
15414
|
console.error(message);
|
|
@@ -15497,7 +15433,7 @@ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
|
|
|
15497
15433
|
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
15498
15434
|
}
|
|
15499
15435
|
|
|
15500
|
-
if (!isPlainObject$
|
|
15436
|
+
if (!isPlainObject$3(inputState)) {
|
|
15501
15437
|
return "The " + argumentName + " has unexpected type of \"" + kindOf$1(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
|
15502
15438
|
}
|
|
15503
15439
|
|
|
@@ -15559,7 +15495,7 @@ function combineReducers(reducers) {
|
|
|
15559
15495
|
|
|
15560
15496
|
if (process.env.NODE_ENV !== 'production') {
|
|
15561
15497
|
if (typeof reducers[key] === 'undefined') {
|
|
15562
|
-
warning$
|
|
15498
|
+
warning$1("No reducer provided for key \"" + key + "\"");
|
|
15563
15499
|
}
|
|
15564
15500
|
}
|
|
15565
15501
|
|
|
@@ -15598,7 +15534,7 @@ function combineReducers(reducers) {
|
|
|
15598
15534
|
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
15599
15535
|
|
|
15600
15536
|
if (warningMessage) {
|
|
15601
|
-
warning$
|
|
15537
|
+
warning$1(warningMessage);
|
|
15602
15538
|
}
|
|
15603
15539
|
}
|
|
15604
15540
|
|
|
@@ -15633,7 +15569,7 @@ function combineReducers(reducers) {
|
|
|
15633
15569
|
function isCrushed$1() {}
|
|
15634
15570
|
|
|
15635
15571
|
if (process.env.NODE_ENV !== 'production' && typeof isCrushed$1.name === 'string' && isCrushed$1.name !== 'isCrushed') {
|
|
15636
|
-
warning$
|
|
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.');
|
|
15637
15573
|
}function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
|
|
15638
15574
|
inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
|
|
15639
15575
|
outbound) {
|
|
@@ -15868,11 +15804,11 @@ var pick = flatRest(function(object, paths) {
|
|
|
15868
15804
|
return object == null ? {} : basePick(object, paths);
|
|
15869
15805
|
});
|
|
15870
15806
|
|
|
15871
|
-
var pick_1 = pick;
|
|
15807
|
+
var pick_1 = pick;const SetTransform = createTransform((inboundState, key) => {
|
|
15872
15808
|
if (key !== 'root')
|
|
15873
15809
|
return inboundState;
|
|
15874
15810
|
return pick_1(inboundState, PERSIST_STORAGE_NAMES);
|
|
15875
|
-
},
|
|
15811
|
+
}, (outboundState, key) => {
|
|
15876
15812
|
if (key !== 'root')
|
|
15877
15813
|
return outboundState;
|
|
15878
15814
|
return pick_1(outboundState, PERSIST_STORAGE_NAMES);
|
|
@@ -15882,81 +15818,80 @@ var persistConfig = {
|
|
|
15882
15818
|
whitelist: ['root'],
|
|
15883
15819
|
transforms: [SetTransform],
|
|
15884
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;
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
|
|
15821
|
+
const pathConverter = (path) => path.replace(/\./g, SEPARATOR);
|
|
15822
|
+
const errorConverter = (errors) => {
|
|
15823
|
+
const res = {};
|
|
15888
15824
|
if (errors) {
|
|
15889
|
-
errors.forEach(
|
|
15825
|
+
errors.forEach((i) => {
|
|
15890
15826
|
if (i.keyword === 'required') {
|
|
15891
|
-
jsonpointer.set(res,
|
|
15827
|
+
jsonpointer.set(res, `${pathConverter(`${i.instancePath}.${i.params.missingProperty}`)}/-`, i.message);
|
|
15892
15828
|
}
|
|
15893
15829
|
else {
|
|
15894
|
-
jsonpointer.set(res,
|
|
15830
|
+
jsonpointer.set(res, `${pathConverter(i.instancePath)}/-`, i.message);
|
|
15895
15831
|
}
|
|
15896
15832
|
});
|
|
15897
15833
|
}
|
|
15898
15834
|
return res;
|
|
15899
15835
|
};
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15836
|
+
const validateJSON = (schema, store, data) => {
|
|
15837
|
+
const ajv = new Ajv({ allErrors: true });
|
|
15838
|
+
const validate = ajv.compile(schema);
|
|
15839
|
+
const valid = validate(data);
|
|
15904
15840
|
return {
|
|
15905
|
-
store:
|
|
15906
|
-
valid
|
|
15841
|
+
store: `${store}${STORE_ERROR_POSTFIX}`,
|
|
15842
|
+
valid,
|
|
15907
15843
|
value: valid ? null : errorConverter(validate.errors),
|
|
15908
15844
|
};
|
|
15909
|
-
};
|
|
15910
|
-
|
|
15845
|
+
};const initialState$1 = {};
|
|
15846
|
+
const validateNewState = (stock, newState, actionStore, actionPath) => {
|
|
15911
15847
|
if (stock === null || stock === void 0 ? void 0 : stock.validations) {
|
|
15912
|
-
stock.validations.forEach(
|
|
15913
|
-
if (validateItem.store === actionStore &&
|
|
15848
|
+
stock.validations.forEach((validateItem) => {
|
|
15849
|
+
if (validateItem.store === actionStore && `${actionPath}`.startsWith(validateItem.path)) {
|
|
15914
15850
|
if (validateItem.schema) {
|
|
15915
|
-
|
|
15916
|
-
|
|
15851
|
+
const stateToBeValidated = jsonPointerGet(newState, `${SEPARATOR}${actionStore}${validateItem.path}`);
|
|
15852
|
+
const errors = validateJSON(validateItem.schema, actionStore, stateToBeValidated);
|
|
15917
15853
|
// console.log('matched validator', `${c.SEPARATOR}${errors.store}${validateItem.path}`, errors)
|
|
15918
15854
|
// eslint-disable-next-line no-param-reassign
|
|
15919
|
-
newState = jsonPointerSet(newState,
|
|
15855
|
+
newState = jsonPointerSet(newState, `${SEPARATOR}${errors.store}${validateItem.path}`, errors.value);
|
|
15920
15856
|
}
|
|
15921
15857
|
}
|
|
15922
15858
|
});
|
|
15923
15859
|
}
|
|
15924
15860
|
};
|
|
15925
|
-
|
|
15926
|
-
if (state === void 0) { state = initialState$1; }
|
|
15861
|
+
const reducer = (state = initialState$1, action) => {
|
|
15927
15862
|
switch (action === null || action === void 0 ? void 0 : action.type) {
|
|
15928
15863
|
case DATA_UPDATE: {
|
|
15929
|
-
|
|
15930
|
-
if (
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
? changeRelativePath(
|
|
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}`)
|
|
15934
15869
|
: changeRelativePath(path);
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
if (
|
|
15870
|
+
convertedPath = convertedPath.startsWith(SEPARATOR) ? convertedPath : `${SEPARATOR}${convertedPath}`;
|
|
15871
|
+
const absolutePathWithStoreKey = `${SEPARATOR}${storekey}${convertedPath}`;
|
|
15872
|
+
const newState = produce(state, (draft) => {
|
|
15873
|
+
if (jsonataDef) {
|
|
15939
15874
|
try {
|
|
15940
15875
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15876
|
+
const jsonata = require('jsonata');
|
|
15877
|
+
const expression = jsonata(jsonataDef);
|
|
15878
|
+
const newValue = expression.evaluate(value);
|
|
15944
15879
|
// eslint-disable-next-line no-param-reassign
|
|
15945
|
-
draft = jsonPointerSet(draft,
|
|
15880
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, newValue);
|
|
15946
15881
|
}
|
|
15947
15882
|
catch (error) {
|
|
15948
15883
|
// eslint-disable-next-line no-console
|
|
15949
|
-
console.error('jsonata error', error,
|
|
15884
|
+
console.error('jsonata error', error, jsonataDef);
|
|
15950
15885
|
// eslint-disable-next-line no-param-reassign
|
|
15951
|
-
draft = jsonPointerSet(draft,
|
|
15886
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
|
|
15952
15887
|
}
|
|
15953
15888
|
}
|
|
15954
15889
|
else {
|
|
15955
15890
|
// eslint-disable-next-line no-param-reassign
|
|
15956
|
-
draft = jsonPointerSet(draft,
|
|
15891
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
|
|
15957
15892
|
}
|
|
15958
15893
|
// if validatior has match, need to validate it synchronously
|
|
15959
|
-
validateNewState(
|
|
15894
|
+
validateNewState(stock, draft, store, convertedPath);
|
|
15960
15895
|
});
|
|
15961
15896
|
return newState;
|
|
15962
15897
|
}
|
|
@@ -15968,19 +15903,11 @@ var reducer = function (state, action) {
|
|
|
15968
15903
|
default:
|
|
15969
15904
|
return state;
|
|
15970
15905
|
}
|
|
15971
|
-
};
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
return [4 /*yield*/, stock.callFunction('reloadApp', {})];
|
|
15977
|
-
case 1:
|
|
15978
|
-
_a.sent();
|
|
15979
|
-
return [2 /*return*/];
|
|
15980
|
-
}
|
|
15981
|
-
});
|
|
15982
|
-
}); };
|
|
15983
|
-
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 };
|
|
15984
15911
|
|
|
15985
15912
|
/**
|
|
15986
15913
|
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
@@ -16426,7 +16353,7 @@ var _getNative = getNative$3;
|
|
|
16426
16353
|
|
|
16427
16354
|
var getNative$2 = _getNative;
|
|
16428
16355
|
|
|
16429
|
-
var defineProperty$
|
|
16356
|
+
var defineProperty$2 = (function() {
|
|
16430
16357
|
try {
|
|
16431
16358
|
var func = getNative$2(Object, 'defineProperty');
|
|
16432
16359
|
func({}, '', {});
|
|
@@ -16434,10 +16361,10 @@ var defineProperty$3 = (function() {
|
|
|
16434
16361
|
} catch (e) {}
|
|
16435
16362
|
}());
|
|
16436
16363
|
|
|
16437
|
-
var _defineProperty$4 = defineProperty$
|
|
16364
|
+
var _defineProperty$4 = defineProperty$2;
|
|
16438
16365
|
|
|
16439
16366
|
var constant = constant_1,
|
|
16440
|
-
defineProperty$
|
|
16367
|
+
defineProperty$1 = _defineProperty$4,
|
|
16441
16368
|
identity$1 = identity_1;
|
|
16442
16369
|
|
|
16443
16370
|
/**
|
|
@@ -16448,8 +16375,8 @@ var constant = constant_1,
|
|
|
16448
16375
|
* @param {Function} string The `toString` result.
|
|
16449
16376
|
* @returns {Function} Returns `func`.
|
|
16450
16377
|
*/
|
|
16451
|
-
var baseSetToString$1 = !defineProperty$
|
|
16452
|
-
return defineProperty$
|
|
16378
|
+
var baseSetToString$1 = !defineProperty$1 ? identity$1 : function(func, string) {
|
|
16379
|
+
return defineProperty$1(func, 'toString', {
|
|
16453
16380
|
'configurable': true,
|
|
16454
16381
|
'enumerable': false,
|
|
16455
16382
|
'value': constant(string),
|
|
@@ -17200,7 +17127,7 @@ Stack$1.prototype.set = stackSet;
|
|
|
17200
17127
|
|
|
17201
17128
|
var _Stack = Stack$1;
|
|
17202
17129
|
|
|
17203
|
-
var defineProperty
|
|
17130
|
+
var defineProperty = _defineProperty$4;
|
|
17204
17131
|
|
|
17205
17132
|
/**
|
|
17206
17133
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
@@ -17212,8 +17139,8 @@ var defineProperty$1 = _defineProperty$4;
|
|
|
17212
17139
|
* @param {*} value The value to assign.
|
|
17213
17140
|
*/
|
|
17214
17141
|
function baseAssignValue$3(object, key, value) {
|
|
17215
|
-
if (key == '__proto__' && defineProperty
|
|
17216
|
-
defineProperty
|
|
17142
|
+
if (key == '__proto__' && defineProperty) {
|
|
17143
|
+
defineProperty(object, key, {
|
|
17217
17144
|
'configurable': true,
|
|
17218
17145
|
'enumerable': true,
|
|
17219
17146
|
'value': value,
|
|
@@ -17819,7 +17746,7 @@ var objectCtorString = funcToString.call(Object);
|
|
|
17819
17746
|
* _.isPlainObject(Object.create(null));
|
|
17820
17747
|
* // => true
|
|
17821
17748
|
*/
|
|
17822
|
-
function isPlainObject$
|
|
17749
|
+
function isPlainObject$2(value) {
|
|
17823
17750
|
if (!isObjectLike$1(value) || baseGetTag$1(value) != objectTag$1) {
|
|
17824
17751
|
return false;
|
|
17825
17752
|
}
|
|
@@ -17832,7 +17759,7 @@ function isPlainObject$3(value) {
|
|
|
17832
17759
|
funcToString.call(Ctor) == objectCtorString;
|
|
17833
17760
|
}
|
|
17834
17761
|
|
|
17835
|
-
var isPlainObject_1 = isPlainObject$
|
|
17762
|
+
var isPlainObject_1 = isPlainObject$2;
|
|
17836
17763
|
|
|
17837
17764
|
var baseGetTag = _baseGetTag,
|
|
17838
17765
|
isLength = isLength_1,
|
|
@@ -18299,7 +18226,7 @@ var assignMergeValue$1 = _assignMergeValue,
|
|
|
18299
18226
|
isBuffer = isBuffer$2.exports,
|
|
18300
18227
|
isFunction = isFunction_1,
|
|
18301
18228
|
isObject$3 = isObject_1,
|
|
18302
|
-
isPlainObject$
|
|
18229
|
+
isPlainObject$1 = isPlainObject_1,
|
|
18303
18230
|
isTypedArray = isTypedArray_1,
|
|
18304
18231
|
safeGet$1 = _safeGet,
|
|
18305
18232
|
toPlainObject = toPlainObject_1;
|
|
@@ -18359,7 +18286,7 @@ function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, s
|
|
|
18359
18286
|
newValue = [];
|
|
18360
18287
|
}
|
|
18361
18288
|
}
|
|
18362
|
-
else if (isPlainObject$
|
|
18289
|
+
else if (isPlainObject$1(srcValue) || isArguments(srcValue)) {
|
|
18363
18290
|
newValue = objValue;
|
|
18364
18291
|
if (isArguments(objValue)) {
|
|
18365
18292
|
newValue = toPlainObject(objValue);
|
|
@@ -18595,31 +18522,33 @@ var defaultsDeep = baseRest(function(args) {
|
|
|
18595
18522
|
|
|
18596
18523
|
var defaultsDeep_1 = defaultsDeep;
|
|
18597
18524
|
|
|
18598
|
-
function Text(
|
|
18599
|
-
|
|
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);
|
|
18600
18529
|
}
|
|
18601
18530
|
|
|
18602
18531
|
function Button(props) {
|
|
18603
18532
|
// eslint-disable-next-line react/button-has-type
|
|
18604
|
-
return jsxRuntime$1.exports.jsx("button",
|
|
18533
|
+
return jsxRuntime$1.exports.jsx("button", Object.assign({}, props), void 0);
|
|
18605
18534
|
}
|
|
18606
18535
|
|
|
18607
18536
|
function Edit(props) {
|
|
18608
|
-
|
|
18537
|
+
const handleChange = (event) => {
|
|
18609
18538
|
props === null || props === void 0 ? void 0 : props.onChange(event.target.value);
|
|
18610
18539
|
};
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
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;
|
|
18614
18543
|
if (error && fieldErrors) {
|
|
18615
18544
|
helperText = fieldErrors && Array.isArray(fieldErrors) ? fieldErrors.join(', ') : fieldErrors;
|
|
18616
18545
|
}
|
|
18617
18546
|
if (validation && value && validation.jsonataDef) {
|
|
18618
|
-
|
|
18547
|
+
let isValid = true;
|
|
18619
18548
|
try {
|
|
18620
18549
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
18621
|
-
|
|
18622
|
-
|
|
18550
|
+
const jsonata = require('jsonata');
|
|
18551
|
+
const expression = jsonata(validation.jsonataDef);
|
|
18623
18552
|
isValid = expression.evaluate(value);
|
|
18624
18553
|
}
|
|
18625
18554
|
catch (err) {
|
|
@@ -18632,19 +18561,21 @@ function Edit(props) {
|
|
|
18632
18561
|
helperText = validation.fieldErrors && Array.isArray(validation.fieldErrors) ? validation.fieldErrors.join(', ') : validation.fieldErrors;
|
|
18633
18562
|
}
|
|
18634
18563
|
}
|
|
18635
|
-
return (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx("p",
|
|
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));
|
|
18636
18565
|
}
|
|
18637
18566
|
|
|
18638
|
-
function View(
|
|
18639
|
-
|
|
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);
|
|
18640
18571
|
}
|
|
18641
18572
|
|
|
18642
18573
|
function Image(props) {
|
|
18643
|
-
|
|
18644
|
-
return jsxRuntime$1.exports.jsx("img",
|
|
18574
|
+
const { src } = props;
|
|
18575
|
+
return jsxRuntime$1.exports.jsx("img", Object.assign({ alt: "" }, props, { src: src && src.uri ? src.uri : src }), void 0);
|
|
18645
18576
|
}
|
|
18646
18577
|
|
|
18647
|
-
|
|
18578
|
+
const styles = {
|
|
18648
18579
|
label: {
|
|
18649
18580
|
backgroundColor: '#ffffaa',
|
|
18650
18581
|
borderColor: '#666666',
|
|
@@ -18665,45 +18596,41 @@ var styles = {
|
|
|
18665
18596
|
display: 'block',
|
|
18666
18597
|
},
|
|
18667
18598
|
};
|
|
18668
|
-
|
|
18599
|
+
const getName = (props) => {
|
|
18669
18600
|
if (props && props[constants.V_COMP_NAME]) {
|
|
18670
18601
|
return props[constants.V_COMP_NAME];
|
|
18671
18602
|
}
|
|
18672
18603
|
return 'Unknown';
|
|
18673
18604
|
};
|
|
18674
|
-
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
}
|
|
18683
|
-
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() {
|
|
18684
18613
|
this.counter += 1;
|
|
18685
|
-
}
|
|
18686
|
-
|
|
18614
|
+
}
|
|
18615
|
+
componentDidUpdate() {
|
|
18687
18616
|
this.counter += 1;
|
|
18688
|
-
}
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18617
|
+
}
|
|
18618
|
+
render() {
|
|
18619
|
+
const { id } = this.props;
|
|
18620
|
+
const { filter } = this.props;
|
|
18621
|
+
const component = this.props[constants.V_COMP_NAME];
|
|
18693
18622
|
if (!component || component === '_PrimitiveProp') {
|
|
18694
18623
|
return null;
|
|
18695
18624
|
}
|
|
18696
18625
|
if (filter && Array.isArray(filter) && Object.keys(filter).length !== 0 && !filter.includes(id)) {
|
|
18697
18626
|
return null;
|
|
18698
18627
|
}
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
return InfoBox;
|
|
18703
|
-
})(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
|
+
}
|
|
18704
18631
|
|
|
18705
18632
|
function Undefined(props) {
|
|
18706
|
-
return (jsxRuntime$1.exports.jsx("p",
|
|
18633
|
+
return (jsxRuntime$1.exports.jsx("p", Object.assign({ style: {
|
|
18707
18634
|
flex: 1,
|
|
18708
18635
|
minWidth: 100,
|
|
18709
18636
|
minHeight: 20,
|
|
@@ -18713,34 +18640,34 @@ function Undefined(props) {
|
|
|
18713
18640
|
} }, { children: getLabel(props) }), void 0));
|
|
18714
18641
|
}
|
|
18715
18642
|
|
|
18716
|
-
function PrimitiveProp(
|
|
18717
|
-
var children = _a.children;
|
|
18643
|
+
function PrimitiveProp({ [constants.V_CHILDREN_NAME]: children }) {
|
|
18718
18644
|
return jsxRuntime$1.exports.jsx("span", { children: !constants.SIMPLE_DATA_TYPES.includes(typeof children) || typeof children === 'boolean' ? JSON.stringify(children) : children }, void 0);
|
|
18719
18645
|
}
|
|
18720
18646
|
|
|
18721
|
-
|
|
18722
|
-
var
|
|
18723
|
-
|
|
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);
|
|
18724
18651
|
};
|
|
18725
18652
|
|
|
18726
|
-
|
|
18727
|
-
View
|
|
18653
|
+
const Components = {
|
|
18654
|
+
View,
|
|
18728
18655
|
_PrimitiveProp: PrimitiveProp,
|
|
18729
18656
|
_Undefined: Undefined,
|
|
18730
|
-
Fragment
|
|
18731
|
-
Image
|
|
18732
|
-
Text
|
|
18733
|
-
Button
|
|
18734
|
-
Edit
|
|
18657
|
+
Fragment,
|
|
18658
|
+
Image,
|
|
18659
|
+
Text,
|
|
18660
|
+
Button,
|
|
18661
|
+
Edit,
|
|
18735
18662
|
};
|
|
18736
18663
|
|
|
18737
18664
|
// eslint-disable-next-line import/prefer-default-export
|
|
18738
|
-
|
|
18739
|
-
|
|
18665
|
+
const getStock = (stockInit, model, Wrapper, reduxStore) => {
|
|
18666
|
+
const stock = new Stock(defaultsDeep_1(stockInit, {
|
|
18740
18667
|
components: Components,
|
|
18741
|
-
functions
|
|
18668
|
+
functions,
|
|
18742
18669
|
}), Wrapper, reduxStore);
|
|
18743
|
-
|
|
18670
|
+
const i18n = new I18n({
|
|
18744
18671
|
language: (navigator.languages && navigator.languages[0]) || // Chrome / Firefox
|
|
18745
18672
|
navigator.language || // All browsers
|
|
18746
18673
|
navigator.userLanguage,
|
|
@@ -18748,18 +18675,18 @@ var getStock = function (stockInit, model, Wrapper, reduxStore) {
|
|
|
18748
18675
|
});
|
|
18749
18676
|
// get Validations
|
|
18750
18677
|
stock.validations = util$1.collectObjToArray(constants.REF_VALIDATES, model);
|
|
18751
|
-
stock.registerFunction('t',
|
|
18752
|
-
stock.registerFunction('test',
|
|
18678
|
+
stock.registerFunction('t', (p) => i18n.t(p.keys, p.options));
|
|
18679
|
+
stock.registerFunction('test', () => 'Test is ok');
|
|
18753
18680
|
return stock;
|
|
18754
18681
|
};
|
|
18755
|
-
|
|
18682
|
+
const stock = {
|
|
18756
18683
|
components: Components,
|
|
18757
|
-
functions
|
|
18684
|
+
functions,
|
|
18758
18685
|
};
|
|
18759
18686
|
|
|
18760
18687
|
var propTypes = {exports: {}};
|
|
18761
18688
|
|
|
18762
|
-
var reactIs$
|
|
18689
|
+
var reactIs$2 = {exports: {}};
|
|
18763
18690
|
|
|
18764
18691
|
var reactIs_production_min$2 = {};
|
|
18765
18692
|
|
|
@@ -18960,9 +18887,9 @@ reactIs_development$2.typeOf = typeOf;
|
|
|
18960
18887
|
}
|
|
18961
18888
|
|
|
18962
18889
|
if (process.env.NODE_ENV === 'production') {
|
|
18963
|
-
reactIs$
|
|
18890
|
+
reactIs$2.exports = reactIs_production_min$2;
|
|
18964
18891
|
} else {
|
|
18965
|
-
reactIs$
|
|
18892
|
+
reactIs$2.exports = reactIs_development$2;
|
|
18966
18893
|
}
|
|
18967
18894
|
|
|
18968
18895
|
/**
|
|
@@ -19087,7 +19014,7 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
19087
19014
|
* LICENSE file in the root directory of this source tree.
|
|
19088
19015
|
*/
|
|
19089
19016
|
|
|
19090
|
-
var ReactIs$1 = reactIs$
|
|
19017
|
+
var ReactIs$1 = reactIs$2.exports;
|
|
19091
19018
|
var assign$1 = objectAssign$1;
|
|
19092
19019
|
|
|
19093
19020
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
@@ -19759,7 +19686,7 @@ var factoryWithThrowingShims = function() {
|
|
|
19759
19686
|
*/
|
|
19760
19687
|
|
|
19761
19688
|
if (process.env.NODE_ENV !== 'production') {
|
|
19762
|
-
var ReactIs = reactIs$
|
|
19689
|
+
var ReactIs = reactIs$2.exports;
|
|
19763
19690
|
|
|
19764
19691
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
19765
19692
|
// http://fb.me/prop-types-in-prod
|
|
@@ -19976,40 +19903,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
19976
19903
|
};
|
|
19977
19904
|
}
|
|
19978
19905
|
|
|
19979
|
-
|
|
19980
|
-
_extends = Object.assign || function (target) {
|
|
19981
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
19982
|
-
var source = arguments[i];
|
|
19983
|
-
|
|
19984
|
-
for (var key in source) {
|
|
19985
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19986
|
-
target[key] = source[key];
|
|
19987
|
-
}
|
|
19988
|
-
}
|
|
19989
|
-
}
|
|
19990
|
-
|
|
19991
|
-
return target;
|
|
19992
|
-
};
|
|
19993
|
-
|
|
19994
|
-
return _extends.apply(this, arguments);
|
|
19995
|
-
}
|
|
19996
|
-
|
|
19997
|
-
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
19998
|
-
if (source == null) return {};
|
|
19999
|
-
var target = {};
|
|
20000
|
-
var sourceKeys = Object.keys(source);
|
|
20001
|
-
var key, i;
|
|
20002
|
-
|
|
20003
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
20004
|
-
key = sourceKeys[i];
|
|
20005
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
20006
|
-
target[key] = source[key];
|
|
20007
|
-
}
|
|
20008
|
-
|
|
20009
|
-
return target;
|
|
20010
|
-
}
|
|
20011
|
-
|
|
20012
|
-
var reactIs$2 = {exports: {}};
|
|
19906
|
+
var reactIs$1 = {exports: {}};
|
|
20013
19907
|
|
|
20014
19908
|
var reactIs_production_min$1 = {};
|
|
20015
19909
|
|
|
@@ -20210,39 +20104,12 @@ reactIs_development$1.typeOf = typeOf;
|
|
|
20210
20104
|
}
|
|
20211
20105
|
|
|
20212
20106
|
if (process.env.NODE_ENV === 'production') {
|
|
20213
|
-
reactIs$
|
|
20107
|
+
reactIs$1.exports = reactIs_production_min$1;
|
|
20214
20108
|
} else {
|
|
20215
|
-
reactIs$
|
|
20109
|
+
reactIs$1.exports = reactIs_development$1;
|
|
20216
20110
|
}
|
|
20217
20111
|
|
|
20218
|
-
var reactIs
|
|
20219
|
-
|
|
20220
|
-
/**
|
|
20221
|
-
* Copyright 2015, Yahoo! Inc.
|
|
20222
|
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
20223
|
-
*/
|
|
20224
|
-
var REACT_STATICS = {
|
|
20225
|
-
childContextTypes: true,
|
|
20226
|
-
contextType: true,
|
|
20227
|
-
contextTypes: true,
|
|
20228
|
-
defaultProps: true,
|
|
20229
|
-
displayName: true,
|
|
20230
|
-
getDefaultProps: true,
|
|
20231
|
-
getDerivedStateFromError: true,
|
|
20232
|
-
getDerivedStateFromProps: true,
|
|
20233
|
-
mixins: true,
|
|
20234
|
-
propTypes: true,
|
|
20235
|
-
type: true
|
|
20236
|
-
};
|
|
20237
|
-
var KNOWN_STATICS = {
|
|
20238
|
-
name: true,
|
|
20239
|
-
length: true,
|
|
20240
|
-
prototype: true,
|
|
20241
|
-
caller: true,
|
|
20242
|
-
callee: true,
|
|
20243
|
-
arguments: true,
|
|
20244
|
-
arity: true
|
|
20245
|
-
};
|
|
20112
|
+
var reactIs = reactIs$1.exports;
|
|
20246
20113
|
var FORWARD_REF_STATICS = {
|
|
20247
20114
|
'$$typeof': true,
|
|
20248
20115
|
render: true,
|
|
@@ -20259,65 +20126,8 @@ var MEMO_STATICS = {
|
|
|
20259
20126
|
type: true
|
|
20260
20127
|
};
|
|
20261
20128
|
var TYPE_STATICS = {};
|
|
20262
|
-
TYPE_STATICS[reactIs
|
|
20263
|
-
TYPE_STATICS[reactIs
|
|
20264
|
-
|
|
20265
|
-
function getStatics(component) {
|
|
20266
|
-
// React v16.11 and below
|
|
20267
|
-
if (reactIs$1.isMemo(component)) {
|
|
20268
|
-
return MEMO_STATICS;
|
|
20269
|
-
} // React v16.12 and above
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
|
20273
|
-
}
|
|
20274
|
-
|
|
20275
|
-
var defineProperty = Object.defineProperty;
|
|
20276
|
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
20277
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
20278
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
20279
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
20280
|
-
var objectPrototype = Object.prototype;
|
|
20281
|
-
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
20282
|
-
if (typeof sourceComponent !== 'string') {
|
|
20283
|
-
// don't hoist over string (html) components
|
|
20284
|
-
if (objectPrototype) {
|
|
20285
|
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
20286
|
-
|
|
20287
|
-
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
20288
|
-
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
20289
|
-
}
|
|
20290
|
-
}
|
|
20291
|
-
|
|
20292
|
-
var keys = getOwnPropertyNames(sourceComponent);
|
|
20293
|
-
|
|
20294
|
-
if (getOwnPropertySymbols) {
|
|
20295
|
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
20296
|
-
}
|
|
20297
|
-
|
|
20298
|
-
var targetStatics = getStatics(targetComponent);
|
|
20299
|
-
var sourceStatics = getStatics(sourceComponent);
|
|
20300
|
-
|
|
20301
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
20302
|
-
var key = keys[i];
|
|
20303
|
-
|
|
20304
|
-
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
20305
|
-
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
20306
|
-
|
|
20307
|
-
try {
|
|
20308
|
-
// Avoid failures from read-only properties
|
|
20309
|
-
defineProperty(targetComponent, key, descriptor);
|
|
20310
|
-
} catch (e) {}
|
|
20311
|
-
}
|
|
20312
|
-
}
|
|
20313
|
-
}
|
|
20314
|
-
|
|
20315
|
-
return targetComponent;
|
|
20316
|
-
}
|
|
20317
|
-
|
|
20318
|
-
var hoistNonReactStatics_cjs = hoistNonReactStatics;
|
|
20319
|
-
|
|
20320
|
-
var reactIs = {exports: {}};
|
|
20129
|
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
20130
|
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
20321
20131
|
|
|
20322
20132
|
var reactIs_production_min = {};
|
|
20323
20133
|
|
|
@@ -20559,395 +20369,21 @@ reactIs_development.typeOf = typeOf;
|
|
|
20559
20369
|
})();
|
|
20560
20370
|
}
|
|
20561
20371
|
|
|
20562
|
-
if (process.env.NODE_ENV === 'production')
|
|
20563
|
-
reactIs.exports = reactIs_production_min;
|
|
20564
|
-
} else {
|
|
20565
|
-
reactIs.exports = reactIs_development;
|
|
20566
|
-
}
|
|
20567
|
-
|
|
20568
|
-
var _excluded$2 = ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"],
|
|
20569
|
-
_excluded2 = ["reactReduxForwardedRef"];
|
|
20372
|
+
if (process.env.NODE_ENV === 'production') ;
|
|
20570
20373
|
|
|
20571
|
-
|
|
20572
|
-
|
|
20573
|
-
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
return JSON.stringify(Comp);
|
|
20577
|
-
} catch (err) {
|
|
20578
|
-
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;
|
|
20579
20379
|
}
|
|
20580
|
-
};
|
|
20581
|
-
|
|
20582
|
-
function storeStateUpdatesReducer(state, action) {
|
|
20583
|
-
var updateCount = state[1];
|
|
20584
|
-
return [action.payload, updateCount + 1];
|
|
20585
20380
|
}
|
|
20586
20381
|
|
|
20587
|
-
function
|
|
20588
|
-
|
|
20589
|
-
return effectFunc.apply(void 0, effectArgs);
|
|
20590
|
-
}, dependencies);
|
|
20591
|
-
}
|
|
20592
|
-
|
|
20593
|
-
function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {
|
|
20594
|
-
// We want to capture the wrapper props and child props we used for later comparisons
|
|
20595
|
-
lastWrapperProps.current = wrapperProps;
|
|
20596
|
-
lastChildProps.current = actualChildProps;
|
|
20597
|
-
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;
|
|
20598
20384
|
|
|
20599
|
-
if (
|
|
20600
|
-
|
|
20601
|
-
notifyNestedSubs();
|
|
20602
|
-
}
|
|
20603
|
-
}
|
|
20604
|
-
|
|
20605
|
-
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {
|
|
20606
|
-
// If we're not subscribed to the store, nothing to do here
|
|
20607
|
-
if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts
|
|
20608
|
-
|
|
20609
|
-
var didUnsubscribe = false;
|
|
20610
|
-
var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
|
|
20611
|
-
|
|
20612
|
-
var checkForUpdates = function checkForUpdates() {
|
|
20613
|
-
if (didUnsubscribe) {
|
|
20614
|
-
// Don't run stale listeners.
|
|
20615
|
-
// Redux doesn't guarantee unsubscriptions happen until next dispatch.
|
|
20616
|
-
return;
|
|
20617
|
-
}
|
|
20618
|
-
|
|
20619
|
-
var latestStoreState = store.getState();
|
|
20620
|
-
var newChildProps, error;
|
|
20621
|
-
|
|
20622
|
-
try {
|
|
20623
|
-
// Actually run the selector with the most recent store state and wrapper props
|
|
20624
|
-
// to determine what the child props should be
|
|
20625
|
-
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
|
|
20626
|
-
} catch (e) {
|
|
20627
|
-
error = e;
|
|
20628
|
-
lastThrownError = e;
|
|
20629
|
-
}
|
|
20630
|
-
|
|
20631
|
-
if (!error) {
|
|
20632
|
-
lastThrownError = null;
|
|
20633
|
-
} // If the child props haven't changed, nothing to do here - cascade the subscription update
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
if (newChildProps === lastChildProps.current) {
|
|
20637
|
-
if (!renderIsScheduled.current) {
|
|
20638
|
-
notifyNestedSubs();
|
|
20639
|
-
}
|
|
20640
|
-
} else {
|
|
20641
|
-
// Save references to the new child props. Note that we track the "child props from store update"
|
|
20642
|
-
// as a ref instead of a useState/useReducer because we need a way to determine if that value has
|
|
20643
|
-
// been processed. If this went into useState/useReducer, we couldn't clear out the value without
|
|
20644
|
-
// forcing another re-render, which we don't want.
|
|
20645
|
-
lastChildProps.current = newChildProps;
|
|
20646
|
-
childPropsFromStoreUpdate.current = newChildProps;
|
|
20647
|
-
renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render
|
|
20648
|
-
|
|
20649
|
-
forceComponentUpdateDispatch({
|
|
20650
|
-
type: 'STORE_UPDATED',
|
|
20651
|
-
payload: {
|
|
20652
|
-
error: error
|
|
20653
|
-
}
|
|
20654
|
-
});
|
|
20655
|
-
}
|
|
20656
|
-
}; // Actually subscribe to the nearest connected ancestor (or store)
|
|
20657
|
-
|
|
20658
|
-
|
|
20659
|
-
subscription.onStateChange = checkForUpdates;
|
|
20660
|
-
subscription.trySubscribe(); // Pull data from the store after first render in case the store has
|
|
20661
|
-
// changed since we began.
|
|
20662
|
-
|
|
20663
|
-
checkForUpdates();
|
|
20664
|
-
|
|
20665
|
-
var unsubscribeWrapper = function unsubscribeWrapper() {
|
|
20666
|
-
didUnsubscribe = true;
|
|
20667
|
-
subscription.tryUnsubscribe();
|
|
20668
|
-
subscription.onStateChange = null;
|
|
20669
|
-
|
|
20670
|
-
if (lastThrownError) {
|
|
20671
|
-
// It's possible that we caught an error due to a bad mapState function, but the
|
|
20672
|
-
// parent re-rendered without this component and we're about to unmount.
|
|
20673
|
-
// This shouldn't happen as long as we do top-down subscriptions correctly, but
|
|
20674
|
-
// if we ever do those wrong, this throw will surface the error in our tests.
|
|
20675
|
-
// In that case, throw the error from here so it doesn't get lost.
|
|
20676
|
-
throw lastThrownError;
|
|
20677
|
-
}
|
|
20678
|
-
};
|
|
20679
|
-
|
|
20680
|
-
return unsubscribeWrapper;
|
|
20681
|
-
}
|
|
20682
|
-
|
|
20683
|
-
var initStateUpdates = function initStateUpdates() {
|
|
20684
|
-
return [null, 0];
|
|
20685
|
-
};
|
|
20686
|
-
|
|
20687
|
-
function connectAdvanced(
|
|
20688
|
-
/*
|
|
20689
|
-
selectorFactory is a func that is responsible for returning the selector function used to
|
|
20690
|
-
compute new props from state, props, and dispatch. For example:
|
|
20691
|
-
export default connectAdvanced((dispatch, options) => (state, props) => ({
|
|
20692
|
-
thing: state.things[props.thingId],
|
|
20693
|
-
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
|
|
20694
|
-
}))(YourComponent)
|
|
20695
|
-
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
|
|
20696
|
-
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
|
|
20697
|
-
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
|
|
20698
|
-
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
|
|
20699
|
-
props. Do not use connectAdvanced directly without memoizing results between calls to your
|
|
20700
|
-
selector, otherwise the Connect component will re-render on every state or props change.
|
|
20701
|
-
*/
|
|
20702
|
-
selectorFactory, // options object:
|
|
20703
|
-
_ref) {
|
|
20704
|
-
if (_ref === void 0) {
|
|
20705
|
-
_ref = {};
|
|
20706
|
-
}
|
|
20707
|
-
|
|
20708
|
-
var _ref2 = _ref,
|
|
20709
|
-
_ref2$getDisplayName = _ref2.getDisplayName,
|
|
20710
|
-
getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
|
|
20711
|
-
return "ConnectAdvanced(" + name + ")";
|
|
20712
|
-
} : _ref2$getDisplayName,
|
|
20713
|
-
_ref2$methodName = _ref2.methodName,
|
|
20714
|
-
methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
|
|
20715
|
-
_ref2$renderCountProp = _ref2.renderCountProp,
|
|
20716
|
-
renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
|
|
20717
|
-
_ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
|
|
20718
|
-
shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
|
|
20719
|
-
_ref2$storeKey = _ref2.storeKey,
|
|
20720
|
-
storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
|
|
20721
|
-
_ref2$withRef = _ref2.withRef,
|
|
20722
|
-
withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
|
|
20723
|
-
_ref2$forwardRef = _ref2.forwardRef,
|
|
20724
|
-
forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,
|
|
20725
|
-
_ref2$context = _ref2.context,
|
|
20726
|
-
context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,
|
|
20727
|
-
connectOptions = _objectWithoutPropertiesLoose$1(_ref2, _excluded$2);
|
|
20728
|
-
|
|
20729
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
20730
|
-
if (renderCountProp !== undefined) {
|
|
20731
|
-
throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");
|
|
20732
|
-
}
|
|
20733
|
-
|
|
20734
|
-
if (withRef) {
|
|
20735
|
-
throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');
|
|
20736
|
-
}
|
|
20737
|
-
|
|
20738
|
-
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';
|
|
20739
|
-
|
|
20740
|
-
if (storeKey !== 'store') {
|
|
20741
|
-
throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);
|
|
20742
|
-
}
|
|
20743
|
-
}
|
|
20744
|
-
|
|
20745
|
-
var Context = context;
|
|
20746
|
-
return function wrapWithConnect(WrappedComponent) {
|
|
20747
|
-
if (process.env.NODE_ENV !== 'production' && !reactIs.exports.isValidElementType(WrappedComponent)) {
|
|
20748
|
-
throw new Error("You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent)));
|
|
20749
|
-
}
|
|
20750
|
-
|
|
20751
|
-
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
20752
|
-
var displayName = getDisplayName(wrappedComponentName);
|
|
20753
|
-
|
|
20754
|
-
var selectorFactoryOptions = _extends({}, connectOptions, {
|
|
20755
|
-
getDisplayName: getDisplayName,
|
|
20756
|
-
methodName: methodName,
|
|
20757
|
-
renderCountProp: renderCountProp,
|
|
20758
|
-
shouldHandleStateChanges: shouldHandleStateChanges,
|
|
20759
|
-
storeKey: storeKey,
|
|
20760
|
-
displayName: displayName,
|
|
20761
|
-
wrappedComponentName: wrappedComponentName,
|
|
20762
|
-
WrappedComponent: WrappedComponent
|
|
20763
|
-
});
|
|
20764
|
-
|
|
20765
|
-
var pure = connectOptions.pure;
|
|
20766
|
-
|
|
20767
|
-
function createChildSelector(store) {
|
|
20768
|
-
return selectorFactory(store.dispatch, selectorFactoryOptions);
|
|
20769
|
-
} // If we aren't running in "pure" mode, we don't want to memoize values.
|
|
20770
|
-
// To avoid conditionally calling hooks, we fall back to a tiny wrapper
|
|
20771
|
-
// that just executes the given callback immediately.
|
|
20772
|
-
|
|
20773
|
-
|
|
20774
|
-
var usePureOnlyMemo = pure ? React.useMemo : function (callback) {
|
|
20775
|
-
return callback();
|
|
20776
|
-
};
|
|
20777
|
-
|
|
20778
|
-
function ConnectFunction(props) {
|
|
20779
|
-
var _useMemo = React.useMemo(function () {
|
|
20780
|
-
// Distinguish between actual "data" props that were passed to the wrapper component,
|
|
20781
|
-
// and values needed to control behavior (forwarded refs, alternate context instances).
|
|
20782
|
-
// To maintain the wrapperProps object reference, memoize this destructuring.
|
|
20783
|
-
var reactReduxForwardedRef = props.reactReduxForwardedRef,
|
|
20784
|
-
wrapperProps = _objectWithoutPropertiesLoose$1(props, _excluded2);
|
|
20785
|
-
|
|
20786
|
-
return [props.context, reactReduxForwardedRef, wrapperProps];
|
|
20787
|
-
}, [props]),
|
|
20788
|
-
propsContext = _useMemo[0],
|
|
20789
|
-
reactReduxForwardedRef = _useMemo[1],
|
|
20790
|
-
wrapperProps = _useMemo[2];
|
|
20791
|
-
|
|
20792
|
-
var ContextToUse = React.useMemo(function () {
|
|
20793
|
-
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
|
|
20794
|
-
// Memoize the check that determines which context instance we should use.
|
|
20795
|
-
return propsContext && propsContext.Consumer && reactIs.exports.isContextConsumer( /*#__PURE__*/React__default["default"].createElement(propsContext.Consumer, null)) ? propsContext : Context;
|
|
20796
|
-
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
|
|
20797
|
-
|
|
20798
|
-
var contextValue = React.useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
|
|
20799
|
-
// We'll check to see if it _looks_ like a Redux store first.
|
|
20800
|
-
// This allows us to pass through a `store` prop that is just a plain value.
|
|
20801
|
-
|
|
20802
|
-
var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
|
|
20803
|
-
var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
|
|
20804
|
-
|
|
20805
|
-
if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {
|
|
20806
|
-
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."));
|
|
20807
|
-
} // Based on the previous check, one of these must be true
|
|
20808
|
-
|
|
20809
|
-
|
|
20810
|
-
var store = didStoreComeFromProps ? props.store : contextValue.store;
|
|
20811
|
-
var childPropsSelector = React.useMemo(function () {
|
|
20812
|
-
// The child props selector needs the store reference as an input.
|
|
20813
|
-
// Re-create this selector whenever the store changes.
|
|
20814
|
-
return createChildSelector(store);
|
|
20815
|
-
}, [store]);
|
|
20816
|
-
|
|
20817
|
-
var _useMemo2 = React.useMemo(function () {
|
|
20818
|
-
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
|
|
20819
|
-
// connected to the store via props shouldn't use subscription from context, or vice versa.
|
|
20820
|
-
|
|
20821
|
-
// This Subscription's source should match where store came from: props vs. context. A component
|
|
20822
|
-
// connected to the store via props shouldn't use subscription from context, or vice versa.
|
|
20823
|
-
var subscription = createSubscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
|
|
20824
|
-
// the middle of the notification loop, where `subscription` will then be null. This can
|
|
20825
|
-
// probably be avoided if Subscription's listeners logic is changed to not call listeners
|
|
20826
|
-
// that have been unsubscribed in the middle of the notification loop.
|
|
20827
|
-
|
|
20828
|
-
// `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
|
|
20829
|
-
// the middle of the notification loop, where `subscription` will then be null. This can
|
|
20830
|
-
// probably be avoided if Subscription's listeners logic is changed to not call listeners
|
|
20831
|
-
// that have been unsubscribed in the middle of the notification loop.
|
|
20832
|
-
var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
|
|
20833
|
-
return [subscription, notifyNestedSubs];
|
|
20834
|
-
}, [store, didStoreComeFromProps, contextValue]),
|
|
20835
|
-
subscription = _useMemo2[0],
|
|
20836
|
-
notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,
|
|
20837
|
-
// and memoize that value to avoid unnecessary context updates.
|
|
20838
|
-
|
|
20839
|
-
|
|
20840
|
-
var overriddenContextValue = React.useMemo(function () {
|
|
20841
|
-
if (didStoreComeFromProps) {
|
|
20842
|
-
// This component is directly subscribed to a store from props.
|
|
20843
|
-
// We don't want descendants reading from this store - pass down whatever
|
|
20844
|
-
// the existing context value is from the nearest connected ancestor.
|
|
20845
|
-
return contextValue;
|
|
20846
|
-
} // Otherwise, put this component's subscription instance into context, so that
|
|
20847
|
-
// connected descendants won't update until after this component is done
|
|
20848
|
-
|
|
20849
|
-
|
|
20850
|
-
return _extends({}, contextValue, {
|
|
20851
|
-
subscription: subscription
|
|
20852
|
-
});
|
|
20853
|
-
}, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update
|
|
20854
|
-
// causes a change to the calculated child component props (or we caught an error in mapState)
|
|
20855
|
-
|
|
20856
|
-
var _useReducer = React.useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),
|
|
20857
|
-
_useReducer$ = _useReducer[0],
|
|
20858
|
-
previousStateUpdateResult = _useReducer$[0],
|
|
20859
|
-
forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards
|
|
20860
|
-
|
|
20861
|
-
|
|
20862
|
-
if (previousStateUpdateResult && previousStateUpdateResult.error) {
|
|
20863
|
-
throw previousStateUpdateResult.error;
|
|
20864
|
-
} // Set up refs to coordinate values between the subscription effect and the render logic
|
|
20865
|
-
|
|
20866
|
-
|
|
20867
|
-
var lastChildProps = React.useRef();
|
|
20868
|
-
var lastWrapperProps = React.useRef(wrapperProps);
|
|
20869
|
-
var childPropsFromStoreUpdate = React.useRef();
|
|
20870
|
-
var renderIsScheduled = React.useRef(false);
|
|
20871
|
-
var actualChildProps = usePureOnlyMemo(function () {
|
|
20872
|
-
// Tricky logic here:
|
|
20873
|
-
// - This render may have been triggered by a Redux store update that produced new child props
|
|
20874
|
-
// - However, we may have gotten new wrapper props after that
|
|
20875
|
-
// If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
|
|
20876
|
-
// But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
|
|
20877
|
-
// So, we'll use the child props from store update only if the wrapper props are the same as last time.
|
|
20878
|
-
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
|
|
20879
|
-
return childPropsFromStoreUpdate.current;
|
|
20880
|
-
} // TODO We're reading the store directly in render() here. Bad idea?
|
|
20881
|
-
// This will likely cause Bad Things (TM) to happen in Concurrent Mode.
|
|
20882
|
-
// Note that we do this because on renders _not_ caused by store updates, we need the latest store state
|
|
20883
|
-
// to determine what the child props should be.
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
return childPropsSelector(store.getState(), wrapperProps);
|
|
20887
|
-
}, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
|
|
20888
|
-
// about useLayoutEffect in SSR, so we try to detect environment and fall back to
|
|
20889
|
-
// just useEffect instead to avoid the warning, since neither will run anyway.
|
|
20890
|
-
|
|
20891
|
-
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes
|
|
20892
|
-
|
|
20893
|
-
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.
|
|
20894
|
-
// We memoize the elements for the rendered child component as an optimization.
|
|
20895
|
-
|
|
20896
|
-
var renderedWrappedComponent = React.useMemo(function () {
|
|
20897
|
-
return /*#__PURE__*/React__default["default"].createElement(WrappedComponent, _extends({}, actualChildProps, {
|
|
20898
|
-
ref: reactReduxForwardedRef
|
|
20899
|
-
}));
|
|
20900
|
-
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
|
|
20901
|
-
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
|
|
20902
|
-
|
|
20903
|
-
var renderedChild = React.useMemo(function () {
|
|
20904
|
-
if (shouldHandleStateChanges) {
|
|
20905
|
-
// If this component is subscribed to store updates, we need to pass its own
|
|
20906
|
-
// subscription instance down to our descendants. That means rendering the same
|
|
20907
|
-
// Context instance, and putting a different value into the context.
|
|
20908
|
-
return /*#__PURE__*/React__default["default"].createElement(ContextToUse.Provider, {
|
|
20909
|
-
value: overriddenContextValue
|
|
20910
|
-
}, renderedWrappedComponent);
|
|
20911
|
-
}
|
|
20912
|
-
|
|
20913
|
-
return renderedWrappedComponent;
|
|
20914
|
-
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
|
|
20915
|
-
return renderedChild;
|
|
20916
|
-
} // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed.
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
var Connect = pure ? React__default["default"].memo(ConnectFunction) : ConnectFunction;
|
|
20920
|
-
Connect.WrappedComponent = WrappedComponent;
|
|
20921
|
-
Connect.displayName = ConnectFunction.displayName = displayName;
|
|
20922
|
-
|
|
20923
|
-
if (forwardRef) {
|
|
20924
|
-
var forwarded = React__default["default"].forwardRef(function forwardConnectRef(props, ref) {
|
|
20925
|
-
return /*#__PURE__*/React__default["default"].createElement(Connect, _extends({}, props, {
|
|
20926
|
-
reactReduxForwardedRef: ref
|
|
20927
|
-
}));
|
|
20928
|
-
});
|
|
20929
|
-
forwarded.displayName = displayName;
|
|
20930
|
-
forwarded.WrappedComponent = WrappedComponent;
|
|
20931
|
-
return hoistNonReactStatics_cjs(forwarded, WrappedComponent);
|
|
20932
|
-
}
|
|
20933
|
-
|
|
20934
|
-
return hoistNonReactStatics_cjs(Connect, WrappedComponent);
|
|
20935
|
-
};
|
|
20936
|
-
}
|
|
20937
|
-
|
|
20938
|
-
function is(x, y) {
|
|
20939
|
-
if (x === y) {
|
|
20940
|
-
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
20941
|
-
} else {
|
|
20942
|
-
return x !== x && y !== y;
|
|
20943
|
-
}
|
|
20944
|
-
}
|
|
20945
|
-
|
|
20946
|
-
function shallowEqual(objA, objB) {
|
|
20947
|
-
if (is(objA, objB)) return true;
|
|
20948
|
-
|
|
20949
|
-
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
20950
|
-
return false;
|
|
20385
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
20386
|
+
return false;
|
|
20951
20387
|
}
|
|
20952
20388
|
|
|
20953
20389
|
var keysA = Object.keys(objA);
|
|
@@ -20963,395 +20399,6 @@ function shallowEqual(objA, objB) {
|
|
|
20963
20399
|
return true;
|
|
20964
20400
|
}
|
|
20965
20401
|
|
|
20966
|
-
function bindActionCreators(actionCreators, dispatch) {
|
|
20967
|
-
var boundActionCreators = {};
|
|
20968
|
-
|
|
20969
|
-
var _loop = function _loop(key) {
|
|
20970
|
-
var actionCreator = actionCreators[key];
|
|
20971
|
-
|
|
20972
|
-
if (typeof actionCreator === 'function') {
|
|
20973
|
-
boundActionCreators[key] = function () {
|
|
20974
|
-
return dispatch(actionCreator.apply(void 0, arguments));
|
|
20975
|
-
};
|
|
20976
|
-
}
|
|
20977
|
-
};
|
|
20978
|
-
|
|
20979
|
-
for (var key in actionCreators) {
|
|
20980
|
-
_loop(key);
|
|
20981
|
-
}
|
|
20982
|
-
|
|
20983
|
-
return boundActionCreators;
|
|
20984
|
-
}
|
|
20985
|
-
|
|
20986
|
-
/**
|
|
20987
|
-
* @param {any} obj The object to inspect.
|
|
20988
|
-
* @returns {boolean} True if the argument appears to be a plain object.
|
|
20989
|
-
*/
|
|
20990
|
-
function isPlainObject$1(obj) {
|
|
20991
|
-
if (typeof obj !== 'object' || obj === null) return false;
|
|
20992
|
-
var proto = Object.getPrototypeOf(obj);
|
|
20993
|
-
if (proto === null) return true;
|
|
20994
|
-
var baseProto = proto;
|
|
20995
|
-
|
|
20996
|
-
while (Object.getPrototypeOf(baseProto) !== null) {
|
|
20997
|
-
baseProto = Object.getPrototypeOf(baseProto);
|
|
20998
|
-
}
|
|
20999
|
-
|
|
21000
|
-
return proto === baseProto;
|
|
21001
|
-
}
|
|
21002
|
-
|
|
21003
|
-
/**
|
|
21004
|
-
* Prints a warning in the console if it exists.
|
|
21005
|
-
*
|
|
21006
|
-
* @param {String} message The warning message.
|
|
21007
|
-
* @returns {void}
|
|
21008
|
-
*/
|
|
21009
|
-
function warning$1(message) {
|
|
21010
|
-
/* eslint-disable no-console */
|
|
21011
|
-
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
21012
|
-
console.error(message);
|
|
21013
|
-
}
|
|
21014
|
-
/* eslint-enable no-console */
|
|
21015
|
-
|
|
21016
|
-
|
|
21017
|
-
try {
|
|
21018
|
-
// This error was thrown as a convenience so that if you enable
|
|
21019
|
-
// "break on all exceptions" in your console,
|
|
21020
|
-
// it would pause the execution at this line.
|
|
21021
|
-
throw new Error(message);
|
|
21022
|
-
/* eslint-disable no-empty */
|
|
21023
|
-
} catch (e) {}
|
|
21024
|
-
/* eslint-enable no-empty */
|
|
21025
|
-
|
|
21026
|
-
}
|
|
21027
|
-
|
|
21028
|
-
function verifyPlainObject(value, displayName, methodName) {
|
|
21029
|
-
if (!isPlainObject$1(value)) {
|
|
21030
|
-
warning$1(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
|
|
21031
|
-
}
|
|
21032
|
-
}
|
|
21033
|
-
|
|
21034
|
-
function wrapMapToPropsConstant(getConstant) {
|
|
21035
|
-
return function initConstantSelector(dispatch, options) {
|
|
21036
|
-
var constant = getConstant(dispatch, options);
|
|
21037
|
-
|
|
21038
|
-
function constantSelector() {
|
|
21039
|
-
return constant;
|
|
21040
|
-
}
|
|
21041
|
-
|
|
21042
|
-
constantSelector.dependsOnOwnProps = false;
|
|
21043
|
-
return constantSelector;
|
|
21044
|
-
};
|
|
21045
|
-
} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
|
|
21046
|
-
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
|
|
21047
|
-
// whether mapToProps needs to be invoked when props have changed.
|
|
21048
|
-
//
|
|
21049
|
-
// A length of one signals that mapToProps does not depend on props from the parent component.
|
|
21050
|
-
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
|
|
21051
|
-
// therefore not reporting its length accurately..
|
|
21052
|
-
|
|
21053
|
-
function getDependsOnOwnProps(mapToProps) {
|
|
21054
|
-
return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
|
|
21055
|
-
} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
|
|
21056
|
-
// this function wraps mapToProps in a proxy function which does several things:
|
|
21057
|
-
//
|
|
21058
|
-
// * Detects whether the mapToProps function being called depends on props, which
|
|
21059
|
-
// is used by selectorFactory to decide if it should reinvoke on props changes.
|
|
21060
|
-
//
|
|
21061
|
-
// * On first call, handles mapToProps if returns another function, and treats that
|
|
21062
|
-
// new function as the true mapToProps for subsequent calls.
|
|
21063
|
-
//
|
|
21064
|
-
// * On first call, verifies the first result is a plain object, in order to warn
|
|
21065
|
-
// the developer that their mapToProps function is not returning a valid result.
|
|
21066
|
-
//
|
|
21067
|
-
|
|
21068
|
-
function wrapMapToPropsFunc(mapToProps, methodName) {
|
|
21069
|
-
return function initProxySelector(dispatch, _ref) {
|
|
21070
|
-
var displayName = _ref.displayName;
|
|
21071
|
-
|
|
21072
|
-
var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
|
|
21073
|
-
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
|
|
21074
|
-
}; // allow detectFactoryAndVerify to get ownProps
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
proxy.dependsOnOwnProps = true;
|
|
21078
|
-
|
|
21079
|
-
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
|
|
21080
|
-
proxy.mapToProps = mapToProps;
|
|
21081
|
-
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
|
|
21082
|
-
var props = proxy(stateOrDispatch, ownProps);
|
|
21083
|
-
|
|
21084
|
-
if (typeof props === 'function') {
|
|
21085
|
-
proxy.mapToProps = props;
|
|
21086
|
-
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
|
|
21087
|
-
props = proxy(stateOrDispatch, ownProps);
|
|
21088
|
-
}
|
|
21089
|
-
|
|
21090
|
-
if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
|
|
21091
|
-
return props;
|
|
21092
|
-
};
|
|
21093
|
-
|
|
21094
|
-
return proxy;
|
|
21095
|
-
};
|
|
21096
|
-
}
|
|
21097
|
-
|
|
21098
|
-
function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
|
|
21099
|
-
return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;
|
|
21100
|
-
}
|
|
21101
|
-
function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
|
|
21102
|
-
return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {
|
|
21103
|
-
return {
|
|
21104
|
-
dispatch: dispatch
|
|
21105
|
-
};
|
|
21106
|
-
}) : undefined;
|
|
21107
|
-
}
|
|
21108
|
-
function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
|
|
21109
|
-
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {
|
|
21110
|
-
return bindActionCreators(mapDispatchToProps, dispatch);
|
|
21111
|
-
}) : undefined;
|
|
21112
|
-
}
|
|
21113
|
-
var defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
|
|
21114
|
-
|
|
21115
|
-
function whenMapStateToPropsIsFunction(mapStateToProps) {
|
|
21116
|
-
return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;
|
|
21117
|
-
}
|
|
21118
|
-
function whenMapStateToPropsIsMissing(mapStateToProps) {
|
|
21119
|
-
return !mapStateToProps ? wrapMapToPropsConstant(function () {
|
|
21120
|
-
return {};
|
|
21121
|
-
}) : undefined;
|
|
21122
|
-
}
|
|
21123
|
-
var defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
|
|
21124
|
-
|
|
21125
|
-
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
|
|
21126
|
-
return _extends({}, ownProps, stateProps, dispatchProps);
|
|
21127
|
-
}
|
|
21128
|
-
function wrapMergePropsFunc(mergeProps) {
|
|
21129
|
-
return function initMergePropsProxy(dispatch, _ref) {
|
|
21130
|
-
var displayName = _ref.displayName,
|
|
21131
|
-
pure = _ref.pure,
|
|
21132
|
-
areMergedPropsEqual = _ref.areMergedPropsEqual;
|
|
21133
|
-
var hasRunOnce = false;
|
|
21134
|
-
var mergedProps;
|
|
21135
|
-
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
|
|
21136
|
-
var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21137
|
-
|
|
21138
|
-
if (hasRunOnce) {
|
|
21139
|
-
if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
|
|
21140
|
-
} else {
|
|
21141
|
-
hasRunOnce = true;
|
|
21142
|
-
mergedProps = nextMergedProps;
|
|
21143
|
-
if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
|
|
21144
|
-
}
|
|
21145
|
-
|
|
21146
|
-
return mergedProps;
|
|
21147
|
-
};
|
|
21148
|
-
};
|
|
21149
|
-
}
|
|
21150
|
-
function whenMergePropsIsFunction(mergeProps) {
|
|
21151
|
-
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
|
|
21152
|
-
}
|
|
21153
|
-
function whenMergePropsIsOmitted(mergeProps) {
|
|
21154
|
-
return !mergeProps ? function () {
|
|
21155
|
-
return defaultMergeProps;
|
|
21156
|
-
} : undefined;
|
|
21157
|
-
}
|
|
21158
|
-
var defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
|
|
21159
|
-
|
|
21160
|
-
function verify(selector, methodName, displayName) {
|
|
21161
|
-
if (!selector) {
|
|
21162
|
-
throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
|
|
21163
|
-
} else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
|
|
21164
|
-
if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
|
|
21165
|
-
warning$1("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
|
|
21166
|
-
}
|
|
21167
|
-
}
|
|
21168
|
-
}
|
|
21169
|
-
|
|
21170
|
-
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
|
|
21171
|
-
verify(mapStateToProps, 'mapStateToProps', displayName);
|
|
21172
|
-
verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
|
|
21173
|
-
verify(mergeProps, 'mergeProps', displayName);
|
|
21174
|
-
}
|
|
21175
|
-
|
|
21176
|
-
var _excluded$1 = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
|
|
21177
|
-
function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
|
|
21178
|
-
return function impureFinalPropsSelector(state, ownProps) {
|
|
21179
|
-
return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
|
|
21180
|
-
};
|
|
21181
|
-
}
|
|
21182
|
-
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
|
|
21183
|
-
var areStatesEqual = _ref.areStatesEqual,
|
|
21184
|
-
areOwnPropsEqual = _ref.areOwnPropsEqual,
|
|
21185
|
-
areStatePropsEqual = _ref.areStatePropsEqual;
|
|
21186
|
-
var hasRunAtLeastOnce = false;
|
|
21187
|
-
var state;
|
|
21188
|
-
var ownProps;
|
|
21189
|
-
var stateProps;
|
|
21190
|
-
var dispatchProps;
|
|
21191
|
-
var mergedProps;
|
|
21192
|
-
|
|
21193
|
-
function handleFirstCall(firstState, firstOwnProps) {
|
|
21194
|
-
state = firstState;
|
|
21195
|
-
ownProps = firstOwnProps;
|
|
21196
|
-
stateProps = mapStateToProps(state, ownProps);
|
|
21197
|
-
dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21198
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21199
|
-
hasRunAtLeastOnce = true;
|
|
21200
|
-
return mergedProps;
|
|
21201
|
-
}
|
|
21202
|
-
|
|
21203
|
-
function handleNewPropsAndNewState() {
|
|
21204
|
-
stateProps = mapStateToProps(state, ownProps);
|
|
21205
|
-
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21206
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21207
|
-
return mergedProps;
|
|
21208
|
-
}
|
|
21209
|
-
|
|
21210
|
-
function handleNewProps() {
|
|
21211
|
-
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
|
|
21212
|
-
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21213
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21214
|
-
return mergedProps;
|
|
21215
|
-
}
|
|
21216
|
-
|
|
21217
|
-
function handleNewState() {
|
|
21218
|
-
var nextStateProps = mapStateToProps(state, ownProps);
|
|
21219
|
-
var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
|
|
21220
|
-
stateProps = nextStateProps;
|
|
21221
|
-
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21222
|
-
return mergedProps;
|
|
21223
|
-
}
|
|
21224
|
-
|
|
21225
|
-
function handleSubsequentCalls(nextState, nextOwnProps) {
|
|
21226
|
-
var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
|
|
21227
|
-
var stateChanged = !areStatesEqual(nextState, state);
|
|
21228
|
-
state = nextState;
|
|
21229
|
-
ownProps = nextOwnProps;
|
|
21230
|
-
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
|
|
21231
|
-
if (propsChanged) return handleNewProps();
|
|
21232
|
-
if (stateChanged) return handleNewState();
|
|
21233
|
-
return mergedProps;
|
|
21234
|
-
}
|
|
21235
|
-
|
|
21236
|
-
return function pureFinalPropsSelector(nextState, nextOwnProps) {
|
|
21237
|
-
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
|
|
21238
|
-
};
|
|
21239
|
-
} // TODO: Add more comments
|
|
21240
|
-
// If pure is true, the selector returned by selectorFactory will memoize its results,
|
|
21241
|
-
// allowing connectAdvanced's shouldComponentUpdate to return false if final
|
|
21242
|
-
// props have not changed. If false, the selector will always return a new
|
|
21243
|
-
// object and shouldComponentUpdate will always return true.
|
|
21244
|
-
|
|
21245
|
-
function finalPropsSelectorFactory(dispatch, _ref2) {
|
|
21246
|
-
var initMapStateToProps = _ref2.initMapStateToProps,
|
|
21247
|
-
initMapDispatchToProps = _ref2.initMapDispatchToProps,
|
|
21248
|
-
initMergeProps = _ref2.initMergeProps,
|
|
21249
|
-
options = _objectWithoutPropertiesLoose$1(_ref2, _excluded$1);
|
|
21250
|
-
|
|
21251
|
-
var mapStateToProps = initMapStateToProps(dispatch, options);
|
|
21252
|
-
var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
|
|
21253
|
-
var mergeProps = initMergeProps(dispatch, options);
|
|
21254
|
-
|
|
21255
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
21256
|
-
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
|
|
21257
|
-
}
|
|
21258
|
-
|
|
21259
|
-
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
|
|
21260
|
-
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
|
|
21261
|
-
}
|
|
21262
|
-
|
|
21263
|
-
var _excluded = ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"];
|
|
21264
|
-
/*
|
|
21265
|
-
connect is a facade over connectAdvanced. It turns its args into a compatible
|
|
21266
|
-
selectorFactory, which has the signature:
|
|
21267
|
-
|
|
21268
|
-
(dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
|
|
21269
|
-
|
|
21270
|
-
connect passes its args to connectAdvanced as options, which will in turn pass them to
|
|
21271
|
-
selectorFactory each time a Connect component instance is instantiated or hot reloaded.
|
|
21272
|
-
|
|
21273
|
-
selectorFactory returns a final props selector from its mapStateToProps,
|
|
21274
|
-
mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
|
|
21275
|
-
mergePropsFactories, and pure args.
|
|
21276
|
-
|
|
21277
|
-
The resulting final props selector is called by the Connect component instance whenever
|
|
21278
|
-
it receives new props or store state.
|
|
21279
|
-
*/
|
|
21280
|
-
|
|
21281
|
-
function match$1(arg, factories, name) {
|
|
21282
|
-
for (var i = factories.length - 1; i >= 0; i--) {
|
|
21283
|
-
var result = factories[i](arg);
|
|
21284
|
-
if (result) return result;
|
|
21285
|
-
}
|
|
21286
|
-
|
|
21287
|
-
return function (dispatch, options) {
|
|
21288
|
-
throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
|
|
21289
|
-
};
|
|
21290
|
-
}
|
|
21291
|
-
|
|
21292
|
-
function strictEqual(a, b) {
|
|
21293
|
-
return a === b;
|
|
21294
|
-
} // createConnect with default args builds the 'official' connect behavior. Calling it with
|
|
21295
|
-
// different options opens up some testing and extensibility scenarios
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
function createConnect(_temp) {
|
|
21299
|
-
var _ref = _temp === void 0 ? {} : _temp,
|
|
21300
|
-
_ref$connectHOC = _ref.connectHOC,
|
|
21301
|
-
connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,
|
|
21302
|
-
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
|
|
21303
|
-
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,
|
|
21304
|
-
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
|
|
21305
|
-
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,
|
|
21306
|
-
_ref$mergePropsFactor = _ref.mergePropsFactories,
|
|
21307
|
-
mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,
|
|
21308
|
-
_ref$selectorFactory = _ref.selectorFactory,
|
|
21309
|
-
selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;
|
|
21310
|
-
|
|
21311
|
-
return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
|
|
21312
|
-
if (_ref2 === void 0) {
|
|
21313
|
-
_ref2 = {};
|
|
21314
|
-
}
|
|
21315
|
-
|
|
21316
|
-
var _ref3 = _ref2,
|
|
21317
|
-
_ref3$pure = _ref3.pure,
|
|
21318
|
-
pure = _ref3$pure === void 0 ? true : _ref3$pure,
|
|
21319
|
-
_ref3$areStatesEqual = _ref3.areStatesEqual,
|
|
21320
|
-
areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
|
|
21321
|
-
_ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
|
|
21322
|
-
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,
|
|
21323
|
-
_ref3$areStatePropsEq = _ref3.areStatePropsEqual,
|
|
21324
|
-
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,
|
|
21325
|
-
_ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
|
|
21326
|
-
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,
|
|
21327
|
-
extraOptions = _objectWithoutPropertiesLoose$1(_ref3, _excluded);
|
|
21328
|
-
|
|
21329
|
-
var initMapStateToProps = match$1(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
|
|
21330
|
-
var initMapDispatchToProps = match$1(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
|
|
21331
|
-
var initMergeProps = match$1(mergeProps, mergePropsFactories, 'mergeProps');
|
|
21332
|
-
return connectHOC(selectorFactory, _extends({
|
|
21333
|
-
// used in error messages
|
|
21334
|
-
methodName: 'connect',
|
|
21335
|
-
// used to compute Connect's displayName from the wrapped component's displayName.
|
|
21336
|
-
getDisplayName: function getDisplayName(name) {
|
|
21337
|
-
return "Connect(" + name + ")";
|
|
21338
|
-
},
|
|
21339
|
-
// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
|
|
21340
|
-
shouldHandleStateChanges: Boolean(mapStateToProps),
|
|
21341
|
-
// passed through to selectorFactory
|
|
21342
|
-
initMapStateToProps: initMapStateToProps,
|
|
21343
|
-
initMapDispatchToProps: initMapDispatchToProps,
|
|
21344
|
-
initMergeProps: initMergeProps,
|
|
21345
|
-
pure: pure,
|
|
21346
|
-
areStatesEqual: areStatesEqual,
|
|
21347
|
-
areOwnPropsEqual: areOwnPropsEqual,
|
|
21348
|
-
areStatePropsEqual: areStatePropsEqual,
|
|
21349
|
-
areMergedPropsEqual: areMergedPropsEqual
|
|
21350
|
-
}, extraOptions));
|
|
21351
|
-
};
|
|
21352
|
-
}
|
|
21353
|
-
var connect = /*#__PURE__*/createConnect();
|
|
21354
|
-
|
|
21355
20402
|
/**
|
|
21356
20403
|
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
21357
20404
|
* hook that you should usually not need to call directly.
|
|
@@ -21419,6 +20466,201 @@ function createStoreHook(context) {
|
|
|
21419
20466
|
|
|
21420
20467
|
var useStore = /*#__PURE__*/createStoreHook();
|
|
21421
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
|
+
|
|
21422
20664
|
// with standard React renderers (ReactDOM, React Native)
|
|
21423
20665
|
|
|
21424
20666
|
setBatch(reactDom.unstable_batchedUpdates);
|
|
@@ -22527,25 +21769,47 @@ function persistStore(store, options, cb) {
|
|
|
22527
21769
|
return persistor;
|
|
22528
21770
|
}
|
|
22529
21771
|
|
|
22530
|
-
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
|
|
22537
|
-
_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 },
|
|
22538
21779
|
// eslint-disable-next-line no-underscore-dangle
|
|
22539
21780
|
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
|
|
22540
|
-
|
|
22541
|
-
|
|
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
|
+
};
|
|
22542
21797
|
}
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
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 } });
|
|
22546
21807
|
};
|
|
22547
|
-
|
|
22548
|
-
|
|
21808
|
+
React.useEffect(() => {
|
|
21809
|
+
messageHandler === null || messageHandler === void 0 ? void 0 : messageHandler.set(changeDefaultValue);
|
|
21810
|
+
}, [messageHandler, dispatch]);
|
|
21811
|
+
return null;
|
|
21812
|
+
};
|
|
22549
21813
|
|
|
22550
21814
|
/*
|
|
22551
21815
|
|
|
@@ -22570,7 +21834,7 @@ styleSheet.flush()
|
|
|
22570
21834
|
|
|
22571
21835
|
*/
|
|
22572
21836
|
// $FlowFixMe
|
|
22573
|
-
function sheetForTag
|
|
21837
|
+
function sheetForTag(tag) {
|
|
22574
21838
|
if (tag.sheet) {
|
|
22575
21839
|
// $FlowFixMe
|
|
22576
21840
|
return tag.sheet;
|
|
@@ -22587,7 +21851,7 @@ function sheetForTag$1(tag) {
|
|
|
22587
21851
|
}
|
|
22588
21852
|
}
|
|
22589
21853
|
|
|
22590
|
-
function createStyleElement
|
|
21854
|
+
function createStyleElement(options) {
|
|
22591
21855
|
var tag = document.createElement('style');
|
|
22592
21856
|
tag.setAttribute('data-emotion', options.key);
|
|
22593
21857
|
|
|
@@ -22600,7 +21864,7 @@ function createStyleElement$1(options) {
|
|
|
22600
21864
|
return tag;
|
|
22601
21865
|
}
|
|
22602
21866
|
|
|
22603
|
-
var StyleSheet
|
|
21867
|
+
var StyleSheet = /*#__PURE__*/function () {
|
|
22604
21868
|
function StyleSheet(options) {
|
|
22605
21869
|
var _this = this;
|
|
22606
21870
|
|
|
@@ -22647,7 +21911,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
|
|
|
22647
21911
|
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
22648
21912
|
// and you can only have one source map per style tag
|
|
22649
21913
|
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
22650
|
-
this._insertTag(createStyleElement
|
|
21914
|
+
this._insertTag(createStyleElement(this));
|
|
22651
21915
|
}
|
|
22652
21916
|
|
|
22653
21917
|
var tag = this.tags[this.tags.length - 1];
|
|
@@ -22665,7 +21929,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
|
|
|
22665
21929
|
}
|
|
22666
21930
|
|
|
22667
21931
|
if (this.isSpeedy) {
|
|
22668
|
-
var sheet = sheetForTag
|
|
21932
|
+
var sheet = sheetForTag(tag);
|
|
22669
21933
|
|
|
22670
21934
|
try {
|
|
22671
21935
|
// this is the ultrafast version, works across browsers
|
|
@@ -23462,7 +22726,7 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
23462
22726
|
};
|
|
23463
22727
|
};
|
|
23464
22728
|
|
|
23465
|
-
function memoize
|
|
22729
|
+
function memoize(fn) {
|
|
23466
22730
|
var cache = Object.create(null);
|
|
23467
22731
|
return function (arg) {
|
|
23468
22732
|
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
@@ -23665,7 +22929,7 @@ var incorrectImportAlarm = function incorrectImportAlarm(element, index, childre
|
|
|
23665
22929
|
|
|
23666
22930
|
var isBrowser$3 = typeof document !== 'undefined';
|
|
23667
22931
|
var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
|
|
23668
|
-
return memoize
|
|
22932
|
+
return memoize(function () {
|
|
23669
22933
|
var cache = {};
|
|
23670
22934
|
return function (name) {
|
|
23671
22935
|
return cache[name];
|
|
@@ -23844,7 +23108,7 @@ var createCache = function createCache(options) {
|
|
|
23844
23108
|
|
|
23845
23109
|
var cache = {
|
|
23846
23110
|
key: key,
|
|
23847
|
-
sheet: new StyleSheet
|
|
23111
|
+
sheet: new StyleSheet({
|
|
23848
23112
|
key: key,
|
|
23849
23113
|
container: container,
|
|
23850
23114
|
nonce: options.nonce,
|
|
@@ -24012,14 +23276,6 @@ var unitlessKeys = {
|
|
|
24012
23276
|
strokeWidth: 1
|
|
24013
23277
|
};
|
|
24014
23278
|
|
|
24015
|
-
function memoize(fn) {
|
|
24016
|
-
var cache = Object.create(null);
|
|
24017
|
-
return function (arg) {
|
|
24018
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
24019
|
-
return cache[arg];
|
|
24020
|
-
};
|
|
24021
|
-
}
|
|
24022
|
-
|
|
24023
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";
|
|
24024
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).";
|
|
24025
23281
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
@@ -24462,158 +23718,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
24462
23718
|
Emotion.displayName = 'EmotionCssPropInternal';
|
|
24463
23719
|
}
|
|
24464
23720
|
|
|
24465
|
-
/*
|
|
24466
|
-
|
|
24467
|
-
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
24468
|
-
|
|
24469
|
-
high performance StyleSheet for css-in-js systems
|
|
24470
|
-
|
|
24471
|
-
- uses multiple style tags behind the scenes for millions of rules
|
|
24472
|
-
- uses `insertRule` for appending in production for *much* faster performance
|
|
24473
|
-
|
|
24474
|
-
// usage
|
|
24475
|
-
|
|
24476
|
-
import { StyleSheet } from '@emotion/sheet'
|
|
24477
|
-
|
|
24478
|
-
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
24479
|
-
|
|
24480
|
-
styleSheet.insert('#box { border: 1px solid red; }')
|
|
24481
|
-
- appends a css rule into the stylesheet
|
|
24482
|
-
|
|
24483
|
-
styleSheet.flush()
|
|
24484
|
-
- empties the stylesheet of all its contents
|
|
24485
|
-
|
|
24486
|
-
*/
|
|
24487
|
-
// $FlowFixMe
|
|
24488
|
-
function sheetForTag(tag) {
|
|
24489
|
-
if (tag.sheet) {
|
|
24490
|
-
// $FlowFixMe
|
|
24491
|
-
return tag.sheet;
|
|
24492
|
-
} // this weirdness brought to you by firefox
|
|
24493
|
-
|
|
24494
|
-
/* istanbul ignore next */
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
24498
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
24499
|
-
// $FlowFixMe
|
|
24500
|
-
return document.styleSheets[i];
|
|
24501
|
-
}
|
|
24502
|
-
}
|
|
24503
|
-
}
|
|
24504
|
-
|
|
24505
|
-
function createStyleElement(options) {
|
|
24506
|
-
var tag = document.createElement('style');
|
|
24507
|
-
tag.setAttribute('data-emotion', options.key);
|
|
24508
|
-
|
|
24509
|
-
if (options.nonce !== undefined) {
|
|
24510
|
-
tag.setAttribute('nonce', options.nonce);
|
|
24511
|
-
}
|
|
24512
|
-
|
|
24513
|
-
tag.appendChild(document.createTextNode(''));
|
|
24514
|
-
tag.setAttribute('data-s', '');
|
|
24515
|
-
return tag;
|
|
24516
|
-
}
|
|
24517
|
-
|
|
24518
|
-
var StyleSheet = /*#__PURE__*/function () {
|
|
24519
|
-
function StyleSheet(options) {
|
|
24520
|
-
var _this = this;
|
|
24521
|
-
|
|
24522
|
-
this._insertTag = function (tag) {
|
|
24523
|
-
var before;
|
|
24524
|
-
|
|
24525
|
-
if (_this.tags.length === 0) {
|
|
24526
|
-
if (_this.insertionPoint) {
|
|
24527
|
-
before = _this.insertionPoint.nextSibling;
|
|
24528
|
-
} else if (_this.prepend) {
|
|
24529
|
-
before = _this.container.firstChild;
|
|
24530
|
-
} else {
|
|
24531
|
-
before = _this.before;
|
|
24532
|
-
}
|
|
24533
|
-
} else {
|
|
24534
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
24535
|
-
}
|
|
24536
|
-
|
|
24537
|
-
_this.container.insertBefore(tag, before);
|
|
24538
|
-
|
|
24539
|
-
_this.tags.push(tag);
|
|
24540
|
-
};
|
|
24541
|
-
|
|
24542
|
-
this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
|
|
24543
|
-
this.tags = [];
|
|
24544
|
-
this.ctr = 0;
|
|
24545
|
-
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
24546
|
-
|
|
24547
|
-
this.key = options.key;
|
|
24548
|
-
this.container = options.container;
|
|
24549
|
-
this.prepend = options.prepend;
|
|
24550
|
-
this.insertionPoint = options.insertionPoint;
|
|
24551
|
-
this.before = null;
|
|
24552
|
-
}
|
|
24553
|
-
|
|
24554
|
-
var _proto = StyleSheet.prototype;
|
|
24555
|
-
|
|
24556
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
24557
|
-
nodes.forEach(this._insertTag);
|
|
24558
|
-
};
|
|
24559
|
-
|
|
24560
|
-
_proto.insert = function insert(rule) {
|
|
24561
|
-
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
24562
|
-
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
24563
|
-
// and you can only have one source map per style tag
|
|
24564
|
-
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
24565
|
-
this._insertTag(createStyleElement(this));
|
|
24566
|
-
}
|
|
24567
|
-
|
|
24568
|
-
var tag = this.tags[this.tags.length - 1];
|
|
24569
|
-
|
|
24570
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
24571
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
24572
|
-
|
|
24573
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
24574
|
-
// this would only cause problem in speedy mode
|
|
24575
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
24576
|
-
// so we report this error at all times
|
|
24577
|
-
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.');
|
|
24578
|
-
}
|
|
24579
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
24580
|
-
}
|
|
24581
|
-
|
|
24582
|
-
if (this.isSpeedy) {
|
|
24583
|
-
var sheet = sheetForTag(tag);
|
|
24584
|
-
|
|
24585
|
-
try {
|
|
24586
|
-
// this is the ultrafast version, works across browsers
|
|
24587
|
-
// the big drawback is that the css won't be editable in devtools
|
|
24588
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
24589
|
-
} catch (e) {
|
|
24590
|
-
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)) {
|
|
24591
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
24592
|
-
}
|
|
24593
|
-
}
|
|
24594
|
-
} else {
|
|
24595
|
-
tag.appendChild(document.createTextNode(rule));
|
|
24596
|
-
}
|
|
24597
|
-
|
|
24598
|
-
this.ctr++;
|
|
24599
|
-
};
|
|
24600
|
-
|
|
24601
|
-
_proto.flush = function flush() {
|
|
24602
|
-
// $FlowFixMe
|
|
24603
|
-
this.tags.forEach(function (tag) {
|
|
24604
|
-
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
24605
|
-
});
|
|
24606
|
-
this.tags = [];
|
|
24607
|
-
this.ctr = 0;
|
|
24608
|
-
|
|
24609
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
24610
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
24611
|
-
}
|
|
24612
|
-
};
|
|
24613
|
-
|
|
24614
|
-
return StyleSheet;
|
|
24615
|
-
}();
|
|
24616
|
-
|
|
24617
23721
|
var pkg = {
|
|
24618
23722
|
name: "@emotion/react",
|
|
24619
23723
|
version: "11.7.1",
|
|
@@ -24955,50 +24059,47 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
24955
24059
|
}
|
|
24956
24060
|
}
|
|
24957
24061
|
|
|
24958
|
-
|
|
24959
|
-
|
|
24960
|
-
|
|
24961
|
-
|
|
24962
|
-
|
|
24963
|
-
_this.state = { hasError: false, error: null };
|
|
24964
|
-
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 };
|
|
24965
24067
|
}
|
|
24966
|
-
|
|
24068
|
+
static getDerivedStateFromError(error) {
|
|
24967
24069
|
return {
|
|
24968
24070
|
hasError: true,
|
|
24969
24071
|
error: error && error.message ? error.message : error,
|
|
24970
24072
|
};
|
|
24971
|
-
}
|
|
24972
|
-
|
|
24073
|
+
}
|
|
24074
|
+
componentDidCatch(error, info) {
|
|
24973
24075
|
this.setState({ didInfo: info.componentStack });
|
|
24974
|
-
}
|
|
24975
|
-
|
|
24976
|
-
|
|
24977
|
-
|
|
24076
|
+
}
|
|
24077
|
+
render() {
|
|
24078
|
+
const { hasError, error, didInfo } = this.state;
|
|
24079
|
+
const { type, id, children } = this.props;
|
|
24978
24080
|
if (hasError) {
|
|
24979
24081
|
if (type === 'component') {
|
|
24980
|
-
return (jsxRuntime$1.exports.jsx("div",
|
|
24082
|
+
return (jsxRuntime$1.exports.jsx("div", Object.assign({ style: {
|
|
24981
24083
|
flex: 1,
|
|
24982
24084
|
flexDirection: 'column',
|
|
24983
24085
|
borderColor: 'orange',
|
|
24984
24086
|
borderWidth: 2,
|
|
24985
|
-
} }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div",
|
|
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));
|
|
24986
24088
|
}
|
|
24987
|
-
return (jsxRuntime$1.exports.jsx("div",
|
|
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: {
|
|
24988
24090
|
flex: 1,
|
|
24989
24091
|
backgroundColor: 'red',
|
|
24990
24092
|
padding: 10,
|
|
24991
24093
|
alignItems: 'center',
|
|
24992
|
-
} }, { children: jsxRuntime$1.exports.jsxs("p",
|
|
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));
|
|
24993
24095
|
}
|
|
24994
24096
|
return children;
|
|
24995
|
-
}
|
|
24996
|
-
|
|
24997
|
-
}(React__default["default"].Component));
|
|
24097
|
+
}
|
|
24098
|
+
}
|
|
24998
24099
|
|
|
24999
|
-
|
|
25000
|
-
|
|
25001
|
-
|
|
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]);
|
|
25002
24103
|
if (style && style.borderWidth && !style.borderStyle) {
|
|
25003
24104
|
style.borderStyle = 'solid';
|
|
25004
24105
|
}
|
|
@@ -25009,84 +24110,70 @@ var genStyle = function (props) {
|
|
|
25009
24110
|
parentComp.style.flex < 1
|
|
25010
24111
|
// if smaller or larger, noesn't matter
|
|
25011
24112
|
) {
|
|
25012
|
-
style.height =
|
|
25013
|
-
style.width =
|
|
24113
|
+
style.height = `100%`;
|
|
24114
|
+
style.width = `100%`;
|
|
25014
24115
|
}
|
|
25015
24116
|
else if (!style.height) {
|
|
25016
|
-
style.height =
|
|
24117
|
+
style.height = `${style.flex * 100}%`;
|
|
25017
24118
|
}
|
|
25018
24119
|
}
|
|
25019
24120
|
return style;
|
|
25020
24121
|
};
|
|
25021
|
-
|
|
25022
|
-
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
|
|
25027
|
-
|
|
25028
|
-
|
|
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);
|
|
25029
24131
|
if (!stock) {
|
|
25030
24132
|
return null;
|
|
25031
24133
|
}
|
|
25032
|
-
|
|
25033
|
-
|
|
24134
|
+
const Comp = stock.getComponent(component);
|
|
24135
|
+
const infobox = false;
|
|
25034
24136
|
if (!Comp) {
|
|
25035
24137
|
// eslint-disable-next-line no-throw-literal
|
|
25036
|
-
throw
|
|
24138
|
+
throw `The Component(${component}) is not available`;
|
|
25037
24139
|
}
|
|
25038
|
-
|
|
25039
|
-
return (jsxRuntime$1.exports.jsx(ErrorBoundary,
|
|
25040
|
-
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 }) => {
|
|
25041
24142
|
ownProps.className = newStyle ? cx(css(newStyle)) : undefined;
|
|
25042
|
-
|
|
25043
|
-
|
|
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));
|
|
25044
24146
|
} }, void 0) }), void 0));
|
|
25045
24147
|
}
|
|
25046
|
-
var ReduxWrapper = connect(genAllStateProps, null, function (stateProps, dispatchProps, ownProps) { return util$1.mergePath(ownProps, stateProps); }, {
|
|
25047
|
-
areStatePropsEqual: function (next, prev) {
|
|
25048
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
25049
|
-
for (var _i = 0, _a = Object.entries(next); _i < _a.length; _i++) {
|
|
25050
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
25051
|
-
if (value !== prev[key]) {
|
|
25052
|
-
return false;
|
|
25053
|
-
}
|
|
25054
|
-
}
|
|
25055
|
-
return true;
|
|
25056
|
-
},
|
|
25057
|
-
})(Wrapper);
|
|
25058
|
-
function WrapperOuter(props) {
|
|
25059
|
-
var currentPaths = React.useContext(PathModifierContext);
|
|
25060
|
-
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]));
|
|
25061
|
-
return jsxRuntime$1.exports.jsx(ReduxWrapper, __assign$1({}, newProps), void 0);
|
|
25062
|
-
}
|
|
25063
24148
|
|
|
25064
|
-
|
|
25065
|
-
|
|
25066
|
-
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]);
|
|
25067
24151
|
if (model === undefined) {
|
|
25068
24152
|
return null;
|
|
25069
24153
|
}
|
|
25070
|
-
return (jsxRuntime$1.exports.jsx(StockContext.Provider,
|
|
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));
|
|
25071
24155
|
};
|
|
25072
|
-
|
|
25073
|
-
|
|
25074
|
-
|
|
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));
|
|
25075
24160
|
};
|
|
25076
24161
|
|
|
25077
|
-
function Viewer(
|
|
25078
|
-
|
|
25079
|
-
|
|
25080
|
-
|
|
25081
|
-
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),
|
|
25082
24166
|
};
|
|
25083
24167
|
return jsxRuntime$1.exports.jsx(rendererFunc, { model: model, stockInit: stockInit }, void 0);
|
|
25084
24168
|
}
|
|
25085
|
-
function ViewerWeb(
|
|
25086
|
-
|
|
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));
|
|
25087
24172
|
}
|
|
25088
24173
|
|
|
25089
|
-
|
|
24174
|
+
const JsonUI = (props) => jsxRuntime$1.exports.jsx(ViewerWeb, Object.assign({}, props), void 0);
|
|
25090
24175
|
|
|
25091
24176
|
exports.JsonUI = JsonUI;
|
|
24177
|
+
exports.MessageHandler = MessageHandler;
|
|
24178
|
+
exports.MessageHandlerContext = MessageHandlerContext;
|
|
25092
24179
|
//# sourceMappingURL=index.js.map
|