@common-stack/client-react 0.1.14 → 0.1.18

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/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.18](https://github.com/cdmbase/fullstack-pro/compare/v0.1.17...v0.1.18) (2022-01-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * added browser plugin area support ([e4e54cb](https://github.com/cdmbase/fullstack-pro/commit/e4e54cb7e149b23829ceb01a7445cffdeac4be1e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.1.17](https://github.com/cdmbase/fullstack-pro/compare/v0.1.16...v0.1.17) (2022-01-08)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * removed div from plugin area ([c4aff19](https://github.com/cdmbase/fullstack-pro/commit/c4aff191275be2c8e108b2e2ac331f06aea86100))
23
+
24
+
25
+
26
+
27
+
28
+ ## [0.1.16](https://github.com/cdmbase/fullstack-pro/compare/v0.1.15...v0.1.16) (2022-01-05)
29
+
30
+
31
+ ### Features
32
+
33
+ * added slot fill support ([d576e16](https://github.com/cdmbase/fullstack-pro/commit/d576e16fc8630256e9b46d04960a0260bf5d8129))
34
+
35
+
36
+
37
+
38
+
39
+ ## [0.1.15](https://github.com/cdmbase/fullstack-pro/compare/v0.1.14...v0.1.15) (2022-01-01)
40
+
41
+ **Note:** Version bump only for package @common-stack/client-react
42
+
43
+
44
+
45
+
46
+
6
47
  ## [0.1.14](https://github.com/cdmbase/fullstack-pro/compare/v0.1.13...v0.1.14) (2021-12-23)
7
48
 
8
49
  **Note:** Version bump only for package @common-stack/client-react
package/lib/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export * from './utils';
6
6
  export * from './interfaces';
7
7
  export * from './plugin-area';
8
8
  export * from './route-based-plugin-area';
9
+ export * from './slot-fill';
package/lib/index.js CHANGED
@@ -290,6 +290,7 @@ __exportStar(__webpack_require__(/*! ./utils */ "./src/utils/index.ts"), exports
290
290
  __exportStar(__webpack_require__(/*! ./interfaces */ "./src/interfaces/index.ts"), exports);
291
291
  __exportStar(__webpack_require__(/*! ./plugin-area */ "./src/plugin-area/index.ts"), exports);
292
292
  __exportStar(__webpack_require__(/*! ./route-based-plugin-area */ "./src/route-based-plugin-area/index.ts"), exports);
293
+ __exportStar(__webpack_require__(/*! ./slot-fill */ "./src/slot-fill/index.ts"), exports);
293
294
 
294
295
 
295
296
  /***/ }),
@@ -385,6 +386,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
385
386
  Object.defineProperty(exports, "__esModule", { value: true });
386
387
 
387
388
 
389
+ /***/ }),
390
+
391
+ /***/ "./src/plugin-area/browser-plugin-area.tsx":
392
+ /*!*************************************************!*\
393
+ !*** ./src/plugin-area/browser-plugin-area.tsx ***!
394
+ \*************************************************/
395
+ /*! no static exports found */
396
+ /***/ (function(module, exports, __webpack_require__) {
397
+
398
+ "use strict";
399
+
400
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
401
+ if (k2 === undefined) k2 = k;
402
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
403
+ }) : (function(o, m, k, k2) {
404
+ if (k2 === undefined) k2 = k;
405
+ o[k2] = m[k];
406
+ }));
407
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
408
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
409
+ }) : function(o, v) {
410
+ o["default"] = v;
411
+ });
412
+ var __importStar = (this && this.__importStar) || function (mod) {
413
+ if (mod && mod.__esModule) return mod;
414
+ var result = {};
415
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
416
+ __setModuleDefault(result, mod);
417
+ return result;
418
+ };
419
+ Object.defineProperty(exports, "__esModule", { value: true });
420
+ exports.BrowserPluginArea = void 0;
421
+ const React = __importStar(__webpack_require__(/*! react */ "react"));
422
+ const plugin_area_1 = __webpack_require__(/*! ./plugin-area */ "./src/plugin-area/plugin-area.tsx");
423
+ exports.BrowserPluginArea = () => {
424
+ return React.createElement("div", { style: { display: "none" } },
425
+ React.createElement(plugin_area_1.PluginArea, null));
426
+ };
427
+
428
+
388
429
  /***/ }),
389
430
 
390
431
  /***/ "./src/plugin-area/higher-order-component-util.ts":
@@ -443,6 +484,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
443
484
  Object.defineProperty(exports, "__esModule", { value: true });
444
485
  __exportStar(__webpack_require__(/*! ./plugin-area */ "./src/plugin-area/plugin-area.tsx"), exports);
445
486
  __exportStar(__webpack_require__(/*! ./plugin-api */ "./src/plugin-area/plugin-api.ts"), exports);
487
+ __exportStar(__webpack_require__(/*! ./browser-plugin-area */ "./src/plugin-area/browser-plugin-area.tsx"), exports);
446
488
 
447
489
 
448
490
  /***/ }),
@@ -607,7 +649,7 @@ class PluginArea extends React.Component {
607
649
  this.setState(this.getCurrentPluginsState);
608
650
  }
609
651
  render() {
610
- return (React.createElement("div", { style: { display: 'none' } }, lodash_1.map(this.state.plugins, ({ context, Plugin }) => (React.createElement(plugin_context_1.PluginContextProvider, { key: context.name, value: context },
652
+ return (React.createElement(React.Fragment, null, lodash_1.map(this.state.plugins, ({ context, Plugin }) => (React.createElement(plugin_context_1.PluginContextProvider, { key: context.name, value: context },
611
653
  React.createElement(Plugin, null))))));
612
654
  }
613
655
  }
@@ -1208,6 +1250,417 @@ exports.FeatureWithRouterFactory = new connector_1.Feature({
1208
1250
  });
1209
1251
 
1210
1252
 
1253
+ /***/ }),
1254
+
1255
+ /***/ "./src/slot-fill/context.tsx":
1256
+ /*!***********************************!*\
1257
+ !*** ./src/slot-fill/context.tsx ***!
1258
+ \***********************************/
1259
+ /*! no static exports found */
1260
+ /***/ (function(module, exports, __webpack_require__) {
1261
+
1262
+ "use strict";
1263
+
1264
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1265
+ if (k2 === undefined) k2 = k;
1266
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1267
+ }) : (function(o, m, k, k2) {
1268
+ if (k2 === undefined) k2 = k;
1269
+ o[k2] = m[k];
1270
+ }));
1271
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1272
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1273
+ }) : function(o, v) {
1274
+ o["default"] = v;
1275
+ });
1276
+ var __importStar = (this && this.__importStar) || function (mod) {
1277
+ if (mod && mod.__esModule) return mod;
1278
+ var result = {};
1279
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1280
+ __setModuleDefault(result, mod);
1281
+ return result;
1282
+ };
1283
+ Object.defineProperty(exports, "__esModule", { value: true });
1284
+ exports.Consumer = exports.useSlot = void 0;
1285
+ const React = __importStar(__webpack_require__(/*! react */ "react"));
1286
+ const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
1287
+ const SlotFillContext = React.createContext({
1288
+ registerSlot: () => { },
1289
+ unregisterSlot: () => { },
1290
+ registerFill: () => { },
1291
+ unregisterFill: () => { },
1292
+ getSlot: () => ({}),
1293
+ getFills: () => ([]),
1294
+ subscribe: () => { },
1295
+ });
1296
+ const { Provider, Consumer } = SlotFillContext;
1297
+ exports.Consumer = Consumer;
1298
+ class SlotFillProvider extends React.Component {
1299
+ constructor(props) {
1300
+ super(props);
1301
+ this.registerSlot = this.registerSlot.bind(this);
1302
+ this.registerFill = this.registerFill.bind(this);
1303
+ this.unregisterSlot = this.unregisterSlot.bind(this);
1304
+ this.unregisterFill = this.unregisterFill.bind(this);
1305
+ this.getSlot = this.getSlot.bind(this);
1306
+ this.getFills = this.getFills.bind(this);
1307
+ this.subscribe = this.subscribe.bind(this);
1308
+ this.slots = {};
1309
+ this.fills = {};
1310
+ this.listeners = [];
1311
+ this.contextValue = {
1312
+ registerSlot: this.registerSlot,
1313
+ unregisterSlot: this.unregisterSlot,
1314
+ registerFill: this.registerFill,
1315
+ unregisterFill: this.unregisterFill,
1316
+ getSlot: this.getSlot,
1317
+ getFills: this.getFills,
1318
+ subscribe: this.subscribe,
1319
+ };
1320
+ }
1321
+ registerSlot(name, slot) {
1322
+ const previousSlot = this.slots[name];
1323
+ this.slots[name] = slot;
1324
+ this.triggerListeners();
1325
+ // Sometimes the fills are registered after the initial render of slot
1326
+ // But before the registerSlot call, we need to rerender the slot
1327
+ this.forceUpdateSlot(name);
1328
+ // If a new instance of a slot is being mounted while another with the
1329
+ // same name exists, force its update _after_ the new slot has been
1330
+ // assigned into the instance, suich that its own rendering of children
1331
+ // will be empty (the new Slot will subsume all fills for this name).
1332
+ if (previousSlot) {
1333
+ previousSlot.forceUpdate();
1334
+ }
1335
+ }
1336
+ registerFill(name, instance) {
1337
+ this.fills[name] = [...(this.fills[name] || []), instance];
1338
+ this.forceUpdateSlot(name);
1339
+ }
1340
+ unregisterSlot(name, instance) {
1341
+ // If a previous instance of a Slot by this name unmounts, do nothing,
1342
+ // as the slot and its fills should only be removed for the current
1343
+ // known instance.
1344
+ if (this.slots[name] !== instance) {
1345
+ return;
1346
+ }
1347
+ delete this.slots[name];
1348
+ this.triggerListeners();
1349
+ }
1350
+ unregisterFill(name, instance) {
1351
+ this.fills[name] = lodash_1.without(this.fills[name], instance);
1352
+ this.resetFillOccurrence(name);
1353
+ this.forceUpdateSlot(name);
1354
+ }
1355
+ getSlot(name) {
1356
+ return this.slots[name];
1357
+ }
1358
+ getFills(name, slotInstance) {
1359
+ // Commented following as we need the Slot to render at multiple places
1360
+ // Fills should only be returned for the current instance of the slot
1361
+ // in which they occupy.
1362
+ // if (this.slots[name] !== slotInstance) {
1363
+ // return [];
1364
+ // }
1365
+ return lodash_1.sortBy(this.fills[name], 'occurrence');
1366
+ }
1367
+ resetFillOccurrence(name) {
1368
+ lodash_1.forEach(this.fills[name], instance => {
1369
+ instance.occurrence = undefined;
1370
+ });
1371
+ }
1372
+ forceUpdateSlot(name) {
1373
+ const slot = this.getSlot(name);
1374
+ if (slot) {
1375
+ slot.forceUpdate();
1376
+ }
1377
+ }
1378
+ triggerListeners() {
1379
+ this.listeners.forEach((listener) => listener());
1380
+ }
1381
+ subscribe(listener) {
1382
+ this.listeners.push(listener);
1383
+ return () => {
1384
+ this.listeners = lodash_1.without(this.listeners, listener);
1385
+ };
1386
+ }
1387
+ render() {
1388
+ return React.createElement(Provider, { value: this.contextValue }, this.props.children);
1389
+ }
1390
+ }
1391
+ /**
1392
+ * React hook returning the active slot given a name.
1393
+ *
1394
+ * @param {string} name Slot name.
1395
+ * @return {Object} Slot object.
1396
+ */
1397
+ exports.useSlot = (name) => {
1398
+ const { getSlot, subscribe } = React.useContext(SlotFillContext);
1399
+ const [slot, setSlot] = React.useState(getSlot(name));
1400
+ React.useEffect(() => {
1401
+ setSlot(getSlot(name));
1402
+ const unsubscribe = subscribe(() => {
1403
+ setSlot(getSlot(name));
1404
+ });
1405
+ return unsubscribe;
1406
+ }, [name]);
1407
+ return slot;
1408
+ };
1409
+ exports.default = SlotFillProvider;
1410
+
1411
+
1412
+ /***/ }),
1413
+
1414
+ /***/ "./src/slot-fill/fill.tsx":
1415
+ /*!********************************!*\
1416
+ !*** ./src/slot-fill/fill.tsx ***!
1417
+ \********************************/
1418
+ /*! no static exports found */
1419
+ /***/ (function(module, exports, __webpack_require__) {
1420
+
1421
+ "use strict";
1422
+
1423
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1424
+ if (k2 === undefined) k2 = k;
1425
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1426
+ }) : (function(o, m, k, k2) {
1427
+ if (k2 === undefined) k2 = k;
1428
+ o[k2] = m[k];
1429
+ }));
1430
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1431
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1432
+ }) : function(o, v) {
1433
+ o["default"] = v;
1434
+ });
1435
+ var __importStar = (this && this.__importStar) || function (mod) {
1436
+ if (mod && mod.__esModule) return mod;
1437
+ var result = {};
1438
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1439
+ __setModuleDefault(result, mod);
1440
+ return result;
1441
+ };
1442
+ Object.defineProperty(exports, "__esModule", { value: true });
1443
+ exports.Fill = void 0;
1444
+ const React = __importStar(__webpack_require__(/*! react */ "react"));
1445
+ const react_dom_1 = __webpack_require__(/*! react-dom */ "react-dom");
1446
+ const context_1 = __webpack_require__(/*! ./context */ "./src/slot-fill/context.tsx");
1447
+ const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
1448
+ let occurrences = 0;
1449
+ const FillComponent = ({ name, children, registerFill, unregisterFill, }) => {
1450
+ const slot = context_1.useSlot(name);
1451
+ const ref = React.useRef({
1452
+ name,
1453
+ children,
1454
+ occurrence: 0,
1455
+ });
1456
+ if (!ref.current.occurrence) {
1457
+ ref.current.occurrence = ++occurrences;
1458
+ }
1459
+ React.useLayoutEffect(() => {
1460
+ registerFill(name, ref.current);
1461
+ return () => unregisterFill(name, ref.current);
1462
+ }, []);
1463
+ React.useLayoutEffect(() => {
1464
+ ref.current.children = children;
1465
+ if (slot && !slot.props.bubblesVirtually) {
1466
+ slot.forceUpdate();
1467
+ }
1468
+ }, [children]);
1469
+ React.useLayoutEffect(() => {
1470
+ if (name === ref.current.name) {
1471
+ // ignore initial effect
1472
+ return;
1473
+ }
1474
+ unregisterFill(ref.current.name, ref.current);
1475
+ ref.current.name = name;
1476
+ registerFill(name, ref.current);
1477
+ }, [name]);
1478
+ if (!slot || !slot.node || !slot.props.bubblesVirtually) {
1479
+ return null;
1480
+ }
1481
+ // If a function is passed as a child, provide it with the fillProps.
1482
+ if (lodash_1.isFunction(children)) {
1483
+ children = children(slot.props.fillProps);
1484
+ }
1485
+ return react_dom_1.createPortal(children, slot.node);
1486
+ };
1487
+ const Fill = props => {
1488
+ return (React.createElement(context_1.Consumer, null, ({ registerFill, unregisterFill }) => (React.createElement(FillComponent, Object.assign({}, props, { registerFill: registerFill, unregisterFill: unregisterFill })))));
1489
+ };
1490
+ exports.Fill = Fill;
1491
+
1492
+
1493
+ /***/ }),
1494
+
1495
+ /***/ "./src/slot-fill/index.ts":
1496
+ /*!********************************!*\
1497
+ !*** ./src/slot-fill/index.ts ***!
1498
+ \********************************/
1499
+ /*! no static exports found */
1500
+ /***/ (function(module, exports, __webpack_require__) {
1501
+
1502
+ "use strict";
1503
+
1504
+ var __importDefault = (this && this.__importDefault) || function (mod) {
1505
+ return (mod && mod.__esModule) ? mod : { "default": mod };
1506
+ };
1507
+ Object.defineProperty(exports, "__esModule", { value: true });
1508
+ exports.SlotFillProvider = exports.Fill = exports.Slot = void 0;
1509
+ const slot_1 = __webpack_require__(/*! ./slot */ "./src/slot-fill/slot.tsx");
1510
+ Object.defineProperty(exports, "Slot", { enumerable: true, get: function () { return slot_1.Slot; } });
1511
+ const fill_1 = __webpack_require__(/*! ./fill */ "./src/slot-fill/fill.tsx");
1512
+ Object.defineProperty(exports, "Fill", { enumerable: true, get: function () { return fill_1.Fill; } });
1513
+ const context_1 = __importDefault(__webpack_require__(/*! ./context */ "./src/slot-fill/context.tsx"));
1514
+ exports.SlotFillProvider = context_1.default;
1515
+
1516
+
1517
+ /***/ }),
1518
+
1519
+ /***/ "./src/slot-fill/slot.tsx":
1520
+ /*!********************************!*\
1521
+ !*** ./src/slot-fill/slot.tsx ***!
1522
+ \********************************/
1523
+ /*! no static exports found */
1524
+ /***/ (function(module, exports, __webpack_require__) {
1525
+
1526
+ "use strict";
1527
+
1528
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1529
+ if (k2 === undefined) k2 = k;
1530
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1531
+ }) : (function(o, m, k, k2) {
1532
+ if (k2 === undefined) k2 = k;
1533
+ o[k2] = m[k];
1534
+ }));
1535
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1536
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1537
+ }) : function(o, v) {
1538
+ o["default"] = v;
1539
+ });
1540
+ var __importStar = (this && this.__importStar) || function (mod) {
1541
+ if (mod && mod.__esModule) return mod;
1542
+ var result = {};
1543
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1544
+ __setModuleDefault(result, mod);
1545
+ return result;
1546
+ };
1547
+ Object.defineProperty(exports, "__esModule", { value: true });
1548
+ exports.Slot = void 0;
1549
+ const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
1550
+ const React = __importStar(__webpack_require__(/*! react */ "react"));
1551
+ const context_1 = __webpack_require__(/*! ./context */ "./src/slot-fill/context.tsx");
1552
+ const utils_1 = __webpack_require__(/*! ./utils */ "./src/slot-fill/utils/index.ts");
1553
+ class SlotComponent extends React.Component {
1554
+ constructor(props) {
1555
+ super(props);
1556
+ this.bindNode = this.bindNode.bind(this);
1557
+ }
1558
+ componentDidMount() {
1559
+ const { registerSlot } = this.props;
1560
+ registerSlot(this.props.name, this);
1561
+ }
1562
+ componentWillUnmount() {
1563
+ const { unregisterSlot } = this.props;
1564
+ unregisterSlot(this.props.name, this);
1565
+ }
1566
+ componentDidUpdate(prevProps) {
1567
+ const { name, unregisterSlot, registerSlot } = this.props;
1568
+ // Commented following as we need the Slot to render at multiple places
1569
+ // if (prevProps.name !== name) {
1570
+ // unregisterSlot(prevProps.name);
1571
+ // registerSlot(name, this);
1572
+ // }
1573
+ }
1574
+ bindNode(node) {
1575
+ this.node = node;
1576
+ }
1577
+ render() {
1578
+ const { children, name, bubblesVirtually = false, fillProps = {}, getFills, className, } = this.props;
1579
+ if (bubblesVirtually) {
1580
+ return React.createElement("div", { ref: this.bindNode, className: className });
1581
+ }
1582
+ const fills = lodash_1.map(getFills(name, this), fill => {
1583
+ const fillKey = fill.occurrence;
1584
+ const fillChildren = lodash_1.isFunction(fill.children)
1585
+ ? fill.children(fillProps)
1586
+ : fill.children;
1587
+ return React.Children.map(fillChildren, (child, childIndex) => {
1588
+ if (!child || lodash_1.isString(child)) {
1589
+ return child;
1590
+ }
1591
+ const childKey = `${fillKey}---${child.key || childIndex}`;
1592
+ return React.cloneElement(child, { key: childKey });
1593
+ });
1594
+ }).filter(
1595
+ // In some cases fills are rendered only when some conditions apply.
1596
+ // This ensures that we only use non-empty fills when rendering, i.e.,
1597
+ // it allows us to render wrappers only when the fills are actually present.
1598
+ lodash_1.negate(utils_1.isEmptyElement));
1599
+ return React.createElement(React.Fragment, null, lodash_1.isFunction(children) ? children(fills) : fills);
1600
+ }
1601
+ }
1602
+ const Slot = props => {
1603
+ return (React.createElement(context_1.Consumer, null, ({ registerSlot, unregisterSlot, getFills }) => (React.createElement(SlotComponent, Object.assign({}, props, { getFills: getFills, registerSlot: registerSlot, unregisterSlot: unregisterSlot })))));
1604
+ };
1605
+ exports.Slot = Slot;
1606
+
1607
+
1608
+ /***/ }),
1609
+
1610
+ /***/ "./src/slot-fill/utils/index.ts":
1611
+ /*!**************************************!*\
1612
+ !*** ./src/slot-fill/utils/index.ts ***!
1613
+ \**************************************/
1614
+ /*! no static exports found */
1615
+ /***/ (function(module, exports, __webpack_require__) {
1616
+
1617
+ "use strict";
1618
+
1619
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1620
+ if (k2 === undefined) k2 = k;
1621
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1622
+ }) : (function(o, m, k, k2) {
1623
+ if (k2 === undefined) k2 = k;
1624
+ o[k2] = m[k];
1625
+ }));
1626
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1627
+ for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
1628
+ };
1629
+ Object.defineProperty(exports, "__esModule", { value: true });
1630
+ __exportStar(__webpack_require__(/*! ./isEmptyElement */ "./src/slot-fill/utils/isEmptyElement.tsx"), exports);
1631
+
1632
+
1633
+ /***/ }),
1634
+
1635
+ /***/ "./src/slot-fill/utils/isEmptyElement.tsx":
1636
+ /*!************************************************!*\
1637
+ !*** ./src/slot-fill/utils/isEmptyElement.tsx ***!
1638
+ \************************************************/
1639
+ /*! no static exports found */
1640
+ /***/ (function(module, exports, __webpack_require__) {
1641
+
1642
+ "use strict";
1643
+
1644
+ Object.defineProperty(exports, "__esModule", { value: true });
1645
+ exports.isEmptyElement = void 0;
1646
+ const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
1647
+ /**
1648
+ * Checks if the provided element to check.
1649
+ *
1650
+ * @param element React Component to check.
1651
+ * @returns True when an element is considered empty.
1652
+ */
1653
+ exports.isEmptyElement = (element) => {
1654
+ if (lodash_1.isNumber(element)) {
1655
+ return false;
1656
+ }
1657
+ if (lodash_1.isString(element) || lodash_1.isArray(element)) {
1658
+ return !element.length;
1659
+ }
1660
+ return !element;
1661
+ };
1662
+
1663
+
1211
1664
  /***/ }),
