@jsonui/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +787 -1709
- 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 +787 -1711
- 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/esm/index.js
CHANGED
|
@@ -1,60 +1,6 @@
|
|
|
1
|
-
import React, { createContext, useLayoutEffect, useEffect, useMemo,
|
|
1
|
+
import React, { createContext, useContext, useLayoutEffect, useEffect, useMemo, useDebugValue, useReducer, useRef, PureComponent, forwardRef, createElement, Fragment as Fragment$1 } from 'react';
|
|
2
2
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
3
3
|
|
|
4
|
-
/*! *****************************************************************************
|
|
5
|
-
Copyright (c) Microsoft Corporation.
|
|
6
|
-
|
|
7
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
-
purpose with or without fee is hereby granted.
|
|
9
|
-
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
11
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
14
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
-
***************************************************************************** */
|
|
18
|
-
/* global Reflect, Promise */
|
|
19
|
-
|
|
20
|
-
var extendStatics = function(d, b) {
|
|
21
|
-
extendStatics = Object.setPrototypeOf ||
|
|
22
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
23
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
24
|
-
return extendStatics(d, b);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function __extends(d, b) {
|
|
28
|
-
if (typeof b !== "function" && b !== null)
|
|
29
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var __assign$1 = function() {
|
|
36
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
37
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38
|
-
s = arguments[i];
|
|
39
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
return __assign$1.apply(this, arguments);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function __rest$1(s, e) {
|
|
47
|
-
var t = {};
|
|
48
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
-
t[p] = s[p];
|
|
50
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
-
t[p[i]] = s[p[i]];
|
|
54
|
-
}
|
|
55
|
-
return t;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
4
|
var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
59
5
|
|
|
60
6
|
var jsxRuntime$1 = {exports: {}};
|
|
@@ -67,7 +13,7 @@ object-assign
|
|
|
67
13
|
@license MIT
|
|
68
14
|
*/
|
|
69
15
|
/* eslint-disable no-unused-vars */
|
|
70
|
-
var getOwnPropertySymbols$
|
|
16
|
+
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
|
|
71
17
|
var hasOwnProperty$f = Object.prototype.hasOwnProperty;
|
|
72
18
|
var propIsEnumerable$1 = Object.prototype.propertyIsEnumerable;
|
|
73
19
|
|
|
@@ -137,8 +83,8 @@ var objectAssign$1 = shouldUseNative$1() ? Object.assign : function (target, sou
|
|
|
137
83
|
}
|
|
138
84
|
}
|
|
139
85
|
|
|
140
|
-
if (getOwnPropertySymbols$
|
|
141
|
-
symbols = getOwnPropertySymbols$
|
|
86
|
+
if (getOwnPropertySymbols$1) {
|
|
87
|
+
symbols = getOwnPropertySymbols$1(from);
|
|
142
88
|
for (var i = 0; i < symbols.length; i++) {
|
|
143
89
|
if (propIsEnumerable$1.call(from, symbols[i])) {
|
|
144
90
|
to[symbols[i]] = from[symbols[i]];
|
|
@@ -1388,18 +1334,22 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1388
1334
|
jsxRuntime$1.exports = reactJsxRuntime_development$1;
|
|
1389
1335
|
}
|
|
1390
1336
|
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1394
|
-
s = arguments[i];
|
|
1395
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1396
|
-
}
|
|
1397
|
-
return t;
|
|
1398
|
-
};
|
|
1399
|
-
return __assign.apply(this, arguments);
|
|
1400
|
-
};
|
|
1337
|
+
/*! *****************************************************************************
|
|
1338
|
+
Copyright (c) Microsoft Corporation.
|
|
1401
1339
|
|
|
1402
|
-
|
|
1340
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1341
|
+
purpose with or without fee is hereby granted.
|
|
1342
|
+
|
|
1343
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1344
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1345
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1346
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1347
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1348
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1349
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1350
|
+
***************************************************************************** */
|
|
1351
|
+
|
|
1352
|
+
function __rest$1(s, e) {
|
|
1403
1353
|
var t = {};
|
|
1404
1354
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1405
1355
|
t[p] = s[p];
|
|
@@ -1409,85 +1359,35 @@ function __rest(s, e) {
|
|
|
1409
1359
|
t[p[i]] = s[p[i]];
|
|
1410
1360
|
}
|
|
1411
1361
|
return t;
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1420
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1421
|
-
});
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
function __generator(thisArg, body) {
|
|
1425
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1426
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1427
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1428
|
-
function step(op) {
|
|
1429
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1430
|
-
while (_) try {
|
|
1431
|
-
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;
|
|
1432
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1433
|
-
switch (op[0]) {
|
|
1434
|
-
case 0: case 1: t = op; break;
|
|
1435
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
1436
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1437
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1438
|
-
default:
|
|
1439
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1440
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1441
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1442
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1443
|
-
if (t[2]) _.ops.pop();
|
|
1444
|
-
_.trys.pop(); continue;
|
|
1445
|
-
}
|
|
1446
|
-
op = body.call(thisArg, _);
|
|
1447
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1448
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
function __spreadArray(to, from, pack) {
|
|
1453
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1454
|
-
if (ar || !(i in from)) {
|
|
1455
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1456
|
-
ar[i] = from[i];
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1460
|
-
}var Stock = /** @class */ (function () {
|
|
1461
|
-
function Stock(newStock, Wrapper, reduxStore) {
|
|
1462
|
-
var _this = this;
|
|
1463
|
-
this.init = function (_a) {
|
|
1464
|
-
var components = _a.components, functions = _a.functions;
|
|
1465
|
-
_this.stock.components = __assign(__assign({}, _this.stock.components), components);
|
|
1466
|
-
_this.stock.functions = __assign(__assign({}, _this.stock.functions), functions);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
class Stock {
|
|
1365
|
+
constructor(newStock, Wrapper, reduxStore) {
|
|
1366
|
+
this.init = ({ components, functions }) => {
|
|
1367
|
+
this.stock.components = Object.assign(Object.assign({}, this.stock.components), components);
|
|
1368
|
+
this.stock.functions = Object.assign(Object.assign({}, this.stock.functions), functions);
|
|
1467
1369
|
};
|
|
1468
|
-
this.registerComponent =
|
|
1469
|
-
if (!!key && typeof key === 'string' && key.length > 0 && !(key in
|
|
1470
|
-
|
|
1370
|
+
this.registerComponent = (key, value) => {
|
|
1371
|
+
if (!!key && typeof key === 'string' && key.length > 0 && !(key in this.stock.components)) {
|
|
1372
|
+
this.stock.components[key] = value;
|
|
1471
1373
|
}
|
|
1472
1374
|
};
|
|
1473
|
-
this.registerFunction =
|
|
1474
|
-
if (!!key && typeof key === 'string' && key.length > 0 && !(key in
|
|
1475
|
-
|
|
1375
|
+
this.registerFunction = (key, value) => {
|
|
1376
|
+
if (!!key && typeof key === 'string' && key.length > 0 && !(key in this.stock.functions)) {
|
|
1377
|
+
this.stock.functions[key] = value;
|
|
1476
1378
|
}
|
|
1477
1379
|
};
|
|
1478
|
-
this.callFunction =
|
|
1479
|
-
if (!!attr && !!name && name in
|
|
1480
|
-
|
|
1380
|
+
this.callFunction = (name, attr, props, callerArgs) => {
|
|
1381
|
+
if (!!attr && !!name && name in this.stock.functions) {
|
|
1382
|
+
const result = this.stock.functions[name](attr, props, callerArgs, this);
|
|
1481
1383
|
return result;
|
|
1482
1384
|
}
|
|
1483
1385
|
return null;
|
|
1484
1386
|
};
|
|
1485
|
-
this.getComponent =
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
_this.stock.components._Undefined;
|
|
1490
|
-
};
|
|
1387
|
+
this.getComponent = (componentName) => !!componentName && componentName in this.stock.components
|
|
1388
|
+
? this.stock.components[componentName]
|
|
1389
|
+
: // eslint-disable-next-line no-underscore-dangle
|
|
1390
|
+
this.stock.components._Undefined;
|
|
1491
1391
|
this.stock = {
|
|
1492
1392
|
components: {},
|
|
1493
1393
|
functions: {},
|
|
@@ -1497,8 +1397,42 @@ function __spreadArray(to, from, pack) {
|
|
|
1497
1397
|
this.reduxStore = reduxStore;
|
|
1498
1398
|
this.init(newStock);
|
|
1499
1399
|
}
|
|
1500
|
-
|
|
1501
|
-
|
|
1400
|
+
}/*! *****************************************************************************
|
|
1401
|
+
Copyright (c) Microsoft Corporation.
|
|
1402
|
+
|
|
1403
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1404
|
+
purpose with or without fee is hereby granted.
|
|
1405
|
+
|
|
1406
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1407
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1408
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1409
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1410
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1411
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1412
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1413
|
+
***************************************************************************** */
|
|
1414
|
+
|
|
1415
|
+
function __rest(s, e) {
|
|
1416
|
+
var t = {};
|
|
1417
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1418
|
+
t[p] = s[p];
|
|
1419
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1420
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1421
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1422
|
+
t[p[i]] = s[p[i]];
|
|
1423
|
+
}
|
|
1424
|
+
return t;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1428
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1429
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1430
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1431
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1432
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1433
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1434
|
+
});
|
|
1435
|
+
}var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1502
1436
|
|
|
1503
1437
|
function getDefaultExportFromCjs (x) {
|
|
1504
1438
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -1508,7 +1442,7 @@ object-assign
|
|
|
1508
1442
|
@license MIT
|
|
1509
1443
|
*/
|
|
1510
1444
|
/* eslint-disable no-unused-vars */
|
|
1511
|
-
var getOwnPropertySymbols
|
|
1445
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1512
1446
|
var hasOwnProperty$d = Object.prototype.hasOwnProperty;
|
|
1513
1447
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1514
1448
|
|
|
@@ -1578,8 +1512,8 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
1578
1512
|
}
|
|
1579
1513
|
}
|
|
1580
1514
|
|
|
1581
|
-
if (getOwnPropertySymbols
|
|
1582
|
-
symbols = getOwnPropertySymbols
|
|
1515
|
+
if (getOwnPropertySymbols) {
|
|
1516
|
+
symbols = getOwnPropertySymbols(from);
|
|
1583
1517
|
for (var i = 0; i < symbols.length; i++) {
|
|
1584
1518
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
1585
1519
|
to[symbols[i]] = from[symbols[i]];
|
|
@@ -3793,7 +3727,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
|
|
|
3793
3727
|
* // Replace `_.memoize.Cache`.
|
|
3794
3728
|
* _.memoize.Cache = WeakMap;
|
|
3795
3729
|
*/
|
|
3796
|
-
function memoize$1
|
|
3730
|
+
function memoize$1(func, resolver) {
|
|
3797
3731
|
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
3798
3732
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
3799
3733
|
}
|
|
@@ -3809,14 +3743,14 @@ function memoize$1$1(func, resolver) {
|
|
|
3809
3743
|
memoized.cache = cache.set(key, result) || cache;
|
|
3810
3744
|
return result;
|
|
3811
3745
|
};
|
|
3812
|
-
memoized.cache = new (memoize$1
|
|
3746
|
+
memoized.cache = new (memoize$1.Cache || MapCache$2);
|
|
3813
3747
|
return memoized;
|
|
3814
3748
|
}
|
|
3815
3749
|
|
|
3816
3750
|
// Expose `MapCache`.
|
|
3817
|
-
memoize$1
|
|
3751
|
+
memoize$1.Cache = MapCache$2;
|
|
3818
3752
|
|
|
3819
|
-
var memoize_1 = memoize$1
|
|
3753
|
+
var memoize_1 = memoize$1;var memoize$2 = memoize_1;
|
|
3820
3754
|
|
|
3821
3755
|
/** Used as the maximum memoize cache size. */
|
|
3822
3756
|
var MAX_MEMOIZE_SIZE = 500;
|
|
@@ -6385,31 +6319,38 @@ var hasOwnProperty$3$1 = Object.hasOwnProperty || function (obj, key) {
|
|
|
6385
6319
|
return key in obj;
|
|
6386
6320
|
};
|
|
6387
6321
|
|
|
6388
|
-
var traverse$3 = traverse$4.exports;
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6322
|
+
var traverse$3 = traverse$4.exports;const SEPARATOR = '/';
|
|
6323
|
+
const STORE_ERROR_POSTFIX = '.error';
|
|
6324
|
+
const PATH_MODIFIERS_KEY = '$pathModifiers';
|
|
6325
|
+
const MODIFIER_KEY = '$modifier';
|
|
6326
|
+
const ACTION_KEY = '$action';
|
|
6327
|
+
const PERSIST_STORAGE_KEY = '$persistStores';
|
|
6328
|
+
const PERSIST_STORAGE_NAMES = ['data'];
|
|
6329
|
+
const REF_ASSETS = '$assetsRef';
|
|
6330
|
+
const REF_LOCALES = '$locales';
|
|
6331
|
+
const REF_VALIDATES = '$validations';
|
|
6332
|
+
const STYLE_WEB_NAME = 'styleWeb';
|
|
6333
|
+
const STYLE_RN_NAME = 'styleRN';
|
|
6334
|
+
const REDUX_GET_FUNCTION = 'get';
|
|
6335
|
+
const REDUX_SET_FUNCTION = 'set';
|
|
6336
|
+
const REDUX_FUNCTIONS = [REDUX_GET_FUNCTION, REDUX_SET_FUNCTION];
|
|
6337
|
+
const PATHNAME = 'path';
|
|
6338
|
+
const SIMPLE_DATA_TYPES = ['string', 'number', 'boolean', 'null'];
|
|
6339
|
+
const V_CHILDREN_NAME = '$children';
|
|
6340
|
+
const V_COMP_NAME = '$comp';
|
|
6341
|
+
const LIST_SEMAPHORE = '$isList';
|
|
6342
|
+
const LIST_ITEM = '$listItem';
|
|
6343
|
+
const LIST_PAGE = '$page';
|
|
6344
|
+
const LIST_ITEM_PER_PAGE = '$itemPerPage';
|
|
6345
|
+
const LIST_LENGTH = '$listLength';
|
|
6346
|
+
const LIST_ITEM_PER_PAGE_DEFAULT = 10;
|
|
6347
|
+
const REDUX_PATHS = '$$reduxPaths';
|
|
6348
|
+
const V_CHILDREN_PREFIX = '$child';
|
|
6349
|
+
const PARENT_PROP_NAME = '__parentprop';
|
|
6350
|
+
const CURRENT_PATH_NAME = '__currentPaths';
|
|
6351
|
+
const PRIMITIVE_COMP_NAME = '_PrimitiveProp'; // TODO check all literal and replace with this constant
|
|
6352
|
+
const FRAGMENT_COMP_NAME = 'Fragment'; // TODO check all literal and replace with this constant
|
|
6353
|
+
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 = /~/;
|
|
6413
6354
|
var escapeMatcher = /~[01]/g;
|
|
6414
6355
|
function escapeReplacer (m) {
|
|
6415
6356
|
switch (m) {
|
|
@@ -7719,7 +7660,7 @@ function constant$1$1(value) {
|
|
|
7719
7660
|
}
|
|
7720
7661
|
|
|
7721
7662
|
var constant_1$1 = constant$1$1;var constant$2 = constant_1$1,
|
|
7722
|
-
defineProperty$
|
|
7663
|
+
defineProperty$3 = _defineProperty$5,
|
|
7723
7664
|
identity$1$1 = identity_1$1;
|
|
7724
7665
|
|
|
7725
7666
|
/**
|
|
@@ -7730,8 +7671,8 @@ var constant_1$1 = constant$1$1;var constant$2 = constant_1$1,
|
|
|
7730
7671
|
* @param {Function} string The `toString` result.
|
|
7731
7672
|
* @returns {Function} Returns `func`.
|
|
7732
7673
|
*/
|
|
7733
|
-
var baseSetToString$1$1 = !defineProperty$
|
|
7734
|
-
return defineProperty$
|
|
7674
|
+
var baseSetToString$1$1 = !defineProperty$3 ? identity$1$1 : function(func, string) {
|
|
7675
|
+
return defineProperty$3(func, 'toString', {
|
|
7735
7676
|
'configurable': true,
|
|
7736
7677
|
'enumerable': false,
|
|
7737
7678
|
'value': constant$2(string),
|
|
@@ -7988,35 +7929,32 @@ var pullAll_1 = pullAll$1;var baseRest$3 = _baseRest$1,
|
|
|
7988
7929
|
*/
|
|
7989
7930
|
var pull = baseRest$3(pullAll);
|
|
7990
7931
|
|
|
7991
|
-
var pull_1 = pull;
|
|
7992
|
-
|
|
7932
|
+
var pull_1 = pull;const findLastIndex = (arr, func) => {
|
|
7933
|
+
const reverseIdx = [...arr].reverse().findIndex(func);
|
|
7993
7934
|
return reverseIdx === -1 ? reverseIdx : arr.length - (reverseIdx + 1);
|
|
7994
7935
|
};
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
};
|
|
7999
|
-
var isNumber = function (a) { return typeof a === 'number'; };
|
|
8000
|
-
var jsonPointerGet = function (json, path) {
|
|
7936
|
+
const drop = (arr, n = 1) => arr.slice(n);
|
|
7937
|
+
const isNumber = (a) => typeof a === 'number';
|
|
7938
|
+
const jsonPointerGet = (json, path) => {
|
|
8001
7939
|
if (json === undefined || path === null || path === undefined || typeof path !== 'string')
|
|
8002
7940
|
return undefined;
|
|
8003
7941
|
if (path === SEPARATOR /* || path === '' same effect */)
|
|
8004
7942
|
return json;
|
|
8005
7943
|
try {
|
|
8006
|
-
return jsonpointer.get(json, path.startsWith(SEPARATOR) ? path :
|
|
7944
|
+
return jsonpointer.get(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`);
|
|
8007
7945
|
}
|
|
8008
7946
|
catch (e) {
|
|
8009
7947
|
return undefined;
|
|
8010
7948
|
}
|
|
8011
7949
|
};
|
|
8012
|
-
|
|
7950
|
+
const jsonPointerSet = (json, path, value) => {
|
|
8013
7951
|
if (json === undefined || path === null || path === undefined || typeof path !== 'string')
|
|
8014
7952
|
return json;
|
|
8015
7953
|
if (path === SEPARATOR || path === '') {
|
|
8016
7954
|
return value;
|
|
8017
7955
|
}
|
|
8018
7956
|
try {
|
|
8019
|
-
jsonpointer.set(json, path.startsWith(SEPARATOR) ? path :
|
|
7957
|
+
jsonpointer.set(json, path.startsWith(SEPARATOR) ? path : `${SEPARATOR}${path}`, value);
|
|
8020
7958
|
return json;
|
|
8021
7959
|
// eslint-disable-next-line no-empty
|
|
8022
7960
|
}
|
|
@@ -8024,47 +7962,48 @@ var jsonPointerSet = function (json, path, value) {
|
|
|
8024
7962
|
return json;
|
|
8025
7963
|
}
|
|
8026
7964
|
};
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
};
|
|
8030
|
-
var pathArrayToJsonPointer = function (array) { return "/".concat(array.join('/')); };
|
|
7965
|
+
const pathArrayToPathString = (array) => array.map((i, index) => (Number.isInteger(i) ? `[${i}]` : `${index > 0 ? '.' : ''}${i}`)).join('');
|
|
7966
|
+
const pathArrayToJsonPointer = (array) => `/${array.join('/')}`;
|
|
8031
7967
|
function isOnlyObject(item) {
|
|
8032
7968
|
return !!item && typeof item === 'object' && !Array.isArray(item);
|
|
8033
7969
|
}
|
|
8034
|
-
|
|
7970
|
+
const mergePath = (target, newState) => {
|
|
8035
7971
|
if (!newState || typeof newState !== 'object')
|
|
8036
7972
|
return target;
|
|
8037
|
-
|
|
8038
|
-
Object.entries(newState).forEach(
|
|
8039
|
-
var key = _a[0], value = _a[1];
|
|
7973
|
+
let newTarget = cloneDeep_1(target);
|
|
7974
|
+
Object.entries(newState).forEach(([key, value]) => {
|
|
8040
7975
|
newTarget = jsonPointerSet(newTarget, key, value);
|
|
8041
7976
|
});
|
|
8042
7977
|
return newTarget;
|
|
8043
7978
|
};
|
|
8044
7979
|
// eslint-disable-next-line import/prefer-default-export
|
|
8045
|
-
|
|
8046
|
-
|
|
7980
|
+
const changeRelativePath = (path) => {
|
|
7981
|
+
let pathArray = path.split(SEPARATOR);
|
|
8047
7982
|
// remove last /
|
|
8048
7983
|
if (pathArray && pathArray.length > 1 && pathArray[pathArray.length - 1] === '' && !(pathArray.length === 2 && pathArray[0] === '')) {
|
|
8049
7984
|
pathArray.pop();
|
|
8050
7985
|
}
|
|
8051
7986
|
// the last / is meaningful
|
|
8052
|
-
|
|
7987
|
+
const absolutepathIndex = findLastIndex(pathArray, (i) => i === '');
|
|
8053
7988
|
if (absolutepathIndex > 0) {
|
|
8054
7989
|
pathArray = drop(pathArray, absolutepathIndex);
|
|
8055
7990
|
}
|
|
8056
7991
|
// all . need to remove because is just pointing the prev level
|
|
8057
7992
|
pathArray = pull_1(pathArray, '.');
|
|
8058
|
-
|
|
8059
|
-
|
|
7993
|
+
let count = 0;
|
|
7994
|
+
let relativepathIndex = -1;
|
|
8060
7995
|
do {
|
|
8061
7996
|
count += 1;
|
|
8062
|
-
relativepathIndex = findIndex_1(pathArray,
|
|
7997
|
+
relativepathIndex = findIndex_1(pathArray, (i) => i === '..');
|
|
8063
7998
|
if (relativepathIndex !== -1) {
|
|
8064
7999
|
pathArray.splice(relativepathIndex, 1);
|
|
8065
8000
|
pathArray.splice(relativepathIndex - 1, 1);
|
|
8066
8001
|
}
|
|
8067
8002
|
} while (relativepathIndex !== -1 && count < 100);
|
|
8003
|
+
pathArray = pull_1(pathArray, '..');
|
|
8004
|
+
if (pathArray.length === 1 && pathArray[0] !== '') {
|
|
8005
|
+
pathArray = ['', ...pathArray];
|
|
8006
|
+
}
|
|
8068
8007
|
return pathArray.join(SEPARATOR);
|
|
8069
8008
|
};
|
|
8070
8009
|
/**
|
|
@@ -8072,58 +8011,53 @@ var changeRelativePath = function (path) {
|
|
|
8072
8011
|
* @param target
|
|
8073
8012
|
* @param ...sources
|
|
8074
8013
|
*/
|
|
8075
|
-
function mergeDeep(target) {
|
|
8076
|
-
var _a, _b;
|
|
8077
|
-
var sources = [];
|
|
8078
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
8079
|
-
sources[_i - 1] = arguments[_i];
|
|
8080
|
-
}
|
|
8014
|
+
function mergeDeep(target, ...sources) {
|
|
8081
8015
|
if (!sources.length)
|
|
8082
8016
|
return target;
|
|
8083
|
-
|
|
8017
|
+
const source = sources.shift();
|
|
8084
8018
|
if (isOnlyObject(target) && isOnlyObject(source)) {
|
|
8085
8019
|
// eslint-disable-next-line no-restricted-syntax
|
|
8086
|
-
for (
|
|
8020
|
+
for (const key in source) {
|
|
8087
8021
|
if (isOnlyObject(source[key])) {
|
|
8088
8022
|
if (!target[key])
|
|
8089
|
-
Object.assign(target,
|
|
8023
|
+
Object.assign(target, { [key]: {} });
|
|
8090
8024
|
mergeDeep(target[key], source[key]);
|
|
8091
8025
|
}
|
|
8092
8026
|
else {
|
|
8093
|
-
Object.assign(target,
|
|
8027
|
+
Object.assign(target, { [key]: source[key] });
|
|
8094
8028
|
}
|
|
8095
8029
|
}
|
|
8096
8030
|
}
|
|
8097
|
-
return mergeDeep
|
|
8031
|
+
return mergeDeep(target, ...sources);
|
|
8098
8032
|
}
|
|
8099
|
-
|
|
8100
|
-
|
|
8033
|
+
const collectObjMerge = (refConst, json) => {
|
|
8034
|
+
const res = {};
|
|
8101
8035
|
if (refConst && json && typeof json === 'object') {
|
|
8102
|
-
|
|
8036
|
+
const refs = [];
|
|
8103
8037
|
// eslint-disable-next-line func-names
|
|
8104
8038
|
traverse$3(json).forEach(function (x) {
|
|
8105
8039
|
if (x && !!x[refConst] && !!this && !this.circular) {
|
|
8106
|
-
|
|
8040
|
+
refs.push(x[refConst]);
|
|
8107
8041
|
}
|
|
8108
8042
|
});
|
|
8109
|
-
|
|
8043
|
+
refs.filter((i) => !!i).forEach((i) => mergeDeep(res, i));
|
|
8110
8044
|
}
|
|
8111
8045
|
return res;
|
|
8112
8046
|
};
|
|
8113
|
-
|
|
8047
|
+
const collectObjToArray = (refConst, json) => {
|
|
8114
8048
|
if (refConst && json && typeof json === 'object') {
|
|
8115
|
-
|
|
8049
|
+
const refs = [];
|
|
8116
8050
|
// eslint-disable-next-line func-names
|
|
8117
8051
|
traverse$3(json).forEach(function (x) {
|
|
8118
8052
|
if (x && !!x[refConst] && !!this && !this.circular) {
|
|
8119
|
-
|
|
8053
|
+
refs.push(x[refConst]);
|
|
8120
8054
|
}
|
|
8121
8055
|
});
|
|
8122
|
-
return
|
|
8056
|
+
return refs;
|
|
8123
8057
|
}
|
|
8124
8058
|
return [];
|
|
8125
8059
|
};
|
|
8126
|
-
|
|
8060
|
+
const isCircular = (d) => {
|
|
8127
8061
|
try {
|
|
8128
8062
|
JSON.stringify(d);
|
|
8129
8063
|
}
|
|
@@ -8131,121 +8065,116 @@ var isCircular = function (d) {
|
|
|
8131
8065
|
return true;
|
|
8132
8066
|
}
|
|
8133
8067
|
return false;
|
|
8134
|
-
};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});
|
|
8135
|
-
var
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
_a = traverse$3(props).get(i.path), _b = ACTION_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
8152
|
-
traverse$3(props).set(i.path, function () {
|
|
8153
|
-
var callerArgs = [];
|
|
8154
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8155
|
-
callerArgs[_i] = arguments[_i];
|
|
8068
|
+
};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) => {
|
|
8069
|
+
var _b = PARENT_PROP_NAME; _a[_b]; var propsNew = __rest(_a, [_b + ""]);
|
|
8070
|
+
const paths = [];
|
|
8071
|
+
function* jsonTraverse(o) {
|
|
8072
|
+
const memory = new Set();
|
|
8073
|
+
function* innerTraversal(oo, path = []) {
|
|
8074
|
+
var _a;
|
|
8075
|
+
if (memory.has(oo)) {
|
|
8076
|
+
return; // circular
|
|
8077
|
+
}
|
|
8078
|
+
memory.add(oo);
|
|
8079
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
8080
|
+
for (const i of Object.keys(oo)) {
|
|
8081
|
+
const itemPath = path.concat(i);
|
|
8082
|
+
if (itemPath && itemPath.length > 1 && typeof oo[i] === 'object' && ((_a = oo[i]) === null || _a === void 0 ? void 0 : _a[V_COMP_NAME])) {
|
|
8083
|
+
// eslint-disable-next-line no-continue
|
|
8084
|
+
continue;
|
|
8156
8085
|
}
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
}
|
|
8167
|
-
}
|
|
8168
|
-
return [2 /*return*/];
|
|
8169
|
-
});
|
|
8170
|
-
}); });
|
|
8171
|
-
};
|
|
8172
|
-
var modifierBuilder = function (props, stock) {
|
|
8173
|
-
var paths = [];
|
|
8174
|
-
props.parentComp; var propsNew = __rest(props
|
|
8175
|
-
// eslint-disable-next-line func-names
|
|
8176
|
-
, ["parentComp"]);
|
|
8177
|
-
// eslint-disable-next-line func-names
|
|
8178
|
-
traverse$3(propsNew).forEach(function (x) {
|
|
8179
|
-
if (!!x && !!x[MODIFIER_KEY] && !REDUX_FUNCTIONS.includes(x[MODIFIER_KEY]) && !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
|
|
8180
|
-
paths.push({ path: this.path, level: this.level });
|
|
8086
|
+
if (i === PARENT_PROP_NAME || i === CURRENT_PATH_NAME || i === LIST_ITEM) {
|
|
8087
|
+
// eslint-disable-next-line no-continue
|
|
8088
|
+
continue;
|
|
8089
|
+
}
|
|
8090
|
+
if (func({ key: i, value: oo[i], path, parent: oo, level: path.length })) {
|
|
8091
|
+
yield { key: i, value: oo[i], path, parent: oo, level: path.length };
|
|
8092
|
+
}
|
|
8093
|
+
if (oo[i] !== null && typeof oo[i] === 'object') {
|
|
8094
|
+
yield* innerTraversal(oo[i], itemPath);
|
|
8095
|
+
}
|
|
8096
|
+
}
|
|
8181
8097
|
}
|
|
8098
|
+
yield* innerTraversal(o);
|
|
8099
|
+
}
|
|
8100
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
8101
|
+
for (const filteredvalue of jsonTraverse(propsNew)) {
|
|
8102
|
+
paths.push(filteredvalue);
|
|
8103
|
+
}
|
|
8104
|
+
return paths;
|
|
8105
|
+
};
|
|
8106
|
+
const actionBuilder = (props, stock) => {
|
|
8107
|
+
const _a = props, _b = PARENT_PROP_NAME; _a[_b]; const propsNew = __rest(_a, [_b + ""]);
|
|
8108
|
+
const paths = getFilteredPath(propsNew, ({ key }) => key === ACTION_KEY);
|
|
8109
|
+
orderBy_1(paths, ['level'], ['desc']).forEach((i) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8110
|
+
const _c = traverse$3(props).get(i.path), _d = ACTION_KEY, functionName = _c[_d], functionParams = __rest(_c, [_d + ""]);
|
|
8111
|
+
traverse$3(props).set(i.path, (...callerArgs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8112
|
+
yield stock.callFunction(functionName, functionParams, props, callerArgs);
|
|
8113
|
+
}));
|
|
8114
|
+
}));
|
|
8115
|
+
};
|
|
8116
|
+
const calculatePropsFromModifier = (props, stock) => {
|
|
8117
|
+
const reduxPaths = [];
|
|
8118
|
+
const _a = props, _b = PARENT_PROP_NAME; _a[_b]; const propsNew = __rest(_a, [_b + ""]);
|
|
8119
|
+
const paths = getFilteredPath(propsNew, ({ key }) => key === MODIFIER_KEY);
|
|
8120
|
+
orderBy_1(paths, ['level'], ['desc']).forEach((i) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8121
|
+
const _c = traverse$3(props).get(i.path), _d = MODIFIER_KEY, functionName = _c[_d], functionParams = __rest(_c, [_d + ""]);
|
|
8122
|
+
if (typeof functionName === 'string' && functionName === REDUX_GET_FUNCTION) {
|
|
8123
|
+
reduxPaths.push(functionParams);
|
|
8124
|
+
}
|
|
8125
|
+
traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
|
|
8126
|
+
}));
|
|
8127
|
+
return reduxPaths.map((i) => {
|
|
8128
|
+
return { store: i === null || i === void 0 ? void 0 : i.store, path: i === null || i === void 0 ? void 0 : i.path };
|
|
8182
8129
|
});
|
|
8183
|
-
orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8184
|
-
var _a, _b, functionName, functionParams;
|
|
8185
|
-
return __generator(this, function (_c) {
|
|
8186
|
-
_a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
8187
|
-
traverse$3(props).set(i.path, stock.callFunction(functionName, functionParams, props));
|
|
8188
|
-
return [2 /*return*/];
|
|
8189
|
-
});
|
|
8190
|
-
}); });
|
|
8191
8130
|
};
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
var modified = false;
|
|
8131
|
+
const getCurrentPaths = (props, pathModifier) => {
|
|
8132
|
+
const currentPaths = Object.assign({}, props[CURRENT_PATH_NAME]);
|
|
8195
8133
|
if (pathModifier && Object.keys(pathModifier).length !== 0) {
|
|
8196
|
-
Object.keys(pathModifier).forEach(
|
|
8197
|
-
var _a, _b;
|
|
8134
|
+
Object.keys(pathModifier).forEach((key) => {
|
|
8198
8135
|
if (!!key && !!pathModifier[key] && pathModifier[key][PATHNAME] !== undefined && pathModifier[key][PATHNAME] !== null) {
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
currentPaths[key] = (_a = {}, _a[PATHNAME] = path, _a);
|
|
8136
|
+
const path = pathModifier[key][PATHNAME];
|
|
8137
|
+
const parent = currentPaths[key];
|
|
8138
|
+
if (`${path}`.startsWith(SEPARATOR) || !(parent && parent[PATHNAME])) {
|
|
8139
|
+
currentPaths[key] = { [PATHNAME]: path };
|
|
8204
8140
|
}
|
|
8205
8141
|
else {
|
|
8206
|
-
currentPaths[key] =
|
|
8142
|
+
currentPaths[key] = { [PATHNAME]: changeRelativePath(`${parent[PATHNAME]}${SEPARATOR}${path}`) };
|
|
8207
8143
|
}
|
|
8208
|
-
if (!!currentPaths[key] &&
|
|
8209
|
-
currentPaths[key][PATHNAME] =
|
|
8144
|
+
if (!!currentPaths[key] && !`${currentPaths[key][PATHNAME]}`.startsWith(SEPARATOR)) {
|
|
8145
|
+
currentPaths[key][PATHNAME] = `${SEPARATOR}${currentPaths[key][PATHNAME]}`;
|
|
8210
8146
|
}
|
|
8211
8147
|
}
|
|
8212
8148
|
});
|
|
8213
8149
|
}
|
|
8214
|
-
return
|
|
8150
|
+
return currentPaths;
|
|
8215
8151
|
};
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
}
|
|
8224
|
-
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));
|
|
8225
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
8226
|
-
for (var i in res)
|
|
8227
|
-
if (typeof res[i] === 'undefined')
|
|
8228
|
-
delete res[i];
|
|
8229
|
-
return res;
|
|
8152
|
+
const normalisePrimitives = (props, parentComp) => {
|
|
8153
|
+
if (!!props && Array.isArray(props)) {
|
|
8154
|
+
return { [V_COMP_NAME]: FRAGMENT_COMP_NAME, [V_CHILDREN_NAME]: props, [PARENT_PROP_NAME]: parentComp };
|
|
8155
|
+
}
|
|
8156
|
+
if (props === null || SIMPLE_DATA_TYPES.includes(typeof props)) {
|
|
8157
|
+
return { [V_COMP_NAME]: PRIMITIVE_COMP_NAME, [V_CHILDREN_NAME]: props, [PARENT_PROP_NAME]: parentComp };
|
|
8158
|
+
}
|
|
8159
|
+
return Object.assign(Object.assign({}, props), { [PARENT_PROP_NAME]: parentComp });
|
|
8230
8160
|
};
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
var listItem = props[LIST_ITEM];
|
|
8161
|
+
const genChildenFromListItem = (props, stock) => {
|
|
8162
|
+
let page = !!props[LIST_PAGE] && isNumber(props[LIST_PAGE]) ? props[LIST_PAGE] : 0;
|
|
8163
|
+
let listLength = !!props[LIST_LENGTH] && isNumber(props[LIST_LENGTH]) ? props[LIST_LENGTH] : undefined;
|
|
8164
|
+
let itemPerPage = !!props[LIST_ITEM_PER_PAGE] && isNumber(props[LIST_ITEM_PER_PAGE]) ? props[LIST_ITEM_PER_PAGE] : undefined;
|
|
8165
|
+
const listItem = props[LIST_ITEM];
|
|
8237
8166
|
if (!listItem)
|
|
8238
8167
|
return undefined;
|
|
8239
|
-
|
|
8168
|
+
const currentPaths = props[CURRENT_PATH_NAME];
|
|
8240
8169
|
if (!currentPaths)
|
|
8241
8170
|
return undefined;
|
|
8242
|
-
|
|
8171
|
+
const store = Object.keys(currentPaths)[0];
|
|
8243
8172
|
if (!store)
|
|
8244
8173
|
return undefined;
|
|
8245
|
-
|
|
8174
|
+
const { path } = currentPaths[store];
|
|
8246
8175
|
if (currentPaths && !listLength) {
|
|
8247
8176
|
if (path) {
|
|
8248
|
-
|
|
8177
|
+
const list = stock.callFunction('get', { store, path });
|
|
8249
8178
|
listLength = !!list && Array.isArray(list) ? list.length : 0;
|
|
8250
8179
|
}
|
|
8251
8180
|
}
|
|
@@ -8255,45 +8184,80 @@ var genChildenFromListItem = function (props, stock) {
|
|
|
8255
8184
|
page = Number.isInteger(page) && page >= 0 ? page : 0;
|
|
8256
8185
|
itemPerPage = !!itemPerPage && Number.isInteger(itemPerPage) && itemPerPage >= 0 ? itemPerPage : 0;
|
|
8257
8186
|
listLength = !!listLength && Number.isInteger(listLength) && listLength >= 0 ? listLength : 0;
|
|
8258
|
-
|
|
8259
|
-
|
|
8187
|
+
const offset = page * itemPerPage <= listLength ? page * itemPerPage : 0;
|
|
8188
|
+
const children = [];
|
|
8260
8189
|
// eslint-disable-next-line no-plusplus
|
|
8261
|
-
for (
|
|
8262
|
-
children.push(
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8190
|
+
for (let i = offset; i < listLength && i < offset + itemPerPage; i++) {
|
|
8191
|
+
children.push(Object.assign(Object.assign({}, listItem), { [PATH_MODIFIERS_KEY]: {
|
|
8192
|
+
[store]: {
|
|
8193
|
+
path: `.${SEPARATOR}${i}`,
|
|
8194
|
+
},
|
|
8195
|
+
} }));
|
|
8267
8196
|
}
|
|
8268
8197
|
return children.length > 0 ? children : undefined;
|
|
8269
8198
|
};
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8199
|
+
const getRootWrapperProps = (props, stock) => {
|
|
8200
|
+
const newProps = Object.assign({}, props);
|
|
8201
|
+
const subscriberPaths = calculatePropsFromModifier(newProps, stock);
|
|
8273
8202
|
actionBuilder(newProps, stock);
|
|
8274
8203
|
if (newProps[LIST_SEMAPHORE]) {
|
|
8275
8204
|
newProps[V_CHILDREN_NAME] = genChildenFromListItem(newProps, stock);
|
|
8276
8205
|
}
|
|
8206
|
+
newProps.subscriberPaths = subscriberPaths;
|
|
8277
8207
|
return newProps;
|
|
8278
8208
|
};
|
|
8279
|
-
|
|
8280
|
-
|
|
8209
|
+
const isChildrenProps = (propName) => !!propName && typeof propName === 'string' && propName.startsWith(V_CHILDREN_PREFIX);
|
|
8210
|
+
const getParentProps = (props) => {
|
|
8211
|
+
return props && typeof props === 'object' && !Array.isArray(props)
|
|
8212
|
+
? Object.keys(props)
|
|
8213
|
+
.filter((key) => !isChildrenProps(key) && key !== PARENT_PROP_NAME)
|
|
8214
|
+
.reduce((newObj, key) => {
|
|
8215
|
+
// eslint-disable-next-line no-param-reassign
|
|
8216
|
+
newObj[key] = props[key];
|
|
8217
|
+
return newObj;
|
|
8218
|
+
}, {})
|
|
8219
|
+
: {};
|
|
8220
|
+
};
|
|
8221
|
+
const getPropsChildrenFilter = ({ props, filter }) => props && typeof props === 'object' && !Array.isArray(props)
|
|
8222
|
+
? Object.keys(props)
|
|
8223
|
+
.filter((key) => ((filter === 'withoutChildren' && !isChildrenProps(key)) || (filter === 'onlyChildren' && isChildrenProps(key))) && key !== PARENT_PROP_NAME)
|
|
8224
|
+
.reduce((newObj, key) => {
|
|
8225
|
+
// eslint-disable-next-line no-param-reassign
|
|
8226
|
+
newObj[key] = props[key];
|
|
8227
|
+
return newObj;
|
|
8228
|
+
}, {})
|
|
8229
|
+
: {};
|
|
8230
|
+
const getChildrensForRoot = (props, children, Wrapper) => {
|
|
8281
8231
|
// eslint-disable-next-line no-nested-ternary
|
|
8282
8232
|
if (!!props && Array.isArray(children)) {
|
|
8283
|
-
return children.map(
|
|
8233
|
+
return children.map((childrenItem, index) => {
|
|
8284
8234
|
// eslint-disable-next-line react/no-array-index-key
|
|
8285
|
-
return jsxRuntime.exports.jsx(Wrapper,
|
|
8235
|
+
return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(childrenItem, getParentProps(props)) }, index);
|
|
8286
8236
|
});
|
|
8287
8237
|
}
|
|
8288
8238
|
if (!!props && !!children) {
|
|
8289
|
-
return jsxRuntime.exports.jsx(Wrapper,
|
|
8239
|
+
return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(children, getParentProps(props)) }, void 0);
|
|
8240
|
+
}
|
|
8241
|
+
return undefined;
|
|
8242
|
+
};
|
|
8243
|
+
const generateChildren = (props, { Wrapper }) => props[V_COMP_NAME] !== '_PrimitiveProp' ? getChildrensForRoot(props, props[V_CHILDREN_NAME], Wrapper) : props[V_CHILDREN_NAME];
|
|
8244
|
+
const generateNewChildren = (props, { Wrapper }) => {
|
|
8245
|
+
// eslint-disable-next-line no-nested-ternary
|
|
8246
|
+
if (props) {
|
|
8247
|
+
if (Array.isArray(props)) {
|
|
8248
|
+
return props.map((childrenItem, index) => {
|
|
8249
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
8250
|
+
return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(childrenItem, getParentProps(props)) }, index);
|
|
8251
|
+
});
|
|
8252
|
+
}
|
|
8253
|
+
return jsxRuntime.exports.jsx(Wrapper, { props: normalisePrimitives(props, getParentProps(props)) }, void 0);
|
|
8290
8254
|
}
|
|
8291
8255
|
return undefined;
|
|
8292
8256
|
};
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
return
|
|
8296
|
-
};var wrapperUtil=/*#__PURE__*/Object.freeze({__proto__:null,actionBuilder:actionBuilder,
|
|
8257
|
+
const removeTechnicalProps = (changeableProps) => {
|
|
8258
|
+
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 + ""]);
|
|
8259
|
+
return newProps;
|
|
8260
|
+
};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) {
|
|
8297
8261
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8298
8262
|
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;
|
|
8299
8263
|
class _CodeOrName {
|
|
@@ -15218,7 +15182,7 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
|
|
|
15218
15182
|
|
|
15219
15183
|
return str
|
|
15220
15184
|
|
|
15221
|
-
};
|
|
15185
|
+
};const I18nSchema = {
|
|
15222
15186
|
$id: 'http://example.com/schemas/schema.json',
|
|
15223
15187
|
type: 'object',
|
|
15224
15188
|
additionalProperties: {
|
|
@@ -15243,28 +15207,26 @@ var src = function(str, data, delimiter = [ '{{ ', ' }}' ]) {
|
|
|
15243
15207
|
},
|
|
15244
15208
|
minProperties: 1,
|
|
15245
15209
|
};
|
|
15246
|
-
|
|
15210
|
+
class I18n {
|
|
15247
15211
|
// eslint-disable-next-line consistent-this
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
this.getLocales = function () { return (_this.language.includes('-') ? _this.language.split('-') : _this.language.split('_') || [])[0]; };
|
|
15252
|
-
this.t = function (key, options, language) {
|
|
15212
|
+
constructor({ language = 'en', resources, nonExistsHandler, keyPrefix = '{{', keyPostfix = '}}' }) {
|
|
15213
|
+
this.getLocales = () => (this.language.includes('-') ? this.language.split('-') : this.language.split('_') || [])[0];
|
|
15214
|
+
this.t = (key, options, language) => {
|
|
15253
15215
|
if (!(typeof key === 'string')) {
|
|
15254
15216
|
return key;
|
|
15255
15217
|
}
|
|
15256
|
-
if (!
|
|
15218
|
+
if (!this.resources || (!this.resources && !this.language && !language) || !this.resources[`${this.availableLanguageKey || language}`]) {
|
|
15257
15219
|
return key;
|
|
15258
15220
|
}
|
|
15259
|
-
|
|
15221
|
+
const value = this.resources[`${this.availableLanguageKey || language}`].translation[key];
|
|
15260
15222
|
if (value === undefined) {
|
|
15261
|
-
if (
|
|
15262
|
-
return
|
|
15223
|
+
if (this.nonExistsHandler && typeof this.nonExistsHandler === 'function') {
|
|
15224
|
+
return this.nonExistsHandler(key);
|
|
15263
15225
|
}
|
|
15264
15226
|
return key;
|
|
15265
15227
|
}
|
|
15266
15228
|
if (options) {
|
|
15267
|
-
return src(value, options, [
|
|
15229
|
+
return src(value, options, [this.keyPrefix, this.keyPostfix]);
|
|
15268
15230
|
}
|
|
15269
15231
|
return value;
|
|
15270
15232
|
};
|
|
@@ -15272,9 +15234,9 @@ var I18n = /** @class */ (function () {
|
|
|
15272
15234
|
this.nonExistsHandler = nonExistsHandler;
|
|
15273
15235
|
this.keyPrefix = keyPrefix;
|
|
15274
15236
|
this.keyPostfix = keyPostfix;
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15237
|
+
const ajv = new Ajv();
|
|
15238
|
+
const validate = ajv.compile(I18nSchema);
|
|
15239
|
+
const isValid = validate(resources);
|
|
15278
15240
|
if (isValid) {
|
|
15279
15241
|
this.resources = resources;
|
|
15280
15242
|
}
|
|
@@ -15286,84 +15248,49 @@ var I18n = /** @class */ (function () {
|
|
|
15286
15248
|
this.availableLanguageKey = this.getLocales();
|
|
15287
15249
|
}
|
|
15288
15250
|
}
|
|
15289
|
-
|
|
15290
|
-
}
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
var store = _a.store, path = _a.path, _b = _a.isError, isError = _b === void 0 ? false : _b;
|
|
15295
|
-
var state = getState(globalState);
|
|
15251
|
+
}const StockContext = createContext(null);
|
|
15252
|
+
const PathModifierContext = createContext({});const getState = (state) => state === null || state === void 0 ? void 0 : state.root;
|
|
15253
|
+
const getValue$3 = (state, store, path) => jsonPointerGet(state[store], path) || null;
|
|
15254
|
+
const getStateValue$1 = (globalState, { store, path, isError = false }, currentPaths) => {
|
|
15255
|
+
const state = getState(globalState);
|
|
15296
15256
|
if (state && store && path) {
|
|
15297
|
-
|
|
15298
|
-
return getValue$3(state,
|
|
15257
|
+
const convertedPath = currentPaths && currentPaths[store] && currentPaths[store].path ? changeRelativePath(`${currentPaths[store].path}${SEPARATOR}${path}`) : path;
|
|
15258
|
+
return getValue$3(state, `${store}${isError ? STORE_ERROR_POSTFIX : ''}`, convertedPath);
|
|
15299
15259
|
}
|
|
15300
15260
|
return null;
|
|
15301
15261
|
};
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
if (!!x && !!x[MODIFIER_KEY] && x[MODIFIER_KEY] === 'get' && !(this.path.length > 1 && this.path.includes(V_CHILDREN_NAME))) {
|
|
15312
|
-
paths.push({ path: this.path, level: this.level });
|
|
15313
|
-
}
|
|
15314
|
-
});
|
|
15315
|
-
orderBy_1(paths, ['level'], ['desc']).forEach(function (i) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15316
|
-
var _a, _b, functionName, functionParams, value, jsonata, expression;
|
|
15317
|
-
return __generator(this, function (_c) {
|
|
15318
|
-
_a = traverse$3(props).get(i.path), _b = MODIFIER_KEY, functionName = _a[_b], functionParams = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
15319
|
-
if (functionName === 'get' && functionParams.store && functionParams.path) {
|
|
15320
|
-
value = getStateValue$1(globalState, functionParams, currentPaths);
|
|
15321
|
-
if (functionParams.jsonataDef) {
|
|
15322
|
-
try {
|
|
15323
|
-
jsonata = require('jsonata');
|
|
15324
|
-
expression = jsonata(functionParams.jsonataDef);
|
|
15325
|
-
value = expression.evaluate(value);
|
|
15326
|
-
}
|
|
15327
|
-
catch (error) {
|
|
15328
|
-
// eslint-disable-next-line no-console
|
|
15329
|
-
console.error('jsonata error', error, functionParams.jsonataDef);
|
|
15330
|
-
}
|
|
15331
|
-
}
|
|
15332
|
-
// traverse(result).set(i.path, value)
|
|
15333
|
-
result[pathArrayToJsonPointer(i.path)] = value;
|
|
15334
|
-
}
|
|
15335
|
-
return [2 /*return*/];
|
|
15336
|
-
});
|
|
15337
|
-
}); });
|
|
15338
|
-
return result;
|
|
15339
|
-
};var DATA_UPDATE = 'DATA_UPDATE';
|
|
15340
|
-
var PURGE$1 = 'PURGE';
|
|
15341
|
-
var set$1 = function (payload) { return ({
|
|
15262
|
+
const compSelectorHook = (currentPaths, subscriberPaths) => (state) => {
|
|
15263
|
+
if (typeof subscriberPaths === 'object' && Array.isArray(subscriberPaths) && (subscriberPaths === null || subscriberPaths === void 0 ? void 0 : subscriberPaths.length) > 0) {
|
|
15264
|
+
return subscriberPaths.map((subscriberPath) => getStateValue$1(state, subscriberPath, currentPaths));
|
|
15265
|
+
}
|
|
15266
|
+
// TODO isError, currentPaths, root need to solve propperly
|
|
15267
|
+
return undefined;
|
|
15268
|
+
};const DATA_UPDATE = 'DATA_UPDATE';
|
|
15269
|
+
const PURGE$1 = 'PURGE';
|
|
15270
|
+
const set$1 = (payload) => ({
|
|
15342
15271
|
type: DATA_UPDATE,
|
|
15343
|
-
payload
|
|
15344
|
-
});
|
|
15345
|
-
|
|
15272
|
+
payload,
|
|
15273
|
+
});
|
|
15274
|
+
const purge = (payload) => ({
|
|
15346
15275
|
type: PURGE$1,
|
|
15347
|
-
payload
|
|
15348
|
-
});
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
return getStateValue$1(state, { store: store, path: path }, currentPaths);
|
|
15276
|
+
payload,
|
|
15277
|
+
});const getStateValue = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
|
|
15278
|
+
const { store, path } = attr;
|
|
15279
|
+
const state = stock.reduxStore.getState();
|
|
15280
|
+
return getStateValue$1(state, { store, path }, currentPaths);
|
|
15353
15281
|
};
|
|
15354
|
-
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
|
|
15358
|
-
return getStateValue$1(state, { store: store, path: path }, currentPaths);
|
|
15282
|
+
const get = (attr, { [CURRENT_PATH_NAME]: currentPaths } = {}, callerArgs, stock) => {
|
|
15283
|
+
const { store, path } = attr;
|
|
15284
|
+
const state = stock.reduxStore.getState();
|
|
15285
|
+
return getStateValue$1(state, { store, path }, currentPaths);
|
|
15359
15286
|
};
|
|
15360
|
-
|
|
15361
|
-
stock.reduxStore.dispatch(set$1(
|
|
15287
|
+
const set = (attr, props, callerArgs, stock) => {
|
|
15288
|
+
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 })));
|
|
15362
15289
|
};
|
|
15363
15290
|
var functions = {
|
|
15364
|
-
getStateValue
|
|
15365
|
-
get
|
|
15366
|
-
set
|
|
15291
|
+
getStateValue,
|
|
15292
|
+
get,
|
|
15293
|
+
set,
|
|
15367
15294
|
};/**
|
|
15368
15295
|
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
|
15369
15296
|
*
|
|
@@ -15397,7 +15324,7 @@ var ActionTypes$1 = {
|
|
|
15397
15324
|
* @param {any} obj The object to inspect.
|
|
15398
15325
|
* @returns {boolean} True if the argument appears to be a plain object.
|
|
15399
15326
|
*/
|
|
15400
|
-
function isPlainObject$
|
|
15327
|
+
function isPlainObject$3(obj) {
|
|
15401
15328
|
if (typeof obj !== 'object' || obj === null) return false;
|
|
15402
15329
|
var proto = obj;
|
|
15403
15330
|
|
|
@@ -15473,7 +15400,7 @@ function kindOf$1(val) {
|
|
|
15473
15400
|
* @param {String} message The warning message.
|
|
15474
15401
|
* @returns {void}
|
|
15475
15402
|
*/
|
|
15476
|
-
function warning$
|
|
15403
|
+
function warning$1(message) {
|
|
15477
15404
|
/* eslint-disable no-console */
|
|
15478
15405
|
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
15479
15406
|
console.error(message);
|
|
@@ -15498,7 +15425,7 @@ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, une
|
|
|
15498
15425
|
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
15499
15426
|
}
|
|
15500
15427
|
|
|
15501
|
-
if (!isPlainObject$
|
|
15428
|
+
if (!isPlainObject$3(inputState)) {
|
|
15502
15429
|
return "The " + argumentName + " has unexpected type of \"" + kindOf$1(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
|
15503
15430
|
}
|
|
15504
15431
|
|
|
@@ -15560,7 +15487,7 @@ function combineReducers(reducers) {
|
|
|
15560
15487
|
|
|
15561
15488
|
if (process.env.NODE_ENV !== 'production') {
|
|
15562
15489
|
if (typeof reducers[key] === 'undefined') {
|
|
15563
|
-
warning$
|
|
15490
|
+
warning$1("No reducer provided for key \"" + key + "\"");
|
|
15564
15491
|
}
|
|
15565
15492
|
}
|
|
15566
15493
|
|
|
@@ -15599,7 +15526,7 @@ function combineReducers(reducers) {
|
|
|
15599
15526
|
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
15600
15527
|
|
|
15601
15528
|
if (warningMessage) {
|
|
15602
|
-
warning$
|
|
15529
|
+
warning$1(warningMessage);
|
|
15603
15530
|
}
|
|
15604
15531
|
}
|
|
15605
15532
|
|
|
@@ -15634,7 +15561,7 @@ function combineReducers(reducers) {
|
|
|
15634
15561
|
function isCrushed$1() {}
|
|
15635
15562
|
|
|
15636
15563
|
if (process.env.NODE_ENV !== 'production' && typeof isCrushed$1.name === 'string' && isCrushed$1.name !== 'isCrushed') {
|
|
15637
|
-
warning$
|
|
15564
|
+
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.');
|
|
15638
15565
|
}function createTransform( // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
|
|
15639
15566
|
inbound, // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
|
|
15640
15567
|
outbound) {
|
|
@@ -15869,11 +15796,11 @@ var pick = flatRest(function(object, paths) {
|
|
|
15869
15796
|
return object == null ? {} : basePick(object, paths);
|
|
15870
15797
|
});
|
|
15871
15798
|
|
|
15872
|
-
var pick_1 = pick;
|
|
15799
|
+
var pick_1 = pick;const SetTransform = createTransform((inboundState, key) => {
|
|
15873
15800
|
if (key !== 'root')
|
|
15874
15801
|
return inboundState;
|
|
15875
15802
|
return pick_1(inboundState, PERSIST_STORAGE_NAMES);
|
|
15876
|
-
},
|
|
15803
|
+
}, (outboundState, key) => {
|
|
15877
15804
|
if (key !== 'root')
|
|
15878
15805
|
return outboundState;
|
|
15879
15806
|
return pick_1(outboundState, PERSIST_STORAGE_NAMES);
|
|
@@ -15883,81 +15810,80 @@ var persistConfig = {
|
|
|
15883
15810
|
whitelist: ['root'],
|
|
15884
15811
|
transforms: [SetTransform],
|
|
15885
15812
|
};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;
|
|
15886
|
-
|
|
15887
|
-
|
|
15888
|
-
|
|
15813
|
+
const pathConverter = (path) => path.replace(/\./g, SEPARATOR);
|
|
15814
|
+
const errorConverter = (errors) => {
|
|
15815
|
+
const res = {};
|
|
15889
15816
|
if (errors) {
|
|
15890
|
-
errors.forEach(
|
|
15817
|
+
errors.forEach((i) => {
|
|
15891
15818
|
if (i.keyword === 'required') {
|
|
15892
|
-
jsonpointer.set(res,
|
|
15819
|
+
jsonpointer.set(res, `${pathConverter(`${i.instancePath}.${i.params.missingProperty}`)}/-`, i.message);
|
|
15893
15820
|
}
|
|
15894
15821
|
else {
|
|
15895
|
-
jsonpointer.set(res,
|
|
15822
|
+
jsonpointer.set(res, `${pathConverter(i.instancePath)}/-`, i.message);
|
|
15896
15823
|
}
|
|
15897
15824
|
});
|
|
15898
15825
|
}
|
|
15899
15826
|
return res;
|
|
15900
15827
|
};
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15828
|
+
const validateJSON = (schema, store, data) => {
|
|
15829
|
+
const ajv = new Ajv({ allErrors: true });
|
|
15830
|
+
const validate = ajv.compile(schema);
|
|
15831
|
+
const valid = validate(data);
|
|
15905
15832
|
return {
|
|
15906
|
-
store:
|
|
15907
|
-
valid
|
|
15833
|
+
store: `${store}${STORE_ERROR_POSTFIX}`,
|
|
15834
|
+
valid,
|
|
15908
15835
|
value: valid ? null : errorConverter(validate.errors),
|
|
15909
15836
|
};
|
|
15910
|
-
};
|
|
15911
|
-
|
|
15837
|
+
};const initialState$1 = {};
|
|
15838
|
+
const validateNewState = (stock, newState, actionStore, actionPath) => {
|
|
15912
15839
|
if (stock === null || stock === void 0 ? void 0 : stock.validations) {
|
|
15913
|
-
stock.validations.forEach(
|
|
15914
|
-
if (validateItem.store === actionStore &&
|
|
15840
|
+
stock.validations.forEach((validateItem) => {
|
|
15841
|
+
if (validateItem.store === actionStore && `${actionPath}`.startsWith(validateItem.path)) {
|
|
15915
15842
|
if (validateItem.schema) {
|
|
15916
|
-
|
|
15917
|
-
|
|
15843
|
+
const stateToBeValidated = jsonPointerGet(newState, `${SEPARATOR}${actionStore}${validateItem.path}`);
|
|
15844
|
+
const errors = validateJSON(validateItem.schema, actionStore, stateToBeValidated);
|
|
15918
15845
|
// console.log('matched validator', `${c.SEPARATOR}${errors.store}${validateItem.path}`, errors)
|
|
15919
15846
|
// eslint-disable-next-line no-param-reassign
|
|
15920
|
-
newState = jsonPointerSet(newState,
|
|
15847
|
+
newState = jsonPointerSet(newState, `${SEPARATOR}${errors.store}${validateItem.path}`, errors.value);
|
|
15921
15848
|
}
|
|
15922
15849
|
}
|
|
15923
15850
|
});
|
|
15924
15851
|
}
|
|
15925
15852
|
};
|
|
15926
|
-
|
|
15927
|
-
if (state === void 0) { state = initialState$1; }
|
|
15853
|
+
const reducer = (state = initialState$1, action) => {
|
|
15928
15854
|
switch (action === null || action === void 0 ? void 0 : action.type) {
|
|
15929
15855
|
case DATA_UPDATE: {
|
|
15930
|
-
|
|
15931
|
-
if (
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
? changeRelativePath(
|
|
15856
|
+
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) || {};
|
|
15857
|
+
if (store && path && !isCircular(value)) {
|
|
15858
|
+
const storekey = `${store}`;
|
|
15859
|
+
let convertedPath = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
|
|
15860
|
+
? changeRelativePath(`${currentPaths[storekey].path}${SEPARATOR}${path}`)
|
|
15935
15861
|
: changeRelativePath(path);
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
if (
|
|
15862
|
+
convertedPath = convertedPath.startsWith(SEPARATOR) ? convertedPath : `${SEPARATOR}${convertedPath}`;
|
|
15863
|
+
const absolutePathWithStoreKey = `${SEPARATOR}${storekey}${convertedPath}`;
|
|
15864
|
+
const newState = produce(state, (draft) => {
|
|
15865
|
+
if (jsonataDef) {
|
|
15940
15866
|
try {
|
|
15941
15867
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15868
|
+
const jsonata = require('jsonata');
|
|
15869
|
+
const expression = jsonata(jsonataDef);
|
|
15870
|
+
const newValue = expression.evaluate(value);
|
|
15945
15871
|
// eslint-disable-next-line no-param-reassign
|
|
15946
|
-
draft = jsonPointerSet(draft,
|
|
15872
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, newValue);
|
|
15947
15873
|
}
|
|
15948
15874
|
catch (error) {
|
|
15949
15875
|
// eslint-disable-next-line no-console
|
|
15950
|
-
console.error('jsonata error', error,
|
|
15876
|
+
console.error('jsonata error', error, jsonataDef);
|
|
15951
15877
|
// eslint-disable-next-line no-param-reassign
|
|
15952
|
-
draft = jsonPointerSet(draft,
|
|
15878
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
|
|
15953
15879
|
}
|
|
15954
15880
|
}
|
|
15955
15881
|
else {
|
|
15956
15882
|
// eslint-disable-next-line no-param-reassign
|
|
15957
|
-
draft = jsonPointerSet(draft,
|
|
15883
|
+
draft = jsonPointerSet(draft, absolutePathWithStoreKey, value);
|
|
15958
15884
|
}
|
|
15959
15885
|
// if validatior has match, need to validate it synchronously
|
|
15960
|
-
validateNewState(
|
|
15886
|
+
validateNewState(stock, draft, store, convertedPath);
|
|
15961
15887
|
});
|
|
15962
15888
|
return newState;
|
|
15963
15889
|
}
|
|
@@ -15969,19 +15895,11 @@ var reducer = function (state, action) {
|
|
|
15969
15895
|
default:
|
|
15970
15896
|
return state;
|
|
15971
15897
|
}
|
|
15972
|
-
};
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
|
|
15977
|
-
return [4 /*yield*/, stock.callFunction('reloadApp', {})];
|
|
15978
|
-
case 1:
|
|
15979
|
-
_a.sent();
|
|
15980
|
-
return [2 /*return*/];
|
|
15981
|
-
}
|
|
15982
|
-
});
|
|
15983
|
-
}); };
|
|
15984
|
-
var appRootFunctions = { deletePersistDataStore: deletePersistDataStore };
|
|
15898
|
+
};const rootReducer = combineReducers({ root: reducer });const deletePersistDataStore = (attr, props, callerArgs, stock) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15899
|
+
stock.reduxStore.dispatch(purge(null));
|
|
15900
|
+
yield stock.callFunction('reloadApp', {});
|
|
15901
|
+
});
|
|
15902
|
+
const appRootFunctions = { deletePersistDataStore };
|
|
15985
15903
|
|
|
15986
15904
|
/**
|
|
15987
15905
|
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
@@ -16427,7 +16345,7 @@ var _getNative = getNative$3;
|
|
|
16427
16345
|
|
|
16428
16346
|
var getNative$2 = _getNative;
|
|
16429
16347
|
|
|
16430
|
-
var defineProperty$
|
|
16348
|
+
var defineProperty$2 = (function() {
|
|
16431
16349
|
try {
|
|
16432
16350
|
var func = getNative$2(Object, 'defineProperty');
|
|
16433
16351
|
func({}, '', {});
|
|
@@ -16435,10 +16353,10 @@ var defineProperty$3 = (function() {
|
|
|
16435
16353
|
} catch (e) {}
|
|
16436
16354
|
}());
|
|
16437
16355
|
|
|
16438
|
-
var _defineProperty$4 = defineProperty$
|
|
16356
|
+
var _defineProperty$4 = defineProperty$2;
|
|
16439
16357
|
|
|
16440
16358
|
var constant = constant_1,
|
|
16441
|
-
defineProperty$
|
|
16359
|
+
defineProperty$1 = _defineProperty$4,
|
|
16442
16360
|
identity$1 = identity_1;
|
|
16443
16361
|
|
|
16444
16362
|
/**
|
|
@@ -16449,8 +16367,8 @@ var constant = constant_1,
|
|
|
16449
16367
|
* @param {Function} string The `toString` result.
|
|
16450
16368
|
* @returns {Function} Returns `func`.
|
|
16451
16369
|
*/
|
|
16452
|
-
var baseSetToString$1 = !defineProperty$
|
|
16453
|
-
return defineProperty$
|
|
16370
|
+
var baseSetToString$1 = !defineProperty$1 ? identity$1 : function(func, string) {
|
|
16371
|
+
return defineProperty$1(func, 'toString', {
|
|
16454
16372
|
'configurable': true,
|
|
16455
16373
|
'enumerable': false,
|
|
16456
16374
|
'value': constant(string),
|
|
@@ -17201,7 +17119,7 @@ Stack$1.prototype.set = stackSet;
|
|
|
17201
17119
|
|
|
17202
17120
|
var _Stack = Stack$1;
|
|
17203
17121
|
|
|
17204
|
-
var defineProperty
|
|
17122
|
+
var defineProperty = _defineProperty$4;
|
|
17205
17123
|
|
|
17206
17124
|
/**
|
|
17207
17125
|
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
@@ -17213,8 +17131,8 @@ var defineProperty$1 = _defineProperty$4;
|
|
|
17213
17131
|
* @param {*} value The value to assign.
|
|
17214
17132
|
*/
|
|
17215
17133
|
function baseAssignValue$3(object, key, value) {
|
|
17216
|
-
if (key == '__proto__' && defineProperty
|
|
17217
|
-
defineProperty
|
|
17134
|
+
if (key == '__proto__' && defineProperty) {
|
|
17135
|
+
defineProperty(object, key, {
|
|
17218
17136
|
'configurable': true,
|
|
17219
17137
|
'enumerable': true,
|
|
17220
17138
|
'value': value,
|
|
@@ -17820,7 +17738,7 @@ var objectCtorString = funcToString.call(Object);
|
|
|
17820
17738
|
* _.isPlainObject(Object.create(null));
|
|
17821
17739
|
* // => true
|
|
17822
17740
|
*/
|
|
17823
|
-
function isPlainObject$
|
|
17741
|
+
function isPlainObject$2(value) {
|
|
17824
17742
|
if (!isObjectLike$1(value) || baseGetTag$1(value) != objectTag$1) {
|
|
17825
17743
|
return false;
|
|
17826
17744
|
}
|
|
@@ -17833,7 +17751,7 @@ function isPlainObject$3(value) {
|
|
|
17833
17751
|
funcToString.call(Ctor) == objectCtorString;
|
|
17834
17752
|
}
|
|
17835
17753
|
|
|
17836
|
-
var isPlainObject_1 = isPlainObject$
|
|
17754
|
+
var isPlainObject_1 = isPlainObject$2;
|
|
17837
17755
|
|
|
17838
17756
|
var baseGetTag = _baseGetTag,
|
|
17839
17757
|
isLength = isLength_1,
|
|
@@ -18300,7 +18218,7 @@ var assignMergeValue$1 = _assignMergeValue,
|
|
|
18300
18218
|
isBuffer = isBuffer$2.exports,
|
|
18301
18219
|
isFunction = isFunction_1,
|
|
18302
18220
|
isObject$3 = isObject_1,
|
|
18303
|
-
isPlainObject$
|
|
18221
|
+
isPlainObject$1 = isPlainObject_1,
|
|
18304
18222
|
isTypedArray = isTypedArray_1,
|
|
18305
18223
|
safeGet$1 = _safeGet,
|
|
18306
18224
|
toPlainObject = toPlainObject_1;
|
|
@@ -18360,7 +18278,7 @@ function baseMergeDeep$1(object, source, key, srcIndex, mergeFunc, customizer, s
|
|
|
18360
18278
|
newValue = [];
|
|
18361
18279
|
}
|
|
18362
18280
|
}
|
|
18363
|
-
else if (isPlainObject$
|
|
18281
|
+
else if (isPlainObject$1(srcValue) || isArguments(srcValue)) {
|
|
18364
18282
|
newValue = objValue;
|
|
18365
18283
|
if (isArguments(objValue)) {
|
|
18366
18284
|
newValue = toPlainObject(objValue);
|
|
@@ -18596,31 +18514,33 @@ var defaultsDeep = baseRest(function(args) {
|
|
|
18596
18514
|
|
|
18597
18515
|
var defaultsDeep_1 = defaultsDeep;
|
|
18598
18516
|
|
|
18599
|
-
function Text(
|
|
18600
|
-
|
|
18517
|
+
function Text(_a) {
|
|
18518
|
+
var { value } = _a, _b = constants.V_CHILDREN_NAME, children = _a[_b], props = __rest$1(_a, ["value", typeof _b === "symbol" ? _b : _b + ""]);
|
|
18519
|
+
const stock = useContext(StockContext);
|
|
18520
|
+
return jsxRuntime$1.exports.jsx("p", Object.assign({}, props, { children: wrapperUtil.generateNewChildren(value || children, stock) }), void 0);
|
|
18601
18521
|
}
|
|
18602
18522
|
|
|
18603
18523
|
function Button(props) {
|
|
18604
18524
|
// eslint-disable-next-line react/button-has-type
|
|
18605
|
-
return jsxRuntime$1.exports.jsx("button",
|
|
18525
|
+
return jsxRuntime$1.exports.jsx("button", Object.assign({}, props), void 0);
|
|
18606
18526
|
}
|
|
18607
18527
|
|
|
18608
18528
|
function Edit(props) {
|
|
18609
|
-
|
|
18529
|
+
const handleChange = (event) => {
|
|
18610
18530
|
props === null || props === void 0 ? void 0 : props.onChange(event.target.value);
|
|
18611
18531
|
};
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18532
|
+
const { fieldErrors, validation, value, label, helperText: origHelpertext, onChange } = props, ownProps = __rest$1(props, ["fieldErrors", "validation", "value", "label", "helperText", "onChange"]);
|
|
18533
|
+
let error = !!fieldErrors;
|
|
18534
|
+
let helperText = origHelpertext;
|
|
18615
18535
|
if (error && fieldErrors) {
|
|
18616
18536
|
helperText = fieldErrors && Array.isArray(fieldErrors) ? fieldErrors.join(', ') : fieldErrors;
|
|
18617
18537
|
}
|
|
18618
18538
|
if (validation && value && validation.jsonataDef) {
|
|
18619
|
-
|
|
18539
|
+
let isValid = true;
|
|
18620
18540
|
try {
|
|
18621
18541
|
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
18622
|
-
|
|
18623
|
-
|
|
18542
|
+
const jsonata = require('jsonata');
|
|
18543
|
+
const expression = jsonata(validation.jsonataDef);
|
|
18624
18544
|
isValid = expression.evaluate(value);
|
|
18625
18545
|
}
|
|
18626
18546
|
catch (err) {
|
|
@@ -18633,19 +18553,21 @@ function Edit(props) {
|
|
|
18633
18553
|
helperText = validation.fieldErrors && Array.isArray(validation.fieldErrors) ? validation.fieldErrors.join(', ') : validation.fieldErrors;
|
|
18634
18554
|
}
|
|
18635
18555
|
}
|
|
18636
|
-
return (jsxRuntime$1.exports.jsxs(jsxRuntime$1.exports.Fragment, { children: [jsxRuntime$1.exports.jsx("p",
|
|
18556
|
+
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));
|
|
18637
18557
|
}
|
|
18638
18558
|
|
|
18639
|
-
function View(
|
|
18640
|
-
|
|
18559
|
+
function View(_a) {
|
|
18560
|
+
var _b = constants.V_CHILDREN_NAME, children = _a[_b], props = __rest$1(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
18561
|
+
const stock = useContext(StockContext);
|
|
18562
|
+
return jsxRuntime$1.exports.jsx("div", Object.assign({}, props, { children: wrapperUtil.generateNewChildren(children, stock) }), void 0);
|
|
18641
18563
|
}
|
|
18642
18564
|
|
|
18643
18565
|
function Image(props) {
|
|
18644
|
-
|
|
18645
|
-
return jsxRuntime$1.exports.jsx("img",
|
|
18566
|
+
const { src } = props;
|
|
18567
|
+
return jsxRuntime$1.exports.jsx("img", Object.assign({ alt: "" }, props, { src: src && src.uri ? src.uri : src }), void 0);
|
|
18646
18568
|
}
|
|
18647
18569
|
|
|
18648
|
-
|
|
18570
|
+
const styles = {
|
|
18649
18571
|
label: {
|
|
18650
18572
|
backgroundColor: '#ffffaa',
|
|
18651
18573
|
borderColor: '#666666',
|
|
@@ -18666,45 +18588,41 @@ var styles = {
|
|
|
18666
18588
|
display: 'block',
|
|
18667
18589
|
},
|
|
18668
18590
|
};
|
|
18669
|
-
|
|
18591
|
+
const getName = (props) => {
|
|
18670
18592
|
if (props && props[constants.V_COMP_NAME]) {
|
|
18671
18593
|
return props[constants.V_COMP_NAME];
|
|
18672
18594
|
}
|
|
18673
18595
|
return 'Unknown';
|
|
18674
18596
|
};
|
|
18675
|
-
|
|
18676
|
-
|
|
18677
|
-
|
|
18678
|
-
|
|
18679
|
-
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18683
|
-
}
|
|
18684
|
-
InfoBox.prototype.componentDidMount = function () {
|
|
18597
|
+
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));
|
|
18598
|
+
class InfoBox extends React.PureComponent {
|
|
18599
|
+
constructor(props) {
|
|
18600
|
+
super(props);
|
|
18601
|
+
this.counter = 0;
|
|
18602
|
+
this.counter = 1;
|
|
18603
|
+
}
|
|
18604
|
+
componentDidMount() {
|
|
18685
18605
|
this.counter += 1;
|
|
18686
|
-
}
|
|
18687
|
-
|
|
18606
|
+
}
|
|
18607
|
+
componentDidUpdate() {
|
|
18688
18608
|
this.counter += 1;
|
|
18689
|
-
}
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18609
|
+
}
|
|
18610
|
+
render() {
|
|
18611
|
+
const { id } = this.props;
|
|
18612
|
+
const { filter } = this.props;
|
|
18613
|
+
const component = this.props[constants.V_COMP_NAME];
|
|
18694
18614
|
if (!component || component === '_PrimitiveProp') {
|
|
18695
18615
|
return null;
|
|
18696
18616
|
}
|
|
18697
18617
|
if (filter && Array.isArray(filter) && Object.keys(filter).length !== 0 && !filter.includes(id)) {
|
|
18698
18618
|
return null;
|
|
18699
18619
|
}
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
return InfoBox;
|
|
18704
|
-
})(React.PureComponent));
|
|
18620
|
+
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));
|
|
18621
|
+
}
|
|
18622
|
+
}
|
|
18705
18623
|
|
|
18706
18624
|
function Undefined(props) {
|
|
18707
|
-
return (jsxRuntime$1.exports.jsx("p",
|
|
18625
|
+
return (jsxRuntime$1.exports.jsx("p", Object.assign({ style: {
|
|
18708
18626
|
flex: 1,
|
|
18709
18627
|
minWidth: 100,
|
|
18710
18628
|
minHeight: 20,
|
|
@@ -18714,34 +18632,34 @@ function Undefined(props) {
|
|
|
18714
18632
|
} }, { children: getLabel(props) }), void 0));
|
|
18715
18633
|
}
|
|
18716
18634
|
|
|
18717
|
-
function PrimitiveProp(
|
|
18718
|
-
var children = _a.children;
|
|
18635
|
+
function PrimitiveProp({ [constants.V_CHILDREN_NAME]: children }) {
|
|
18719
18636
|
return jsxRuntime$1.exports.jsx("span", { children: !constants.SIMPLE_DATA_TYPES.includes(typeof children) || typeof children === 'boolean' ? JSON.stringify(children) : children }, void 0);
|
|
18720
18637
|
}
|
|
18721
18638
|
|
|
18722
|
-
|
|
18723
|
-
var
|
|
18724
|
-
|
|
18639
|
+
const Fragment = (_a) => {
|
|
18640
|
+
var _b = constants.V_CHILDREN_NAME, props = _a[_b]; __rest$1(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
18641
|
+
const stock = useContext(StockContext);
|
|
18642
|
+
return jsxRuntime$1.exports.jsx(jsxRuntime$1.exports.Fragment, { children: wrapperUtil.generateNewChildren(props, stock) }, void 0);
|
|
18725
18643
|
};
|
|
18726
18644
|
|
|
18727
|
-
|
|
18728
|
-
View
|
|
18645
|
+
const Components = {
|
|
18646
|
+
View,
|
|
18729
18647
|
_PrimitiveProp: PrimitiveProp,
|
|
18730
18648
|
_Undefined: Undefined,
|
|
18731
|
-
Fragment
|
|
18732
|
-
Image
|
|
18733
|
-
Text
|
|
18734
|
-
Button
|
|
18735
|
-
Edit
|
|
18649
|
+
Fragment,
|
|
18650
|
+
Image,
|
|
18651
|
+
Text,
|
|
18652
|
+
Button,
|
|
18653
|
+
Edit,
|
|
18736
18654
|
};
|
|
18737
18655
|
|
|
18738
18656
|
// eslint-disable-next-line import/prefer-default-export
|
|
18739
|
-
|
|
18740
|
-
|
|
18657
|
+
const getStock = (stockInit, model, Wrapper, reduxStore) => {
|
|
18658
|
+
const stock = new Stock(defaultsDeep_1(stockInit, {
|
|
18741
18659
|
components: Components,
|
|
18742
|
-
functions
|
|
18660
|
+
functions,
|
|
18743
18661
|
}), Wrapper, reduxStore);
|
|
18744
|
-
|
|
18662
|
+
const i18n = new I18n({
|
|
18745
18663
|
language: (navigator.languages && navigator.languages[0]) || // Chrome / Firefox
|
|
18746
18664
|
navigator.language || // All browsers
|
|
18747
18665
|
navigator.userLanguage,
|
|
@@ -18749,18 +18667,18 @@ var getStock = function (stockInit, model, Wrapper, reduxStore) {
|
|
|
18749
18667
|
});
|
|
18750
18668
|
// get Validations
|
|
18751
18669
|
stock.validations = util$1.collectObjToArray(constants.REF_VALIDATES, model);
|
|
18752
|
-
stock.registerFunction('t',
|
|
18753
|
-
stock.registerFunction('test',
|
|
18670
|
+
stock.registerFunction('t', (p) => i18n.t(p.keys, p.options));
|
|
18671
|
+
stock.registerFunction('test', () => 'Test is ok');
|
|
18754
18672
|
return stock;
|
|
18755
18673
|
};
|
|
18756
|
-
|
|
18674
|
+
const stock = {
|
|
18757
18675
|
components: Components,
|
|
18758
|
-
functions
|
|
18676
|
+
functions,
|
|
18759
18677
|
};
|
|
18760
18678
|
|
|
18761
18679
|
var propTypes = {exports: {}};
|
|
18762
18680
|
|
|
18763
|
-
var reactIs$
|
|
18681
|
+
var reactIs$2 = {exports: {}};
|
|
18764
18682
|
|
|
18765
18683
|
var reactIs_production_min$2 = {};
|
|
18766
18684
|
|
|
@@ -18961,9 +18879,9 @@ reactIs_development$2.typeOf = typeOf;
|
|
|
18961
18879
|
}
|
|
18962
18880
|
|
|
18963
18881
|
if (process.env.NODE_ENV === 'production') {
|
|
18964
|
-
reactIs$
|
|
18882
|
+
reactIs$2.exports = reactIs_production_min$2;
|
|
18965
18883
|
} else {
|
|
18966
|
-
reactIs$
|
|
18884
|
+
reactIs$2.exports = reactIs_development$2;
|
|
18967
18885
|
}
|
|
18968
18886
|
|
|
18969
18887
|
/**
|
|
@@ -19088,7 +19006,7 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
19088
19006
|
* LICENSE file in the root directory of this source tree.
|
|
19089
19007
|
*/
|
|
19090
19008
|
|
|
19091
|
-
var ReactIs$1 = reactIs$
|
|
19009
|
+
var ReactIs$1 = reactIs$2.exports;
|
|
19092
19010
|
var assign$1 = objectAssign$1;
|
|
19093
19011
|
|
|
19094
19012
|
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
@@ -19760,7 +19678,7 @@ var factoryWithThrowingShims = function() {
|
|
|
19760
19678
|
*/
|
|
19761
19679
|
|
|
19762
19680
|
if (process.env.NODE_ENV !== 'production') {
|
|
19763
|
-
var ReactIs = reactIs$
|
|
19681
|
+
var ReactIs = reactIs$2.exports;
|
|
19764
19682
|
|
|
19765
19683
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
19766
19684
|
// http://fb.me/prop-types-in-prod
|
|
@@ -19977,40 +19895,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
19977
19895
|
};
|
|
19978
19896
|
}
|
|
19979
19897
|
|
|
19980
|
-
|
|
19981
|
-
_extends = Object.assign || function (target) {
|
|
19982
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
19983
|
-
var source = arguments[i];
|
|
19984
|
-
|
|
19985
|
-
for (var key in source) {
|
|
19986
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
19987
|
-
target[key] = source[key];
|
|
19988
|
-
}
|
|
19989
|
-
}
|
|
19990
|
-
}
|
|
19991
|
-
|
|
19992
|
-
return target;
|
|
19993
|
-
};
|
|
19994
|
-
|
|
19995
|
-
return _extends.apply(this, arguments);
|
|
19996
|
-
}
|
|
19997
|
-
|
|
19998
|
-
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
19999
|
-
if (source == null) return {};
|
|
20000
|
-
var target = {};
|
|
20001
|
-
var sourceKeys = Object.keys(source);
|
|
20002
|
-
var key, i;
|
|
20003
|
-
|
|
20004
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
20005
|
-
key = sourceKeys[i];
|
|
20006
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
20007
|
-
target[key] = source[key];
|
|
20008
|
-
}
|
|
20009
|
-
|
|
20010
|
-
return target;
|
|
20011
|
-
}
|
|
20012
|
-
|
|
20013
|
-
var reactIs$2 = {exports: {}};
|
|
19898
|
+
var reactIs$1 = {exports: {}};
|
|
20014
19899
|
|
|
20015
19900
|
var reactIs_production_min$1 = {};
|
|
20016
19901
|
|
|
@@ -20211,39 +20096,12 @@ reactIs_development$1.typeOf = typeOf;
|
|
|
20211
20096
|
}
|
|
20212
20097
|
|
|
20213
20098
|
if (process.env.NODE_ENV === 'production') {
|
|
20214
|
-
reactIs$
|
|
20099
|
+
reactIs$1.exports = reactIs_production_min$1;
|
|
20215
20100
|
} else {
|
|
20216
|
-
reactIs$
|
|
20101
|
+
reactIs$1.exports = reactIs_development$1;
|
|
20217
20102
|
}
|
|
20218
20103
|
|
|
20219
|
-
var reactIs
|
|
20220
|
-
|
|
20221
|
-
/**
|
|
20222
|
-
* Copyright 2015, Yahoo! Inc.
|
|
20223
|
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
20224
|
-
*/
|
|
20225
|
-
var REACT_STATICS = {
|
|
20226
|
-
childContextTypes: true,
|
|
20227
|
-
contextType: true,
|
|
20228
|
-
contextTypes: true,
|
|
20229
|
-
defaultProps: true,
|
|
20230
|
-
displayName: true,
|
|
20231
|
-
getDefaultProps: true,
|
|
20232
|
-
getDerivedStateFromError: true,
|
|
20233
|
-
getDerivedStateFromProps: true,
|
|
20234
|
-
mixins: true,
|
|
20235
|
-
propTypes: true,
|
|
20236
|
-
type: true
|
|
20237
|
-
};
|
|
20238
|
-
var KNOWN_STATICS = {
|
|
20239
|
-
name: true,
|
|
20240
|
-
length: true,
|
|
20241
|
-
prototype: true,
|
|
20242
|
-
caller: true,
|
|
20243
|
-
callee: true,
|
|
20244
|
-
arguments: true,
|
|
20245
|
-
arity: true
|
|
20246
|
-
};
|
|
20104
|
+
var reactIs = reactIs$1.exports;
|
|
20247
20105
|
var FORWARD_REF_STATICS = {
|
|
20248
20106
|
'$$typeof': true,
|
|
20249
20107
|
render: true,
|
|
@@ -20260,65 +20118,8 @@ var MEMO_STATICS = {
|
|
|
20260
20118
|
type: true
|
|
20261
20119
|
};
|
|
20262
20120
|
var TYPE_STATICS = {};
|
|
20263
|
-
TYPE_STATICS[reactIs
|
|
20264
|
-
TYPE_STATICS[reactIs
|
|
20265
|
-
|
|
20266
|
-
function getStatics(component) {
|
|
20267
|
-
// React v16.11 and below
|
|
20268
|
-
if (reactIs$1.isMemo(component)) {
|
|
20269
|
-
return MEMO_STATICS;
|
|
20270
|
-
} // React v16.12 and above
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
|
20274
|
-
}
|
|
20275
|
-
|
|
20276
|
-
var defineProperty = Object.defineProperty;
|
|
20277
|
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
20278
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
20279
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
20280
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
20281
|
-
var objectPrototype = Object.prototype;
|
|
20282
|
-
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
|
20283
|
-
if (typeof sourceComponent !== 'string') {
|
|
20284
|
-
// don't hoist over string (html) components
|
|
20285
|
-
if (objectPrototype) {
|
|
20286
|
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
20287
|
-
|
|
20288
|
-
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
20289
|
-
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
|
20290
|
-
}
|
|
20291
|
-
}
|
|
20292
|
-
|
|
20293
|
-
var keys = getOwnPropertyNames(sourceComponent);
|
|
20294
|
-
|
|
20295
|
-
if (getOwnPropertySymbols) {
|
|
20296
|
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
20297
|
-
}
|
|
20298
|
-
|
|
20299
|
-
var targetStatics = getStatics(targetComponent);
|
|
20300
|
-
var sourceStatics = getStatics(sourceComponent);
|
|
20301
|
-
|
|
20302
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
20303
|
-
var key = keys[i];
|
|
20304
|
-
|
|
20305
|
-
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
20306
|
-
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
20307
|
-
|
|
20308
|
-
try {
|
|
20309
|
-
// Avoid failures from read-only properties
|
|
20310
|
-
defineProperty(targetComponent, key, descriptor);
|
|
20311
|
-
} catch (e) {}
|
|
20312
|
-
}
|
|
20313
|
-
}
|
|
20314
|
-
}
|
|
20315
|
-
|
|
20316
|
-
return targetComponent;
|
|
20317
|
-
}
|
|
20318
|
-
|
|
20319
|
-
var hoistNonReactStatics_cjs = hoistNonReactStatics;
|
|
20320
|
-
|
|
20321
|
-
var reactIs = {exports: {}};
|
|
20121
|
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
20122
|
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
20322
20123
|
|
|
20323
20124
|
var reactIs_production_min = {};
|
|
20324
20125
|
|
|
@@ -20560,400 +20361,26 @@ reactIs_development.typeOf = typeOf;
|
|
|
20560
20361
|
})();
|
|
20561
20362
|
}
|
|
20562
20363
|
|
|
20563
|
-
if (process.env.NODE_ENV === 'production')
|
|
20564
|
-
reactIs.exports = reactIs_production_min;
|
|
20565
|
-
} else {
|
|
20566
|
-
reactIs.exports = reactIs_development;
|
|
20567
|
-
}
|
|
20568
|
-
|
|
20569
|
-
var _excluded$2 = ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef", "forwardRef", "context"],
|
|
20570
|
-
_excluded2 = ["reactReduxForwardedRef"];
|
|
20571
|
-
|
|
20572
|
-
var EMPTY_ARRAY = [];
|
|
20573
|
-
var NO_SUBSCRIPTION_ARRAY = [null, null];
|
|
20364
|
+
if (process.env.NODE_ENV === 'production') ;
|
|
20574
20365
|
|
|
20575
|
-
|
|
20576
|
-
|
|
20577
|
-
return
|
|
20578
|
-
}
|
|
20579
|
-
return
|
|
20366
|
+
function is(x, y) {
|
|
20367
|
+
if (x === y) {
|
|
20368
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
20369
|
+
} else {
|
|
20370
|
+
return x !== x && y !== y;
|
|
20580
20371
|
}
|
|
20581
|
-
};
|
|
20582
|
-
|
|
20583
|
-
function storeStateUpdatesReducer(state, action) {
|
|
20584
|
-
var updateCount = state[1];
|
|
20585
|
-
return [action.payload, updateCount + 1];
|
|
20586
|
-
}
|
|
20587
|
-
|
|
20588
|
-
function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
|
|
20589
|
-
useIsomorphicLayoutEffect(function () {
|
|
20590
|
-
return effectFunc.apply(void 0, effectArgs);
|
|
20591
|
-
}, dependencies);
|
|
20592
20372
|
}
|
|
20593
20373
|
|
|
20594
|
-
function
|
|
20595
|
-
|
|
20596
|
-
lastWrapperProps.current = wrapperProps;
|
|
20597
|
-
lastChildProps.current = actualChildProps;
|
|
20598
|
-
renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
|
|
20374
|
+
function shallowEqual(objA, objB) {
|
|
20375
|
+
if (is(objA, objB)) return true;
|
|
20599
20376
|
|
|
20600
|
-
if (
|
|
20601
|
-
|
|
20602
|
-
notifyNestedSubs();
|
|
20377
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
20378
|
+
return false;
|
|
20603
20379
|
}
|
|
20604
|
-
}
|
|
20605
|
-
|
|
20606
|
-
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {
|
|
20607
|
-
// If we're not subscribed to the store, nothing to do here
|
|
20608
|
-
if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts
|
|
20609
20380
|
|
|
20610
|
-
var
|
|
20611
|
-
var
|
|
20612
|
-
|
|
20613
|
-
var checkForUpdates = function checkForUpdates() {
|
|
20614
|
-
if (didUnsubscribe) {
|
|
20615
|
-
// Don't run stale listeners.
|
|
20616
|
-
// Redux doesn't guarantee unsubscriptions happen until next dispatch.
|
|
20617
|
-
return;
|
|
20618
|
-
}
|
|
20619
|
-
|
|
20620
|
-
var latestStoreState = store.getState();
|
|
20621
|
-
var newChildProps, error;
|
|
20622
|
-
|
|
20623
|
-
try {
|
|
20624
|
-
// Actually run the selector with the most recent store state and wrapper props
|
|
20625
|
-
// to determine what the child props should be
|
|
20626
|
-
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
|
|
20627
|
-
} catch (e) {
|
|
20628
|
-
error = e;
|
|
20629
|
-
lastThrownError = e;
|
|
20630
|
-
}
|
|
20631
|
-
|
|
20632
|
-
if (!error) {
|
|
20633
|
-
lastThrownError = null;
|
|
20634
|
-
} // If the child props haven't changed, nothing to do here - cascade the subscription update
|
|
20635
|
-
|
|
20636
|
-
|
|
20637
|
-
if (newChildProps === lastChildProps.current) {
|
|
20638
|
-
if (!renderIsScheduled.current) {
|
|
20639
|
-
notifyNestedSubs();
|
|
20640
|
-
}
|
|
20641
|
-
} else {
|
|
20642
|
-
// Save references to the new child props. Note that we track the "child props from store update"
|
|
20643
|
-
// as a ref instead of a useState/useReducer because we need a way to determine if that value has
|
|
20644
|
-
// been processed. If this went into useState/useReducer, we couldn't clear out the value without
|
|
20645
|
-
// forcing another re-render, which we don't want.
|
|
20646
|
-
lastChildProps.current = newChildProps;
|
|
20647
|
-
childPropsFromStoreUpdate.current = newChildProps;
|
|
20648
|
-
renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render
|
|
20649
|
-
|
|
20650
|
-
forceComponentUpdateDispatch({
|
|
20651
|
-
type: 'STORE_UPDATED',
|
|
20652
|
-
payload: {
|
|
20653
|
-
error: error
|
|
20654
|
-
}
|
|
20655
|
-
});
|
|
20656
|
-
}
|
|
20657
|
-
}; // Actually subscribe to the nearest connected ancestor (or store)
|
|
20658
|
-
|
|
20659
|
-
|
|
20660
|
-
subscription.onStateChange = checkForUpdates;
|
|
20661
|
-
subscription.trySubscribe(); // Pull data from the store after first render in case the store has
|
|
20662
|
-
// changed since we began.
|
|
20663
|
-
|
|
20664
|
-
checkForUpdates();
|
|
20665
|
-
|
|
20666
|
-
var unsubscribeWrapper = function unsubscribeWrapper() {
|
|
20667
|
-
didUnsubscribe = true;
|
|
20668
|
-
subscription.tryUnsubscribe();
|
|
20669
|
-
subscription.onStateChange = null;
|
|
20670
|
-
|
|
20671
|
-
if (lastThrownError) {
|
|
20672
|
-
// It's possible that we caught an error due to a bad mapState function, but the
|
|
20673
|
-
// parent re-rendered without this component and we're about to unmount.
|
|
20674
|
-
// This shouldn't happen as long as we do top-down subscriptions correctly, but
|
|
20675
|
-
// if we ever do those wrong, this throw will surface the error in our tests.
|
|
20676
|
-
// In that case, throw the error from here so it doesn't get lost.
|
|
20677
|
-
throw lastThrownError;
|
|
20678
|
-
}
|
|
20679
|
-
};
|
|
20680
|
-
|
|
20681
|
-
return unsubscribeWrapper;
|
|
20682
|
-
}
|
|
20683
|
-
|
|
20684
|
-
var initStateUpdates = function initStateUpdates() {
|
|
20685
|
-
return [null, 0];
|
|
20686
|
-
};
|
|
20687
|
-
|
|
20688
|
-
function connectAdvanced(
|
|
20689
|
-
/*
|
|
20690
|
-
selectorFactory is a func that is responsible for returning the selector function used to
|
|
20691
|
-
compute new props from state, props, and dispatch. For example:
|
|
20692
|
-
export default connectAdvanced((dispatch, options) => (state, props) => ({
|
|
20693
|
-
thing: state.things[props.thingId],
|
|
20694
|
-
saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
|
|
20695
|
-
}))(YourComponent)
|
|
20696
|
-
Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
|
|
20697
|
-
outside of their selector as an optimization. Options passed to connectAdvanced are passed to
|
|
20698
|
-
the selectorFactory, along with displayName and WrappedComponent, as the second argument.
|
|
20699
|
-
Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
|
|
20700
|
-
props. Do not use connectAdvanced directly without memoizing results between calls to your
|
|
20701
|
-
selector, otherwise the Connect component will re-render on every state or props change.
|
|
20702
|
-
*/
|
|
20703
|
-
selectorFactory, // options object:
|
|
20704
|
-
_ref) {
|
|
20705
|
-
if (_ref === void 0) {
|
|
20706
|
-
_ref = {};
|
|
20707
|
-
}
|
|
20708
|
-
|
|
20709
|
-
var _ref2 = _ref,
|
|
20710
|
-
_ref2$getDisplayName = _ref2.getDisplayName,
|
|
20711
|
-
getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
|
|
20712
|
-
return "ConnectAdvanced(" + name + ")";
|
|
20713
|
-
} : _ref2$getDisplayName,
|
|
20714
|
-
_ref2$methodName = _ref2.methodName,
|
|
20715
|
-
methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
|
|
20716
|
-
_ref2$renderCountProp = _ref2.renderCountProp,
|
|
20717
|
-
renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
|
|
20718
|
-
_ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
|
|
20719
|
-
shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
|
|
20720
|
-
_ref2$storeKey = _ref2.storeKey,
|
|
20721
|
-
storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
|
|
20722
|
-
_ref2$withRef = _ref2.withRef,
|
|
20723
|
-
withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
|
|
20724
|
-
_ref2$forwardRef = _ref2.forwardRef,
|
|
20725
|
-
forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,
|
|
20726
|
-
_ref2$context = _ref2.context,
|
|
20727
|
-
context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,
|
|
20728
|
-
connectOptions = _objectWithoutPropertiesLoose$1(_ref2, _excluded$2);
|
|
20729
|
-
|
|
20730
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
20731
|
-
if (renderCountProp !== undefined) {
|
|
20732
|
-
throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");
|
|
20733
|
-
}
|
|
20734
|
-
|
|
20735
|
-
if (withRef) {
|
|
20736
|
-
throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');
|
|
20737
|
-
}
|
|
20738
|
-
|
|
20739
|
-
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';
|
|
20740
|
-
|
|
20741
|
-
if (storeKey !== 'store') {
|
|
20742
|
-
throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);
|
|
20743
|
-
}
|
|
20744
|
-
}
|
|
20745
|
-
|
|
20746
|
-
var Context = context;
|
|
20747
|
-
return function wrapWithConnect(WrappedComponent) {
|
|
20748
|
-
if (process.env.NODE_ENV !== 'production' && !reactIs.exports.isValidElementType(WrappedComponent)) {
|
|
20749
|
-
throw new Error("You must pass a component to the function returned by " + (methodName + ". Instead received " + stringifyComponent(WrappedComponent)));
|
|
20750
|
-
}
|
|
20751
|
-
|
|
20752
|
-
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
20753
|
-
var displayName = getDisplayName(wrappedComponentName);
|
|
20754
|
-
|
|
20755
|
-
var selectorFactoryOptions = _extends({}, connectOptions, {
|
|
20756
|
-
getDisplayName: getDisplayName,
|
|
20757
|
-
methodName: methodName,
|
|
20758
|
-
renderCountProp: renderCountProp,
|
|
20759
|
-
shouldHandleStateChanges: shouldHandleStateChanges,
|
|
20760
|
-
storeKey: storeKey,
|
|
20761
|
-
displayName: displayName,
|
|
20762
|
-
wrappedComponentName: wrappedComponentName,
|
|
20763
|
-
WrappedComponent: WrappedComponent
|
|
20764
|
-
});
|
|
20765
|
-
|
|
20766
|
-
var pure = connectOptions.pure;
|
|
20767
|
-
|
|
20768
|
-
function createChildSelector(store) {
|
|
20769
|
-
return selectorFactory(store.dispatch, selectorFactoryOptions);
|
|
20770
|
-
} // If we aren't running in "pure" mode, we don't want to memoize values.
|
|
20771
|
-
// To avoid conditionally calling hooks, we fall back to a tiny wrapper
|
|
20772
|
-
// that just executes the given callback immediately.
|
|
20773
|
-
|
|
20774
|
-
|
|
20775
|
-
var usePureOnlyMemo = pure ? useMemo : function (callback) {
|
|
20776
|
-
return callback();
|
|
20777
|
-
};
|
|
20778
|
-
|
|
20779
|
-
function ConnectFunction(props) {
|
|
20780
|
-
var _useMemo = useMemo(function () {
|
|
20781
|
-
// Distinguish between actual "data" props that were passed to the wrapper component,
|
|
20782
|
-
// and values needed to control behavior (forwarded refs, alternate context instances).
|
|
20783
|
-
// To maintain the wrapperProps object reference, memoize this destructuring.
|
|
20784
|
-
var reactReduxForwardedRef = props.reactReduxForwardedRef,
|
|
20785
|
-
wrapperProps = _objectWithoutPropertiesLoose$1(props, _excluded2);
|
|
20786
|
-
|
|
20787
|
-
return [props.context, reactReduxForwardedRef, wrapperProps];
|
|
20788
|
-
}, [props]),
|
|
20789
|
-
propsContext = _useMemo[0],
|
|
20790
|
-
reactReduxForwardedRef = _useMemo[1],
|
|
20791
|
-
wrapperProps = _useMemo[2];
|
|
20792
|
-
|
|
20793
|
-
var ContextToUse = useMemo(function () {
|
|
20794
|
-
// Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
|
|
20795
|
-
// Memoize the check that determines which context instance we should use.
|
|
20796
|
-
return propsContext && propsContext.Consumer && reactIs.exports.isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;
|
|
20797
|
-
}, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
|
|
20798
|
-
|
|
20799
|
-
var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
|
|
20800
|
-
// We'll check to see if it _looks_ like a Redux store first.
|
|
20801
|
-
// This allows us to pass through a `store` prop that is just a plain value.
|
|
20802
|
-
|
|
20803
|
-
var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
|
|
20804
|
-
var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
|
|
20805
|
-
|
|
20806
|
-
if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {
|
|
20807
|
-
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."));
|
|
20808
|
-
} // Based on the previous check, one of these must be true
|
|
20809
|
-
|
|
20810
|
-
|
|
20811
|
-
var store = didStoreComeFromProps ? props.store : contextValue.store;
|
|
20812
|
-
var childPropsSelector = useMemo(function () {
|
|
20813
|
-
// The child props selector needs the store reference as an input.
|
|
20814
|
-
// Re-create this selector whenever the store changes.
|
|
20815
|
-
return createChildSelector(store);
|
|
20816
|
-
}, [store]);
|
|
20817
|
-
|
|
20818
|
-
var _useMemo2 = useMemo(function () {
|
|
20819
|
-
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
|
|
20820
|
-
// connected to the store via props shouldn't use subscription from context, or vice versa.
|
|
20821
|
-
|
|
20822
|
-
// This Subscription's source should match where store came from: props vs. context. A component
|
|
20823
|
-
// connected to the store via props shouldn't use subscription from context, or vice versa.
|
|
20824
|
-
var subscription = createSubscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
|
|
20825
|
-
// the middle of the notification loop, where `subscription` will then be null. This can
|
|
20826
|
-
// probably be avoided if Subscription's listeners logic is changed to not call listeners
|
|
20827
|
-
// that have been unsubscribed in the middle of the notification loop.
|
|
20828
|
-
|
|
20829
|
-
// `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
|
|
20830
|
-
// the middle of the notification loop, where `subscription` will then be null. This can
|
|
20831
|
-
// probably be avoided if Subscription's listeners logic is changed to not call listeners
|
|
20832
|
-
// that have been unsubscribed in the middle of the notification loop.
|
|
20833
|
-
var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
|
|
20834
|
-
return [subscription, notifyNestedSubs];
|
|
20835
|
-
}, [store, didStoreComeFromProps, contextValue]),
|
|
20836
|
-
subscription = _useMemo2[0],
|
|
20837
|
-
notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,
|
|
20838
|
-
// and memoize that value to avoid unnecessary context updates.
|
|
20839
|
-
|
|
20840
|
-
|
|
20841
|
-
var overriddenContextValue = useMemo(function () {
|
|
20842
|
-
if (didStoreComeFromProps) {
|
|
20843
|
-
// This component is directly subscribed to a store from props.
|
|
20844
|
-
// We don't want descendants reading from this store - pass down whatever
|
|
20845
|
-
// the existing context value is from the nearest connected ancestor.
|
|
20846
|
-
return contextValue;
|
|
20847
|
-
} // Otherwise, put this component's subscription instance into context, so that
|
|
20848
|
-
// connected descendants won't update until after this component is done
|
|
20849
|
-
|
|
20850
|
-
|
|
20851
|
-
return _extends({}, contextValue, {
|
|
20852
|
-
subscription: subscription
|
|
20853
|
-
});
|
|
20854
|
-
}, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update
|
|
20855
|
-
// causes a change to the calculated child component props (or we caught an error in mapState)
|
|
20856
|
-
|
|
20857
|
-
var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),
|
|
20858
|
-
_useReducer$ = _useReducer[0],
|
|
20859
|
-
previousStateUpdateResult = _useReducer$[0],
|
|
20860
|
-
forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards
|
|
20861
|
-
|
|
20862
|
-
|
|
20863
|
-
if (previousStateUpdateResult && previousStateUpdateResult.error) {
|
|
20864
|
-
throw previousStateUpdateResult.error;
|
|
20865
|
-
} // Set up refs to coordinate values between the subscription effect and the render logic
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
var lastChildProps = useRef();
|
|
20869
|
-
var lastWrapperProps = useRef(wrapperProps);
|
|
20870
|
-
var childPropsFromStoreUpdate = useRef();
|
|
20871
|
-
var renderIsScheduled = useRef(false);
|
|
20872
|
-
var actualChildProps = usePureOnlyMemo(function () {
|
|
20873
|
-
// Tricky logic here:
|
|
20874
|
-
// - This render may have been triggered by a Redux store update that produced new child props
|
|
20875
|
-
// - However, we may have gotten new wrapper props after that
|
|
20876
|
-
// If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
|
|
20877
|
-
// But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
|
|
20878
|
-
// So, we'll use the child props from store update only if the wrapper props are the same as last time.
|
|
20879
|
-
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
|
|
20880
|
-
return childPropsFromStoreUpdate.current;
|
|
20881
|
-
} // TODO We're reading the store directly in render() here. Bad idea?
|
|
20882
|
-
// This will likely cause Bad Things (TM) to happen in Concurrent Mode.
|
|
20883
|
-
// Note that we do this because on renders _not_ caused by store updates, we need the latest store state
|
|
20884
|
-
// to determine what the child props should be.
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
return childPropsSelector(store.getState(), wrapperProps);
|
|
20888
|
-
}, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
|
|
20889
|
-
// about useLayoutEffect in SSR, so we try to detect environment and fall back to
|
|
20890
|
-
// just useEffect instead to avoid the warning, since neither will run anyway.
|
|
20891
|
-
|
|
20892
|
-
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes
|
|
20893
|
-
|
|
20894
|
-
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.
|
|
20895
|
-
// We memoize the elements for the rendered child component as an optimization.
|
|
20896
|
-
|
|
20897
|
-
var renderedWrappedComponent = useMemo(function () {
|
|
20898
|
-
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, actualChildProps, {
|
|
20899
|
-
ref: reactReduxForwardedRef
|
|
20900
|
-
}));
|
|
20901
|
-
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
|
|
20902
|
-
// that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
|
|
20903
|
-
|
|
20904
|
-
var renderedChild = useMemo(function () {
|
|
20905
|
-
if (shouldHandleStateChanges) {
|
|
20906
|
-
// If this component is subscribed to store updates, we need to pass its own
|
|
20907
|
-
// subscription instance down to our descendants. That means rendering the same
|
|
20908
|
-
// Context instance, and putting a different value into the context.
|
|
20909
|
-
return /*#__PURE__*/React.createElement(ContextToUse.Provider, {
|
|
20910
|
-
value: overriddenContextValue
|
|
20911
|
-
}, renderedWrappedComponent);
|
|
20912
|
-
}
|
|
20913
|
-
|
|
20914
|
-
return renderedWrappedComponent;
|
|
20915
|
-
}, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
|
|
20916
|
-
return renderedChild;
|
|
20917
|
-
} // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed.
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;
|
|
20921
|
-
Connect.WrappedComponent = WrappedComponent;
|
|
20922
|
-
Connect.displayName = ConnectFunction.displayName = displayName;
|
|
20923
|
-
|
|
20924
|
-
if (forwardRef) {
|
|
20925
|
-
var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {
|
|
20926
|
-
return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {
|
|
20927
|
-
reactReduxForwardedRef: ref
|
|
20928
|
-
}));
|
|
20929
|
-
});
|
|
20930
|
-
forwarded.displayName = displayName;
|
|
20931
|
-
forwarded.WrappedComponent = WrappedComponent;
|
|
20932
|
-
return hoistNonReactStatics_cjs(forwarded, WrappedComponent);
|
|
20933
|
-
}
|
|
20934
|
-
|
|
20935
|
-
return hoistNonReactStatics_cjs(Connect, WrappedComponent);
|
|
20936
|
-
};
|
|
20937
|
-
}
|
|
20938
|
-
|
|
20939
|
-
function is(x, y) {
|
|
20940
|
-
if (x === y) {
|
|
20941
|
-
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
20942
|
-
} else {
|
|
20943
|
-
return x !== x && y !== y;
|
|
20944
|
-
}
|
|
20945
|
-
}
|
|
20946
|
-
|
|
20947
|
-
function shallowEqual(objA, objB) {
|
|
20948
|
-
if (is(objA, objB)) return true;
|
|
20949
|
-
|
|
20950
|
-
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
20951
|
-
return false;
|
|
20952
|
-
}
|
|
20953
|
-
|
|
20954
|
-
var keysA = Object.keys(objA);
|
|
20955
|
-
var keysB = Object.keys(objB);
|
|
20956
|
-
if (keysA.length !== keysB.length) return false;
|
|
20381
|
+
var keysA = Object.keys(objA);
|
|
20382
|
+
var keysB = Object.keys(objB);
|
|
20383
|
+
if (keysA.length !== keysB.length) return false;
|
|
20957
20384
|
|
|
20958
20385
|
for (var i = 0; i < keysA.length; i++) {
|
|
20959
20386
|
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
@@ -20964,395 +20391,6 @@ function shallowEqual(objA, objB) {
|
|
|
20964
20391
|
return true;
|
|
20965
20392
|
}
|
|
20966
20393
|
|
|
20967
|
-
function bindActionCreators(actionCreators, dispatch) {
|
|
20968
|
-
var boundActionCreators = {};
|
|
20969
|
-
|
|
20970
|
-
var _loop = function _loop(key) {
|
|
20971
|
-
var actionCreator = actionCreators[key];
|
|
20972
|
-
|
|
20973
|
-
if (typeof actionCreator === 'function') {
|
|
20974
|
-
boundActionCreators[key] = function () {
|
|
20975
|
-
return dispatch(actionCreator.apply(void 0, arguments));
|
|
20976
|
-
};
|
|
20977
|
-
}
|
|
20978
|
-
};
|
|
20979
|
-
|
|
20980
|
-
for (var key in actionCreators) {
|
|
20981
|
-
_loop(key);
|
|
20982
|
-
}
|
|
20983
|
-
|
|
20984
|
-
return boundActionCreators;
|
|
20985
|
-
}
|
|
20986
|
-
|
|
20987
|
-
/**
|
|
20988
|
-
* @param {any} obj The object to inspect.
|
|
20989
|
-
* @returns {boolean} True if the argument appears to be a plain object.
|
|
20990
|
-
*/
|
|
20991
|
-
function isPlainObject$1(obj) {
|
|
20992
|
-
if (typeof obj !== 'object' || obj === null) return false;
|
|
20993
|
-
var proto = Object.getPrototypeOf(obj);
|
|
20994
|
-
if (proto === null) return true;
|
|
20995
|
-
var baseProto = proto;
|
|
20996
|
-
|
|
20997
|
-
while (Object.getPrototypeOf(baseProto) !== null) {
|
|
20998
|
-
baseProto = Object.getPrototypeOf(baseProto);
|
|
20999
|
-
}
|
|
21000
|
-
|
|
21001
|
-
return proto === baseProto;
|
|
21002
|
-
}
|
|
21003
|
-
|
|
21004
|
-
/**
|
|
21005
|
-
* Prints a warning in the console if it exists.
|
|
21006
|
-
*
|
|
21007
|
-
* @param {String} message The warning message.
|
|
21008
|
-
* @returns {void}
|
|
21009
|
-
*/
|
|
21010
|
-
function warning$1(message) {
|
|
21011
|
-
/* eslint-disable no-console */
|
|
21012
|
-
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
21013
|
-
console.error(message);
|
|
21014
|
-
}
|
|
21015
|
-
/* eslint-enable no-console */
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
try {
|
|
21019
|
-
// This error was thrown as a convenience so that if you enable
|
|
21020
|
-
// "break on all exceptions" in your console,
|
|
21021
|
-
// it would pause the execution at this line.
|
|
21022
|
-
throw new Error(message);
|
|
21023
|
-
/* eslint-disable no-empty */
|
|
21024
|
-
} catch (e) {}
|
|
21025
|
-
/* eslint-enable no-empty */
|
|
21026
|
-
|
|
21027
|
-
}
|
|
21028
|
-
|
|
21029
|
-
function verifyPlainObject(value, displayName, methodName) {
|
|
21030
|
-
if (!isPlainObject$1(value)) {
|
|
21031
|
-
warning$1(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
|
|
21032
|
-
}
|
|
21033
|
-
}
|
|
21034
|
-
|
|
21035
|
-
function wrapMapToPropsConstant(getConstant) {
|
|
21036
|
-
return function initConstantSelector(dispatch, options) {
|
|
21037
|
-
var constant = getConstant(dispatch, options);
|
|
21038
|
-
|
|
21039
|
-
function constantSelector() {
|
|
21040
|
-
return constant;
|
|
21041
|
-
}
|
|
21042
|
-
|
|
21043
|
-
constantSelector.dependsOnOwnProps = false;
|
|
21044
|
-
return constantSelector;
|
|
21045
|
-
};
|
|
21046
|
-
} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
|
|
21047
|
-
// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
|
|
21048
|
-
// whether mapToProps needs to be invoked when props have changed.
|
|
21049
|
-
//
|
|
21050
|
-
// A length of one signals that mapToProps does not depend on props from the parent component.
|
|
21051
|
-
// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
|
|
21052
|
-
// therefore not reporting its length accurately..
|
|
21053
|
-
|
|
21054
|
-
function getDependsOnOwnProps(mapToProps) {
|
|
21055
|
-
return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
|
|
21056
|
-
} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
|
|
21057
|
-
// this function wraps mapToProps in a proxy function which does several things:
|
|
21058
|
-
//
|
|
21059
|
-
// * Detects whether the mapToProps function being called depends on props, which
|
|
21060
|
-
// is used by selectorFactory to decide if it should reinvoke on props changes.
|
|
21061
|
-
//
|
|
21062
|
-
// * On first call, handles mapToProps if returns another function, and treats that
|
|
21063
|
-
// new function as the true mapToProps for subsequent calls.
|
|
21064
|
-
//
|
|
21065
|
-
// * On first call, verifies the first result is a plain object, in order to warn
|
|
21066
|
-
// the developer that their mapToProps function is not returning a valid result.
|
|
21067
|
-
//
|
|
21068
|
-
|
|
21069
|
-
function wrapMapToPropsFunc(mapToProps, methodName) {
|
|
21070
|
-
return function initProxySelector(dispatch, _ref) {
|
|
21071
|
-
var displayName = _ref.displayName;
|
|
21072
|
-
|
|
21073
|
-
var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
|
|
21074
|
-
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
|
|
21075
|
-
}; // allow detectFactoryAndVerify to get ownProps
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
proxy.dependsOnOwnProps = true;
|
|
21079
|
-
|
|
21080
|
-
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
|
|
21081
|
-
proxy.mapToProps = mapToProps;
|
|
21082
|
-
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
|
|
21083
|
-
var props = proxy(stateOrDispatch, ownProps);
|
|
21084
|
-
|
|
21085
|
-
if (typeof props === 'function') {
|
|
21086
|
-
proxy.mapToProps = props;
|
|
21087
|
-
proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
|
|
21088
|
-
props = proxy(stateOrDispatch, ownProps);
|
|
21089
|
-
}
|
|
21090
|
-
|
|
21091
|
-
if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);
|
|
21092
|
-
return props;
|
|
21093
|
-
};
|
|
21094
|
-
|
|
21095
|
-
return proxy;
|
|
21096
|
-
};
|
|
21097
|
-
}
|
|
21098
|
-
|
|
21099
|
-
function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
|
|
21100
|
-
return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;
|
|
21101
|
-
}
|
|
21102
|
-
function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
|
|
21103
|
-
return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {
|
|
21104
|
-
return {
|
|
21105
|
-
dispatch: dispatch
|
|
21106
|
-
};
|
|
21107
|
-
}) : undefined;
|
|
21108
|
-
}
|
|
21109
|
-
function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
|
|
21110
|
-
return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {
|
|
21111
|
-
return bindActionCreators(mapDispatchToProps, dispatch);
|
|
21112
|
-
}) : undefined;
|
|
21113
|
-
}
|
|
21114
|
-
var defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
|
|
21115
|
-
|
|
21116
|
-
function whenMapStateToPropsIsFunction(mapStateToProps) {
|
|
21117
|
-
return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;
|
|
21118
|
-
}
|
|
21119
|
-
function whenMapStateToPropsIsMissing(mapStateToProps) {
|
|
21120
|
-
return !mapStateToProps ? wrapMapToPropsConstant(function () {
|
|
21121
|
-
return {};
|
|
21122
|
-
}) : undefined;
|
|
21123
|
-
}
|
|
21124
|
-
var defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
|
|
21125
|
-
|
|
21126
|
-
function defaultMergeProps(stateProps, dispatchProps, ownProps) {
|
|
21127
|
-
return _extends({}, ownProps, stateProps, dispatchProps);
|
|
21128
|
-
}
|
|
21129
|
-
function wrapMergePropsFunc(mergeProps) {
|
|
21130
|
-
return function initMergePropsProxy(dispatch, _ref) {
|
|
21131
|
-
var displayName = _ref.displayName,
|
|
21132
|
-
pure = _ref.pure,
|
|
21133
|
-
areMergedPropsEqual = _ref.areMergedPropsEqual;
|
|
21134
|
-
var hasRunOnce = false;
|
|
21135
|
-
var mergedProps;
|
|
21136
|
-
return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
|
|
21137
|
-
var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21138
|
-
|
|
21139
|
-
if (hasRunOnce) {
|
|
21140
|
-
if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
|
|
21141
|
-
} else {
|
|
21142
|
-
hasRunOnce = true;
|
|
21143
|
-
mergedProps = nextMergedProps;
|
|
21144
|
-
if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');
|
|
21145
|
-
}
|
|
21146
|
-
|
|
21147
|
-
return mergedProps;
|
|
21148
|
-
};
|
|
21149
|
-
};
|
|
21150
|
-
}
|
|
21151
|
-
function whenMergePropsIsFunction(mergeProps) {
|
|
21152
|
-
return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
|
|
21153
|
-
}
|
|
21154
|
-
function whenMergePropsIsOmitted(mergeProps) {
|
|
21155
|
-
return !mergeProps ? function () {
|
|
21156
|
-
return defaultMergeProps;
|
|
21157
|
-
} : undefined;
|
|
21158
|
-
}
|
|
21159
|
-
var defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
|
|
21160
|
-
|
|
21161
|
-
function verify(selector, methodName, displayName) {
|
|
21162
|
-
if (!selector) {
|
|
21163
|
-
throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
|
|
21164
|
-
} else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
|
|
21165
|
-
if (!Object.prototype.hasOwnProperty.call(selector, 'dependsOnOwnProps')) {
|
|
21166
|
-
warning$1("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
|
|
21167
|
-
}
|
|
21168
|
-
}
|
|
21169
|
-
}
|
|
21170
|
-
|
|
21171
|
-
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
|
|
21172
|
-
verify(mapStateToProps, 'mapStateToProps', displayName);
|
|
21173
|
-
verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
|
|
21174
|
-
verify(mergeProps, 'mergeProps', displayName);
|
|
21175
|
-
}
|
|
21176
|
-
|
|
21177
|
-
var _excluded$1 = ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"];
|
|
21178
|
-
function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
|
|
21179
|
-
return function impureFinalPropsSelector(state, ownProps) {
|
|
21180
|
-
return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
|
|
21181
|
-
};
|
|
21182
|
-
}
|
|
21183
|
-
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
|
|
21184
|
-
var areStatesEqual = _ref.areStatesEqual,
|
|
21185
|
-
areOwnPropsEqual = _ref.areOwnPropsEqual,
|
|
21186
|
-
areStatePropsEqual = _ref.areStatePropsEqual;
|
|
21187
|
-
var hasRunAtLeastOnce = false;
|
|
21188
|
-
var state;
|
|
21189
|
-
var ownProps;
|
|
21190
|
-
var stateProps;
|
|
21191
|
-
var dispatchProps;
|
|
21192
|
-
var mergedProps;
|
|
21193
|
-
|
|
21194
|
-
function handleFirstCall(firstState, firstOwnProps) {
|
|
21195
|
-
state = firstState;
|
|
21196
|
-
ownProps = firstOwnProps;
|
|
21197
|
-
stateProps = mapStateToProps(state, ownProps);
|
|
21198
|
-
dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21199
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21200
|
-
hasRunAtLeastOnce = true;
|
|
21201
|
-
return mergedProps;
|
|
21202
|
-
}
|
|
21203
|
-
|
|
21204
|
-
function handleNewPropsAndNewState() {
|
|
21205
|
-
stateProps = mapStateToProps(state, ownProps);
|
|
21206
|
-
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21207
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21208
|
-
return mergedProps;
|
|
21209
|
-
}
|
|
21210
|
-
|
|
21211
|
-
function handleNewProps() {
|
|
21212
|
-
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
|
|
21213
|
-
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
|
21214
|
-
mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21215
|
-
return mergedProps;
|
|
21216
|
-
}
|
|
21217
|
-
|
|
21218
|
-
function handleNewState() {
|
|
21219
|
-
var nextStateProps = mapStateToProps(state, ownProps);
|
|
21220
|
-
var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
|
|
21221
|
-
stateProps = nextStateProps;
|
|
21222
|
-
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
|
21223
|
-
return mergedProps;
|
|
21224
|
-
}
|
|
21225
|
-
|
|
21226
|
-
function handleSubsequentCalls(nextState, nextOwnProps) {
|
|
21227
|
-
var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
|
|
21228
|
-
var stateChanged = !areStatesEqual(nextState, state);
|
|
21229
|
-
state = nextState;
|
|
21230
|
-
ownProps = nextOwnProps;
|
|
21231
|
-
if (propsChanged && stateChanged) return handleNewPropsAndNewState();
|
|
21232
|
-
if (propsChanged) return handleNewProps();
|
|
21233
|
-
if (stateChanged) return handleNewState();
|
|
21234
|
-
return mergedProps;
|
|
21235
|
-
}
|
|
21236
|
-
|
|
21237
|
-
return function pureFinalPropsSelector(nextState, nextOwnProps) {
|
|
21238
|
-
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
|
|
21239
|
-
};
|
|
21240
|
-
} // TODO: Add more comments
|
|
21241
|
-
// If pure is true, the selector returned by selectorFactory will memoize its results,
|
|
21242
|
-
// allowing connectAdvanced's shouldComponentUpdate to return false if final
|
|
21243
|
-
// props have not changed. If false, the selector will always return a new
|
|
21244
|
-
// object and shouldComponentUpdate will always return true.
|
|
21245
|
-
|
|
21246
|
-
function finalPropsSelectorFactory(dispatch, _ref2) {
|
|
21247
|
-
var initMapStateToProps = _ref2.initMapStateToProps,
|
|
21248
|
-
initMapDispatchToProps = _ref2.initMapDispatchToProps,
|
|
21249
|
-
initMergeProps = _ref2.initMergeProps,
|
|
21250
|
-
options = _objectWithoutPropertiesLoose$1(_ref2, _excluded$1);
|
|
21251
|
-
|
|
21252
|
-
var mapStateToProps = initMapStateToProps(dispatch, options);
|
|
21253
|
-
var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
|
|
21254
|
-
var mergeProps = initMergeProps(dispatch, options);
|
|
21255
|
-
|
|
21256
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
21257
|
-
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
|
|
21258
|
-
}
|
|
21259
|
-
|
|
21260
|
-
var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
|
|
21261
|
-
return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
|
|
21262
|
-
}
|
|
21263
|
-
|
|
21264
|
-
var _excluded = ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"];
|
|
21265
|
-
/*
|
|
21266
|
-
connect is a facade over connectAdvanced. It turns its args into a compatible
|
|
21267
|
-
selectorFactory, which has the signature:
|
|
21268
|
-
|
|
21269
|
-
(dispatch, options) => (nextState, nextOwnProps) => nextFinalProps
|
|
21270
|
-
|
|
21271
|
-
connect passes its args to connectAdvanced as options, which will in turn pass them to
|
|
21272
|
-
selectorFactory each time a Connect component instance is instantiated or hot reloaded.
|
|
21273
|
-
|
|
21274
|
-
selectorFactory returns a final props selector from its mapStateToProps,
|
|
21275
|
-
mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,
|
|
21276
|
-
mergePropsFactories, and pure args.
|
|
21277
|
-
|
|
21278
|
-
The resulting final props selector is called by the Connect component instance whenever
|
|
21279
|
-
it receives new props or store state.
|
|
21280
|
-
*/
|
|
21281
|
-
|
|
21282
|
-
function match$1(arg, factories, name) {
|
|
21283
|
-
for (var i = factories.length - 1; i >= 0; i--) {
|
|
21284
|
-
var result = factories[i](arg);
|
|
21285
|
-
if (result) return result;
|
|
21286
|
-
}
|
|
21287
|
-
|
|
21288
|
-
return function (dispatch, options) {
|
|
21289
|
-
throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
|
|
21290
|
-
};
|
|
21291
|
-
}
|
|
21292
|
-
|
|
21293
|
-
function strictEqual(a, b) {
|
|
21294
|
-
return a === b;
|
|
21295
|
-
} // createConnect with default args builds the 'official' connect behavior. Calling it with
|
|
21296
|
-
// different options opens up some testing and extensibility scenarios
|
|
21297
|
-
|
|
21298
|
-
|
|
21299
|
-
function createConnect(_temp) {
|
|
21300
|
-
var _ref = _temp === void 0 ? {} : _temp,
|
|
21301
|
-
_ref$connectHOC = _ref.connectHOC,
|
|
21302
|
-
connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,
|
|
21303
|
-
_ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
|
|
21304
|
-
mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,
|
|
21305
|
-
_ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
|
|
21306
|
-
mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,
|
|
21307
|
-
_ref$mergePropsFactor = _ref.mergePropsFactories,
|
|
21308
|
-
mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,
|
|
21309
|
-
_ref$selectorFactory = _ref.selectorFactory,
|
|
21310
|
-
selectorFactory = _ref$selectorFactory === void 0 ? finalPropsSelectorFactory : _ref$selectorFactory;
|
|
21311
|
-
|
|
21312
|
-
return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
|
|
21313
|
-
if (_ref2 === void 0) {
|
|
21314
|
-
_ref2 = {};
|
|
21315
|
-
}
|
|
21316
|
-
|
|
21317
|
-
var _ref3 = _ref2,
|
|
21318
|
-
_ref3$pure = _ref3.pure,
|
|
21319
|
-
pure = _ref3$pure === void 0 ? true : _ref3$pure,
|
|
21320
|
-
_ref3$areStatesEqual = _ref3.areStatesEqual,
|
|
21321
|
-
areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
|
|
21322
|
-
_ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
|
|
21323
|
-
areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,
|
|
21324
|
-
_ref3$areStatePropsEq = _ref3.areStatePropsEqual,
|
|
21325
|
-
areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,
|
|
21326
|
-
_ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
|
|
21327
|
-
areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,
|
|
21328
|
-
extraOptions = _objectWithoutPropertiesLoose$1(_ref3, _excluded);
|
|
21329
|
-
|
|
21330
|
-
var initMapStateToProps = match$1(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
|
|
21331
|
-
var initMapDispatchToProps = match$1(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
|
|
21332
|
-
var initMergeProps = match$1(mergeProps, mergePropsFactories, 'mergeProps');
|
|
21333
|
-
return connectHOC(selectorFactory, _extends({
|
|
21334
|
-
// used in error messages
|
|
21335
|
-
methodName: 'connect',
|
|
21336
|
-
// used to compute Connect's displayName from the wrapped component's displayName.
|
|
21337
|
-
getDisplayName: function getDisplayName(name) {
|
|
21338
|
-
return "Connect(" + name + ")";
|
|
21339
|
-
},
|
|
21340
|
-
// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes
|
|
21341
|
-
shouldHandleStateChanges: Boolean(mapStateToProps),
|
|
21342
|
-
// passed through to selectorFactory
|
|
21343
|
-
initMapStateToProps: initMapStateToProps,
|
|
21344
|
-
initMapDispatchToProps: initMapDispatchToProps,
|
|
21345
|
-
initMergeProps: initMergeProps,
|
|
21346
|
-
pure: pure,
|
|
21347
|
-
areStatesEqual: areStatesEqual,
|
|
21348
|
-
areOwnPropsEqual: areOwnPropsEqual,
|
|
21349
|
-
areStatePropsEqual: areStatePropsEqual,
|
|
21350
|
-
areMergedPropsEqual: areMergedPropsEqual
|
|
21351
|
-
}, extraOptions));
|
|
21352
|
-
};
|
|
21353
|
-
}
|
|
21354
|
-
var connect = /*#__PURE__*/createConnect();
|
|
21355
|
-
|
|
21356
20394
|
/**
|
|
21357
20395
|
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
21358
20396
|
* hook that you should usually not need to call directly.
|
|
@@ -21420,6 +20458,201 @@ function createStoreHook(context) {
|
|
|
21420
20458
|
|
|
21421
20459
|
var useStore = /*#__PURE__*/createStoreHook();
|
|
21422
20460
|
|
|
20461
|
+
/**
|
|
20462
|
+
* Hook factory, which creates a `useDispatch` hook bound to a given context.
|
|
20463
|
+
*
|
|
20464
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
20465
|
+
* @returns {Function} A `useDispatch` hook bound to the specified context.
|
|
20466
|
+
*/
|
|
20467
|
+
|
|
20468
|
+
function createDispatchHook(context) {
|
|
20469
|
+
if (context === void 0) {
|
|
20470
|
+
context = ReactReduxContext;
|
|
20471
|
+
}
|
|
20472
|
+
|
|
20473
|
+
var useStore$1 = context === ReactReduxContext ? useStore : createStoreHook(context);
|
|
20474
|
+
return function useDispatch() {
|
|
20475
|
+
var store = useStore$1();
|
|
20476
|
+
return store.dispatch;
|
|
20477
|
+
};
|
|
20478
|
+
}
|
|
20479
|
+
/**
|
|
20480
|
+
* A hook to access the redux `dispatch` function.
|
|
20481
|
+
*
|
|
20482
|
+
* @returns {any|function} redux store's `dispatch` function
|
|
20483
|
+
*
|
|
20484
|
+
* @example
|
|
20485
|
+
*
|
|
20486
|
+
* import React, { useCallback } from 'react'
|
|
20487
|
+
* import { useDispatch } from 'react-redux'
|
|
20488
|
+
*
|
|
20489
|
+
* export const CounterComponent = ({ value }) => {
|
|
20490
|
+
* const dispatch = useDispatch()
|
|
20491
|
+
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
|
|
20492
|
+
* return (
|
|
20493
|
+
* <div>
|
|
20494
|
+
* <span>{value}</span>
|
|
20495
|
+
* <button onClick={increaseCounter}>Increase counter</button>
|
|
20496
|
+
* </div>
|
|
20497
|
+
* )
|
|
20498
|
+
* }
|
|
20499
|
+
*/
|
|
20500
|
+
|
|
20501
|
+
var useDispatch = /*#__PURE__*/createDispatchHook();
|
|
20502
|
+
|
|
20503
|
+
var refEquality = function refEquality(a, b) {
|
|
20504
|
+
return a === b;
|
|
20505
|
+
};
|
|
20506
|
+
|
|
20507
|
+
function useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {
|
|
20508
|
+
var _useReducer = useReducer(function (s) {
|
|
20509
|
+
return s + 1;
|
|
20510
|
+
}, 0),
|
|
20511
|
+
forceRender = _useReducer[1];
|
|
20512
|
+
|
|
20513
|
+
var subscription = useMemo(function () {
|
|
20514
|
+
return createSubscription(store, contextSub);
|
|
20515
|
+
}, [store, contextSub]);
|
|
20516
|
+
var latestSubscriptionCallbackError = useRef();
|
|
20517
|
+
var latestSelector = useRef();
|
|
20518
|
+
var latestStoreState = useRef();
|
|
20519
|
+
var latestSelectedState = useRef();
|
|
20520
|
+
var storeState = store.getState();
|
|
20521
|
+
var selectedState;
|
|
20522
|
+
|
|
20523
|
+
try {
|
|
20524
|
+
if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {
|
|
20525
|
+
var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references
|
|
20526
|
+
|
|
20527
|
+
if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {
|
|
20528
|
+
selectedState = newSelectedState;
|
|
20529
|
+
} else {
|
|
20530
|
+
selectedState = latestSelectedState.current;
|
|
20531
|
+
}
|
|
20532
|
+
} else {
|
|
20533
|
+
selectedState = latestSelectedState.current;
|
|
20534
|
+
}
|
|
20535
|
+
} catch (err) {
|
|
20536
|
+
if (latestSubscriptionCallbackError.current) {
|
|
20537
|
+
err.message += "\nThe error may be correlated with this previous error:\n" + latestSubscriptionCallbackError.current.stack + "\n\n";
|
|
20538
|
+
}
|
|
20539
|
+
|
|
20540
|
+
throw err;
|
|
20541
|
+
}
|
|
20542
|
+
|
|
20543
|
+
useIsomorphicLayoutEffect(function () {
|
|
20544
|
+
latestSelector.current = selector;
|
|
20545
|
+
latestStoreState.current = storeState;
|
|
20546
|
+
latestSelectedState.current = selectedState;
|
|
20547
|
+
latestSubscriptionCallbackError.current = undefined;
|
|
20548
|
+
});
|
|
20549
|
+
useIsomorphicLayoutEffect(function () {
|
|
20550
|
+
function checkForUpdates() {
|
|
20551
|
+
try {
|
|
20552
|
+
var newStoreState = store.getState(); // Avoid calling selector multiple times if the store's state has not changed
|
|
20553
|
+
|
|
20554
|
+
if (newStoreState === latestStoreState.current) {
|
|
20555
|
+
return;
|
|
20556
|
+
}
|
|
20557
|
+
|
|
20558
|
+
var _newSelectedState = latestSelector.current(newStoreState);
|
|
20559
|
+
|
|
20560
|
+
if (equalityFn(_newSelectedState, latestSelectedState.current)) {
|
|
20561
|
+
return;
|
|
20562
|
+
}
|
|
20563
|
+
|
|
20564
|
+
latestSelectedState.current = _newSelectedState;
|
|
20565
|
+
latestStoreState.current = newStoreState;
|
|
20566
|
+
} catch (err) {
|
|
20567
|
+
// we ignore all errors here, since when the component
|
|
20568
|
+
// is re-rendered, the selectors are called again, and
|
|
20569
|
+
// will throw again, if neither props nor store state
|
|
20570
|
+
// changed
|
|
20571
|
+
latestSubscriptionCallbackError.current = err;
|
|
20572
|
+
}
|
|
20573
|
+
|
|
20574
|
+
forceRender();
|
|
20575
|
+
}
|
|
20576
|
+
|
|
20577
|
+
subscription.onStateChange = checkForUpdates;
|
|
20578
|
+
subscription.trySubscribe();
|
|
20579
|
+
checkForUpdates();
|
|
20580
|
+
return function () {
|
|
20581
|
+
return subscription.tryUnsubscribe();
|
|
20582
|
+
};
|
|
20583
|
+
}, [store, subscription]);
|
|
20584
|
+
return selectedState;
|
|
20585
|
+
}
|
|
20586
|
+
/**
|
|
20587
|
+
* Hook factory, which creates a `useSelector` hook bound to a given context.
|
|
20588
|
+
*
|
|
20589
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
20590
|
+
* @returns {Function} A `useSelector` hook bound to the specified context.
|
|
20591
|
+
*/
|
|
20592
|
+
|
|
20593
|
+
|
|
20594
|
+
function createSelectorHook(context) {
|
|
20595
|
+
if (context === void 0) {
|
|
20596
|
+
context = ReactReduxContext;
|
|
20597
|
+
}
|
|
20598
|
+
|
|
20599
|
+
var useReduxContext$1 = context === ReactReduxContext ? useReduxContext : function () {
|
|
20600
|
+
return useContext(context);
|
|
20601
|
+
};
|
|
20602
|
+
return function useSelector(selector, equalityFn) {
|
|
20603
|
+
if (equalityFn === void 0) {
|
|
20604
|
+
equalityFn = refEquality;
|
|
20605
|
+
}
|
|
20606
|
+
|
|
20607
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
20608
|
+
if (!selector) {
|
|
20609
|
+
throw new Error("You must pass a selector to useSelector");
|
|
20610
|
+
}
|
|
20611
|
+
|
|
20612
|
+
if (typeof selector !== 'function') {
|
|
20613
|
+
throw new Error("You must pass a function as a selector to useSelector");
|
|
20614
|
+
}
|
|
20615
|
+
|
|
20616
|
+
if (typeof equalityFn !== 'function') {
|
|
20617
|
+
throw new Error("You must pass a function as an equality function to useSelector");
|
|
20618
|
+
}
|
|
20619
|
+
}
|
|
20620
|
+
|
|
20621
|
+
var _useReduxContext = useReduxContext$1(),
|
|
20622
|
+
store = _useReduxContext.store,
|
|
20623
|
+
contextSub = _useReduxContext.subscription;
|
|
20624
|
+
|
|
20625
|
+
var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);
|
|
20626
|
+
useDebugValue(selectedState);
|
|
20627
|
+
return selectedState;
|
|
20628
|
+
};
|
|
20629
|
+
}
|
|
20630
|
+
/**
|
|
20631
|
+
* A hook to access the redux store's state. This hook takes a selector function
|
|
20632
|
+
* as an argument. The selector is called with the store state.
|
|
20633
|
+
*
|
|
20634
|
+
* This hook takes an optional equality comparison function as the second parameter
|
|
20635
|
+
* that allows you to customize the way the selected state is compared to determine
|
|
20636
|
+
* whether the component needs to be re-rendered.
|
|
20637
|
+
*
|
|
20638
|
+
* @param {Function} selector the selector function
|
|
20639
|
+
* @param {Function=} equalityFn the function that will be used to determine equality
|
|
20640
|
+
*
|
|
20641
|
+
* @returns {any} the selected state
|
|
20642
|
+
*
|
|
20643
|
+
* @example
|
|
20644
|
+
*
|
|
20645
|
+
* import React from 'react'
|
|
20646
|
+
* import { useSelector } from 'react-redux'
|
|
20647
|
+
*
|
|
20648
|
+
* export const CounterComponent = () => {
|
|
20649
|
+
* const counter = useSelector(state => state.counter)
|
|
20650
|
+
* return <div>{counter}</div>
|
|
20651
|
+
* }
|
|
20652
|
+
*/
|
|
20653
|
+
|
|
20654
|
+
var useSelector = /*#__PURE__*/createSelectorHook();
|
|
20655
|
+
|
|
21423
20656
|
// with standard React renderers (ReactDOM, React Native)
|
|
21424
20657
|
|
|
21425
20658
|
setBatch(unstable_batchedUpdates);
|
|
@@ -22528,25 +21761,47 @@ function persistStore(store, options, cb) {
|
|
|
22528
21761
|
return persistor;
|
|
22529
21762
|
}
|
|
22530
21763
|
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
|
|
22537
|
-
|
|
22538
|
-
_this.store = createStore(persistedReducer, { root: props.defaultValues },
|
|
21764
|
+
class Providers extends React.Component {
|
|
21765
|
+
constructor(props) {
|
|
21766
|
+
super(props);
|
|
21767
|
+
const reducerConfig = Object.assign(Object.assign({}, persistConfig), { storage: default_1 });
|
|
21768
|
+
this.disabledPersist = props.disabledPersist || false;
|
|
21769
|
+
const persistedReducer = this.disabledPersist ? rootReducer : persistReducer(reducerConfig, rootReducer);
|
|
21770
|
+
this.store = createStore(persistedReducer, { root: props.defaultValues },
|
|
22539
21771
|
// eslint-disable-next-line no-underscore-dangle
|
|
22540
21772
|
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
|
|
22541
|
-
|
|
22542
|
-
|
|
21773
|
+
this.persistor = persistStore(this.store);
|
|
21774
|
+
}
|
|
21775
|
+
render() {
|
|
21776
|
+
const { children } = this.props;
|
|
21777
|
+
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));
|
|
21778
|
+
}
|
|
21779
|
+
}
|
|
21780
|
+
|
|
21781
|
+
class MessageHandler {
|
|
21782
|
+
constructor() {
|
|
21783
|
+
this.set = (newFunc) => {
|
|
21784
|
+
this.updateDefaultValueHandler = newFunc;
|
|
21785
|
+
};
|
|
21786
|
+
this.get = () => {
|
|
21787
|
+
return this.updateDefaultValueHandler;
|
|
21788
|
+
};
|
|
22543
21789
|
}
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
|
|
21790
|
+
}
|
|
21791
|
+
const MessageHandlerContext = createContext(null);
|
|
21792
|
+
|
|
21793
|
+
const MessageReceiver = () => {
|
|
21794
|
+
const dispatch = useDispatch();
|
|
21795
|
+
const messageHandler = useContext(MessageHandlerContext);
|
|
21796
|
+
const changeDefaultValue = ({ store, path, value }) => {
|
|
21797
|
+
// TODO maybe need to export from core
|
|
21798
|
+
dispatch({ type: 'DATA_UPDATE', payload: { store, value, path } });
|
|
22547
21799
|
};
|
|
22548
|
-
|
|
22549
|
-
|
|
21800
|
+
useEffect(() => {
|
|
21801
|
+
messageHandler === null || messageHandler === void 0 ? void 0 : messageHandler.set(changeDefaultValue);
|
|
21802
|
+
}, [messageHandler, dispatch]);
|
|
21803
|
+
return null;
|
|
21804
|
+
};
|
|
22550
21805
|
|
|
22551
21806
|
/*
|
|
22552
21807
|
|
|
@@ -22571,7 +21826,7 @@ styleSheet.flush()
|
|
|
22571
21826
|
|
|
22572
21827
|
*/
|
|
22573
21828
|
// $FlowFixMe
|
|
22574
|
-
function sheetForTag
|
|
21829
|
+
function sheetForTag(tag) {
|
|
22575
21830
|
if (tag.sheet) {
|
|
22576
21831
|
// $FlowFixMe
|
|
22577
21832
|
return tag.sheet;
|
|
@@ -22588,7 +21843,7 @@ function sheetForTag$1(tag) {
|
|
|
22588
21843
|
}
|
|
22589
21844
|
}
|
|
22590
21845
|
|
|
22591
|
-
function createStyleElement
|
|
21846
|
+
function createStyleElement(options) {
|
|
22592
21847
|
var tag = document.createElement('style');
|
|
22593
21848
|
tag.setAttribute('data-emotion', options.key);
|
|
22594
21849
|
|
|
@@ -22601,7 +21856,7 @@ function createStyleElement$1(options) {
|
|
|
22601
21856
|
return tag;
|
|
22602
21857
|
}
|
|
22603
21858
|
|
|
22604
|
-
var StyleSheet
|
|
21859
|
+
var StyleSheet = /*#__PURE__*/function () {
|
|
22605
21860
|
function StyleSheet(options) {
|
|
22606
21861
|
var _this = this;
|
|
22607
21862
|
|
|
@@ -22648,7 +21903,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
|
|
|
22648
21903
|
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
22649
21904
|
// and you can only have one source map per style tag
|
|
22650
21905
|
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
22651
|
-
this._insertTag(createStyleElement
|
|
21906
|
+
this._insertTag(createStyleElement(this));
|
|
22652
21907
|
}
|
|
22653
21908
|
|
|
22654
21909
|
var tag = this.tags[this.tags.length - 1];
|
|
@@ -22666,7 +21921,7 @@ var StyleSheet$1 = /*#__PURE__*/function () {
|
|
|
22666
21921
|
}
|
|
22667
21922
|
|
|
22668
21923
|
if (this.isSpeedy) {
|
|
22669
|
-
var sheet = sheetForTag
|
|
21924
|
+
var sheet = sheetForTag(tag);
|
|
22670
21925
|
|
|
22671
21926
|
try {
|
|
22672
21927
|
// this is the ultrafast version, works across browsers
|
|
@@ -23463,7 +22718,7 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
23463
22718
|
};
|
|
23464
22719
|
};
|
|
23465
22720
|
|
|
23466
|
-
function memoize
|
|
22721
|
+
function memoize(fn) {
|
|
23467
22722
|
var cache = Object.create(null);
|
|
23468
22723
|
return function (arg) {
|
|
23469
22724
|
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
@@ -23666,7 +22921,7 @@ var incorrectImportAlarm = function incorrectImportAlarm(element, index, childre
|
|
|
23666
22921
|
|
|
23667
22922
|
var isBrowser$3 = typeof document !== 'undefined';
|
|
23668
22923
|
var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
|
|
23669
|
-
return memoize
|
|
22924
|
+
return memoize(function () {
|
|
23670
22925
|
var cache = {};
|
|
23671
22926
|
return function (name) {
|
|
23672
22927
|
return cache[name];
|
|
@@ -23845,7 +23100,7 @@ var createCache = function createCache(options) {
|
|
|
23845
23100
|
|
|
23846
23101
|
var cache = {
|
|
23847
23102
|
key: key,
|
|
23848
|
-
sheet: new StyleSheet
|
|
23103
|
+
sheet: new StyleSheet({
|
|
23849
23104
|
key: key,
|
|
23850
23105
|
container: container,
|
|
23851
23106
|
nonce: options.nonce,
|
|
@@ -24013,14 +23268,6 @@ var unitlessKeys = {
|
|
|
24013
23268
|
strokeWidth: 1
|
|
24014
23269
|
};
|
|
24015
23270
|
|
|
24016
|
-
function memoize(fn) {
|
|
24017
|
-
var cache = Object.create(null);
|
|
24018
|
-
return function (arg) {
|
|
24019
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
24020
|
-
return cache[arg];
|
|
24021
|
-
};
|
|
24022
|
-
}
|
|
24023
|
-
|
|
24024
23271
|
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";
|
|
24025
23272
|
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).";
|
|
24026
23273
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
@@ -24463,158 +23710,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
24463
23710
|
Emotion.displayName = 'EmotionCssPropInternal';
|
|
24464
23711
|
}
|
|
24465
23712
|
|
|
24466
|
-
/*
|
|
24467
|
-
|
|
24468
|
-
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
24469
|
-
|
|
24470
|
-
high performance StyleSheet for css-in-js systems
|
|
24471
|
-
|
|
24472
|
-
- uses multiple style tags behind the scenes for millions of rules
|
|
24473
|
-
- uses `insertRule` for appending in production for *much* faster performance
|
|
24474
|
-
|
|
24475
|
-
// usage
|
|
24476
|
-
|
|
24477
|
-
import { StyleSheet } from '@emotion/sheet'
|
|
24478
|
-
|
|
24479
|
-
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
24480
|
-
|
|
24481
|
-
styleSheet.insert('#box { border: 1px solid red; }')
|
|
24482
|
-
- appends a css rule into the stylesheet
|
|
24483
|
-
|
|
24484
|
-
styleSheet.flush()
|
|
24485
|
-
- empties the stylesheet of all its contents
|
|
24486
|
-
|
|
24487
|
-
*/
|
|
24488
|
-
// $FlowFixMe
|
|
24489
|
-
function sheetForTag(tag) {
|
|
24490
|
-
if (tag.sheet) {
|
|
24491
|
-
// $FlowFixMe
|
|
24492
|
-
return tag.sheet;
|
|
24493
|
-
} // this weirdness brought to you by firefox
|
|
24494
|
-
|
|
24495
|
-
/* istanbul ignore next */
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
24499
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
24500
|
-
// $FlowFixMe
|
|
24501
|
-
return document.styleSheets[i];
|
|
24502
|
-
}
|
|
24503
|
-
}
|
|
24504
|
-
}
|
|
24505
|
-
|
|
24506
|
-
function createStyleElement(options) {
|
|
24507
|
-
var tag = document.createElement('style');
|
|
24508
|
-
tag.setAttribute('data-emotion', options.key);
|
|
24509
|
-
|
|
24510
|
-
if (options.nonce !== undefined) {
|
|
24511
|
-
tag.setAttribute('nonce', options.nonce);
|
|
24512
|
-
}
|
|
24513
|
-
|
|
24514
|
-
tag.appendChild(document.createTextNode(''));
|
|
24515
|
-
tag.setAttribute('data-s', '');
|
|
24516
|
-
return tag;
|
|
24517
|
-
}
|
|
24518
|
-
|
|
24519
|
-
var StyleSheet = /*#__PURE__*/function () {
|
|
24520
|
-
function StyleSheet(options) {
|
|
24521
|
-
var _this = this;
|
|
24522
|
-
|
|
24523
|
-
this._insertTag = function (tag) {
|
|
24524
|
-
var before;
|
|
24525
|
-
|
|
24526
|
-
if (_this.tags.length === 0) {
|
|
24527
|
-
if (_this.insertionPoint) {
|
|
24528
|
-
before = _this.insertionPoint.nextSibling;
|
|
24529
|
-
} else if (_this.prepend) {
|
|
24530
|
-
before = _this.container.firstChild;
|
|
24531
|
-
} else {
|
|
24532
|
-
before = _this.before;
|
|
24533
|
-
}
|
|
24534
|
-
} else {
|
|
24535
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
24536
|
-
}
|
|
24537
|
-
|
|
24538
|
-
_this.container.insertBefore(tag, before);
|
|
24539
|
-
|
|
24540
|
-
_this.tags.push(tag);
|
|
24541
|
-
};
|
|
24542
|
-
|
|
24543
|
-
this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
|
|
24544
|
-
this.tags = [];
|
|
24545
|
-
this.ctr = 0;
|
|
24546
|
-
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
24547
|
-
|
|
24548
|
-
this.key = options.key;
|
|
24549
|
-
this.container = options.container;
|
|
24550
|
-
this.prepend = options.prepend;
|
|
24551
|
-
this.insertionPoint = options.insertionPoint;
|
|
24552
|
-
this.before = null;
|
|
24553
|
-
}
|
|
24554
|
-
|
|
24555
|
-
var _proto = StyleSheet.prototype;
|
|
24556
|
-
|
|
24557
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
24558
|
-
nodes.forEach(this._insertTag);
|
|
24559
|
-
};
|
|
24560
|
-
|
|
24561
|
-
_proto.insert = function insert(rule) {
|
|
24562
|
-
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
24563
|
-
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
24564
|
-
// and you can only have one source map per style tag
|
|
24565
|
-
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
24566
|
-
this._insertTag(createStyleElement(this));
|
|
24567
|
-
}
|
|
24568
|
-
|
|
24569
|
-
var tag = this.tags[this.tags.length - 1];
|
|
24570
|
-
|
|
24571
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
24572
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
24573
|
-
|
|
24574
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
24575
|
-
// this would only cause problem in speedy mode
|
|
24576
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
24577
|
-
// so we report this error at all times
|
|
24578
|
-
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.');
|
|
24579
|
-
}
|
|
24580
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
24581
|
-
}
|
|
24582
|
-
|
|
24583
|
-
if (this.isSpeedy) {
|
|
24584
|
-
var sheet = sheetForTag(tag);
|
|
24585
|
-
|
|
24586
|
-
try {
|
|
24587
|
-
// this is the ultrafast version, works across browsers
|
|
24588
|
-
// the big drawback is that the css won't be editable in devtools
|
|
24589
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
24590
|
-
} catch (e) {
|
|
24591
|
-
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)) {
|
|
24592
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
24593
|
-
}
|
|
24594
|
-
}
|
|
24595
|
-
} else {
|
|
24596
|
-
tag.appendChild(document.createTextNode(rule));
|
|
24597
|
-
}
|
|
24598
|
-
|
|
24599
|
-
this.ctr++;
|
|
24600
|
-
};
|
|
24601
|
-
|
|
24602
|
-
_proto.flush = function flush() {
|
|
24603
|
-
// $FlowFixMe
|
|
24604
|
-
this.tags.forEach(function (tag) {
|
|
24605
|
-
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
24606
|
-
});
|
|
24607
|
-
this.tags = [];
|
|
24608
|
-
this.ctr = 0;
|
|
24609
|
-
|
|
24610
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
24611
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
24612
|
-
}
|
|
24613
|
-
};
|
|
24614
|
-
|
|
24615
|
-
return StyleSheet;
|
|
24616
|
-
}();
|
|
24617
|
-
|
|
24618
23713
|
var pkg = {
|
|
24619
23714
|
name: "@emotion/react",
|
|
24620
23715
|
version: "11.7.1",
|
|
@@ -24956,50 +24051,47 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
24956
24051
|
}
|
|
24957
24052
|
}
|
|
24958
24053
|
|
|
24959
|
-
|
|
24960
|
-
|
|
24961
|
-
|
|
24962
|
-
|
|
24963
|
-
|
|
24964
|
-
_this.state = { hasError: false, error: null };
|
|
24965
|
-
return _this;
|
|
24054
|
+
const printObj = (obj) => (typeof obj === 'string' ? obj : JSON.stringify(obj));
|
|
24055
|
+
class ErrorBoundary extends React.Component {
|
|
24056
|
+
constructor(props) {
|
|
24057
|
+
super(props);
|
|
24058
|
+
this.state = { hasError: false, error: null };
|
|
24966
24059
|
}
|
|
24967
|
-
|
|
24060
|
+
static getDerivedStateFromError(error) {
|
|
24968
24061
|
return {
|
|
24969
24062
|
hasError: true,
|
|
24970
24063
|
error: error && error.message ? error.message : error,
|
|
24971
24064
|
};
|
|
24972
|
-
}
|
|
24973
|
-
|
|
24065
|
+
}
|
|
24066
|
+
componentDidCatch(error, info) {
|
|
24974
24067
|
this.setState({ didInfo: info.componentStack });
|
|
24975
|
-
}
|
|
24976
|
-
|
|
24977
|
-
|
|
24978
|
-
|
|
24068
|
+
}
|
|
24069
|
+
render() {
|
|
24070
|
+
const { hasError, error, didInfo } = this.state;
|
|
24071
|
+
const { type, id, children } = this.props;
|
|
24979
24072
|
if (hasError) {
|
|
24980
24073
|
if (type === 'component') {
|
|
24981
|
-
return (jsxRuntime$1.exports.jsx("div",
|
|
24074
|
+
return (jsxRuntime$1.exports.jsx("div", Object.assign({ style: {
|
|
24982
24075
|
flex: 1,
|
|
24983
24076
|
flexDirection: 'column',
|
|
24984
24077
|
borderColor: 'orange',
|
|
24985
24078
|
borderWidth: 2,
|
|
24986
|
-
} }, { children: jsxRuntime$1.exports.jsxs("div", { children: [jsxRuntime$1.exports.jsx("div",
|
|
24079
|
+
} }, { 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));
|
|
24987
24080
|
}
|
|
24988
|
-
return (jsxRuntime$1.exports.jsx("div",
|
|
24081
|
+
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: {
|
|
24989
24082
|
flex: 1,
|
|
24990
24083
|
backgroundColor: 'red',
|
|
24991
24084
|
padding: 10,
|
|
24992
24085
|
alignItems: 'center',
|
|
24993
|
-
} }, { children: jsxRuntime$1.exports.jsxs("p",
|
|
24086
|
+
} }, { 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));
|
|
24994
24087
|
}
|
|
24995
24088
|
return children;
|
|
24996
|
-
}
|
|
24997
|
-
|
|
24998
|
-
}(React.Component));
|
|
24089
|
+
}
|
|
24090
|
+
}
|
|
24999
24091
|
|
|
25000
|
-
|
|
25001
|
-
|
|
25002
|
-
|
|
24092
|
+
const getWebStyle = (props) => {
|
|
24093
|
+
const { [constants.PARENT_PROP_NAME]: parentComp } = props;
|
|
24094
|
+
const style = Object.assign(Object.assign({ display: 'flex', flexDirection: 'column' }, props.style), props[constants.STYLE_WEB_NAME]);
|
|
25003
24095
|
if (style && style.borderWidth && !style.borderStyle) {
|
|
25004
24096
|
style.borderStyle = 'solid';
|
|
25005
24097
|
}
|
|
@@ -25010,84 +24102,68 @@ var genStyle = function (props) {
|
|
|
25010
24102
|
parentComp.style.flex < 1
|
|
25011
24103
|
// if smaller or larger, noesn't matter
|
|
25012
24104
|
) {
|
|
25013
|
-
style.height =
|
|
25014
|
-
style.width =
|
|
24105
|
+
style.height = `100%`;
|
|
24106
|
+
style.width = `100%`;
|
|
25015
24107
|
}
|
|
25016
24108
|
else if (!style.height) {
|
|
25017
|
-
style.height =
|
|
24109
|
+
style.height = `${style.flex * 100}%`;
|
|
25018
24110
|
}
|
|
25019
24111
|
}
|
|
25020
24112
|
return style;
|
|
25021
24113
|
};
|
|
25022
|
-
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
|
|
25027
|
-
|
|
25028
|
-
|
|
25029
|
-
|
|
24114
|
+
const getStyle = (props = {}, component) => component === 'View' ? getWebStyle(props) : Object.assign(Object.assign({}, props.style), props[constants.STYLE_WEB_NAME]);
|
|
24115
|
+
function Wrapper({ props: origProps }) {
|
|
24116
|
+
const newCurrentPaths = useContext(PathModifierContext);
|
|
24117
|
+
const stock = useContext(StockContext);
|
|
24118
|
+
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]) });
|
|
24119
|
+
const { [constants.V_COMP_NAME]: component } = props;
|
|
24120
|
+
const ownProps = wrapperUtil.getRootWrapperProps(props, stock);
|
|
24121
|
+
// TODO isError
|
|
24122
|
+
useSelector(compSelectorHook(props[constants.CURRENT_PATH_NAME], ownProps.subscriberPaths), shallowEqual);
|
|
25030
24123
|
if (!stock) {
|
|
25031
24124
|
return null;
|
|
25032
24125
|
}
|
|
25033
|
-
|
|
25034
|
-
|
|
24126
|
+
const Comp = stock.getComponent(component);
|
|
24127
|
+
const infobox = false;
|
|
25035
24128
|
if (!Comp) {
|
|
25036
24129
|
// eslint-disable-next-line no-throw-literal
|
|
25037
|
-
throw
|
|
24130
|
+
throw `The Component(${component}) is not available`;
|
|
25038
24131
|
}
|
|
25039
|
-
|
|
25040
|
-
return (jsxRuntime$1.exports.jsx(ErrorBoundary,
|
|
25041
|
-
var css = _a.css, cx = _a.cx;
|
|
24132
|
+
const newStyle = ownProps.style || ownProps[constants.STYLE_WEB_NAME] ? getStyle(ownProps, component) : undefined;
|
|
24133
|
+
return (jsxRuntime$1.exports.jsx(ErrorBoundary, Object.assign({ type: "wrapper", id: props.id }, { children: jsxRuntime$1.exports.jsx(ClassNames, { children: ({ css, cx }) => {
|
|
25042
24134
|
ownProps.className = newStyle ? cx(css(newStyle)) : undefined;
|
|
25043
|
-
|
|
25044
|
-
|
|
24135
|
+
const newProps = wrapperUtil.removeTechnicalProps(ownProps);
|
|
24136
|
+
// children was {wrapperUtil.generateChildren(ownProps, stock)}
|
|
24137
|
+
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));
|
|
25045
24138
|
} }, void 0) }), void 0));
|
|
25046
24139
|
}
|
|
25047
|
-
var ReduxWrapper = connect(genAllStateProps, null, function (stateProps, dispatchProps, ownProps) { return util$1.mergePath(ownProps, stateProps); }, {
|
|
25048
|
-
areStatePropsEqual: function (next, prev) {
|
|
25049
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
25050
|
-
for (var _i = 0, _a = Object.entries(next); _i < _a.length; _i++) {
|
|
25051
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
25052
|
-
if (value !== prev[key]) {
|
|
25053
|
-
return false;
|
|
25054
|
-
}
|
|
25055
|
-
}
|
|
25056
|
-
return true;
|
|
25057
|
-
},
|
|
25058
|
-
})(Wrapper);
|
|
25059
|
-
function WrapperOuter(props) {
|
|
25060
|
-
var currentPaths = useContext(PathModifierContext);
|
|
25061
|
-
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]));
|
|
25062
|
-
return jsxRuntime$1.exports.jsx(ReduxWrapper, __assign$1({}, newProps), void 0);
|
|
25063
|
-
}
|
|
25064
24140
|
|
|
25065
|
-
|
|
25066
|
-
|
|
25067
|
-
var stock = useMemo(function () { return getStock(stockInit, model, WrapperOuter, reduxStore); }, [stockInit, model, reduxStore]);
|
|
24141
|
+
const Renderer = ({ model, stockInit, reduxStore }) => {
|
|
24142
|
+
const stock = useMemo(() => getStock(stockInit, model, Wrapper, reduxStore), [stockInit, model, reduxStore]);
|
|
25068
24143
|
if (model === undefined) {
|
|
25069
24144
|
return null;
|
|
25070
24145
|
}
|
|
25071
|
-
return (jsxRuntime$1.exports.jsx(StockContext.Provider,
|
|
24146
|
+
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));
|
|
25072
24147
|
};
|
|
25073
|
-
|
|
25074
|
-
|
|
25075
|
-
|
|
24148
|
+
const rendererFunc = (props) => {
|
|
24149
|
+
// TODO remove this and merge to Renderer
|
|
24150
|
+
const reduxStore = useStore();
|
|
24151
|
+
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));
|
|
25076
24152
|
};
|
|
25077
24153
|
|
|
25078
|
-
function Viewer(
|
|
25079
|
-
|
|
25080
|
-
|
|
25081
|
-
|
|
25082
|
-
functions: __assign$1(__assign$1(__assign$1({}, stock.functions), appRootFunctions), functions),
|
|
24154
|
+
function Viewer({ model, components, functions }) {
|
|
24155
|
+
const stockInit = {
|
|
24156
|
+
components: Object.assign(Object.assign({}, stock.components), components),
|
|
24157
|
+
functions: Object.assign(Object.assign(Object.assign({}, stock.functions), appRootFunctions), functions),
|
|
25083
24158
|
};
|
|
25084
24159
|
return jsxRuntime$1.exports.jsx(rendererFunc, { model: model, stockInit: stockInit }, void 0);
|
|
25085
24160
|
}
|
|
25086
|
-
function ViewerWeb(
|
|
25087
|
-
|
|
24161
|
+
function ViewerWeb(_a) {
|
|
24162
|
+
var { defaultValues, disabledPersist } = _a, props = __rest$1(_a, ["defaultValues", "disabledPersist"]);
|
|
24163
|
+
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));
|
|
25088
24164
|
}
|
|
25089
24165
|
|
|
25090
|
-
|
|
24166
|
+
const JsonUI = (props) => jsxRuntime$1.exports.jsx(ViewerWeb, Object.assign({}, props), void 0);
|
|
25091
24167
|
|
|
25092
|
-
export { JsonUI };
|
|
24168
|
+
export { JsonUI, MessageHandler, MessageHandlerContext };
|
|
25093
24169
|
//# sourceMappingURL=index.js.map
|