@common-stack/client-react 0.1.12 → 0.1.14

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,14 @@
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.14](https://github.com/cdmbase/fullstack-pro/compare/v0.1.13...v0.1.14) (2021-12-23)
7
+
8
+ **Note:** Version bump only for package @common-stack/client-react
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.1.12](https://github.com/cdmbase/fullstack-pro/compare/v0.1.11...v0.1.12) (2021-12-10)
7
15
 
8
16
  **Note:** Version bump only for package @common-stack/client-react
package/lib/index.js CHANGED
@@ -1275,11 +1275,11 @@ var __rest = (this && this.__rest) || function (s, e) {
1275
1275
  return t;
1276
1276
  };
1277
1277
  Object.defineProperty(exports, "__esModule", { value: true });
1278
- exports.getSortedRoutes = exports.renderRoutes = exports.getMenus = exports.getRoutes = exports.getRoutes2 = exports.isUrl = void 0;
1278
+ exports.getSortedRoutes = exports.sortKeys = exports.renderRoutes = exports.getMenus = exports.getRoutes = exports.getRoutes2 = exports.isUrl = void 0;
1279
1279
  const React = __importStar(__webpack_require__(/*! react */ "react"));
1280
1280
  const interfaces_1 = __webpack_require__(/*! ../interfaces */ "./src/interfaces/index.ts");
1281
1281
  const react_router_dom_1 = __webpack_require__(/*! react-router-dom */ "react-router-dom");
1282
- const sortKeys = __webpack_require__(/*! sort-keys */ "sort-keys");
1282
+ const defaultSortKeys = __webpack_require__(/*! sort-keys */ "sort-keys");
1283
1283
  /* eslint no-useless-escape:0 */
1284
1284
  const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/g;
1285
1285
  function isUrl(path) {
@@ -1344,7 +1344,7 @@ const formatSlash = (route) => {
1344
1344
  _pathPrefix: (route.match(/^\/(\/{1,})/) || ['', ''])[1],
1345
1345
  };
1346
1346
  };
1347
- function getRoutes(path, routeData, authWrapper) {
1347
+ function getRoutes(path, routeData, authWrapper = null) {
1348
1348
  if (!path.startsWith('/')) {
1349
1349
  throw new Error('Invalid path!');
1350
1350
  }
@@ -1459,8 +1459,12 @@ exports.renderRoutes = (routes, solidRoutes, extraProps = {}, switchProps = {})
1459
1459
  ...solidRoutes,
1460
1460
  ...routes.map((route, i) => (React.createElement(react_router_dom_1.Route, { key: route.key || i, path: route.path, exact: route.exact, strict: route.strict, render: props => route.render ? (route.render(Object.assign(Object.assign(Object.assign({}, props), extraProps), { route: route }))) : (React.createElement(route.component, Object.assign({}, props, extraProps, { route: route }))) }))),
1461
1461
  ])) : null;
1462
- exports.getSortedRoutes = (path, routeData, authWrapper) => {
1463
- const sortedRoutes = sortKeys(routeData, { compare });
1462
+ function sortKeys(routeData) {
1463
+ return defaultSortKeys(routeData, { compare });
1464
+ }
1465
+ exports.sortKeys = sortKeys;
1466
+ exports.getSortedRoutes = (path, routeData, authWrapper = null) => {
1467
+ const sortedRoutes = sortKeys(routeData);
1464
1468
  return getRoutes(path, sortedRoutes, authWrapper);
1465
1469
  };
1466
1470
  const compare = ((a, b) => {
@@ -1511,7 +1515,12 @@ function notStartWithColon(str) {
1511
1515
  while (i--) {
1512
1516
  const char = match[i];
1513
1517
  if (char === '/') {
1514
- count = count + 3;
1518
+ if (str === '/') { // if it is root only we put at the last
1519
+ count = count + 6;
1520
+ }
1521
+ else {
1522
+ count = count + 3;
1523
+ }
1515
1524
  }
1516
1525
  else if (char === ':') {
1517
1526
  count = count + 1;
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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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 sortKeys = 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) {\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\n\nexport const getSortedRoutes = (path: string, routeData: IRouteData, authWrapper: (\n ele: React.ReactElement,\n props: Record<string, any>\n) => void) => {\n const sortedRoutes = sortKeys(routeData, { compare });\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\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 count = count + 3;\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/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;QACA;;QAEA;QACA;QACA;QACA,2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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":""}
@@ -10,7 +10,8 @@ export declare function isUrl(path: any): boolean;
10
10
  * @deprecated
11
11
  */
12
12
  export declare function getRoutes2(path: RegExp, routerData: IRouteData): any;
13
- export declare function getRoutes(path: string, routeData: IRouteData, authWrapper: (ele: any, props: any) => void): any;
13
+ export declare function getRoutes(path: string, routeData: IRouteData, authWrapper?: (ele: any, props: any) => void): any;
14
14
  export declare function getMenus(path: string, menuData: IMenuData): IMenuItem[];
15
15
  export declare const renderRoutes: (routes: any, solidRoutes: any, extraProps?: {}, switchProps?: {}) => JSX.Element;
16
- export declare const getSortedRoutes: (path: string, routeData: IRouteData, authWrapper: (ele: React.ReactElement, props: Record<string, any>) => void) => any;
16
+ export declare function sortKeys(routeData: any): any;
17
+ export declare const getSortedRoutes: (path: string, routeData: IRouteData, authWrapper?: (ele: React.ReactElement, props: Record<string, any>) => void) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/client-react",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "browser plugin for git",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -66,7 +66,7 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "5401856aa2b7ee8ddb1c641eb56ab0ef5303f8c7",
69
+ "gitHead": "9297f4dd744b1285c196081b205ea07140bf2987",
70
70
  "typescript": {
71
71
  "definition": "lib/index.d.ts"
72
72
  }