1212
1665
 
1213
1666
  /***/ "./src/utils/index.ts":
@@ -1579,6 +2032,17 @@ module.exports = require("react");
1579
2032
 
1580
2033
  /***/ }),
1581
2034
 
2035
+ /***/ "react-dom":
2036
+ /*!****************************!*\
2037
+ !*** external "react-dom" ***!
2038
+ \****************************/
2039
+ /*! no static exports found */
2040
+ /***/ (function(module, exports) {
2041
+
2042
+ module.exports = require("react-dom");
2043
+
2044
+ /***/ }),
2045
+
1582
2046
  /***/ "react-router":
1583
2047
  /*!*******************************!*\
1584
2048
  !*** external "react-router" ***!
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://@common-stack/client-react/webpack/bootstrap","webpack://@common-stack/client-react/./src/connector/connector.tsx","webpack://@common-stack/client-react/./src/connector/index.ts","webpack://@common-stack/client-react/./src/index.ts","webpack://@common-stack/client-react/./src/interfaces/index.ts","webpack://@common-stack/client-react/./src/interfaces/menu.tsx","webpack://@common-stack/client-react/./src/plugin-area/higher-order-component-util.ts","webpack://@common-stack/client-react/./src/plugin-area/index.ts","webpack://@common-stack/client-react/./src/plugin-area/plugin-api.ts","webpack://@common-stack/client-react/./src/plugin-area/plugin-area.tsx","webpack://@common-stack/client-react/./src/plugin-area/plugin-context.tsx","webpack://@common-stack/client-react/./src/route-based-plugin-area/higher-order-component-util.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/index.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/plugin-api.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/plugin-context.tsx","webpack://@common-stack/client-react/./src/route-based-plugin-area/route-based-plugin-area.tsx","webpack://@common-stack/client-react/./src/route/index.ts","webpack://@common-stack/client-react/./src/route/render-routes.tsx","webpack://@common-stack/client-react/./src/router/index.ts","webpack://@common-stack/client-react/./src/router/router.tsx","webpack://@common-stack/client-react/./src/utils/index.ts","webpack://@common-stack/client-react/./src/utils/route-utils.tsx","webpack://@common-stack/client-react/external \"@common-stack/client-core\"","webpack://@common-stack/client-react/external \"@wordpress/hooks\"","webpack://@common-stack/client-react/external \"lodash\"","webpack://@common-stack/client-react/external \"react\"","webpack://@common-stack/client-react/external \"react-router\"","webpack://@common-stack/client-react/external \"react-router-dom\"","webpack://@common-stack/client-react/external \"sort-keys\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;Q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;;AC3TD,sD;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,sC","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","import * as React from 'react';\nimport { AbstractFeature, IModuleShape } from '@common-stack/client-core';\n// import { makeLogger } from '@cdm-logger/client';\nimport { IReactFeature, IReactModuleShape } from '../interfaces';\nimport { getMenus, getSortedRoutes, renderRoutes } from '../utils';\nimport { castArray, map, union, without, sortBy, filter, find } from 'lodash';\nimport { registerPlugin, getPlugins, getPlugin } from '../plugin-area';\n\nconst combine = (features, extractor) => without(union(...map(features,\n res => castArray(extractor(res)))), undefined);\n\nconst getFirst = (features, extractor) => extractor(find(features, (res) => extractor(res)) || {});\n\ntype FeatureParam = IModuleShape & IReactModuleShape;\n\nexport class Feature extends AbstractFeature implements IReactFeature {\n // private logger;\n public componentFillPlugins;\n\n public routerFactory: any;\n public route: any;\n public routeConfig: any;\n public menuConfig: any;\n public authWrapper: (\n ele: React.ReactElement,\n props: Record<string, any>) => void;\n\n constructor(\n feature?: FeatureParam,\n // tslint:disable:trailing-comma\n ...features: FeatureParam[]\n ) {\n super(feature, ...features);\n // this.logger = makeLogger(Feature.name);\n\n\n // Navigation\n this.routerFactory = combine(arguments, (arg: FeatureParam) => arg.routerFactory)\n .slice(-1)\n .pop();\n this.route = combine(arguments, (arg: FeatureParam) => arg.route);\n this.routeConfig = combine(arguments, (arg: FeatureParam) => arg.routeConfig);\n\n this.menuConfig = combine(arguments, (arg: FeatureParam) => arg.menuConfig);\n\n this.componentFillPlugins = this.registerComponentFillPlugins(combine(arguments,\n (arg: FeatureParam) => arg.componentFillPlugins));\n\n this.authWrapper = getFirst(arguments, (arg: FeatureParam) => arg.authWrapper)\n }\n\n /* tslint:disable:jsx-no-lambda */\n private renderRoutes = renderRoutes;\n\n /**\n * Get the routes\n */\n public getRoutes(searchPath?: any) {\n const configuredRoutes = this.getConfiguredRoutes(searchPath);\n const solidRoutes = this.route.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, { key: component.props.path }));\n return this.renderRoutes(configuredRoutes, solidRoutes);\n }\n\n /**\n * Get menus\n */\n public getMenus(sortByPriority = true) {\n const menus = this.getConfiguredMenus();\n return this.sortMenus(sortByPriority, menus);\n }\n\n /**\n * get configured routes.\n * Note: It overwrites the any duplicate key with latest loaded key.\n * TODO: Find a way to warn when there are duplicate keys.\n */\n public getConfiguredRoutes(searchPath = '/') {\n return getSortedRoutes(searchPath, Object.assign({}, ...this.routeConfig), this.authWrapper);\n }\n\n\n /**\n * get configured menus.\n * Note: It overwrites the any duplicate key with latest loaded key.\n * TODO: Find a way to warn when there are duplicate keys.\n */\n public getConfiguredMenus(searchPath = '/') {\n const routes = Object.assign({}, ...this.menuConfig);\n return getMenus(searchPath, { ...routes });\n }\n\n get navItems() {\n return this.navItem.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, {\n key: component.key ? component.key : idx + this.navItem.length,\n }),\n );\n }\n\n get navItemsRight() {\n return this.navItemsRight.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, {\n key: component.key ? component.key : idx + this.navItems.length,\n }),\n );\n }\n\n public getWrappedRoot(root: React.ReactNode, req?: any): React.ReactNode {\n let nestedRoot = root;\n for (const componentFactory of this.rootComponentFactory) {\n nestedRoot = React.cloneElement(componentFactory(req), {}, nestedRoot);\n }\n return nestedRoot;\n }\n\n public getDataRoot(root) {\n let nestedRoot = root;\n for (const component of this.dataRootComponent) {\n nestedRoot = React.createElement(component, {}, nestedRoot);\n }\n return nestedRoot;\n }\n\n public registerLanguages(monaco) {\n for (const func of this.languagesFuncs) {\n func(monaco);\n }\n }\n\n private registerComponentFillPlugins(plugins): void {\n plugins.forEach((i) => {\n const { name } = i;\n const isFound = !!getPlugin(name);\n if (!isFound) {\n registerPlugin(name, i);\n }\n });\n return plugins;\n }\n\n public getComponentFillPlugins() {\n return getPlugins();\n }\n\n\n private sortMenusByPriority = (menus) => {\n return sortBy(menus, (obj) => parseInt(obj.priority, 10));\n }\n\n private sortMenus = (sortByPriority, menus) => {\n if (sortByPriority) {\n const menuData = this.sortMenusByPriority(menus);\n return menuData.map(menu => {\n return {\n ...menu,\n children: menu.children && this.sortMenus(sortByPriority, menu.children),\n };\n });\n } else {\n return menus;\n }\n }\n\n}\n","export * from './connector';\n","export { ClientTypes } from '@common-stack/client-core';\nexport * from './connector';\nexport * from './router';\nexport * from './route';\nexport * from './utils';\nexport * from './interfaces';\nexport * from './plugin-area';\nexport * from './route-based-plugin-area';\n","export * from './router';\nexport * from './extended-feature';\nexport * from './menu';\nexport * from './new-router';\n","import * as React from 'react';\nimport { deprecate } from 'util';\n\n/**\n * @deprecated Will be removed, don't use it. It is replaced by \n */\nexport interface IMenuData {\n [key: string]: {\n name: any;\n position?: IMenuPosition;\n icon?: any;\n authority?: any;\n exact?: boolean;\n strict?: boolean;\n [key: string]: any;\n };\n}\n\n\n/**\n * @deprecated Will be removed, don't use it. Replaced by IMenuDataItem\n */\nexport interface IMenuItem {\n path?: string;\n name: any;\n icon?: any;\n position: IMenuPosition;\n authority?: any;\n loading?: any;\n exact?: boolean;\n strict?: boolean;\n children?: IMenuItem[];\n priority?: number\n}\n\nexport interface IMenuDataItem {\n /**\n * @name submenu\n */\n children?: IMenuDataItem[];\n /**\n * @name Hide child nodes in the menu\n */\n hideChildrenInMenu?: boolean;\n /**\n * @name hideSelf and children in menu\n */\n hideInMenu?: boolean;\n /**\n * @name Icon of the menu\n */\n icon?: React.ReactNode;\n /**\n * @name Internationalization key for custom menus\n */\n locale?: string | false;\n /**\n * @name The name of the menu\n */\n name?: string;\n /**\n * @name is used to calibrate the selected value, default is path\n */\n key?: string;\n /**\n * @name disable menu option\n */\n disabled?: boolean;\n /**\n * @name path\n */\n path?: string;\n /**\n * @name custom parent node\n * @description When this node is selected, the node of parentKeys is also selected\n */\n parentKeys?: string[];\n /**\n * @name hides itself and elevates child nodes to its level\n */\n flatMenu?: boolean;\n\n /**\n * @name position of the Menu\n */\n position?: IMenuPosition;\n\n\n /**\n * @name permissions to determine whether to render menu or not\n */\n authority?: string[];\n\n /**\n * @name priority of the menu to display in the order. Lower values shows first. \n */\n priority?: number;\n\n [key: string]: any;\n}\n\nexport enum IMenuPosition {\n LOGO = 'LOGO',\n UPPER = 'UPPER',\n MIDDLE = 'MIDDLE',\n LOWER = 'LOWER',\n BOTTOM = 'BOTTOM',\n}\n","\nimport { camelCase, upperFirst } from 'lodash';\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n * \n * @param mapComponentToEnhancedComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n * \n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent(\n mapComponentToEnhancedComponent,\n modifierName\n) {\n return ( OriginalComponent ) => {\n const EnhancedComponent = mapComponentToEnhancedComponent(\n OriginalComponent\n );\n const {\n displayName = OriginalComponent.name || 'Component',\n } = OriginalComponent;\n EnhancedComponent.displayName = `${ upperFirst(\n camelCase(modifierName)\n )}(${displayName})`;\n\n return EnhancedComponent;\n }\n}\n\n","export * from './plugin-area';\nexport * from './plugin-api';\n","import { ComponentElement } from 'react';\n\nimport { isFunction } from 'lodash';\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Defined behavior of a plugin type.\n *\n * @typedef ComponentExtension\n *\n *\n */\nexport interface WorbenchExtension {\n name: string;\n icon: string | ComponentElement<any, any> | Function;\n render: React.SFC | any;\n}\n\n/**\n * Plugin definitions keyed by plugin name.\n */\nconst plugins: { [key: string]: WorbenchExtension } = {};\n\n/**\n * Registeres a plugin to the App.\n *\n * @param name A string identifying the plugin. Must be unique across all registered plugins.\n * @param settings The settings for this plugin.\n */\nexport function registerPlugin(name, settings) {\n if (typeof settings !== 'object') {\n console.error('No settings object provided!');\n return null;\n }\n if (typeof name !== 'string') {\n console.error('Plugin names must be strings.');\n return null;\n }\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(\n 'Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: \"my-pluin\".',\n );\n return null;\n }\n if (plugins[name]) {\n console.error(`Plugin \"${name}\" is alread registered.`);\n }\n settings = applyFilters('plugins.registerPlugin', settings, name);\n\n if (!isFunction(settings.render)) {\n console.error(\n 'The \"render\" property must be specified and must be a valid function.',\n );\n return null;\n }\n plugins[name] = {\n name,\n icon: 'admin-plugins',\n ...settings,\n };\n\n doAction('plugins.pluginRegistered', settings, name);\n\n return settings;\n}\n\n/**\n * Unregisteres a plugin by name.\n * @param name Plugin name.\n *\n * @return The previous plugin settings object, if it has been successfully unregistered; otherwise `undefined`.\n */\nexport function unregisterPlugin(name) {\n if (!plugins[name]) {\n console.error('Plugin \"' + name + '\" is not registered.');\n return;\n }\n const oldPlugin = plugins[name];\n delete plugins[name];\n\n doAction('plugin.pluginUnregistered', oldPlugin, name);\n\n return oldPlugin;\n}\n\n/**\n * Returns a registered plugin settings.\n *\n * @param name Plugin name.\n *\n * @returns Plugin setting.\n */\nexport function getPlugin(name) {\n return plugins[name];\n}\n\n/**\n * Return all registered plugins.\n *\n * @return Plugin settings.\n */\nexport function getPlugins() {\n return Object.values(plugins);\n}\n","import { map } from 'lodash';\nimport * as React from 'react';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { PluginContextProvider } from './plugin-context';\nimport { getPlugins } from './plugin-api';\n\n/**\n * A component that renders all plugin fills in a hidden div.\n */\n\nexport class PluginArea extends React.Component<{}, { plugins: { [key: string]: any}}> {\n\n constructor(args) {\n super(args);\n this.setPlugins = this.setPlugins.bind(this);\n this.state = {plugins: []};\n }\n\n public getCurrentPluginsState() {\n return {\n plugins: map(getPlugins(), ({ icon, name, render }) => {\n return {\n Plugin: render,\n context: {\n name,\n icon,\n },\n };\n }),\n };\n }\n\n public componentDidMount() {\n addAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n this.setPlugins,\n );\n addAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n this.setPlugins,\n );\n this.setPlugins();\n }\n\n public componentWillUnMount() {\n removeAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n );\n removeAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n );\n }\n\n public setPlugins() {\n this.setState(this.getCurrentPluginsState);\n }\n\n public render() {\n return (\n <div style={{ display: 'none' }}>\n {map(this.state.plugins, ({ context, Plugin }) => (\n <PluginContextProvider\n key={context.name}\n value={context}\n >\n <Plugin />\n </PluginContextProvider>\n ))}\n </div>\n );\n }\n}\n","\nimport * as React from 'react';\nimport { createHigherOrderComponent } from './higher-order-component-util';\n\nconst { createContext } = React;\nconst { Consumer, Provider } = createContext({\n name: null,\n icon: null,\n});\n\nexport { Provider as PluginContextProvider };\n\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change, expected to return object of\n * props to merge with the component's own props.\n *\n * @return Enhanced component with injected context as props.\n */\nexport const withPluginContext = (mapContextToProps) =>\n createHigherOrderComponent((OriginalComponent) => {\n return (props) => (\n <Consumer>\n {(context) => (\n <OriginalComponent\n {...props}\n {...mapContextToProps(context, props)}\n />\n )}\n </Consumer>\n );\n }, 'withPluginContext');\n","\nimport { camelCase, upperFirst } from 'lodash';\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n * \n * @param mapComponentToEnhancedComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n * \n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent(\n mapComponentToEnhancedComponent,\n modifierName\n) {\n return ( OriginalComponent ) => {\n const EnhancedComponent = mapComponentToEnhancedComponent(\n OriginalComponent\n );\n const {\n displayName = OriginalComponent.name || 'Component',\n } = OriginalComponent;\n EnhancedComponent.displayName = `${ upperFirst(\n camelCase(modifierName)\n )}(${displayName})`;\n\n return EnhancedComponent;\n }\n}\n\n","export * from './route-based-plugin-area';\nexport * from './plugin-api';\n","import { ComponentElement } from 'react';\n\nimport { isFunction } from 'lodash';\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Defined behavior of a plugin type.\n *\n * @typedef ComponentExtension\n *\n *\n */\n\ninterface WorbenchExtension {\n name: string;\n icon: string | ComponentElement<any, any> | Function;\n render: React.SFC | any;\n}\n\n/**\n * Plugin definitions keyed by plugin name.\n */\nconst plugins: { [key: string]: WorbenchExtension } = {};\n\n/**\n * Registeres a plugin to the App.\n *\n * @param name A string identifying the plugin. Must be unique across all registered plugins.\n * @param settings The settings for this plugin.\n */\nexport function registerRouteBasePlugin(name, settings) {\n if (typeof settings !== 'object') {\n console.error('No settings object provided!');\n return null;\n }\n if (typeof name !== 'string') {\n console.error('Plugin names must be strings.');\n return null;\n }\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(\n 'Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: \"my-pluin\".',\n );\n return null;\n }\n if (plugins[name]) {\n console.error(`Plugin \"${name}\" is alread registered.`);\n }\n settings = applyFilters('plugins.registerPlugin', settings, name);\n\n if (!isFunction(settings.render)) {\n console.error(\n 'The \"render\" property must be specified and must be a valid function.',\n );\n return null;\n }\n plugins[name] = {\n name,\n icon: 'admin-plugins',\n ...settings,\n };\n\n doAction('plugins.pluginRegistered', settings, name);\n\n return settings;\n}\n\n/**\n * Unregisteres a plugin by name.\n * @param name Plugin name.\n *\n * @return The previous plugin settings object, if it has been successfully unregistered; otherwise `undefined`.\n */\nexport function unregisterRouteBasePlugin(name) {\n if (!plugins[name]) {\n console.error('Plugin \"' + name + '\" is not registered.');\n return;\n }\n const oldPlugin = plugins[name];\n delete plugins[name];\n\n doAction('plugin.pluginUnregistered', oldPlugin, name);\n\n return oldPlugin;\n}\n\n/**\n * Returns a registered plugin settings.\n *\n * @param name Plugin name.\n *\n * @returns Plugin setting.\n */\nexport function getRouteBasePlugin(name) {\n return plugins[name];\n}\n\n/**\n * Return all registered plugins.\n *\n * @return Plugin settings.\n */\nexport function getRouteBasePlugins() {\n return Object.values(plugins);\n}\n","\nimport * as React from 'react';\nimport { createHigherOrderComponent } from './higher-order-component-util';\n\nconst { createContext } = React;\nconst { Consumer, Provider } = createContext({\n name: null,\n icon: null,\n});\n\nexport { Provider as PluginContextProvider };\n\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change, expected to return object of\n * props to merge with the component's own props.\n *\n * @return Enhanced component with injected context as props.\n */\nexport const withPluginContext = (mapContextToProps) =>\n createHigherOrderComponent((OriginalComponent) => {\n return (props) => (\n <Consumer>\n {(context) => (\n <OriginalComponent\n {...props}\n {...mapContextToProps(context, props)}\n />\n )}\n </Consumer>\n );\n }, 'withPluginContext');\n","import { map } from 'lodash';\nimport * as React from 'react';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { PluginContextProvider } from './plugin-context';\nimport { getRouteBasePlugins } from './plugin-api';\n\n/**\n * A component that renders all plugin fills in a hidden div.\n */\n\nexport class RouteBasedPluginArea extends React.Component<{}, { plugins: { [key: string]: any}}> {\n\n constructor(args) {\n super(args);\n this.setPlugins = this.setPlugins.bind(this);\n this.state = {plugins: []};\n }\n\n public getCurrentPluginsState() {\n return {\n plugins: map(getRouteBasePlugins(), ({ icon, name, render }) => {\n return {\n Plugin: render,\n context: {\n name,\n icon,\n },\n };\n }),\n };\n }\n\n public componentDidMount() {\n addAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n this.setPlugins,\n );\n addAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n this.setPlugins,\n );\n this.setPlugins();\n }\n\n public componentWillUnMount() {\n removeAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n );\n removeAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n );\n }\n\n public setPlugins() {\n this.setState(this.getCurrentPluginsState);\n }\n\n public render() {\n return (\n <div style={{ display: 'none' }}>\n {map(this.state.plugins, ({ context, Plugin }) => (\n <PluginContextProvider\n key={context.name}\n value={context}\n >\n <Plugin />\n </PluginContextProvider>\n ))}\n </div>\n );\n }\n}\n","export * from './render-routes';\n","import * as React from 'react';\nimport { useEffect, useState, createElement } from 'react';\n// import { Plugin, ApplyPluginsType } from '@umijs/runtime';\nimport { IRoute, IComponent } from '../interfaces/new-router';\nimport { Switch, Route, Redirect } from 'react-router';\n\ninterface IOpts {\n routes: IRoute[];\n plugin?: Plugin;\n extraProps?: object;\n pageInitialProps?: object;\n getInitialPropsCtx?: object;\n isServer?: boolean;\n ssrProps?: object;\n rootRoutes?: IRoute[];\n auth?: boolean,\n authWrapper?: () => void;\n}\n\ninterface IGetRouteElementOpts {\n route: IRoute;\n index: number;\n opts: IOpts;\n}\n\nfunction wrapInitialPropsFetch(route: IRoute, opts: IOpts): IComponent {\n const { component, ...restRouteParams } = route;\n let Component: any = route!.component;\n function ComponentWithInitialPropsFetch(props: any) {\n const [initialProps, setInitialProps] = useState(\n () => (window as any).g_initialProps,\n );\n\n useEffect(() => {\n /**\n * 1. 首次渲染时,此时 window.g_initialProps 变量存在,不需要再走一次 getInitialProps,这样一次 SSR 就走了 2 次 getInitialProps\n * 2. 但是路由切换时,window.getInitialProps 会被赋为 null,这时候就走 getInitialProps 逻辑\n * 3. 如果任何时候都走 2 次,配置 forceInitial: true,这个场景用于静态站点的首屏加载希望走最新数据\n * 4. 开启动态加载后,会在执行 getInitialProps 前预加载下\n */\n const handleGetInitialProps = async () => {\n // preload when enalbe dynamicImport\n if (Component.preload) {\n const preloadComponent = await Component.preload();\n // for test case, really use .default\n Component = preloadComponent.default || preloadComponent;\n }\n\n //@sri not suppported\n // const defaultCtx = {\n // isServer: false,\n // match: props?.match,\n // route,\n // ...(opts.getInitialPropsCtx || {}),\n // ...restRouteParams,\n // };\n //@sri not suppported\n // if (Component?.getInitialProps) {\n // const ctx = await opts.plugin.applyPlugins({\n // key: 'ssr.modifyGetInitialPropsCtx',\n // type: ApplyPluginsType.modify,\n // initialValue: defaultCtx,\n // async: true,\n // });\n\n // const initialProps = await Component!.getInitialProps!(\n // ctx || defaultCtx,\n // );\n // setInitialProps(initialProps);\n // }\n };\n // null 时,一定会触发 getInitialProps 执行\n if (!(window as any).g_initialProps) {\n handleGetInitialProps();\n }\n }, [window.location.pathname, window.location.search]);\n return <Component {...props} {...initialProps} />;\n }\n // flag for having wrappered\n ComponentWithInitialPropsFetch.wrapInitialPropsLoaded = true;\n ComponentWithInitialPropsFetch.displayName = 'ComponentWithInitialPropsFetch';\n return ComponentWithInitialPropsFetch;\n}\n\nfunction render({\n route,\n opts,\n props,\n}: {\n route: IRoute;\n opts: IOpts;\n props: object;\n}) {\n const routes = renderRoutes({\n ...opts,\n routes: route.routes || [],\n rootRoutes: opts.rootRoutes,\n });\n let { component: Component, wrappers } = route;\n if (Component) {\n const defaultPageInitialProps = opts.isServer\n ? {}\n : (window as any).g_initialProps;\n const newProps = {\n ...props,\n ...opts.extraProps,\n ...(opts.pageInitialProps || defaultPageInitialProps),\n route,\n routes: opts.rootRoutes,\n };\n // @ts-ignore\n let ret = <Component {...newProps}>{routes}</Component>;\n\n // route.wrappers\n if (wrappers) {\n let len = wrappers.length - 1;\n while (len >= 0) {\n ret = createElement(wrappers[len], newProps, ret);\n len -= 1;\n }\n }\n\n return ret;\n } else {\n return routes;\n }\n}\n\nfunction getRouteElement({ route, index, opts }: IGetRouteElementOpts) {\n const routeProps = {\n key: route.key || index,\n exact: route.exact,\n strict: route.strict,\n sensitive: route.sensitive,\n path: route.path,\n };\n if (route.redirect) {\n return <Redirect {...routeProps} from={route.path} to={route.redirect} />;\n } else {\n // avoid mount and unmount with url hash change\n // @sri not supproted yet\n // if (\n // // only when SSR config enable\n // opts.ssrProps &&\n // !opts.isServer &&\n // // make sure loaded once\n // !(route.component as any)?.wrapInitialPropsLoaded &&\n // (route.component?.getInitialProps || route.component?.preload)\n // ) {\n // // client Render for enable ssr, but not sure SSR success\n // route.component = wrapInitialPropsFetch(route, opts);\n // }\n return (\n <Route\n {...routeProps}\n render={(props: object) => {\n return render({ route, opts, props });\n }}\n />\n );\n }\n}\n\nfunction renderRoutes(opts: IOpts) {\n return opts.routes ? (\n <Switch>\n {opts.routes.map((route, index) => {\n\n const renderedR = getRouteElement({\n route,\n index,\n opts: {\n ...opts,\n rootRoutes: opts.rootRoutes || opts.routes,\n },\n });\n return renderedR;\n }\n\n )}\n </Switch>\n ) : null;\n}\n\nexport { renderRoutes as renderRoutes2 }\n","export * from './router';\n","import * as React from 'react';\nimport { Switch } from 'react-router-dom';\nimport { Feature } from '../connector';\nimport {IReactFeature} from '../interfaces';\n\nconst routerFactory = (routes) => <Switch>{routes}</Switch>;\n\nexport const FeatureWithRouterFactory = new Feature({\n routerFactory,\n} as IReactFeature);\n","export * from './route-utils';\n","import * as React from 'react';\nimport { IRouteData, IMappedData, IMenuData, IMenuItem, IMenuPosition } from '../interfaces';\nimport { RouteProps, Switch } from 'react-router';\nimport { Route } from 'react-router-dom';\nconst defaultSortKeys = require('sort-keys');\n\n\n/* eslint no-useless-escape:0 */\nconst reg = /(((^https?:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\\+\\$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[\\+~%\\/.\\w-_]*)?\\??(?:[-\\+=&;%@.\\w_]*)#?(?:[\\w]*))?)$/g;\n\nexport function isUrl(path) {\n return reg.test(path);\n}\n/**\n * Generates Routes based on the key value, where key has the path of the route and value\n * has rest of the values for building a `<Router ../>` component.\n *\n * @param path: RegExp\n * @param routerData\n * @deprecated\n */\nexport function getRoutes2(path: RegExp, routerData: IRouteData) {\n const routes = Object.keys(routerData).filter(routePath => {\n return routePath.match(path);\n });\n const mappedRoutes: Array<IMappedData> = routes.map(paths => {\n return {\n route: paths,\n ...routerData[paths],\n };\n });\n const root: RouteProps & { routes?: any } = {\n };\n mappedRoutes.forEach(eachRoute => {\n const children = eachRoute.route.split('/');\n children.shift();\n\n // if the route is `/` then add this correction.\n if (eachRoute.route === '/') {\n children.shift();\n children.push('/');\n }\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i <= depth; i++) {\n const lastIndex = (lastNode.routes || []).findIndex(item => {\n if (eachRoute.route.startsWith(item.path)) {\n return eachRoute.route[item.path.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.routes[lastIndex];\n // do not overwrite the route's exact value\n lastNode.exact = routerData[lastNode.path as string].hasOwnProperty('exact') ? routerData[lastNode.path as string].exact : false;\n }\n if (!lastNode.routes) {\n lastNode.routes = [];\n }\n const modfiedRoute = formatSlash(eachRoute.route);\n lastNode.routes.push({\n ...eachRoute,\n // route: modfiedRoute,\n path: modfiedRoute,\n exact: routerData[eachRoute.route].hasOwnProperty('exact') ? routerData[eachRoute.route].exact : true,\n component: eachRoute.component,\n });\n });\n\n return root.routes;\n}\n\nconst startWithMoreThanOneSlash = /^(\\/)\\1+/; // for exame `//abc, ///abc, ...`\nconst formatSlash = (route) => {\n // replaced `//` with `/` in the routes.\n return {\n path: route.replace(startWithMoreThanOneSlash, '/'),\n _pathPrefix: (route.match(/^\\/(\\/{1,})/) || ['', ''])[1],\n }\n}\n\nexport function getRoutes(path: string, routeData: IRouteData, authWrapper: (ele, props) => void = null) {\n if (!path.startsWith('/')) {\n throw new Error('Invalid path!');\n }\n let searchPath = path;\n if (path[path.length - 1] !== '/') {\n searchPath = path + '/';\n }\n const routes = Object.keys(routeData).filter(menuPath => {\n return menuPath.indexOf(searchPath) === 0 || menuPath === path;\n });\n\n const mappedMenuPaths: Array<IMappedData> = routes.map(mPath => {\n return {\n route: mPath,\n position: IMenuPosition.MIDDLE,\n ...routeData[mPath],\n };\n });\n const root: RouteProps & { routes?: any } = {\n // just to satisfy types added following\n // TOOD need to correct types so we don't have to enter them.\n name: 'root',\n position: IMenuPosition.LOGO,\n } as any;\n mappedMenuPaths.forEach(routeItem => {\n const children = routeItem.route.split('/');\n children.shift();\n\n // if the route is `/` then add this correction.\n if (routeItem.path === '/') {\n children.shift();\n children.push('/');\n }\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i < depth; i++) {\n const lastIndex = (lastNode.routes || []).findIndex(item => {\n const routePath = `${item._pathPrefix}${item.path}`;\n\n if (routeItem.route.startsWith(routePath)) {\n return routeItem.route[routePath.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.routes[lastIndex];\n const lastNodePath = `${(lastNode as any)._pathPrefix}${lastNode.path}`;\n lastNode.exact = routeData[lastNodePath].hasOwnProperty('exact') ? routeData[lastNodePath].exact : false;\n }\n if (!lastNode.routes) {\n lastNode.routes = [];\n }\n const { route: ignore, auth, ...rest } = routeItem;\n const pathParams = formatSlash(routeItem.route);\n\n lastNode.routes.push({\n ...rest,\n // path: formatSlash(routeItem.route),\n // path: routeItem.route,\n ...pathParams,\n exact: routeData[routeItem.route].hasOwnProperty('exact') ? routeData[routeItem.route].exact : true,\n /**\n * Here we are checking whether auth property is being \n * set by this route and if authWrapper is declared\n * which is a high order component that can take a component\n * and its props as argument then perform some \n * computation and return a component\n */\n component: auth && authWrapper\n ? (props) => authWrapper(routeItem.component, props)\n : routeItem.component\n });\n });\n\n return root.routes;\n}\n\nexport function getMenus(path: string, menuData: IMenuData) {\n if (!path.startsWith('/')) {\n throw new Error('Invalid path!');\n }\n let searchPath = path;\n if (path[path.length - 1] !== '/') {\n searchPath = path + '/';\n }\n const routes = Object.keys(menuData).filter(menuPath => {\n return menuPath.indexOf(searchPath) === 0 || menuPath === path;\n });\n\n const mappedMenuPaths: Array<IMenuItem & { route?: string }> = routes.map(mPath => {\n return {\n route: mPath,\n position: IMenuPosition.MIDDLE,\n ...menuData[mPath],\n };\n });\n const root: IMenuItem & { route?: string } = {\n // just to satisfy types added following\n // TOOD need to correct types so we don't have to enter them.\n name: 'root',\n position: IMenuPosition.LOGO,\n };\n mappedMenuPaths.forEach(menutItem => {\n const children = menutItem.route.split('/');\n children.shift();\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i < depth; i++) {\n const lastIndex = (lastNode.children || []).findIndex(item => {\n if (menutItem.route.startsWith(item.path)) {\n return menutItem.route[item.path.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.children[lastIndex];\n // do not overwrite the route's exact value\n lastNode.exact = menuData[lastNode.path].hasOwnProperty('exact') ? menuData[lastNode.path].exact : false;\n }\n if (!lastNode.children) {\n lastNode.children = [];\n }\n const { route: ignore, ...rest } = menutItem;\n lastNode.children.push({\n path: menutItem.route,\n ...rest,\n exact: menuData[menutItem.route].hasOwnProperty('exact') ? menuData[menutItem.route].exact : true,\n });\n });\n\n return root.children;\n}\n\n\nexport const renderRoutes = (routes, solidRoutes, extraProps = {}, switchProps = {}) =>\n routes ? (\n <>\n {[\n ...solidRoutes, ...routes.map((route, i) => (\n <Route\n key={route.key || i}\n path={route.path}\n exact={route.exact}\n strict={route.strict}\n render={props =>\n route.render ? (\n route.render({ ...props, ...extraProps, route: route })\n ) : (\n <route.component {...props} {...extraProps} route={route} />\n )\n }\n />\n )),\n ]}\n </>\n ) : null;\n\nexport function sortKeys(routeData) {\n return defaultSortKeys(routeData, { compare})\n}\n\nexport const getSortedRoutes = (path: string, routeData: IRouteData, authWrapper: (\n ele: React.ReactElement,\n props: Record<string, any>\n) => void = null) => {\n const sortedRoutes = sortKeys(routeData);\n return getRoutes(path, sortedRoutes, authWrapper);\n};\n\nconst compare = ((a, b) => {\n const aStr = String(a).toLowerCase();\n const bStr = String(b).toLowerCase();\n // Alphanumeric elements always come before non-alphanumeric elements\n const aIsAlphanumeric = notStartWithColon(aStr);\n const bIsAlphanumeric = notStartWithColon(bStr);\n if (aIsAlphanumeric + bIsAlphanumeric !== -2) {\n if (aIsAlphanumeric * bIsAlphanumeric > 0) {\n if (aIsAlphanumeric === bIsAlphanumeric) {\n return aStr.localeCompare(bStr);\n }\n return aIsAlphanumeric - bIsAlphanumeric;\n }\n if (aIsAlphanumeric > 0) {\n return -1;\n } else if (bIsAlphanumeric > 0) {\n return 1;\n }\n }\n\n // Numerical elements always come before alphabetic elements\n const aNum = Number(a);\n const bNum = Number(b);\n // If both are numerical, sort in the usual fashion (smaller goes first)\n if (aNum && bNum) {\n return aNum - bNum;\n // If a is numerical but b isn't, put a first.\n } else if (aNum) {\n return -1;\n // If b is numerical but a isn't, put b first.\n } else if (bNum) {\n return 1;\n }\n\n // In all other cases, default to usual sort order.\n return aStr.localeCompare(bStr);\n});\n\n\nfunction notStartWithColon(str) {\n const match = (str.match(/^[\\/, *, :]{1,}/) || [-1])[0];\n if (match === -1) {\n return -1;\n }\n var i = match.length;\n let count = 0;\n while (i--) {\n const char = match[i];\n if (char === '/') {\n if(str === '/') { // if it is root only we put at the last\n count = count + 6;\n } else {\n count = count + 3;\n }\n } else if (char === ':') {\n count = count + 1;\n } else if (char === '*') {\n count = count + 2;\n }\n }\n return count;\n}","module.exports = require(\"@common-stack/client-core\");","module.exports = require(\"@wordpress/hooks\");","module.exports = require(\"lodash\");","module.exports = require(\"react\");","module.exports = require(\"react-router\");","module.exports = require(\"react-router-dom\");","module.exports = require(\"sort-keys\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://@common-stack/client-react/webpack/bootstrap","webpack://@common-stack/client-react/./src/connector/connector.tsx","webpack://@common-stack/client-react/./src/connector/index.ts","webpack://@common-stack/client-react/./src/index.ts","webpack://@common-stack/client-react/./src/interfaces/index.ts","webpack://@common-stack/client-react/./src/interfaces/menu.tsx","webpack://@common-stack/client-react/./src/plugin-area/browser-plugin-area.tsx","webpack://@common-stack/client-react/./src/plugin-area/higher-order-component-util.ts","webpack://@common-stack/client-react/./src/plugin-area/index.ts","webpack://@common-stack/client-react/./src/plugin-area/plugin-api.ts","webpack://@common-stack/client-react/./src/plugin-area/plugin-area.tsx","webpack://@common-stack/client-react/./src/plugin-area/plugin-context.tsx","webpack://@common-stack/client-react/./src/route-based-plugin-area/higher-order-component-util.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/index.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/plugin-api.ts","webpack://@common-stack/client-react/./src/route-based-plugin-area/plugin-context.tsx","webpack://@common-stack/client-react/./src/route-based-plugin-area/route-based-plugin-area.tsx","webpack://@common-stack/client-react/./src/route/index.ts","webpack://@common-stack/client-react/./src/route/render-routes.tsx","webpack://@common-stack/client-react/./src/router/index.ts","webpack://@common-stack/client-react/./src/router/router.tsx","webpack://@common-stack/client-react/./src/slot-fill/context.tsx","webpack://@common-stack/client-react/./src/slot-fill/fill.tsx","webpack://@common-stack/client-react/./src/slot-fill/index.ts","webpack://@common-stack/client-react/./src/slot-fill/slot.tsx","webpack://@common-stack/client-react/./src/slot-fill/utils/index.ts","webpack://@common-stack/client-react/./src/slot-fill/utils/isEmptyElement.tsx","webpack://@common-stack/client-react/./src/utils/index.ts","webpack://@common-stack/client-react/./src/utils/route-utils.tsx","webpack://@common-stack/client-react/external \"@common-stack/client-core\"","webpack://@common-stack/client-react/external \"@wordpress/hooks\"","webpack://@common-stack/client-react/external \"lodash\"","webpack://@common-stack/client-react/external \"react\"","webpack://@common-stack/client-react/external \"react-dom\"","webpack://@common-stack/client-react/external \"react-router\"","webpack://@common-stack/client-react/external \"react-router-dom\"","webpack://@common-stack/client-react/external \"sort-keys\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,sEAA+B;AAC/B,wGAA0E;AAG1E,4EAAmE;AACnE,6DAA8E;AAC9E,8FAAuE;AAEvE,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAO,CAAC,cAAK,CAAC,GAAG,YAAG,CAAC,QAAQ,EAClE,GAAG,CAAC,EAAE,CAAC,kBAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAEnD,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAInG,MAAa,OAAQ,SAAQ,6BAAe;IAYxC,YACI,OAAsB;IACtB,g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ACd,OAAO,CAAC,EAAE,EAAE;QACV,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAG,GAAG,KAAK,GAAG,EAAE,EAAE,wCAAwC;gBACxD,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;aACnB;iBAAM;gBACL,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;aACnB;SACF;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE;YACvB,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;SACnB;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE;YACvB,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;SACnB;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;;;;;;;;;;;;AC3TD,sD;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,sC;;;;;;;;;;;ACAA,yC;;;;;;;;;;;ACAA,6C;;;;;;;;;;;ACAA,sC","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","import * as React from 'react';\nimport { AbstractFeature, IModuleShape } from '@common-stack/client-core';\n// import { makeLogger } from '@cdm-logger/client';\nimport { IReactFeature, IReactModuleShape } from '../interfaces';\nimport { getMenus, getSortedRoutes, renderRoutes } from '../utils';\nimport { castArray, map, union, without, sortBy, filter, find } from 'lodash';\nimport { registerPlugin, getPlugins, getPlugin } from '../plugin-area';\n\nconst combine = (features, extractor) => without(union(...map(features,\n res => castArray(extractor(res)))), undefined);\n\nconst getFirst = (features, extractor) => extractor(find(features, (res) => extractor(res)) || {});\n\ntype FeatureParam = IModuleShape & IReactModuleShape;\n\nexport class Feature extends AbstractFeature implements IReactFeature {\n // private logger;\n public componentFillPlugins;\n\n public routerFactory: any;\n public route: any;\n public routeConfig: any;\n public menuConfig: any;\n public authWrapper: (\n ele: React.ReactElement,\n props: Record<string, any>) => void;\n\n constructor(\n feature?: FeatureParam,\n // tslint:disable:trailing-comma\n ...features: FeatureParam[]\n ) {\n super(feature, ...features);\n // this.logger = makeLogger(Feature.name);\n\n\n // Navigation\n this.routerFactory = combine(arguments, (arg: FeatureParam) => arg.routerFactory)\n .slice(-1)\n .pop();\n this.route = combine(arguments, (arg: FeatureParam) => arg.route);\n this.routeConfig = combine(arguments, (arg: FeatureParam) => arg.routeConfig);\n\n this.menuConfig = combine(arguments, (arg: FeatureParam) => arg.menuConfig);\n\n this.componentFillPlugins = this.registerComponentFillPlugins(combine(arguments,\n (arg: FeatureParam) => arg.componentFillPlugins));\n\n this.authWrapper = getFirst(arguments, (arg: FeatureParam) => arg.authWrapper)\n }\n\n /* tslint:disable:jsx-no-lambda */\n private renderRoutes = renderRoutes;\n\n /**\n * Get the routes\n */\n public getRoutes(searchPath?: any) {\n const configuredRoutes = this.getConfiguredRoutes(searchPath);\n const solidRoutes = this.route.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, { key: component.props.path }));\n return this.renderRoutes(configuredRoutes, solidRoutes);\n }\n\n /**\n * Get menus\n */\n public getMenus(sortByPriority = true) {\n const menus = this.getConfiguredMenus();\n return this.sortMenus(sortByPriority, menus);\n }\n\n /**\n * get configured routes.\n * Note: It overwrites the any duplicate key with latest loaded key.\n * TODO: Find a way to warn when there are duplicate keys.\n */\n public getConfiguredRoutes(searchPath = '/') {\n return getSortedRoutes(searchPath, Object.assign({}, ...this.routeConfig), this.authWrapper);\n }\n\n\n /**\n * get configured menus.\n * Note: It overwrites the any duplicate key with latest loaded key.\n * TODO: Find a way to warn when there are duplicate keys.\n */\n public getConfiguredMenus(searchPath = '/') {\n const routes = Object.assign({}, ...this.menuConfig);\n return getMenus(searchPath, { ...routes });\n }\n\n get navItems() {\n return this.navItem.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, {\n key: component.key ? component.key : idx + this.navItem.length,\n }),\n );\n }\n\n get navItemsRight() {\n return this.navItemsRight.map((component: React.ReactElement<any>, idx: number) =>\n React.cloneElement(component, {\n key: component.key ? component.key : idx + this.navItems.length,\n }),\n );\n }\n\n public getWrappedRoot(root: React.ReactNode, req?: any): React.ReactNode {\n let nestedRoot = root;\n for (const componentFactory of this.rootComponentFactory) {\n nestedRoot = React.cloneElement(componentFactory(req), {}, nestedRoot);\n }\n return nestedRoot;\n }\n\n public getDataRoot(root) {\n let nestedRoot = root;\n for (const component of this.dataRootComponent) {\n nestedRoot = React.createElement(component, {}, nestedRoot);\n }\n return nestedRoot;\n }\n\n public registerLanguages(monaco) {\n for (const func of this.languagesFuncs) {\n func(monaco);\n }\n }\n\n private registerComponentFillPlugins(plugins): void {\n plugins.forEach((i) => {\n const { name } = i;\n const isFound = !!getPlugin(name);\n if (!isFound) {\n registerPlugin(name, i);\n }\n });\n return plugins;\n }\n\n public getComponentFillPlugins() {\n return getPlugins();\n }\n\n\n private sortMenusByPriority = (menus) => {\n return sortBy(menus, (obj) => parseInt(obj.priority, 10));\n }\n\n private sortMenus = (sortByPriority, menus) => {\n if (sortByPriority) {\n const menuData = this.sortMenusByPriority(menus);\n return menuData.map(menu => {\n return {\n ...menu,\n children: menu.children && this.sortMenus(sortByPriority, menu.children),\n };\n });\n } else {\n return menus;\n }\n }\n\n}\n","export * from './connector';\n","export { ClientTypes } from '@common-stack/client-core';\nexport * from './connector';\nexport * from './router';\nexport * from './route';\nexport * from './utils';\nexport * from './interfaces';\nexport * from './plugin-area';\nexport * from './route-based-plugin-area';\nexport * from './slot-fill';","export * from './router';\nexport * from './extended-feature';\nexport * from './menu';\nexport * from './new-router';\n","import * as React from 'react';\nimport { deprecate } from 'util';\n\n/**\n * @deprecated Will be removed, don't use it. It is replaced by \n */\nexport interface IMenuData {\n [key: string]: {\n name: any;\n position?: IMenuPosition;\n icon?: any;\n authority?: any;\n exact?: boolean;\n strict?: boolean;\n [key: string]: any;\n };\n}\n\n\n/**\n * @deprecated Will be removed, don't use it. Replaced by IMenuDataItem\n */\nexport interface IMenuItem {\n path?: string;\n name: any;\n icon?: any;\n position: IMenuPosition;\n authority?: any;\n loading?: any;\n exact?: boolean;\n strict?: boolean;\n children?: IMenuItem[];\n priority?: number\n}\n\nexport interface IMenuDataItem {\n /**\n * @name submenu\n */\n children?: IMenuDataItem[];\n /**\n * @name Hide child nodes in the menu\n */\n hideChildrenInMenu?: boolean;\n /**\n * @name hideSelf and children in menu\n */\n hideInMenu?: boolean;\n /**\n * @name Icon of the menu\n */\n icon?: React.ReactNode;\n /**\n * @name Internationalization key for custom menus\n */\n locale?: string | false;\n /**\n * @name The name of the menu\n */\n name?: string;\n /**\n * @name is used to calibrate the selected value, default is path\n */\n key?: string;\n /**\n * @name disable menu option\n */\n disabled?: boolean;\n /**\n * @name path\n */\n path?: string;\n /**\n * @name custom parent node\n * @description When this node is selected, the node of parentKeys is also selected\n */\n parentKeys?: string[];\n /**\n * @name hides itself and elevates child nodes to its level\n */\n flatMenu?: boolean;\n\n /**\n * @name position of the Menu\n */\n position?: IMenuPosition;\n\n\n /**\n * @name permissions to determine whether to render menu or not\n */\n authority?: string[];\n\n /**\n * @name priority of the menu to display in the order. Lower values shows first. \n */\n priority?: number;\n\n [key: string]: any;\n}\n\nexport enum IMenuPosition {\n LOGO = 'LOGO',\n UPPER = 'UPPER',\n MIDDLE = 'MIDDLE',\n LOWER = 'LOWER',\n BOTTOM = 'BOTTOM',\n}\n","import * as React from 'react';\nimport { PluginArea } from './plugin-area';\n\nexport const BrowserPluginArea = () => {\n return <div style={{ display: \"none\" }}>\n <PluginArea />\n </div>\n}","\nimport { camelCase, upperFirst } from 'lodash';\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n * \n * @param mapComponentToEnhancedComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n * \n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent(\n mapComponentToEnhancedComponent,\n modifierName\n) {\n return ( OriginalComponent ) => {\n const EnhancedComponent = mapComponentToEnhancedComponent(\n OriginalComponent\n );\n const {\n displayName = OriginalComponent.name || 'Component',\n } = OriginalComponent;\n EnhancedComponent.displayName = `${ upperFirst(\n camelCase(modifierName)\n )}(${displayName})`;\n\n return EnhancedComponent;\n }\n}\n\n","export * from './plugin-area';\nexport * from './plugin-api';\nexport * from './browser-plugin-area'\n","import { ComponentElement } from 'react';\n\nimport { isFunction } from 'lodash';\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Defined behavior of a plugin type.\n *\n * @typedef ComponentExtension\n *\n *\n */\nexport interface WorbenchExtension {\n name: string;\n icon: string | ComponentElement<any, any> | Function;\n render: React.SFC | any;\n}\n\n/**\n * Plugin definitions keyed by plugin name.\n */\nconst plugins: { [key: string]: WorbenchExtension } = {};\n\n/**\n * Registeres a plugin to the App.\n *\n * @param name A string identifying the plugin. Must be unique across all registered plugins.\n * @param settings The settings for this plugin.\n */\nexport function registerPlugin(name, settings) {\n if (typeof settings !== 'object') {\n console.error('No settings object provided!');\n return null;\n }\n if (typeof name !== 'string') {\n console.error('Plugin names must be strings.');\n return null;\n }\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(\n 'Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: \"my-pluin\".',\n );\n return null;\n }\n if (plugins[name]) {\n console.error(`Plugin \"${name}\" is alread registered.`);\n }\n settings = applyFilters('plugins.registerPlugin', settings, name);\n\n if (!isFunction(settings.render)) {\n console.error(\n 'The \"render\" property must be specified and must be a valid function.',\n );\n return null;\n }\n plugins[name] = {\n name,\n icon: 'admin-plugins',\n ...settings,\n };\n\n doAction('plugins.pluginRegistered', settings, name);\n\n return settings;\n}\n\n/**\n * Unregisteres a plugin by name.\n * @param name Plugin name.\n *\n * @return The previous plugin settings object, if it has been successfully unregistered; otherwise `undefined`.\n */\nexport function unregisterPlugin(name) {\n if (!plugins[name]) {\n console.error('Plugin \"' + name + '\" is not registered.');\n return;\n }\n const oldPlugin = plugins[name];\n delete plugins[name];\n\n doAction('plugin.pluginUnregistered', oldPlugin, name);\n\n return oldPlugin;\n}\n\n/**\n * Returns a registered plugin settings.\n *\n * @param name Plugin name.\n *\n * @returns Plugin setting.\n */\nexport function getPlugin(name) {\n return plugins[name];\n}\n\n/**\n * Return all registered plugins.\n *\n * @return Plugin settings.\n */\nexport function getPlugins() {\n return Object.values(plugins);\n}\n","import { map } from 'lodash';\nimport * as React from 'react';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { PluginContextProvider } from './plugin-context';\nimport { getPlugins } from './plugin-api';\n\n/**\n * A component that renders all plugin fills in a hidden div.\n */\n\nexport class PluginArea extends React.Component<{}, { plugins: { [key: string]: any } }> {\n\n constructor(args) {\n super(args);\n this.setPlugins = this.setPlugins.bind(this);\n this.state = { plugins: [] };\n }\n\n public getCurrentPluginsState() {\n return {\n plugins: map(getPlugins(), ({ icon, name, render }) => {\n return {\n Plugin: render,\n context: {\n name,\n icon,\n },\n };\n }),\n };\n }\n\n public componentDidMount() {\n addAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n this.setPlugins,\n );\n addAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n this.setPlugins,\n );\n this.setPlugins();\n }\n\n public componentWillUnMount() {\n removeAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n );\n removeAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n );\n }\n\n public setPlugins() {\n this.setState(this.getCurrentPluginsState);\n }\n\n public render() {\n return (\n <>\n {map(this.state.plugins, ({ context, Plugin }) => (\n <PluginContextProvider\n key={context.name}\n value={context}\n >\n <Plugin />\n </PluginContextProvider>\n ))}\n </>\n );\n }\n}\n","\nimport * as React from 'react';\nimport { createHigherOrderComponent } from './higher-order-component-util';\n\nconst { createContext } = React;\nconst { Consumer, Provider } = createContext({\n name: null,\n icon: null,\n});\n\nexport { Provider as PluginContextProvider };\n\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change, expected to return object of\n * props to merge with the component's own props.\n *\n * @return Enhanced component with injected context as props.\n */\nexport const withPluginContext = (mapContextToProps) =>\n createHigherOrderComponent((OriginalComponent) => {\n return (props) => (\n <Consumer>\n {(context) => (\n <OriginalComponent\n {...props}\n {...mapContextToProps(context, props)}\n />\n )}\n </Consumer>\n );\n }, 'withPluginContext');\n","\nimport { camelCase, upperFirst } from 'lodash';\n\n/**\n * Given a function mapping a component to an enhanced component and modifier\n * name, returns the enhanced component augmented with a generated displayName.\n * \n * @param mapComponentToEnhancedComponent Function mapping component to enhanced component.\n * @param modifierName Seed name from which to generated display name.\n * \n * @return Component class with generated display name assigned.\n */\nexport function createHigherOrderComponent(\n mapComponentToEnhancedComponent,\n modifierName\n) {\n return ( OriginalComponent ) => {\n const EnhancedComponent = mapComponentToEnhancedComponent(\n OriginalComponent\n );\n const {\n displayName = OriginalComponent.name || 'Component',\n } = OriginalComponent;\n EnhancedComponent.displayName = `${ upperFirst(\n camelCase(modifierName)\n )}(${displayName})`;\n\n return EnhancedComponent;\n }\n}\n\n","export * from './route-based-plugin-area';\nexport * from './plugin-api';\n","import { ComponentElement } from 'react';\n\nimport { isFunction } from 'lodash';\nimport { applyFilters, doAction } from '@wordpress/hooks';\n\n/**\n * Defined behavior of a plugin type.\n *\n * @typedef ComponentExtension\n *\n *\n */\n\ninterface WorbenchExtension {\n name: string;\n icon: string | ComponentElement<any, any> | Function;\n render: React.SFC | any;\n}\n\n/**\n * Plugin definitions keyed by plugin name.\n */\nconst plugins: { [key: string]: WorbenchExtension } = {};\n\n/**\n * Registeres a plugin to the App.\n *\n * @param name A string identifying the plugin. Must be unique across all registered plugins.\n * @param settings The settings for this plugin.\n */\nexport function registerRouteBasePlugin(name, settings) {\n if (typeof settings !== 'object') {\n console.error('No settings object provided!');\n return null;\n }\n if (typeof name !== 'string') {\n console.error('Plugin names must be strings.');\n return null;\n }\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(\n 'Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: \"my-pluin\".',\n );\n return null;\n }\n if (plugins[name]) {\n console.error(`Plugin \"${name}\" is alread registered.`);\n }\n settings = applyFilters('plugins.registerPlugin', settings, name);\n\n if (!isFunction(settings.render)) {\n console.error(\n 'The \"render\" property must be specified and must be a valid function.',\n );\n return null;\n }\n plugins[name] = {\n name,\n icon: 'admin-plugins',\n ...settings,\n };\n\n doAction('plugins.pluginRegistered', settings, name);\n\n return settings;\n}\n\n/**\n * Unregisteres a plugin by name.\n * @param name Plugin name.\n *\n * @return The previous plugin settings object, if it has been successfully unregistered; otherwise `undefined`.\n */\nexport function unregisterRouteBasePlugin(name) {\n if (!plugins[name]) {\n console.error('Plugin \"' + name + '\" is not registered.');\n return;\n }\n const oldPlugin = plugins[name];\n delete plugins[name];\n\n doAction('plugin.pluginUnregistered', oldPlugin, name);\n\n return oldPlugin;\n}\n\n/**\n * Returns a registered plugin settings.\n *\n * @param name Plugin name.\n *\n * @returns Plugin setting.\n */\nexport function getRouteBasePlugin(name) {\n return plugins[name];\n}\n\n/**\n * Return all registered plugins.\n *\n * @return Plugin settings.\n */\nexport function getRouteBasePlugins() {\n return Object.values(plugins);\n}\n","\nimport * as React from 'react';\nimport { createHigherOrderComponent } from './higher-order-component-util';\n\nconst { createContext } = React;\nconst { Consumer, Provider } = createContext({\n name: null,\n icon: null,\n});\n\nexport { Provider as PluginContextProvider };\n\n\n/**\n * A Higher Order Component used to inject Plugin context to the\n * wrapped component.\n *\n * @param mapContextToProps Function called on every context change, expected to return object of\n * props to merge with the component's own props.\n *\n * @return Enhanced component with injected context as props.\n */\nexport const withPluginContext = (mapContextToProps) =>\n createHigherOrderComponent((OriginalComponent) => {\n return (props) => (\n <Consumer>\n {(context) => (\n <OriginalComponent\n {...props}\n {...mapContextToProps(context, props)}\n />\n )}\n </Consumer>\n );\n }, 'withPluginContext');\n","import { map } from 'lodash';\nimport * as React from 'react';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { PluginContextProvider } from './plugin-context';\nimport { getRouteBasePlugins } from './plugin-api';\n\n/**\n * A component that renders all plugin fills in a hidden div.\n */\n\nexport class RouteBasedPluginArea extends React.Component<{}, { plugins: { [key: string]: any}}> {\n\n constructor(args) {\n super(args);\n this.setPlugins = this.setPlugins.bind(this);\n this.state = {plugins: []};\n }\n\n public getCurrentPluginsState() {\n return {\n plugins: map(getRouteBasePlugins(), ({ icon, name, render }) => {\n return {\n Plugin: render,\n context: {\n name,\n icon,\n },\n };\n }),\n };\n }\n\n public componentDidMount() {\n addAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n this.setPlugins,\n );\n addAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n this.setPlugins,\n );\n this.setPlugins();\n }\n\n public componentWillUnMount() {\n removeAction(\n 'plugins.pluginRegistered',\n 'core/plugins/plugin-area/plugins-registered',\n );\n removeAction(\n 'plugins.pluginUnregistered',\n 'core/plugins/plugin-area/plugins-unregistered',\n );\n }\n\n public setPlugins() {\n this.setState(this.getCurrentPluginsState);\n }\n\n public render() {\n return (\n <div style={{ display: 'none' }}>\n {map(this.state.plugins, ({ context, Plugin }) => (\n <PluginContextProvider\n key={context.name}\n value={context}\n >\n <Plugin />\n </PluginContextProvider>\n ))}\n </div>\n );\n }\n}\n","export * from './render-routes';\n","import * as React from 'react';\nimport { useEffect, useState, createElement } from 'react';\n// import { Plugin, ApplyPluginsType } from '@umijs/runtime';\nimport { IRoute, IComponent } from '../interfaces/new-router';\nimport { Switch, Route, Redirect } from 'react-router';\n\ninterface IOpts {\n routes: IRoute[];\n plugin?: Plugin;\n extraProps?: object;\n pageInitialProps?: object;\n getInitialPropsCtx?: object;\n isServer?: boolean;\n ssrProps?: object;\n rootRoutes?: IRoute[];\n auth?: boolean,\n authWrapper?: () => void;\n}\n\ninterface IGetRouteElementOpts {\n route: IRoute;\n index: number;\n opts: IOpts;\n}\n\nfunction wrapInitialPropsFetch(route: IRoute, opts: IOpts): IComponent {\n const { component, ...restRouteParams } = route;\n let Component: any = route!.component;\n function ComponentWithInitialPropsFetch(props: any) {\n const [initialProps, setInitialProps] = useState(\n () => (window as any).g_initialProps,\n );\n\n useEffect(() => {\n /**\n * 1. 首次渲染时,此时 window.g_initialProps 变量存在,不需要再走一次 getInitialProps,这样一次 SSR 就走了 2 次 getInitialProps\n * 2. 但是路由切换时,window.getInitialProps 会被赋为 null,这时候就走 getInitialProps 逻辑\n * 3. 如果任何时候都走 2 次,配置 forceInitial: true,这个场景用于静态站点的首屏加载希望走最新数据\n * 4. 开启动态加载后,会在执行 getInitialProps 前预加载下\n */\n const handleGetInitialProps = async () => {\n // preload when enalbe dynamicImport\n if (Component.preload) {\n const preloadComponent = await Component.preload();\n // for test case, really use .default\n Component = preloadComponent.default || preloadComponent;\n }\n\n //@sri not suppported\n // const defaultCtx = {\n // isServer: false,\n // match: props?.match,\n // route,\n // ...(opts.getInitialPropsCtx || {}),\n // ...restRouteParams,\n // };\n //@sri not suppported\n // if (Component?.getInitialProps) {\n // const ctx = await opts.plugin.applyPlugins({\n // key: 'ssr.modifyGetInitialPropsCtx',\n // type: ApplyPluginsType.modify,\n // initialValue: defaultCtx,\n // async: true,\n // });\n\n // const initialProps = await Component!.getInitialProps!(\n // ctx || defaultCtx,\n // );\n // setInitialProps(initialProps);\n // }\n };\n // null 时,一定会触发 getInitialProps 执行\n if (!(window as any).g_initialProps) {\n handleGetInitialProps();\n }\n }, [window.location.pathname, window.location.search]);\n return <Component {...props} {...initialProps} />;\n }\n // flag for having wrappered\n ComponentWithInitialPropsFetch.wrapInitialPropsLoaded = true;\n ComponentWithInitialPropsFetch.displayName = 'ComponentWithInitialPropsFetch';\n return ComponentWithInitialPropsFetch;\n}\n\nfunction render({\n route,\n opts,\n props,\n}: {\n route: IRoute;\n opts: IOpts;\n props: object;\n}) {\n const routes = renderRoutes({\n ...opts,\n routes: route.routes || [],\n rootRoutes: opts.rootRoutes,\n });\n let { component: Component, wrappers } = route;\n if (Component) {\n const defaultPageInitialProps = opts.isServer\n ? {}\n : (window as any).g_initialProps;\n const newProps = {\n ...props,\n ...opts.extraProps,\n ...(opts.pageInitialProps || defaultPageInitialProps),\n route,\n routes: opts.rootRoutes,\n };\n // @ts-ignore\n let ret = <Component {...newProps}>{routes}</Component>;\n\n // route.wrappers\n if (wrappers) {\n let len = wrappers.length - 1;\n while (len >= 0) {\n ret = createElement(wrappers[len], newProps, ret);\n len -= 1;\n }\n }\n\n return ret;\n } else {\n return routes;\n }\n}\n\nfunction getRouteElement({ route, index, opts }: IGetRouteElementOpts) {\n const routeProps = {\n key: route.key || index,\n exact: route.exact,\n strict: route.strict,\n sensitive: route.sensitive,\n path: route.path,\n };\n if (route.redirect) {\n return <Redirect {...routeProps} from={route.path} to={route.redirect} />;\n } else {\n // avoid mount and unmount with url hash change\n // @sri not supproted yet\n // if (\n // // only when SSR config enable\n // opts.ssrProps &&\n // !opts.isServer &&\n // // make sure loaded once\n // !(route.component as any)?.wrapInitialPropsLoaded &&\n // (route.component?.getInitialProps || route.component?.preload)\n // ) {\n // // client Render for enable ssr, but not sure SSR success\n // route.component = wrapInitialPropsFetch(route, opts);\n // }\n return (\n <Route\n {...routeProps}\n render={(props: object) => {\n return render({ route, opts, props });\n }}\n />\n );\n }\n}\n\nfunction renderRoutes(opts: IOpts) {\n return opts.routes ? (\n <Switch>\n {opts.routes.map((route, index) => {\n\n const renderedR = getRouteElement({\n route,\n index,\n opts: {\n ...opts,\n rootRoutes: opts.rootRoutes || opts.routes,\n },\n });\n return renderedR;\n }\n\n )}\n </Switch>\n ) : null;\n}\n\nexport { renderRoutes as renderRoutes2 }\n","export * from './router';\n","import * as React from 'react';\nimport { Switch } from 'react-router-dom';\nimport { Feature } from '../connector';\nimport {IReactFeature} from '../interfaces';\n\nconst routerFactory = (routes) => <Switch>{routes}</Switch>;\n\nexport const FeatureWithRouterFactory = new Feature({\n routerFactory,\n} as IReactFeature);\n","import * as React from 'react';\nimport { sortBy, forEach, without } from 'lodash';\n\nexport interface IFillProps {\n name: Name;\n [key: string]: any;\n}\nexport interface IFill extends React.Component<IFillProps> {\n occurrence: number;\n children: React.ReactNode;\n}\nexport type Name = string | Symbol;\n\nexport interface ISlotProps {\n /**\n * The name of the component. Use a symbol if you want to be 100% sure the Slot\n * will only be filled by a component you create\n */\n name: Name;\n /**\n * Props to be applied to the child Element of every fill which has the same name.\n *\n * If the value is a function, it must have the following signature:\n * (target: Fill, fills: Fill[]) => void;\n *\n * This allows you to access props on the fill which invoked the function\n * by using target.props.something()\n */\n fillProps?: { [key: string]: any };\n /**\n * A an optional function which gets all of the current fills for this slot\n * Allows sorting, or filtering before rendering. An example use-case could\n * be to only show a limited amount of fills.\n *\n * By default Slot injects an unstyled `<div>` element. If you want greater\n * control over presentation use this function.\n *\n * @example\n * <Slot name=\"My.Slot\">\n * {(items) => <Component>{items}</Component>}\n * </Slot>\n */\n children?: (fills: IFill[]) => JSX.Element;\n bubblesVirtually?: boolean;\n /**\n * `Slot` with `bubblesVirtually` set to true also accept an optional `className` to\n * add to the slot container.\n *\n * @type {string}\n * @memberof ISlotProps\n */\n className?: string;\n}\nexport interface ISlot extends React.Component<ISlotProps> {\n node: Element;\n}\n\nexport interface IContext extends IProviderState {}\nconst SlotFillContext = React.createContext<IContext | null>({ // need to add default value otherwise it will fail\n registerSlot: () => {},\n unregisterSlot: () => {},\n registerFill: () => {},\n unregisterFill: () => {},\n getSlot: () => ({}) as any,\n getFills: () => ([]),\n subscribe: () => {},\n});\nconst { Provider, Consumer } = SlotFillContext;\nexport interface IProviderState {\n registerFill: (a: Name, b: any) => void;\n unregisterFill: (a: Name, b: any) => void;\n unregisterSlot: (a: Name, b?: any) => void;\n registerSlot: (a: Name, b?: any) => void;\n getSlot: (a: Name) => ISlot;\n getFills: (a: Name, b?: any) => IFill[] | [];\n subscribe: (listener: any) => void;\n}\n\nclass SlotFillProvider extends React.Component<{}, {}> {\n private slots: { [key: string]: ISlot };\n private fills: { [key: string]: IFill[] };\n private listeners;\n private contextValue: IProviderState;\n constructor(props) {\n super(props);\n\n this.registerSlot = this.registerSlot.bind(this);\n this.registerFill = this.registerFill.bind(this);\n this.unregisterSlot = this.unregisterSlot.bind(this);\n this.unregisterFill = this.unregisterFill.bind(this);\n this.getSlot = this.getSlot.bind(this);\n this.getFills = this.getFills.bind(this);\n this.subscribe = this.subscribe.bind(this);\n\n this.slots = {};\n this.fills = {};\n this.listeners = [];\n this.contextValue = {\n registerSlot: this.registerSlot,\n unregisterSlot: this.unregisterSlot,\n registerFill: this.registerFill,\n unregisterFill: this.unregisterFill,\n getSlot: this.getSlot,\n getFills: this.getFills,\n subscribe: this.subscribe,\n };\n }\n\n public registerSlot(name, slot) {\n const previousSlot = this.slots[name];\n this.slots[name] = slot;\n this.triggerListeners();\n\n // Sometimes the fills are registered after the initial render of slot\n // But before the registerSlot call, we need to rerender the slot\n this.forceUpdateSlot(name);\n\n // If a new instance of a slot is being mounted while another with the\n // same name exists, force its update _after_ the new slot has been\n // assigned into the instance, suich that its own rendering of children\n // will be empty (the new Slot will subsume all fills for this name).\n if (previousSlot) {\n previousSlot.forceUpdate();\n }\n }\n\n public registerFill(name, instance) {\n this.fills[name] = [...(this.fills[name] || []), instance];\n this.forceUpdateSlot(name);\n }\n\n public unregisterSlot(name, instance) {\n // If a previous instance of a Slot by this name unmounts, do nothing,\n // as the slot and its fills should only be removed for the current\n // known instance.\n if (this.slots[name] !== instance) {\n return;\n }\n delete this.slots[name];\n this.triggerListeners();\n }\n\n public unregisterFill(name, instance: IFill) {\n this.fills[name] = without(this.fills[name], instance);\n this.resetFillOccurrence(name);\n this.forceUpdateSlot(name);\n }\n\n public getSlot(name) {\n return this.slots[name];\n }\n\n public getFills(name, slotInstance) {\n // Commented following as we need the Slot to render at multiple places\n // Fills should only be returned for the current instance of the slot\n // in which they occupy.\n // if (this.slots[name] !== slotInstance) {\n // return [];\n // }\n return sortBy(this.fills[name], 'occurrence');\n }\n\n private resetFillOccurrence(name) {\n forEach(this.fills[name], instance => {\n instance.occurrence = undefined;\n });\n }\n\n private forceUpdateSlot(name) {\n const slot = this.getSlot(name);\n\n if (slot) {\n slot.forceUpdate();\n }\n }\n\n private triggerListeners() {\n this.listeners.forEach((listener) => listener());\n }\n\n public subscribe(listener) {\n this.listeners.push(listener);\n\n return () => {\n this.listeners = without(this.listeners, listener);\n };\n }\n\n public render() {\n return <Provider value={this.contextValue}>{this.props.children}</Provider>;\n }\n}\n\n/**\n * React hook returning the active slot given a name.\n *\n * @param {string} name Slot name.\n * @return {Object} Slot object.\n */\nexport const useSlot = ( name ) => {\n const { getSlot, subscribe } = React.useContext(SlotFillContext);\n const [ slot, setSlot ] = React.useState(getSlot(name));\n\n React.useEffect(() => {\n setSlot(getSlot(name));\n const unsubscribe = subscribe(() => {\n setSlot(getSlot(name));\n });\n return unsubscribe;\n }, [name]);\n return slot;\n};\n\n\nexport default SlotFillProvider;\nexport { Consumer };\n","import * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Consumer, ISlot, IFillProps, Name, IContext, useSlot } from './context';\nimport { isFunction } from 'lodash';\nexport namespace IFillComponent {\n export interface Props extends IFillProps, Partial<IContext> {}\n}\n\nlet occurrences = 0;\n\nconst FillComponent: React.SFC<IFillComponent.Props> = ({\n name,\n children,\n registerFill,\n unregisterFill,\n}) => {\n const slot = useSlot(name);\n\n const ref = React.useRef({\n name,\n children,\n occurrence: 0,\n });\n\n if (!ref.current.occurrence) {\n ref.current.occurrence = ++occurrences;\n }\n\n React.useLayoutEffect(() => {\n registerFill(name, ref.current);\n return () => unregisterFill(name, ref.current);\n }, []);\n\n React.useLayoutEffect(() => {\n ref.current.children = children;\n if (slot && !slot.props.bubblesVirtually) {\n slot.forceUpdate();\n }\n }, [children]);\n\n React.useLayoutEffect(() => {\n if (name === ref.current.name) {\n // ignore initial effect\n return;\n }\n unregisterFill(ref.current.name, ref.current);\n ref.current.name = name;\n registerFill(name, ref.current);\n }, [name]);\n\n if (!slot || !slot.node || !slot.props.bubblesVirtually) {\n return null;\n }\n\n // If a function is passed as a child, provide it with the fillProps.\n if (isFunction(children)) {\n children = children(slot.props.fillProps);\n }\n\n return createPortal(children, slot.node);\n};\n\n\ntype IFillComponentProps<T = IFillProps> = T;\n\n// instead of inline with component assignment\ntype IFillComponent<T = IFillProps> = React.FC<IFillComponentProps<T>>;\n\n\nconst Fill: IFillComponent = props => {\n return (\n <Consumer>\n {({ registerFill, unregisterFill }) => (\n <FillComponent\n {...props}\n registerFill={registerFill}\n unregisterFill={unregisterFill}\n />\n )}\n </Consumer>\n );\n};\n\nexport { Fill };\n","import { Slot } from './slot';\nimport { Fill } from './fill';\nimport SlotFillProvider from './context';\n\nexport { Slot, Fill, SlotFillProvider };\n\n","import { isFunction, isString, map, negate } from 'lodash';\nimport * as React from 'react';\nimport { Consumer, ISlotProps, IContext } from './context';\nimport { isEmptyElement } from './utils';\n\nexport namespace ISlotComponent {\n export interface Props extends Partial<IContext>, ISlotProps { }\n}\n\nclass SlotComponent extends React.Component<ISlotComponent.Props, {}> {\n private node: Element;\n constructor(props: ISlotComponent.Props) {\n super(props);\n this.bindNode = this.bindNode.bind(this);\n }\n\n public componentDidMount() {\n const { registerSlot } = this.props;\n registerSlot(this.props.name, this);\n }\n\n public componentWillUnmount() {\n const { unregisterSlot } = this.props;\n unregisterSlot(this.props.name, this);\n }\n\n public componentDidUpdate(prevProps) {\n const { name, unregisterSlot, registerSlot } = this.props;\n\n // Commented following as we need the Slot to render at multiple places\n // if (prevProps.name !== name) {\n // unregisterSlot(prevProps.name);\n // registerSlot(name, this);\n // }\n }\n\n public bindNode(node: Element) {\n this.node = node;\n }\n\n public render() {\n const {\n children,\n name,\n bubblesVirtually = false,\n fillProps = {},\n getFills,\n className,\n } = this.props;\n\n if (bubblesVirtually) {\n return <div ref={this.bindNode} className={className} />;\n }\n\n const fills = map(getFills(name, this), fill => {\n const fillKey = fill.occurrence;\n const fillChildren: React.ReactElement = isFunction(fill.children)\n ? fill.children(fillProps)\n : fill.children;\n\n return React.Children.map(fillChildren, (child, childIndex) => {\n if (!child || isString(child)) {\n return child;\n }\n\n const childKey = `${fillKey}---${child.key || childIndex}`;\n return React.cloneElement(child, { key: childKey });\n });\n }).filter(\n // In some cases fills are rendered only when some conditions apply.\n // This ensures that we only use non-empty fills when rendering, i.e.,\n // it allows us to render wrappers only when the fills are actually present.\n negate(isEmptyElement),\n );\n\n return <>{isFunction(children) ? children(fills as any) : fills}</>;\n }\n}\n\nconst Slot: React.SFC<ISlotProps> = props => {\n return (\n <Consumer>\n {({ registerSlot, unregisterSlot, getFills }) => (\n <SlotComponent\n {...props}\n getFills={getFills}\n registerSlot={registerSlot}\n unregisterSlot={unregisterSlot}\n />\n )}\n </Consumer>\n );\n};\n\nexport { Slot };\n","export * from './isEmptyElement';","import * as React from 'react';\n\nimport { isArray, isNumber, isString } from 'lodash';\n\n/**\n * Checks if the provided element to check.\n *\n * @param element React Component to check.\n * @returns True when an element is considered empty.\n */\n\nexport const isEmptyElement = (element: React.ComponentElement<any, any> | any) => {\n if (isNumber(element)) {\n return false;\n }\n\n if (isString(element) || isArray(element)) {\n return !element.length;\n }\n\n return !element;\n};","export * from './route-utils';\n","import * as React from 'react';\nimport { IRouteData, IMappedData, IMenuData, IMenuItem, IMenuPosition } from '../interfaces';\nimport { RouteProps, Switch } from 'react-router';\nimport { Route } from 'react-router-dom';\nconst defaultSortKeys = require('sort-keys');\n\n\n/* eslint no-useless-escape:0 */\nconst reg = /(((^https?:(?:\\/\\/)?)(?:[-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\\+\\$,\\w]+@)[A-Za-z0-9.-]+)((?:\\/[\\+~%\\/.\\w-_]*)?\\??(?:[-\\+=&;%@.\\w_]*)#?(?:[\\w]*))?)$/g;\n\nexport function isUrl(path) {\n return reg.test(path);\n}\n/**\n * Generates Routes based on the key value, where key has the path of the route and value\n * has rest of the values for building a `<Router ../>` component.\n *\n * @param path: RegExp\n * @param routerData\n * @deprecated\n */\nexport function getRoutes2(path: RegExp, routerData: IRouteData) {\n const routes = Object.keys(routerData).filter(routePath => {\n return routePath.match(path);\n });\n const mappedRoutes: Array<IMappedData> = routes.map(paths => {\n return {\n route: paths,\n ...routerData[paths],\n };\n });\n const root: RouteProps & { routes?: any } = {\n };\n mappedRoutes.forEach(eachRoute => {\n const children = eachRoute.route.split('/');\n children.shift();\n\n // if the route is `/` then add this correction.\n if (eachRoute.route === '/') {\n children.shift();\n children.push('/');\n }\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i <= depth; i++) {\n const lastIndex = (lastNode.routes || []).findIndex(item => {\n if (eachRoute.route.startsWith(item.path)) {\n return eachRoute.route[item.path.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.routes[lastIndex];\n // do not overwrite the route's exact value\n lastNode.exact = routerData[lastNode.path as string].hasOwnProperty('exact') ? routerData[lastNode.path as string].exact : false;\n }\n if (!lastNode.routes) {\n lastNode.routes = [];\n }\n const modfiedRoute = formatSlash(eachRoute.route);\n lastNode.routes.push({\n ...eachRoute,\n // route: modfiedRoute,\n path: modfiedRoute,\n exact: routerData[eachRoute.route].hasOwnProperty('exact') ? routerData[eachRoute.route].exact : true,\n component: eachRoute.component,\n });\n });\n\n return root.routes;\n}\n\nconst startWithMoreThanOneSlash = /^(\\/)\\1+/; // for exame `//abc, ///abc, ...`\nconst formatSlash = (route) => {\n // replaced `//` with `/` in the routes.\n return {\n path: route.replace(startWithMoreThanOneSlash, '/'),\n _pathPrefix: (route.match(/^\\/(\\/{1,})/) || ['', ''])[1],\n }\n}\n\nexport function getRoutes(path: string, routeData: IRouteData, authWrapper: (ele, props) => void = null) {\n if (!path.startsWith('/')) {\n throw new Error('Invalid path!');\n }\n let searchPath = path;\n if (path[path.length - 1] !== '/') {\n searchPath = path + '/';\n }\n const routes = Object.keys(routeData).filter(menuPath => {\n return menuPath.indexOf(searchPath) === 0 || menuPath === path;\n });\n\n const mappedMenuPaths: Array<IMappedData> = routes.map(mPath => {\n return {\n route: mPath,\n position: IMenuPosition.MIDDLE,\n ...routeData[mPath],\n };\n });\n const root: RouteProps & { routes?: any } = {\n // just to satisfy types added following\n // TOOD need to correct types so we don't have to enter them.\n name: 'root',\n position: IMenuPosition.LOGO,\n } as any;\n mappedMenuPaths.forEach(routeItem => {\n const children = routeItem.route.split('/');\n children.shift();\n\n // if the route is `/` then add this correction.\n if (routeItem.path === '/') {\n children.shift();\n children.push('/');\n }\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i < depth; i++) {\n const lastIndex = (lastNode.routes || []).findIndex(item => {\n const routePath = `${item._pathPrefix}${item.path}`;\n\n if (routeItem.route.startsWith(routePath)) {\n return routeItem.route[routePath.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.routes[lastIndex];\n const lastNodePath = `${(lastNode as any)._pathPrefix}${lastNode.path}`;\n lastNode.exact = routeData[lastNodePath].hasOwnProperty('exact') ? routeData[lastNodePath].exact : false;\n }\n if (!lastNode.routes) {\n lastNode.routes = [];\n }\n const { route: ignore, auth, ...rest } = routeItem;\n const pathParams = formatSlash(routeItem.route);\n\n lastNode.routes.push({\n ...rest,\n // path: formatSlash(routeItem.route),\n // path: routeItem.route,\n ...pathParams,\n exact: routeData[routeItem.route].hasOwnProperty('exact') ? routeData[routeItem.route].exact : true,\n /**\n * Here we are checking whether auth property is being \n * set by this route and if authWrapper is declared\n * which is a high order component that can take a component\n * and its props as argument then perform some \n * computation and return a component\n */\n component: auth && authWrapper\n ? (props) => authWrapper(routeItem.component, props)\n : routeItem.component\n });\n });\n\n return root.routes;\n}\n\nexport function getMenus(path: string, menuData: IMenuData) {\n if (!path.startsWith('/')) {\n throw new Error('Invalid path!');\n }\n let searchPath = path;\n if (path[path.length - 1] !== '/') {\n searchPath = path + '/';\n }\n const routes = Object.keys(menuData).filter(menuPath => {\n return menuPath.indexOf(searchPath) === 0 || menuPath === path;\n });\n\n const mappedMenuPaths: Array<IMenuItem & { route?: string }> = routes.map(mPath => {\n return {\n route: mPath,\n position: IMenuPosition.MIDDLE,\n ...menuData[mPath],\n };\n });\n const root: IMenuItem & { route?: string } = {\n // just to satisfy types added following\n // TOOD need to correct types so we don't have to enter them.\n name: 'root',\n position: IMenuPosition.LOGO,\n };\n mappedMenuPaths.forEach(menutItem => {\n const children = menutItem.route.split('/');\n children.shift();\n const depth = children.length;\n let lastNode = root;\n for (let i = 0; i < depth; i++) {\n const lastIndex = (lastNode.children || []).findIndex(item => {\n if (menutItem.route.startsWith(item.path)) {\n return menutItem.route[item.path.length] === '/';\n }\n });\n if (lastIndex === -1) {\n break;\n }\n lastNode = lastNode.children[lastIndex];\n // do not overwrite the route's exact value\n lastNode.exact = menuData[lastNode.path].hasOwnProperty('exact') ? menuData[lastNode.path].exact : false;\n }\n if (!lastNode.children) {\n lastNode.children = [];\n }\n const { route: ignore, ...rest } = menutItem;\n lastNode.children.push({\n path: menutItem.route,\n ...rest,\n exact: menuData[menutItem.route].hasOwnProperty('exact') ? menuData[menutItem.route].exact : true,\n });\n });\n\n return root.children;\n}\n\n\nexport const renderRoutes = (routes, solidRoutes, extraProps = {}, switchProps = {}) =>\n routes ? (\n <>\n {[\n ...solidRoutes, ...routes.map((route, i) => (\n <Route\n key={route.key || i}\n path={route.path}\n exact={route.exact}\n strict={route.strict}\n render={props =>\n route.render ? (\n route.render({ ...props, ...extraProps, route: route })\n ) : (\n <route.component {...props} {...extraProps} route={route} />\n )\n }\n />\n )),\n ]}\n </>\n ) : null;\n\nexport function sortKeys(routeData) {\n return defaultSortKeys(routeData, { compare})\n}\n\nexport const getSortedRoutes = (path: string, routeData: IRouteData, authWrapper: (\n ele: React.ReactElement,\n props: Record<string, any>\n) => void = null) => {\n const sortedRoutes = sortKeys(routeData);\n return getRoutes(path, sortedRoutes, authWrapper);\n};\n\nconst compare = ((a, b) => {\n const aStr = String(a).toLowerCase();\n const bStr = String(b).toLowerCase();\n // Alphanumeric elements always come before non-alphanumeric elements\n const aIsAlphanumeric = notStartWithColon(aStr);\n const bIsAlphanumeric = notStartWithColon(bStr);\n if (aIsAlphanumeric + bIsAlphanumeric !== -2) {\n if (aIsAlphanumeric * bIsAlphanumeric > 0) {\n if (aIsAlphanumeric === bIsAlphanumeric) {\n return aStr.localeCompare(bStr);\n }\n return aIsAlphanumeric - bIsAlphanumeric;\n }\n if (aIsAlphanumeric > 0) {\n return -1;\n } else if (bIsAlphanumeric > 0) {\n return 1;\n }\n }\n\n // Numerical elements always come before alphabetic elements\n const aNum = Number(a);\n const bNum = Number(b);\n // If both are numerical, sort in the usual fashion (smaller goes first)\n if (aNum && bNum) {\n return aNum - bNum;\n // If a is numerical but b isn't, put a first.\n } else if (aNum) {\n return -1;\n // If b is numerical but a isn't, put b first.\n } else if (bNum) {\n return 1;\n }\n\n // In all other cases, default to usual sort order.\n return aStr.localeCompare(bStr);\n});\n\n\nfunction notStartWithColon(str) {\n const match = (str.match(/^[\\/, *, :]{1,}/) || [-1])[0];\n if (match === -1) {\n return -1;\n }\n var i = match.length;\n let count = 0;\n while (i--) {\n const char = match[i];\n if (char === '/') {\n if(str === '/') { // if it is root only we put at the last\n count = count + 6;\n } else {\n count = count + 3;\n }\n } else if (char === ':') {\n count = count + 1;\n } else if (char === '*') {\n count = count + 2;\n }\n }\n return count;\n}","module.exports = require(\"@common-stack/client-core\");","module.exports = require(\"@wordpress/hooks\");","module.exports = require(\"lodash\");","module.exports = require(\"react\");","module.exports = require(\"react-dom\");","module.exports = require(\"react-router\");","module.exports = require(\"react-router-dom\");","module.exports = require(\"sort-keys\");"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const BrowserPluginArea: () => JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export * from './plugin-area';
2
2
  export * from './plugin-api';
