diff --git a/CHANGELOG.md b/CHANGELOG.md index 01710e9c71..6a6a5ab28c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add `headerAction` slot to the `Dialog` component @mnajdova ([#1617](https://github.com/stardust-ui/react/pull/1617)) - Add `Slider` component @Bugaa92 ([#1559](https://github.com/stardust-ui/react/pull/1559)) +### Documentation +- Make sidebar categories collapsible @lucivpav ([#1611](https://github.com/stardust-ui/react/pull/1611)) + ## [v0.34.1](https://github.com/stardust-ui/react/tree/v0.34.1) (2019-07-11) [Compare changes](https://github.com/stardust-ui/react/compare/v0.34.0...v0.34.1) diff --git a/build/webpack.config.ts b/build/webpack.config.ts index 98f86b2764..c5d7efbe89 100644 --- a/build/webpack.config.ts +++ b/build/webpack.config.ts @@ -121,8 +121,6 @@ const webpackConfig: any = { src: paths.packageSrc('react'), docs: paths.base('docs'), }, - // Allows to avoid multiple inclusions of the same module - modules: [paths.base('node_modules')], }, optimization: { // Automatically split vendor and commons diff --git a/docs/src/app.tsx b/docs/src/app.tsx index ffc41f9ef7..e10abdf2c0 100644 --- a/docs/src/app.tsx +++ b/docs/src/app.tsx @@ -4,7 +4,7 @@ import { Provider, themes } from '@stardust-ui/react' import { mergeThemes } from 'src/lib' import { ThemeContext, ThemeContextData, themeContextDefaults } from './context/ThemeContext' -import Router from './routes' +import Routes from './routes' import { PerfDataProvider } from './components/ComponentDoc/PerfChart' class App extends React.Component { @@ -32,7 +32,7 @@ class App extends React.Component { })} > - + diff --git a/docs/src/components/ComponentDoc/ComponentDoc.tsx b/docs/src/components/ComponentDoc/ComponentDoc.tsx index 5f4fb03162..6f22235fd6 100644 --- a/docs/src/components/ComponentDoc/ComponentDoc.tsx +++ b/docs/src/components/ComponentDoc/ComponentDoc.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash' import * as PropTypes from 'prop-types' import * as React from 'react' -import { withRouter } from 'react-router' +import { withRouter } from 'react-router-dom' import { Flex, Header, Icon, Dropdown, Text, Grid } from '@stardust-ui/react' import componentInfoShape from 'docs/src/utils/componentInfoShape' diff --git a/docs/src/components/ComponentDoc/ComponentExample/ComponentExample.tsx b/docs/src/components/ComponentDoc/ComponentExample/ComponentExample.tsx index 870c363f82..76bed6e0c2 100644 --- a/docs/src/components/ComponentDoc/ComponentExample/ComponentExample.tsx +++ b/docs/src/components/ComponentDoc/ComponentExample/ComponentExample.tsx @@ -6,7 +6,7 @@ import { } from '@stardust-ui/docs-components' import * as _ from 'lodash' import * as React from 'react' -import { RouteComponentProps, withRouter } from 'react-router' +import { RouteComponentProps, withRouter } from 'react-router-dom' import * as copyToClipboard from 'copy-to-clipboard' import SourceRender from 'react-source-render' diff --git a/docs/src/components/DocsLayout.tsx b/docs/src/components/DocsLayout.tsx index 70d0927c82..2cac933001 100644 --- a/docs/src/components/DocsLayout.tsx +++ b/docs/src/components/DocsLayout.tsx @@ -1,13 +1,12 @@ -import { Provider, themes } from '@stardust-ui/react' +import { Provider, themes, pxToRem } from '@stardust-ui/react' import AnchorJS from 'anchor-js' import * as PropTypes from 'prop-types' import * as React from 'react' -import { withRouter } from 'react-router' +import { withRouter } from 'react-router-dom' -import { Route } from 'react-router-dom' import Sidebar from 'docs/src/components/Sidebar/Sidebar' import { scrollToAnchor } from 'docs/src/utils' -import { getUnhandledProps, mergeThemes } from 'src/lib' +import { mergeThemes } from 'src/lib' const anchors = new AnchorJS({ class: 'anchor-link', @@ -67,8 +66,29 @@ class DocsLayout extends React.Component { }) } - renderChildren = props => { - const { component: Children, render } = this.props + renderChildren() { + const { children, render } = this.props + const sidebarWidth = '270px' + + const treeSectionStyle = { + fontWeight: 700, + margin: '0 0 .5rem', + padding: '0 1.2857rem', + background: '#201f1f', + color: 'white', + } + + const treeItemStyle = { + padding: '.5em 1.33333333em', + textDecoration: 'none', + fontSize: '0.85714286em', + fontWeight: 400, + color: '#ffffff80', + + '& .active': { + fontWeight: 'bold', + }, + } return ( <> @@ -76,29 +96,45 @@ class DocsLayout extends React.Component { theme={mergeThemes(themes.teamsDark, { // adjust Teams' theme to Semantic UI's font size scheme componentVariables: { - MenuDivider: { - borderColor: '#ffffff80', + TreeItem: { + padding: `${pxToRem(7)} ${pxToRem(16)}`, + textDecoration: 'none', + fontSize: pxToRem(12), + fontWeight: 400, + color: '#ffffff80', + + '& .active': { + fontWeight: 'bold', + }, }, - MenuItem: { - activeBackgroundColor: 'none', - focusedBackgroundColor: 'none', + }, + componentStyles: { + TreeItem: { + root: ({ variables: v, props: p }) => ({ + ...(!p.items && treeItemStyle), + ...(p.items && treeSectionStyle), + }), + }, + TreeTitle: { + root: { + display: 'block', + width: '100%', + }, }, }, })} > - + -
- {render ? render() : } +
+ {render ? render() : children}
) } render() { - const unhandledProps = getUnhandledProps(DocsLayout, this.props) - - return + return this.renderChildren() } } diff --git a/docs/src/components/ExternalExampleLayout.tsx b/docs/src/components/ExternalExampleLayout.tsx index 9458634881..3b0f9ed0d8 100644 --- a/docs/src/components/ExternalExampleLayout.tsx +++ b/docs/src/components/ExternalExampleLayout.tsx @@ -1,7 +1,7 @@ import { Provider, themes } from '@stardust-ui/react' import * as _ from 'lodash' import * as React from 'react' -import { match } from 'react-router' +import { match } from 'react-router-dom' import SourceRender from 'react-source-render' import { KnobProvider } from '@stardust-ui/docs-components' diff --git a/docs/src/components/MarkdownPage.tsx b/docs/src/components/MarkdownPage.tsx index aaa62e4102..592ec96f0f 100644 --- a/docs/src/components/MarkdownPage.tsx +++ b/docs/src/components/MarkdownPage.tsx @@ -2,9 +2,8 @@ import { MDXProvider } from '@mdx-js/react' import { CodeSnippet } from '@stardust-ui/docs-components' import { Header } from '@stardust-ui/react' import * as React from 'react' -import { RouteProps } from 'react-router' +import { RouteProps } from 'react-router-dom' -import DocsLayout from 'docs/src/components/DocsLayout' import { link } from 'docs/src/utils/helpers' import DocPage from 'docs/src/components/DocPage' import GuidesNavigationFooter, { PageDescriptor } from 'docs/src/components/GuidesNavigationFooter' @@ -39,21 +38,16 @@ const components = { } const MarkdownPage: React.FunctionComponent = props => { - const { page, ...rest } = props + const { page } = props const { default: Component, meta } = page return ( - ( - - - - - - - )} - /> + + + + + + ) } diff --git a/docs/src/components/Sidebar/Sidebar.tsx b/docs/src/components/Sidebar/Sidebar.tsx index 80e11c1f30..351bffc580 100644 --- a/docs/src/components/Sidebar/Sidebar.tsx +++ b/docs/src/components/Sidebar/Sidebar.tsx @@ -1,4 +1,12 @@ -import { Icon, Menu, Segment, Text, ICSSInJSStyle } from '@stardust-ui/react' +import { + Icon, + Tree, + Segment, + Text, + ICSSInJSStyle, + TreeItemProps, + TreeProps, +} from '@stardust-ui/react' import { ShorthandValue } from '../../../../packages/react/src/types' import Logo from 'docs/src/components/Logo/Logo' import { getComponentPathname } from 'docs/src/utils' @@ -7,12 +15,9 @@ import * as _ from 'lodash' import * as PropTypes from 'prop-types' import * as React from 'react' import { findDOMNode } from 'react-dom' -import { withRouter } from 'react-router' - -import { NavLink } from 'react-router-dom' +import { NavLink, withRouter } from 'react-router-dom' import { constants } from 'src/lib' -import { fontWeightBold } from 'src/themes/teams/siteVariables' type ComponentMenuItem = { displayName: string; type: string } @@ -122,65 +127,155 @@ class Sidebar extends React.Component { }) */ + keyDownCallback(e) { + if (keyboardKey.getCode(e) !== keyboardKey.Enter) { + return + } + e.stopPropagation() + e.target.click() + } + + addItemKeyCallbacks(sections: ShorthandValue[]) { + for (let i = 0; i < sections.length; i++) { + const category = sections[i] + if ('items' in category) { + this.addItemKeyCallbacks(category.items) + } else { + if (!('title' in category)) { + continue + } + category['onKeyDown'] = e => { + this.keyDownCallback(e) + } + } + } + } + + getTreeItems(): ShorthandValue[] { + return [ + { + key: 'concepts', + title: 'Concepts', + items: [ + { + key: 'intro', + title: { + content: 'Introduction', + exact: true, + activeClassName: 'active', + as: NavLink, + to: '/', + }, + }, + { + key: 'composition', + title: { + as: NavLink, + content: 'Composition', + activeClassName: 'active', + to: '/composition', + }, + }, + { + key: 'shorthand', + title: { + as: NavLink, + content: 'Shorthand Props', + activeClassName: 'active', + to: '/shorthand-props', + }, + }, + ], + }, + { + key: 'guides', + title: 'Guides', + items: [ + { + key: 'quickstart', + title: { + content: 'QuickStart', + as: NavLink, + activeClassName: 'active', + to: '/quick-start', + }, + }, + { + key: 'faq', + title: { content: 'FAQ', as: NavLink, activeClassName: 'active', to: '/faq' }, + }, + { + key: 'accessiblity', + title: { + content: 'Accessibility', + as: NavLink, + activeClassName: 'active', + to: '/accessibility', + }, + }, + { + key: 'theming', + title: { content: 'Theming', as: NavLink, activeClassName: 'active', to: '/theming' }, + }, + { + key: 'theming-examples', + title: { + content: 'Theming Examples', + as: NavLink, + activeClassName: 'active', + to: '/theming-examples', + }, + }, + { + key: 'colorpalette', + title: { content: 'Colors', as: NavLink, activeClassName: 'active', to: '/colors' }, + }, + { + key: 'layout', + title: { content: 'Layout', as: NavLink, activeClassName: 'active', to: '/layout' }, + }, + { + key: 'integrate-custom', + title: { + content: 'Integrate Custom Components', + as: NavLink, + activeClassName: 'active', + to: '/integrate-custom-components', + }, + }, + ], + }, + // TODO: to re-enable the search input - will modify the list of the components depending on the search results + // {query ? this.renderSearchItems() : this.menuItemsByType}, + // { + // key: 'search', + // content: ( + // + // ), + // }, + ] + } + render() { - // Should be applied by provider const sidebarStyles: ICSSInJSStyle = { background: '#201f1f', - width: '250px', + width: this.props.width, position: 'fixed', overflowY: 'scroll', top: 0, left: 0, padding: 0, - maxHeight: '100vh', + height: '100%', zIndex: 1000, } - const menuSectionStyles: ICSSInJSStyle = { - fontWeight: fontWeightBold, - margin: '0 0 .5rem', - padding: '0 1.2857rem', - background: '#201f1f', - color: 'white', - ':hover': { - background: 'none', - color: 'white', - }, - ':focus': { - background: 'none', - color: 'white', - }, - } - - const menuItemStyles: ICSSInJSStyle = { - padding: '.5em 1.33333333em', - textDecoration: 'none', - fontSize: '0.85714286em', - fontWeight: 400, - color: '#ffffff80', - background: '#201f1f', - ':hover': { - color: 'white', - backgroundColor: 'none', - }, - ':focus': { - color: 'white', - backgroundColor: 'none', - }, - } - - const dividerStyles: ICSSInJSStyle = { - marginTop: '.5em', - paddingBottom: '.5em', - background: '#201f1f', - } - - const navBarStyles: ICSSInJSStyle = { - color: '#ffffff80', - padding: '0px', - backgroundColor: '#201f1f', - } - const logoStyles: ICSSInJSStyle = { paddingRight: '5px', color: 'white', @@ -188,308 +283,152 @@ class Sidebar extends React.Component { } const changeLogUrl: string = `${constants.repoURL}/blob/master/CHANGELOG.md` - const menuItemsByType = _.map(constants.typeOrder, nextType => { + const treeItemsByType = _.map(constants.typeOrder, nextType => { const items = _.chain([...componentMenu, ...behaviorMenu]) .filter(({ type }) => type === nextType) .map(info => ({ key: info.displayName.concat(nextType), - content: info.displayName, + title: { content: info.displayName, as: NavLink, to: getComponentPathname(info) }, onClick: this.handleItemClick, - as: NavLink, - to: getComponentPathname(info), - styles: menuItemStyles, })) .value() return { items } }) - const menuItems: ShorthandValue[] = [ + const topTreeItems: TreeProps['items'] = [ { key: 'github', - content: ( -
- GitHub - -
- ), - href: constants.repoURL, - target: '_blank', - rel: 'noopener noreferrer', - styles: menuItemStyles, + title: { + content: ( +
+ GitHub + +
+ ), + href: constants.repoURL, + target: '_blank', + rel: 'noopener noreferrer', + }, }, { key: 'change', - content: ( -
- CHANGELOG - -
- ), - href: changeLogUrl, - target: '_blank', - rel: 'noopener noreferrer', - styles: menuItemStyles, - }, - { - key: 'divider1', - kind: 'divider', - styles: dividerStyles, - }, - { - key: 'concepts', - content: 'Concepts', - styles: menuSectionStyles, - disabled: true, - }, - { - key: 'intro', - content: 'Introduction', - as: NavLink, - to: '/', - styles: menuItemStyles, - }, - { - key: 'composition', - content: 'Composition', - as: NavLink, - to: '/composition', - styles: menuItemStyles, - }, - { - key: 'shorthand', - content: 'Shorthand Props', - as: NavLink, - to: '/shorthand-props', - styles: menuItemStyles, - }, - { - key: 'divider2', - kind: 'divider', - styles: dividerStyles, - }, - { - key: 'guides', - content: 'Guides', - styles: menuSectionStyles, - disabled: true, - }, - { - key: 'quickstart', - content: 'QuickStart', - as: NavLink, - to: '/quick-start', - styles: menuItemStyles, - }, - { - key: 'faq', - content: 'FAQ', - as: NavLink, - to: '/faq', - styles: menuItemStyles, - }, - { - key: 'accessiblity', - content: 'Accessibility', - as: NavLink, - to: '/accessibility', - styles: menuItemStyles, - }, - { - key: 'theming', - content: 'Theming', - as: NavLink, - to: '/theming', - styles: menuItemStyles, - }, - { - key: 'theming-examples', - content: 'Theming Examples', - as: NavLink, - to: '/theming-examples', - styles: menuItemStyles, - }, - { - key: 'colorpalette', - content: 'Colors', - as: NavLink, - to: '/colors', - styles: menuItemStyles, - }, - { - key: 'layout', - content: 'Layout', - as: NavLink, - to: '/layout', - styles: menuItemStyles, - }, - { - key: 'integrate-custom', - content: 'Integrate Custom Components', - as: NavLink, - to: '/integrate-custom-components', - styles: menuItemStyles, - }, - { - key: 'divider3', - kind: 'divider', - styles: dividerStyles, + title: { + content: ( +
+ CHANGELOG + +
+ ), + href: changeLogUrl, + target: '_blank', + rel: 'noopener noreferrer', + }, }, - // TODO: to re-enable the search input - will modify the list of the components depending on the search results - // {query ? this.renderSearchItems() : this.menuItemsByType}, - // { - // key: 'search', - // content: ( - // - // ), - // }, ] - const prototypesMenuItemTitle = { - key: 'prototypes', - content: 'Prototypes', - styles: menuSectionStyles, - disabled: true, - } + const treeItems = topTreeItems.concat(this.getTreeItems()) - const prototypesMenuItems: ShorthandValue[] = [ + const prototypesTreeItems: TreeProps['items'] = [ { key: 'chatpane', - content: 'Chat Pane', - as: NavLink, - to: '/prototype-chat-pane', - styles: menuItemStyles, + title: { content: 'Chat Pane', as: NavLink, to: '/prototype-chat-pane' }, }, { key: 'chatMssages', - content: 'Chat Messages', - as: NavLink, - to: '/prototype-chat-messages', - styles: menuItemStyles, + title: { content: 'Chat Messages', as: NavLink, to: '/prototype-chat-messages' }, }, { key: 'customtoolbar', - content: 'Custom Styled Toolbar', - as: NavLink, - to: '/prototype-custom-toolbar', - styles: menuItemStyles, + title: { content: 'Custom Styled Toolbar', as: NavLink, to: '/prototype-custom-toolbar' }, }, { key: 'dropdowns', - content: 'Dropdowns', - as: NavLink, - to: '/prototype-dropdowns', - styles: menuItemStyles, + title: { content: 'Dropdowns', as: NavLink, to: '/prototype-dropdowns' }, }, { key: 'alerts', - content: 'Alerts', - as: NavLink, - to: '/prototype-alerts', - styles: menuItemStyles, + title: { content: 'Alerts', as: NavLink, to: '/prototype-alerts' }, }, { key: 'asyncshorthand', - content: 'Async Shorthand', - as: NavLink, - to: '/prototype-async-shorthand', - styles: menuItemStyles, + title: { content: 'Async Shorthand', as: NavLink, to: '/prototype-async-shorthand' }, }, { key: 'employeecard', - content: 'Employee Card', - as: NavLink, - to: '/prototype-employee-card', - styles: menuItemStyles, + title: { content: 'Employee Card', as: NavLink, to: '/prototype-employee-card' }, }, { key: 'meetingoptions', - content: 'Meeting Options', - as: NavLink, - to: '/prototype-meeting-options', - styles: menuItemStyles, + title: { content: 'Meeting Options', as: NavLink, to: '/prototype-meeting-options' }, }, { key: 'mentions', - content: 'Mentions', - as: NavLink, - to: '/prototype-mentions', - styles: menuItemStyles, + title: { content: 'Mentions', as: NavLink, to: '/prototype-mentions' }, }, { key: 'searchpage', - content: 'Search Page', - as: NavLink, - to: '/prototype-search-page', - styles: menuItemStyles, + title: { content: 'Search Page', as: NavLink, to: '/prototype-search-page' }, }, { key: 'popups', - content: 'Popups', - as: NavLink, - to: '/prototype-popups', - styles: menuItemStyles, + title: { content: 'Popups', as: NavLink, to: '/prototype-popups' }, }, { key: 'iconviewer', - content: 'Processed Icons', - as: NavLink, - to: '/icon-viewer', - styles: menuItemStyles, + title: { content: 'Processed Icons', as: NavLink, to: '/icon-viewer' }, }, { key: 'menu-button', - content: 'MenuButton', - as: NavLink, - to: '/menu-button', - styles: menuItemStyles, - }, - { - key: 'divider4', - kind: 'divider', - styles: dividerStyles, + title: { content: 'MenuButton', as: NavLink, to: '/menu-button' }, }, ] + const prototypeTreeSection = { + key: 'prototypes', + title: 'Prototypes', + items: prototypesTreeItems, + } + const withPrototypes = - process.env.NODE_ENV !== 'production' - ? menuItems.concat(prototypesMenuItemTitle).concat(prototypesMenuItems) - : menuItems + process.env.NODE_ENV !== 'production' ? treeItems.concat(prototypeTreeSection) : treeItems - const componentMenuItem = { + const componentTreeSection = { key: 'components', - content: 'Components', - styles: menuSectionStyles, - disabled: true, + title: 'Components', + items: treeItemsByType[0].items, } - const behaviorMenuItem = { + const behaviorTreeSection = { key: 'behaviour', - content: 'Behaviors', - styles: menuSectionStyles, - disabled: true, + title: 'Behaviors', + items: treeItemsByType[1].items, } - const withComponents = withPrototypes.concat(componentMenuItem).concat(menuItemsByType[0].items) - const allItems = withComponents - .concat({ - key: 'divider5', - kind: 'divider', - styles: dividerStyles, - }) - .concat(behaviorMenuItem) - .concat(menuItemsByType[1].items) + const withComponents = withPrototypes.concat(componentTreeSection) + const allSections = withComponents.concat(behaviorTreeSection) + + const at = this.props.location.pathname + const activeCategoryIndex = _.findIndex( + allSections, + (section: ShorthandValue) => { + return _.find((section as any).items, item => item.title.to === at) + }, + ) + // TODO: remove after the issue with TreeItem will be fixed + // https://github.com/stardust-ui/react/issues/1613 + this.addItemKeyCallbacks(allSections) + + const titleRenderer = (Component, { content, open, hasSubtree, ...restProps }) => ( + + {content} + {hasSubtree && } + + ) // TODO: bring back the active elements indicators return ( - + { /> - + ) } diff --git a/docs/src/routes.tsx b/docs/src/routes.tsx index 280fb20217..51a87c829a 100644 --- a/docs/src/routes.tsx +++ b/docs/src/routes.tsx @@ -39,117 +39,111 @@ import IconViewerPrototype from './prototypes/IconViewer' import MenuButtonPrototype from './prototypes/MenuButton' import AlertsPrototype from './prototypes/alerts' -const Router = () => ( +const Routes = () => ( - - - - - {process.env.NODE_ENV !== 'production' && [ - , - , - , - , - , - , - , - , - , - , - , - , - , - ]} - - - - - - - - - - - - - - - - - + + + + + + {process.env.NODE_ENV !== 'production' && [ + , + , + , + , + , + , + , + , + , + , + , + , + , + ]} + + + + + + + + + + + + + + + + + + + + + + + + ) -export default Router +export default Routes diff --git a/e2e/server/E2EExample.tsx b/e2e/server/E2EExample.tsx index f5ff7913a2..90cace0b13 100644 --- a/e2e/server/E2EExample.tsx +++ b/e2e/server/E2EExample.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import browserTestRoutes from './routes' -import { RouteComponentProps } from 'react-router' +import { RouteComponentProps } from 'react-router-dom' type E2EProps = RouteComponentProps<{ exampleName: string }> diff --git a/package.json b/package.json index 3e9d934658..65cbb79cb4 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@types/react-custom-scrollbars": "^4.0.5", "@types/react-dom": "^16.8.3", "@types/react-is": "^16.7.1", - "@types/react-router": "^4.0.27", + "@types/react-router-dom": "^4.3.4", "@types/rimraf": "^2.0.2", "babel-loader": "^8.0.6", "circular-dependency-plugin": "^5.0.2", @@ -125,8 +125,7 @@ "react-element-to-jsx-string": "^14.0.2", "react-hot-loader": "^4.8.2", "react-markdown": "^4.0.8", - "react-router": "^4.1.2", - "react-router-dom": "^4.1.2", + "react-router-dom": "^5.0.1", "react-source-render": "3.0.0-5", "react-test-renderer": "^16.8.5", "react-vis": "^1.11.6", diff --git a/packages/react/src/components/Tree/TreeItem.tsx b/packages/react/src/components/Tree/TreeItem.tsx index 2aa1c7f71a..37b31b7937 100644 --- a/packages/react/src/components/Tree/TreeItem.tsx +++ b/packages/react/src/components/Tree/TreeItem.tsx @@ -42,9 +42,6 @@ export interface TreeItemProps extends UIComponentProps, ChildrenComponentProps /** Only allow one subtree to be open at a time. */ exclusive?: boolean - /** Initial open value. */ - defaultOpen?: boolean - /** The index of the item among its sibbling */ index: number @@ -83,13 +80,10 @@ class TreeItem extends UIComponent> { subtree: `${TreeItem.className}__subtree`, } - static autoControlledProps = ['open'] - static propTypes = { ...commonPropTypes.createCommon({ content: false, }), - defaultOpen: PropTypes.bool, items: customPropTypes.collectionShorthand, index: PropTypes.number, exclusive: PropTypes.bool, diff --git a/types/global.d.ts b/types/global.d.ts index a55e550164..1805bb881c 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -1,6 +1,6 @@ declare const __DEV__: boolean declare const __PATH_SEP__: string -declare const __BASENAME__: boolean +declare const __BASENAME__: string declare interface NodeModule { hot: any diff --git a/yarn.lock b/yarn.lock index 2e37fc8b4a..4404204651 100644 --- a/yarn.lock +++ b/yarn.lock @@ -723,10 +723,10 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12" - integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ== +"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.0", "@babel/runtime@^7.4.5": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.4.tgz#cb7d1ad7c6d65676e66b47186577930465b5271b" + integrity sha512-Na84uwyImZZc3FKf4aUF1tysApzwf3p2yuFBIyBfbzT5glzKTdvYI4KVW4kcgjrzoGUjC7w3YyCHcJKaRxsr2Q== dependencies: regenerator-runtime "^0.13.2" @@ -1811,9 +1811,9 @@ chalk "^2.2.0" "@types/history@*": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" - integrity sha512-eVAb52MJ4lfPLiO9VvTgv8KaZDEIqCwhv+lXOMLlt4C1YHTShgmMULEg0RrCbnqfYd6QKfHsMp0MiX0vWISpSw== + version "4.7.2" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.2.tgz#0e670ea254d559241b6eeb3894f8754991e73220" + integrity sha512-ui3WwXmjTaY73fOQ3/m3nnajU/Orhi6cEu5rzX+BrAAJxa3eITXZ5ch9suPqtM03OWhAHhPSyBGCN4UKoxO20Q== "@types/istanbul-lib-coverage@^1.1.0": version "1.1.0" @@ -1908,10 +1908,19 @@ dependencies: "@types/react" "*" -"@types/react-router@^4.0.27": - version "4.0.27" - resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.27.tgz#553f54df7c4b09d6046b0201ce9b91c46b2940e3" - integrity sha512-EqGMptbgv4IkwJdU/ozonsFiL1iESUXk57rA6myayd/bIgYP4/pD0cZJUpOWCSvYT7QLDBuDkrwyEgCqfMZfNg== +"@types/react-router-dom@^4.3.4": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.3.4.tgz#63a7a8558129d2f4ff76e4bdd099bf4b98e25a0d" + integrity sha512-xrwaWHpnxKk/TTRe7pmoGy3E4SyF/ojFqNfFJacw7OLdfLXRvGfk4r/XePVaZNVfeJzL8fcnNilPN7xOdJ/vGw== + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react-router" "*" + +"@types/react-router@*": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.0.3.tgz#855a1606e62de3f4d69ea34fb3c0e50e98e964d5" + integrity sha512-j2Gge5cvxca+5lK9wxovmGPgpVJMwjyu5lTA/Cd6fLGoPq7FXcUE1jFkEdxeyqGGz8VfHYSHCn5Lcn24BzaNKA== dependencies: "@types/history" "*" "@types/react" "*" @@ -6822,6 +6831,11 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= +gud@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" + integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== + gulp-babel@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0.tgz#e0da96f4f2ec4a88dd3a3030f476e38ab2126d87" @@ -7199,16 +7213,17 @@ header-case@^1.0.0: no-case "^2.2.0" upper-case "^1.1.3" -history@^4.7.2: - version "4.7.2" - resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b" - integrity sha512-1zkBRWW6XweO0NBcjiphtVJVsIQ+SXF29z9DVkceeaSLVMFXHool+fdCZD4spDCfZJCILPILc3bm7Bc+HRi0nA== +history@^4.9.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/history/-/history-4.9.0.tgz#84587c2068039ead8af769e9d6a6860a14fa1bca" + integrity sha512-H2DkjCjXf0Op9OAr6nJ56fcRkTSNrUiv41vNJ6IswJjif6wlpZK0BTfFbi7qK9dXLSYZxkq5lBsj3vUjlYBYZA== dependencies: - invariant "^2.2.1" + "@babel/runtime" "^7.1.2" loose-envify "^1.2.0" resolve-pathname "^2.2.0" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" value-equal "^0.4.0" - warning "^3.0.0" hmac-drbg@^1.0.0: version "1.0.1" @@ -7224,12 +7239,7 @@ hoek@4.2.1, hoek@4.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== -hoist-non-react-statics@^2.5.0: - version "2.5.5" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" - integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== - -hoist-non-react-statics@^3.3.0: +hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA== @@ -7664,7 +7674,7 @@ interpret@^1.1.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== -invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -9939,6 +9949,15 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" +mini-create-react-context@^0.3.0: + version "0.3.2" + resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz#79fc598f283dd623da8e088b05db8cddab250189" + integrity sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw== + dependencies: + "@babel/runtime" "^7.4.0" + gud "^1.0.0" + tiny-warning "^1.0.2" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -11931,7 +11950,7 @@ react-hot-loader@^4.8.2: shallowequal "^1.0.2" source-map "^0.7.3" -react-is@^16.5.2, react-is@^16.6.3, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: +react-is@^16.5.2, react-is@^16.6.0, react-is@^16.6.3, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== @@ -11968,30 +11987,34 @@ react-node-resolver@^1.0.1: resolved "https://registry.yarnpkg.com/react-node-resolver/-/react-node-resolver-1.0.1.tgz#1798a729c0e218bf2f0e8ddf79c550d4af61d83a" integrity sha1-F5inKcDiGL8vDo3fecVQ1K9h2Do= -react-router-dom@^4.1.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" - integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA== +react-router-dom@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.0.1.tgz#ee66f4a5d18b6089c361958e443489d6bab714be" + integrity sha512-zaVHSy7NN0G91/Bz9GD4owex5+eop+KvgbxXsP/O+iW1/Ln+BrJ8QiIR5a6xNPtrdTvLkxqlDClx13QO1uB8CA== dependencies: - history "^4.7.2" - invariant "^2.2.4" + "@babel/runtime" "^7.1.2" + history "^4.9.0" loose-envify "^1.3.1" - prop-types "^15.6.1" - react-router "^4.3.1" - warning "^4.0.1" + prop-types "^15.6.2" + react-router "5.0.1" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" -react-router@^4.1.2, react-router@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e" - integrity sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg== +react-router@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.0.1.tgz#04ee77df1d1ab6cb8939f9f01ad5702dbadb8b0f" + integrity sha512-EM7suCPNKb1NxcTZ2LEOWFtQBQRQXecLxVpdsP4DW4PbbqYWeRiLyV/Tt1SdCrvT2jcyXAXmVTmzvSzrPR63Bg== dependencies: - history "^4.7.2" - hoist-non-react-statics "^2.5.0" - invariant "^2.2.4" + "@babel/runtime" "^7.1.2" + history "^4.9.0" + hoist-non-react-statics "^3.1.0" loose-envify "^1.3.1" + mini-create-react-context "^0.3.0" path-to-regexp "^1.7.0" - prop-types "^15.6.1" - warning "^4.0.1" + prop-types "^15.6.2" + react-is "^16.6.0" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" react-side-effect@^1.0.2: version "1.1.5" @@ -14101,6 +14124,16 @@ tiny-emitter@^2.0.0: resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.0.2.tgz#82d27468aca5ade8e5fd1e6d22b57dd43ebdfb7c" integrity sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow== +tiny-invariant@^1.0.2: + version "1.0.6" + resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.0.6.tgz#b3f9b38835e36a41c843a3b0907a5a7b3755de73" + integrity sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA== + +tiny-warning@^1.0.0, tiny-warning@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + title-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" @@ -15051,20 +15084,6 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" -warning@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" - integrity sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w= - dependencies: - loose-envify "^1.0.0" - -warning@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.2.tgz#aa6876480872116fa3e11d434b0d0d8d91e44607" - integrity sha512-wbTp09q/9C+jJn4KKJfJfoS6VleK/Dti0yqWSm6KMvJ4MRCXFQNapHuJXutJIrWV0Cf4AhTdeIe4qdKHR1+Hug== - dependencies: - loose-envify "^1.0.0" - watchpack@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00"