@webiny/app-admin 5.20.0 → 5.21.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons/slack-logo.svg +1 -1
- package/base/Admin.d.ts +14 -0
- package/base/Admin.js +29 -0
- package/base/Base.d.ts +2 -0
- package/base/Base.js +65 -0
- package/base/plugins/AddGraphQLQuerySelection.d.ts +9 -0
- package/base/plugins/AddGraphQLQuerySelection.js +15 -0
- package/base/providers/ApolloProvider.d.ts +4 -0
- package/base/providers/ApolloProvider.js +14 -0
- package/base/providers/TelemetryProvider.d.ts +4 -0
- package/base/providers/TelemetryProvider.js +19 -0
- package/base/providers/UiStateProvider.d.ts +4 -0
- package/base/providers/UiStateProvider.js +10 -0
- package/base/providers/ViewCompositionProvider.d.ts +18 -0
- package/base/providers/ViewCompositionProvider.js +44 -0
- package/base/ui/Brand.d.ts +9 -0
- package/base/ui/Brand.js +6 -0
- package/base/ui/CenteredView.d.ts +8 -0
- package/base/ui/CenteredView.js +27 -0
- package/base/ui/Dashboard.d.ts +9 -0
- package/base/ui/Dashboard.js +6 -0
- package/base/ui/Layout.d.ts +13 -0
- package/base/ui/Layout.js +11 -0
- package/base/ui/LocaleSelector.d.ts +9 -0
- package/base/ui/LocaleSelector.js +6 -0
- package/base/ui/LoginScreen.d.ts +9 -0
- package/base/ui/LoginScreen.js +7 -0
- package/base/ui/Logo.d.ts +14 -0
- package/base/ui/Logo.js +20 -0
- package/base/ui/Menu.d.ts +35 -0
- package/base/ui/Menu.js +80 -0
- package/base/ui/Navigation.d.ts +35 -0
- package/base/ui/Navigation.js +147 -0
- package/base/ui/NotFound.d.ts +9 -0
- package/base/ui/NotFound.js +6 -0
- package/base/ui/Search.d.ts +28 -0
- package/base/ui/Search.js +48 -0
- package/base/ui/Tags.d.ts +8 -0
- package/base/ui/Tags.js +13 -0
- package/base/ui/UserMenu.d.ts +54 -0
- package/base/ui/UserMenu.js +86 -0
- package/components/AdminLayout.js +5 -31
- package/components/AppInstaller/AppInstaller.d.ts +4 -0
- package/components/AppInstaller/AppInstaller.js +136 -0
- package/components/AppInstaller/index.d.ts +1 -4
- package/components/AppInstaller/index.js +13 -133
- package/components/AppInstaller/styled.d.ts +4 -4
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +2 -2
- package/components/Routes.d.ts +6 -0
- package/components/Routes.js +34 -0
- package/index.d.ts +28 -0
- package/index.js +26 -0
- package/package.json +15 -13
- package/plugins/MenuPlugin.d.ts +18 -1
- package/plugins/globalSearch/SearchBar.d.ts +6 -3
- package/plugins/globalSearch/SearchBar.js +2 -1
- package/plugins/globalSearch/index.d.ts +0 -3
- package/plugins/globalSearch/index.js +0 -18
- package/plugins/globalSearch/styled.d.ts +3 -3
- package/plugins/index.d.ts +1 -1
- package/plugins/index.js +2 -4
- package/styles/material-theme-assignments.scss +1 -0
- package/types.d.ts +1 -10
- package/ui/elements/form/FileManagerElement/styled.d.ts +9 -9
- package/ui/elements/form/FileManagerElement.d.ts +3 -2
- package/plugins/logo/Logo.d.ts +0 -22
- package/plugins/logo/Logo.js +0 -108
- package/plugins/logo/index.d.ts +0 -5
- package/plugins/logo/index.js +0 -32
- package/plugins/menu/documentation.d.ts +0 -4
- package/plugins/menu/documentation.js +0 -16
- package/plugins/menu/fileManager.d.ts +0 -4
- package/plugins/menu/fileManager.js +0 -64
- package/plugins/menu/index.d.ts +0 -6
- package/plugins/menu/index.js +0 -24
- package/plugins/menu/renderers/MenuGroupRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuGroupRenderer.js +0 -126
- package/plugins/menu/renderers/MenuLinkRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuLinkRenderer.js +0 -52
- package/plugins/menu/renderers/MenuSectionItemRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuSectionItemRenderer.js +0 -77
- package/plugins/menu/renderers/MenuSectionRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuSectionRenderer.js +0 -51
- package/plugins/menu/slack.d.ts +0 -4
- package/plugins/menu/slack.js +0 -16
- package/plugins/menu/source.d.ts +0 -4
- package/plugins/menu/source.js +0 -16
- package/plugins/userMenu/UserMenuElement.d.ts +0 -7
- package/plugins/userMenu/UserMenuElement.js +0 -43
- package/plugins/userMenu/UserMenuRenderer.d.ts +0 -6
- package/plugins/userMenu/UserMenuRenderer.js +0 -47
- package/plugins/userMenu/index.d.ts +0 -4
- package/plugins/userMenu/index.js +0 -16
- package/ui/views/AdminView.d.ts +0 -12
- package/ui/views/AdminView.js +0 -90
- package/ui/views/NavigationView/ContentElement.d.ts +0 -10
- package/ui/views/NavigationView/ContentElement.js +0 -86
- package/ui/views/NavigationView/FooterElement.d.ts +0 -13
- package/ui/views/NavigationView/FooterElement.js +0 -59
- package/ui/views/NavigationView/HeaderElement.d.ts +0 -16
- package/ui/views/NavigationView/HeaderElement.js +0 -66
- package/ui/views/NavigationView/NavigationViewRenderer.d.ts +0 -6
- package/ui/views/NavigationView/NavigationViewRenderer.js +0 -38
- package/ui/views/NavigationView/Styled.d.ts +0 -7
- package/ui/views/NavigationView/Styled.js +0 -47
- package/ui/views/NavigationView/legacyMenu.d.ts +0 -22
- package/ui/views/NavigationView/legacyMenu.js +0 -1
- package/ui/views/NavigationView/useNavigation.d.ts +0 -6
- package/ui/views/NavigationView/useNavigation.js +0 -22
- package/ui/views/NavigationView.d.ts +0 -26
- package/ui/views/NavigationView.js +0 -204
package/plugins/logo/Logo.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
declare class Logo extends React.Component<any> {
|
|
3
|
-
static defaultProps: {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
mobileWidth: number;
|
|
7
|
-
mobileHeight: number;
|
|
8
|
-
altText: string;
|
|
9
|
-
className: string;
|
|
10
|
-
white: boolean;
|
|
11
|
-
onClick: any;
|
|
12
|
-
};
|
|
13
|
-
checkDisplayInterval: any;
|
|
14
|
-
state: {
|
|
15
|
-
display: string;
|
|
16
|
-
};
|
|
17
|
-
shouldComponentUpdate(_: any, state: any): boolean;
|
|
18
|
-
componentDidMount(): void;
|
|
19
|
-
componentWillUnmount(): void;
|
|
20
|
-
render(): JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
export default Logo;
|
package/plugins/logo/Logo.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
import _isEqual from "lodash/isEqual";
|
|
8
|
-
import React from "react";
|
|
9
|
-
import { ReactComponent as WebinyLogo } from "@svgr/webpack!../../assets/images/webiny-logo.svg";
|
|
10
|
-
import { Link } from "@webiny/react-router";
|
|
11
|
-
|
|
12
|
-
var Logo = /*#__PURE__*/function (_React$Component) {
|
|
13
|
-
_inherits(Logo, _React$Component);
|
|
14
|
-
|
|
15
|
-
var _super = _createSuper(Logo);
|
|
16
|
-
|
|
17
|
-
function Logo() {
|
|
18
|
-
var _this;
|
|
19
|
-
|
|
20
|
-
_classCallCheck(this, Logo);
|
|
21
|
-
|
|
22
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
-
args[_key] = arguments[_key];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
27
|
-
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "checkDisplayInterval", null);
|
|
29
|
-
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
31
|
-
display: "desktop"
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_createClass(Logo, [{
|
|
38
|
-
key: "shouldComponentUpdate",
|
|
39
|
-
value: function shouldComponentUpdate(_, state) {
|
|
40
|
-
return !_isEqual(state, this.state);
|
|
41
|
-
}
|
|
42
|
-
}, {
|
|
43
|
-
key: "componentDidMount",
|
|
44
|
-
value: function componentDidMount() {
|
|
45
|
-
var _this2 = this;
|
|
46
|
-
|
|
47
|
-
this.checkDisplayInterval = setInterval(function () {
|
|
48
|
-
_this2.setState({
|
|
49
|
-
display: window.outerWidth > 768 ? "desktop" : "mobile"
|
|
50
|
-
});
|
|
51
|
-
}, 500);
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "componentWillUnmount",
|
|
55
|
-
value: function componentWillUnmount() {
|
|
56
|
-
clearInterval(this.checkDisplayInterval);
|
|
57
|
-
}
|
|
58
|
-
}, {
|
|
59
|
-
key: "render",
|
|
60
|
-
value: function render() {
|
|
61
|
-
var _this$props = this.props,
|
|
62
|
-
className = _this$props.className,
|
|
63
|
-
altText = _this$props.altText,
|
|
64
|
-
white = _this$props.white,
|
|
65
|
-
onClick = _this$props.onClick;
|
|
66
|
-
var style = {
|
|
67
|
-
width: this.props.width,
|
|
68
|
-
height: this.props.height,
|
|
69
|
-
display: this.props.display,
|
|
70
|
-
marginTop: 8,
|
|
71
|
-
color: undefined
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
if (white) {
|
|
75
|
-
style.color = "white";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (this.state.display !== "desktop") {
|
|
79
|
-
style.width = this.props.mobileWidth;
|
|
80
|
-
style.height = this.props.mobileHeight;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
84
|
-
to: "/",
|
|
85
|
-
onClick: onClick
|
|
86
|
-
}, /*#__PURE__*/React.createElement(WebinyLogo, {
|
|
87
|
-
className: ["webiny-logo", className].join(" "),
|
|
88
|
-
style: style,
|
|
89
|
-
alt: altText
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
}]);
|
|
93
|
-
|
|
94
|
-
return Logo;
|
|
95
|
-
}(React.Component);
|
|
96
|
-
|
|
97
|
-
_defineProperty(Logo, "defaultProps", {
|
|
98
|
-
width: 100,
|
|
99
|
-
height: 30,
|
|
100
|
-
mobileWidth: 100,
|
|
101
|
-
mobileHeight: 36,
|
|
102
|
-
altText: "Webiny",
|
|
103
|
-
className: "",
|
|
104
|
-
white: false,
|
|
105
|
-
onClick: null
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
export default Logo;
|
package/plugins/logo/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
2
|
-
import { AdminView } from "../../ui/views/AdminView";
|
|
3
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
4
|
-
declare const _default: () => (UIViewPlugin<NavigationView> | UIViewPlugin<AdminView>)[];
|
|
5
|
-
export default _default;
|
package/plugins/logo/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Logo from "./Logo";
|
|
3
|
-
import { plugins } from "@webiny/plugins";
|
|
4
|
-
import { logoStyle } from "../../ui/views/NavigationView/Styled";
|
|
5
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
6
|
-
import { AdminView } from "../../ui/views/AdminView";
|
|
7
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
8
|
-
export default (function () {
|
|
9
|
-
return [
|
|
10
|
-
/* Set logo in the layout header. */
|
|
11
|
-
new UIViewPlugin(AdminView, function (view) {
|
|
12
|
-
view.getHeaderElement().setLogo( /*#__PURE__*/React.createElement(Logo, {
|
|
13
|
-
white: true
|
|
14
|
-
}));
|
|
15
|
-
}),
|
|
16
|
-
/* Set logo in the navigation drawer. */
|
|
17
|
-
new UIViewPlugin(NavigationView, function (view) {
|
|
18
|
-
view.getHeaderElement().setLogo( /*#__PURE__*/React.createElement(Logo, {
|
|
19
|
-
onClick: function onClick() {
|
|
20
|
-
return view.getNavigationHook().hideMenu();
|
|
21
|
-
}
|
|
22
|
-
})); // IMPORTANT: Fetch logo plugin for backwards compatibility.
|
|
23
|
-
|
|
24
|
-
var logoPlugin = plugins.byName("admin-menu-logo");
|
|
25
|
-
|
|
26
|
-
if (logoPlugin) {
|
|
27
|
-
view.getHeaderElement().setLogo( /*#__PURE__*/React.cloneElement(logoPlugin.render(), {
|
|
28
|
-
className: logoStyle
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
})];
|
|
32
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NavigationMenuElement } from "../../ui/elements/NavigationMenuElement";
|
|
3
|
-
import { ReactComponent as DocsIcon } from "@svgr/webpack!../../assets/icons/icon-documentation.svg";
|
|
4
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
5
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
6
|
-
export default (function () {
|
|
7
|
-
return new UIViewPlugin(NavigationView, function (view) {
|
|
8
|
-
view.getFooterElement().addMenuElement(new NavigationMenuElement("documentation", {
|
|
9
|
-
label: "Documentation",
|
|
10
|
-
icon: /*#__PURE__*/React.createElement(DocsIcon, null),
|
|
11
|
-
path: "https://docs.webiny.com/",
|
|
12
|
-
rel: "noopener noreferrer",
|
|
13
|
-
target: "_blank"
|
|
14
|
-
}));
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { css } from "emotion";
|
|
7
|
-
import { ListItem, ListItemGraphic } from "@webiny/ui/List";
|
|
8
|
-
import { Icon } from "@webiny/ui/Icon";
|
|
9
|
-
import { ReactComponent as FileIcon } from "@svgr/webpack!../../assets/icons/insert_drive_file-24px.svg";
|
|
10
|
-
import { FileManager } from "../../components";
|
|
11
|
-
import { NavigationMenuElement } from "../../ui/elements/NavigationMenuElement";
|
|
12
|
-
import { UIRenderer } from "../../ui/UIRenderer";
|
|
13
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
14
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
15
|
-
var listItemStyle = /*#__PURE__*/css({
|
|
16
|
-
".mdc-list &.mdc-list-item:hover": {
|
|
17
|
-
cursor: "pointer",
|
|
18
|
-
backgroundColor: "var(--mdc-theme-background)"
|
|
19
|
-
}
|
|
20
|
-
}, "label:listItemStyle;");
|
|
21
|
-
|
|
22
|
-
var FileManagerMenuItemRenderer = /*#__PURE__*/function (_UIRenderer) {
|
|
23
|
-
_inherits(FileManagerMenuItemRenderer, _UIRenderer);
|
|
24
|
-
|
|
25
|
-
var _super = _createSuper(FileManagerMenuItemRenderer);
|
|
26
|
-
|
|
27
|
-
function FileManagerMenuItemRenderer() {
|
|
28
|
-
_classCallCheck(this, FileManagerMenuItemRenderer);
|
|
29
|
-
|
|
30
|
-
return _super.apply(this, arguments);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
_createClass(FileManagerMenuItemRenderer, [{
|
|
34
|
-
key: "render",
|
|
35
|
-
value: function render(_ref) {
|
|
36
|
-
var element = _ref.element;
|
|
37
|
-
return /*#__PURE__*/React.createElement(FileManager, null, function (_ref2) {
|
|
38
|
-
var showFileManager = _ref2.showFileManager;
|
|
39
|
-
return /*#__PURE__*/React.createElement(ListItem, {
|
|
40
|
-
ripple: false,
|
|
41
|
-
onClick: showFileManager,
|
|
42
|
-
className: listItemStyle,
|
|
43
|
-
"data-testid": element.config.testId
|
|
44
|
-
}, /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(Icon, {
|
|
45
|
-
icon: element.config.icon
|
|
46
|
-
})), element.config.label);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}]);
|
|
50
|
-
|
|
51
|
-
return FileManagerMenuItemRenderer;
|
|
52
|
-
}(UIRenderer);
|
|
53
|
-
|
|
54
|
-
export default (function () {
|
|
55
|
-
return [new UIViewPlugin(NavigationView, function (view) {
|
|
56
|
-
var element = new NavigationMenuElement("fileManager", {
|
|
57
|
-
label: "File Manager",
|
|
58
|
-
icon: /*#__PURE__*/React.createElement(FileIcon, null),
|
|
59
|
-
testId: "admin-drawer-footer-menu-file-manager"
|
|
60
|
-
});
|
|
61
|
-
element.addRenderer(new FileManagerMenuItemRenderer());
|
|
62
|
-
view.getFooterElement().addMenuElement(element);
|
|
63
|
-
})];
|
|
64
|
-
});
|
package/plugins/menu/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UIElementPlugin } from "../../ui/UIElement";
|
|
2
|
-
import { NavigationMenuElement } from "../../ui/elements/NavigationMenuElement";
|
|
3
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
4
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
5
|
-
declare const _default: (UIViewPlugin<NavigationView> | UIElementPlugin<NavigationMenuElement<import("../../ui/elements/NavigationMenuElement").NavigationMenuElementConfig>>)[];
|
|
6
|
-
export default _default;
|
package/plugins/menu/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IconButton } from "@webiny/ui/Button";
|
|
3
|
-
import { ReactComponent as MenuIcon } from "@svgr/webpack!../../assets/icons/baseline-menu-24px.svg";
|
|
4
|
-
import { MenuGroupRenderer } from "./renderers/MenuGroupRenderer";
|
|
5
|
-
import { MenuSectionRenderer } from "./renderers/MenuSectionRenderer";
|
|
6
|
-
import { MenuSectionItemRenderer } from "./renderers/MenuSectionItemRenderer";
|
|
7
|
-
import { MenuLinkRenderer } from "./renderers/MenuLinkRenderer";
|
|
8
|
-
import { UIElementPlugin } from "../../ui/UIElement";
|
|
9
|
-
import { NavigationMenuElement } from "../../ui/elements/NavigationMenuElement";
|
|
10
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
11
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
12
|
-
export default [new UIViewPlugin(NavigationView, function (view) {
|
|
13
|
-
view.getHeaderElement().setMenuButton( /*#__PURE__*/React.createElement(IconButton, {
|
|
14
|
-
icon: /*#__PURE__*/React.createElement(MenuIcon, null),
|
|
15
|
-
onClick: function onClick() {
|
|
16
|
-
return view.getNavigationHook().hideMenu();
|
|
17
|
-
}
|
|
18
|
-
}));
|
|
19
|
-
}), new UIElementPlugin(NavigationMenuElement, function (element) {
|
|
20
|
-
element.addRenderer(new MenuGroupRenderer());
|
|
21
|
-
element.addRenderer(new MenuSectionRenderer());
|
|
22
|
-
element.addRenderer(new MenuSectionItemRenderer());
|
|
23
|
-
element.addRenderer(new MenuLinkRenderer());
|
|
24
|
-
})];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { UIRenderer, UIRenderParams } from "../../../ui/UIRenderer";
|
|
3
|
-
import { NavigationMenuElement } from "../../../ui/elements/NavigationMenuElement";
|
|
4
|
-
export declare class MenuGroupRenderer extends UIRenderer<NavigationMenuElement> {
|
|
5
|
-
canRender(element: NavigationMenuElement): boolean;
|
|
6
|
-
render({ element, props, next }: UIRenderParams<NavigationMenuElement>): React.ReactNode;
|
|
7
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
|
-
import React, { Fragment } from "react";
|
|
8
|
-
import { css } from "emotion";
|
|
9
|
-
import { Transition } from "react-transition-group";
|
|
10
|
-
import classNames from "classnames";
|
|
11
|
-
import { UIRenderer } from "../../../ui/UIRenderer";
|
|
12
|
-
import { List, ListItem, ListItemGraphic, ListItemMeta } from "@webiny/ui/List";
|
|
13
|
-
import { IconButton } from "@webiny/ui/Button";
|
|
14
|
-
import { ReactComponent as UpIcon } from "@svgr/webpack!../../../assets/icons/round-keyboard_arrow_up-24px.svg";
|
|
15
|
-
import { ReactComponent as DownIcon } from "@svgr/webpack!../../../assets/icons/round-keyboard_arrow_down-24px.svg";
|
|
16
|
-
import { ContentElement } from "../../../ui/views/NavigationView/ContentElement";
|
|
17
|
-
import { Link } from "@webiny/react-router";
|
|
18
|
-
var defaultStyle = {
|
|
19
|
-
transform: "translateY(-20px)",
|
|
20
|
-
opacity: 0,
|
|
21
|
-
transitionProperty: "transform, opacity",
|
|
22
|
-
transitionTimingFunction: "cubic-bezier(0, 0, .2, 1)",
|
|
23
|
-
transitionDuration: "100ms",
|
|
24
|
-
willChange: "opacity, transform"
|
|
25
|
-
};
|
|
26
|
-
var transitionStyles = {
|
|
27
|
-
entering: {
|
|
28
|
-
transform: "translateY(-20px)",
|
|
29
|
-
opacity: 0
|
|
30
|
-
},
|
|
31
|
-
entered: {
|
|
32
|
-
transform: "translateY(0px)",
|
|
33
|
-
opacity: 1
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var menuTitle = /*#__PURE__*/css({
|
|
37
|
-
".mdc-drawer &.mdc-list": {
|
|
38
|
-
borderBottom: "1px solid var(--mdc-theme-on-background)",
|
|
39
|
-
padding: 0,
|
|
40
|
-
".mdc-list-item": {
|
|
41
|
-
margin: 0,
|
|
42
|
-
padding: "0 15px",
|
|
43
|
-
height: "48px",
|
|
44
|
-
width: "100%",
|
|
45
|
-
fontWeight: 600,
|
|
46
|
-
boxSizing: "border-box"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, "label:menuTitle;");
|
|
50
|
-
var menuTitleActive = /*#__PURE__*/css({
|
|
51
|
-
backgroundColor: "var(--mdc-theme-background)"
|
|
52
|
-
}, "label:menuTitleActive;");
|
|
53
|
-
export var MenuGroupRenderer = /*#__PURE__*/function (_UIRenderer) {
|
|
54
|
-
_inherits(MenuGroupRenderer, _UIRenderer);
|
|
55
|
-
|
|
56
|
-
var _super = _createSuper(MenuGroupRenderer);
|
|
57
|
-
|
|
58
|
-
function MenuGroupRenderer() {
|
|
59
|
-
_classCallCheck(this, MenuGroupRenderer);
|
|
60
|
-
|
|
61
|
-
return _super.apply(this, arguments);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
_createClass(MenuGroupRenderer, [{
|
|
65
|
-
key: "canRender",
|
|
66
|
-
value: function canRender(element) {
|
|
67
|
-
var isInContent = Boolean(element.getParentByType(ContentElement));
|
|
68
|
-
return element.depth === 1 && isInContent && !element.config.path;
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "render",
|
|
72
|
-
value: function render(_ref) {
|
|
73
|
-
var element = _ref.element,
|
|
74
|
-
props = _ref.props,
|
|
75
|
-
next = _ref.next;
|
|
76
|
-
var hasChildren = element.getChildren().length > 0;
|
|
77
|
-
|
|
78
|
-
if (!hasChildren) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var withLink = function withLink(content) {
|
|
83
|
-
var defaultOnClick = element.getView().getNavigationHook().hideMenu;
|
|
84
|
-
var onClick = element.config.onClick || defaultOnClick;
|
|
85
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
86
|
-
to: element.config.path,
|
|
87
|
-
"data-testid": element.config.testId,
|
|
88
|
-
onClick: onClick ? function () {
|
|
89
|
-
return onClick(props);
|
|
90
|
-
} : null
|
|
91
|
-
}, content);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var menuItem = /*#__PURE__*/React.createElement(List, {
|
|
95
|
-
className: classNames(menuTitle, _defineProperty({}, menuTitleActive, element.isExpanded))
|
|
96
|
-
}, /*#__PURE__*/React.createElement(ListItem, {
|
|
97
|
-
"data-testid": element.config.testId,
|
|
98
|
-
onClick: function onClick() {
|
|
99
|
-
if (typeof element.config.onClick === "function") {
|
|
100
|
-
element.config.onClick(function () {
|
|
101
|
-
return element.toggleElement();
|
|
102
|
-
});
|
|
103
|
-
} else {
|
|
104
|
-
element.toggleElement();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}, element.config.icon && /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
108
|
-
icon: element.config.icon
|
|
109
|
-
})), element.config.label, hasChildren ? /*#__PURE__*/React.createElement(ListItemMeta, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
110
|
-
icon: element.isExpanded ? /*#__PURE__*/React.createElement(UpIcon, null) : /*#__PURE__*/React.createElement(DownIcon, null)
|
|
111
|
-
})) : null));
|
|
112
|
-
return /*#__PURE__*/React.createElement(Fragment, null, element.config.path ? withLink(menuItem) : menuItem, hasChildren ? /*#__PURE__*/React.createElement(Transition, {
|
|
113
|
-
in: element.isExpanded,
|
|
114
|
-
timeout: 100,
|
|
115
|
-
appear: true,
|
|
116
|
-
unmountOnExit: true
|
|
117
|
-
}, function (state) {
|
|
118
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
style: _objectSpread(_objectSpread({}, defaultStyle), transitionStyles[state])
|
|
120
|
-
}, next());
|
|
121
|
-
}) : null);
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
|
|
125
|
-
return MenuGroupRenderer;
|
|
126
|
-
}(UIRenderer);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { UIRenderer, UIRenderParams } from "../../../ui/UIRenderer";
|
|
3
|
-
import { NavigationMenuElement } from "../../../ui/elements/NavigationMenuElement";
|
|
4
|
-
export declare class MenuLinkRenderer extends UIRenderer<NavigationMenuElement> {
|
|
5
|
-
canRender(element: NavigationMenuElement): boolean;
|
|
6
|
-
render({ element, props }: UIRenderParams<NavigationMenuElement>): React.ReactNode;
|
|
7
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { Link } from "@webiny/react-router";
|
|
7
|
-
import { ListItem, ListItemGraphic } from "@webiny/ui/List";
|
|
8
|
-
import { UIRenderer } from "../../../ui/UIRenderer";
|
|
9
|
-
import { Icon } from "@webiny/ui/Icon";
|
|
10
|
-
import { FooterElement } from "../../../ui/views/NavigationView/FooterElement";
|
|
11
|
-
export var MenuLinkRenderer = /*#__PURE__*/function (_UIRenderer) {
|
|
12
|
-
_inherits(MenuLinkRenderer, _UIRenderer);
|
|
13
|
-
|
|
14
|
-
var _super = _createSuper(MenuLinkRenderer);
|
|
15
|
-
|
|
16
|
-
function MenuLinkRenderer() {
|
|
17
|
-
_classCallCheck(this, MenuLinkRenderer);
|
|
18
|
-
|
|
19
|
-
return _super.apply(this, arguments);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_createClass(MenuLinkRenderer, [{
|
|
23
|
-
key: "canRender",
|
|
24
|
-
value: function canRender(element) {
|
|
25
|
-
var isInFooter = Boolean(element.getParentByType(FooterElement));
|
|
26
|
-
return element.depth === 1 && isInFooter;
|
|
27
|
-
}
|
|
28
|
-
}, {
|
|
29
|
-
key: "render",
|
|
30
|
-
value: function render(_ref) {
|
|
31
|
-
var element = _ref.element,
|
|
32
|
-
props = _ref.props;
|
|
33
|
-
var defaultOnClick = element.getView().getNavigationHook().hideMenu;
|
|
34
|
-
var onClick = element.config.onClick || defaultOnClick;
|
|
35
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
36
|
-
to: element.config.path,
|
|
37
|
-
"data-testid": element.config.testId,
|
|
38
|
-
onClick: onClick ? function () {
|
|
39
|
-
return onClick(props);
|
|
40
|
-
} : null,
|
|
41
|
-
rel: element.config.rel,
|
|
42
|
-
target: element.config.target
|
|
43
|
-
}, /*#__PURE__*/React.createElement(ListItem, {
|
|
44
|
-
ripple: false
|
|
45
|
-
}, element.config.icon ? /*#__PURE__*/React.createElement(ListItemGraphic, null, /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
-
icon: element.config.icon
|
|
47
|
-
})) : null, element.config.label));
|
|
48
|
-
}
|
|
49
|
-
}]);
|
|
50
|
-
|
|
51
|
-
return MenuLinkRenderer;
|
|
52
|
-
}(UIRenderer);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { UIRenderer, UIRenderParams } from "../../../ui/UIRenderer";
|
|
3
|
-
import { NavigationMenuElement } from "../../../ui/elements/NavigationMenuElement";
|
|
4
|
-
export declare class MenuSectionItemRenderer extends UIRenderer<NavigationMenuElement> {
|
|
5
|
-
canRender(element: NavigationMenuElement): boolean;
|
|
6
|
-
render({ element, props }: UIRenderParams<NavigationMenuElement>): React.ReactNode;
|
|
7
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { css } from "emotion";
|
|
7
|
-
import { Link } from "@webiny/react-router";
|
|
8
|
-
import { List, ListItem } from "@webiny/ui/List";
|
|
9
|
-
import { UIRenderer } from "../../../ui/UIRenderer";
|
|
10
|
-
var linkStyle = /*#__PURE__*/css({
|
|
11
|
-
color: "var(--mdc-theme-text-primary-on-background)",
|
|
12
|
-
textDecoration: "none",
|
|
13
|
-
display: "flex",
|
|
14
|
-
alignItems: "center",
|
|
15
|
-
width: "100%",
|
|
16
|
-
height: "100%",
|
|
17
|
-
outline: "none",
|
|
18
|
-
paddingLeft: 65,
|
|
19
|
-
"&:hover": {
|
|
20
|
-
textDecoration: "none"
|
|
21
|
-
}
|
|
22
|
-
}, "label:linkStyle;");
|
|
23
|
-
var submenuItems = /*#__PURE__*/css({
|
|
24
|
-
".mdc-drawer &.mdc-list-item": {
|
|
25
|
-
paddingLeft: 0
|
|
26
|
-
}
|
|
27
|
-
}, "label:submenuItems;");
|
|
28
|
-
var submenuList = /*#__PURE__*/css({
|
|
29
|
-
"&.mdc-list": {
|
|
30
|
-
padding: 0
|
|
31
|
-
}
|
|
32
|
-
}, "label:submenuList;");
|
|
33
|
-
export var MenuSectionItemRenderer = /*#__PURE__*/function (_UIRenderer) {
|
|
34
|
-
_inherits(MenuSectionItemRenderer, _UIRenderer);
|
|
35
|
-
|
|
36
|
-
var _super = _createSuper(MenuSectionItemRenderer);
|
|
37
|
-
|
|
38
|
-
function MenuSectionItemRenderer() {
|
|
39
|
-
_classCallCheck(this, MenuSectionItemRenderer);
|
|
40
|
-
|
|
41
|
-
return _super.apply(this, arguments);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
_createClass(MenuSectionItemRenderer, [{
|
|
45
|
-
key: "canRender",
|
|
46
|
-
value: function canRender(element) {
|
|
47
|
-
return [2, 3].includes(element.depth) && Boolean(element.config.path);
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
key: "render",
|
|
51
|
-
value: function render(_ref) {
|
|
52
|
-
var element = _ref.element,
|
|
53
|
-
props = _ref.props;
|
|
54
|
-
var defaultOnClick = element.getView().getNavigationHook().hideMenu;
|
|
55
|
-
var onClick = element.config.onClick || defaultOnClick;
|
|
56
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
57
|
-
className: submenuList
|
|
58
|
-
}, /*#__PURE__*/React.createElement(ListItem, {
|
|
59
|
-
className: submenuItems,
|
|
60
|
-
"data-testid": element.config.testId
|
|
61
|
-
}, element.config.path ? /*#__PURE__*/React.createElement(Link, {
|
|
62
|
-
className: linkStyle,
|
|
63
|
-
to: element.config.path,
|
|
64
|
-
onClick: onClick ? function () {
|
|
65
|
-
return onClick(props);
|
|
66
|
-
} : null
|
|
67
|
-
}, element.config.label) : /*#__PURE__*/React.createElement("span", {
|
|
68
|
-
onClick: onClick ? function () {
|
|
69
|
-
return onClick(props);
|
|
70
|
-
} : null,
|
|
71
|
-
className: linkStyle
|
|
72
|
-
}, element.config.label)));
|
|
73
|
-
}
|
|
74
|
-
}]);
|
|
75
|
-
|
|
76
|
-
return MenuSectionItemRenderer;
|
|
77
|
-
}(UIRenderer);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { UIRenderer, UIRenderParams } from "../../../ui/UIRenderer";
|
|
3
|
-
import { NavigationMenuElement } from "../../../ui/elements/NavigationMenuElement";
|
|
4
|
-
export declare class MenuSectionRenderer extends UIRenderer<NavigationMenuElement> {
|
|
5
|
-
canRender(element: NavigationMenuElement): boolean;
|
|
6
|
-
render({ element, next }: UIRenderParams<NavigationMenuElement>): React.ReactNode;
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
|
-
import React, { Fragment } from "react";
|
|
6
|
-
import { css } from "emotion";
|
|
7
|
-
import { Typography } from "@webiny/ui/Typography";
|
|
8
|
-
import { UIRenderer } from "../../../ui/UIRenderer";
|
|
9
|
-
var menuSectionTitle = /*#__PURE__*/css({
|
|
10
|
-
marginLeft: 20,
|
|
11
|
-
display: "flex",
|
|
12
|
-
alignItems: "center",
|
|
13
|
-
color: "var(--mdc-theme-on-surface)"
|
|
14
|
-
}, "label:menuSectionTitle;");
|
|
15
|
-
var iconWrapper = /*#__PURE__*/css({
|
|
16
|
-
marginRight: 5,
|
|
17
|
-
color: "var(--mdc-theme-on-surface)"
|
|
18
|
-
}, "label:iconWrapper;");
|
|
19
|
-
export var MenuSectionRenderer = /*#__PURE__*/function (_UIRenderer) {
|
|
20
|
-
_inherits(MenuSectionRenderer, _UIRenderer);
|
|
21
|
-
|
|
22
|
-
var _super = _createSuper(MenuSectionRenderer);
|
|
23
|
-
|
|
24
|
-
function MenuSectionRenderer() {
|
|
25
|
-
_classCallCheck(this, MenuSectionRenderer);
|
|
26
|
-
|
|
27
|
-
return _super.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
_createClass(MenuSectionRenderer, [{
|
|
31
|
-
key: "canRender",
|
|
32
|
-
value: function canRender(element) {
|
|
33
|
-
return element.depth === 2;
|
|
34
|
-
}
|
|
35
|
-
}, {
|
|
36
|
-
key: "render",
|
|
37
|
-
value: function render(_ref) {
|
|
38
|
-
var element = _ref.element,
|
|
39
|
-
next = _ref.next;
|
|
40
|
-
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className: menuSectionTitle
|
|
42
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: iconWrapper
|
|
44
|
-
}, element.config.icon), /*#__PURE__*/React.createElement(Typography, {
|
|
45
|
-
use: "overline"
|
|
46
|
-
}, element.config.label)), next());
|
|
47
|
-
}
|
|
48
|
-
}]);
|
|
49
|
-
|
|
50
|
-
return MenuSectionRenderer;
|
|
51
|
-
}(UIRenderer);
|
package/plugins/menu/slack.d.ts
DELETED
package/plugins/menu/slack.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { NavigationMenuElement } from "../../ui/elements/NavigationMenuElement";
|
|
3
|
-
import { ReactComponent as SlackIcon } from "@svgr/webpack!../../assets/icons/slack-logo.svg";
|
|
4
|
-
import { UIViewPlugin } from "../../ui/UIView";
|
|
5
|
-
import { NavigationView } from "../../ui/views/NavigationView";
|
|
6
|
-
export default (function () {
|
|
7
|
-
return new UIViewPlugin(NavigationView, function (view) {
|
|
8
|
-
view.getFooterElement().addMenuElement(new NavigationMenuElement("slack", {
|
|
9
|
-
label: "Slack",
|
|
10
|
-
icon: /*#__PURE__*/React.createElement(SlackIcon, null),
|
|
11
|
-
path: "https://www.webiny.com/slack/",
|
|
12
|
-
rel: "noopener noreferrer",
|
|
13
|
-
target: "_blank"
|
|
14
|
-
}));
|
|
15
|
-
});
|
|
16
|
-
});
|