3
+ export * from './browser-plugin-area';
@@ -0,0 +1,94 @@
1
+ import * as React from 'react';
2
+ export interface IFillProps {
3
+ name: Name;
4
+ [key: string]: any;
5
+ }
6
+ export interface IFill extends React.Component<IFillProps> {
7
+ occurrence: number;
8
+ children: React.ReactNode;
9
+ }
10
+ export declare type Name = string | Symbol;
11
+ export interface ISlotProps {
12
+ /**
13
+ * The name of the component. Use a symbol if you want to be 100% sure the Slot
14
+ * will only be filled by a component you create
15
+ */
16
+ name: Name;
17
+ /**
18
+ * Props to be applied to the child Element of every fill which has the same name.
19
+ *
20
+ * If the value is a function, it must have the following signature:
21
+ * (target: Fill, fills: Fill[]) => void;
22
+ *
23
+ * This allows you to access props on the fill which invoked the function
24
+ * by using target.props.something()
25
+ */
26
+ fillProps?: {
27
+ [key: string]: any;
28
+ };
29
+ /**
30
+ * A an optional function which gets all of the current fills for this slot
31
+ * Allows sorting, or filtering before rendering. An example use-case could
32
+ * be to only show a limited amount of fills.
33
+ *
34
+ * By default Slot injects an unstyled `<div>` element. If you want greater
35
+ * control over presentation use this function.
36
+ *
37
+ * @example
38
+ * <Slot name="My.Slot">
39
+ * {(items) => <Component>{items}</Component>}
40
+ * </Slot>
41
+ */
42
+ children?: (fills: IFill[]) => JSX.Element;
43
+ bubblesVirtually?: boolean;
44
+ /**
45
+ * `Slot` with `bubblesVirtually` set to true also accept an optional `className` to
46
+ * add to the slot container.
47
+ *
48
+ * @type {string}
49
+ * @memberof ISlotProps
50
+ */
51
+ className?: string;
52
+ }
53
+ export interface ISlot extends React.Component<ISlotProps> {
54
+ node: Element;
55
+ }
56
+ export interface IContext extends IProviderState {
57
+ }
58
+ declare const Consumer: React.Consumer<IContext>;
59
+ export interface IProviderState {
60
+ registerFill: (a: Name, b: any) => void;
61
+ unregisterFill: (a: Name, b: any) => void;
62
+ unregisterSlot: (a: Name, b?: any) => void;
63
+ registerSlot: (a: Name, b?: any) => void;
64
+ getSlot: (a: Name) => ISlot;
65
+ getFills: (a: Name, b?: any) => IFill[] | [];
66
+ subscribe: (listener: any) => void;
67
+ }
68
+ declare class SlotFillProvider extends React.Component<{}, {}> {
69
+ private slots;
70
+ private fills;
71
+ private listeners;
72
+ private contextValue;
73
+ constructor(props: any);
74
+ registerSlot(name: any, slot: any): void;
75
+ registerFill(name: any, instance: any): void;
76
+ unregisterSlot(name: any, instance: any): void;
77
+ unregisterFill(name: any, instance: IFill): void;
78
+ getSlot(name: any): ISlot;
79
+ getFills(name: any, slotInstance: any): IFill[];
80
+ private resetFillOccurrence;
81
+ private forceUpdateSlot;
82
+ private triggerListeners;
83
+ subscribe(listener: any): () => void;
84
+ render(): JSX.Element;
85
+ }
86
+ /**
87
+ * React hook returning the active slot given a name.
88
+ *
89
+ * @param {string} name Slot name.
90
+ * @return {Object} Slot object.
91
+ */
92
+ export declare const useSlot: (name: any) => ISlot;
93
+ export default SlotFillProvider;
94
+ export { Consumer };
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { IFillProps, IContext } from './context';
3
+ export declare namespace IFillComponent {
4
+ interface Props extends IFillProps, Partial<IContext> {
5
+ }
6
+ }
7
+ declare type IFillComponentProps<T = IFillProps> = T;
8
+ declare type IFillComponent<T = IFillProps> = React.FC<IFillComponentProps<T>>;
9
+ declare const Fill: IFillComponent;
10
+ export { Fill };
@@ -0,0 +1,4 @@
1
+ import { Slot } from './slot';
2
+ import { Fill } from './fill';
3
+ import SlotFillProvider from './context';
4
+ export { Slot, Fill, SlotFillProvider };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { ISlotProps, IContext } from './context';
3
+ export declare namespace ISlotComponent {
4
+ interface Props extends Partial<IContext>, ISlotProps {
5
+ }
6
+ }
7
+ declare const Slot: React.SFC<ISlotProps>;
8
+ export { Slot };
@@ -0,0 +1 @@
1
+ export * from './isEmptyElement';
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Checks if the provided element to check.
4
+ *
5
+ * @param element React Component to check.
6
+ * @returns True when an element is considered empty.
7
+ */
8
+ export declare const isEmptyElement: (element: React.ComponentElement<any, any> | any) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/client-react",
3
- "version": "0.1.14",
3
+ "version": "0.1.18",
4
4
  "description": "browser plugin for git",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@common-stack/client-core": "^0.1.11",
49
+ "@common-stack/client-core": "^0.1.15",
50
50
  "@common-stack/core": "^0.1.11",
51
51
  "@wordpress/hooks": "^2.10.0",
52
52
  "browser-bunyan": "^1.6.3",
@@ -66,7 +66,7 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "9297f4dd744b1285c196081b205ea07140bf2987",
69
+ "gitHead": "3b1adfbd520da071318a58966a5769d0c5ecf243",
70
70
  "typescript": {
71
71
  "definition": "lib/index.d.ts"
72
72
  }