@webiny/app-admin 5.20.0 → 5.22.0-beta.1

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.
Files changed (134) hide show
  1. package/assets/icons/slack-logo.svg +1 -1
  2. package/base/Admin.d.ts +14 -0
  3. package/base/Admin.js +29 -0
  4. package/base/Base.d.ts +2 -0
  5. package/base/Base.js +65 -0
  6. package/base/plugins/AddGraphQLQuerySelection.d.ts +9 -0
  7. package/base/plugins/AddGraphQLQuerySelection.js +15 -0
  8. package/base/providers/ApolloProvider.d.ts +4 -0
  9. package/base/providers/ApolloProvider.js +14 -0
  10. package/base/providers/TelemetryProvider.d.ts +4 -0
  11. package/base/providers/TelemetryProvider.js +19 -0
  12. package/base/providers/UiStateProvider.d.ts +4 -0
  13. package/base/providers/UiStateProvider.js +10 -0
  14. package/base/providers/ViewCompositionProvider.d.ts +18 -0
  15. package/base/providers/ViewCompositionProvider.js +44 -0
  16. package/base/ui/Brand.d.ts +9 -0
  17. package/base/ui/Brand.js +6 -0
  18. package/base/ui/CenteredView.d.ts +8 -0
  19. package/base/ui/CenteredView.js +27 -0
  20. package/base/ui/Dashboard.d.ts +9 -0
  21. package/base/ui/Dashboard.js +6 -0
  22. package/base/ui/Layout.d.ts +13 -0
  23. package/base/ui/Layout.js +11 -0
  24. package/base/ui/LocaleSelector.d.ts +9 -0
  25. package/base/ui/LocaleSelector.js +6 -0
  26. package/base/ui/LoginScreen.d.ts +9 -0
  27. package/base/ui/LoginScreen.js +12 -0
  28. package/base/ui/Logo.d.ts +14 -0
  29. package/base/ui/Logo.js +20 -0
  30. package/base/ui/Menu.d.ts +35 -0
  31. package/base/ui/Menu.js +80 -0
  32. package/base/ui/Navigation.d.ts +35 -0
  33. package/base/ui/Navigation.js +147 -0
  34. package/base/ui/NotFound.d.ts +9 -0
  35. package/base/ui/NotFound.js +6 -0
  36. package/base/ui/Search.d.ts +28 -0
  37. package/base/ui/Search.js +48 -0
  38. package/base/ui/Tags.d.ts +8 -0
  39. package/base/ui/Tags.js +13 -0
  40. package/base/ui/UserMenu.d.ts +54 -0
  41. package/base/ui/UserMenu.js +86 -0
  42. package/components/AdminLayout.js +5 -31
  43. package/components/AppInstaller/AppInstaller.d.ts +4 -0
  44. package/components/AppInstaller/AppInstaller.js +136 -0
  45. package/components/AppInstaller/index.d.ts +1 -4
  46. package/components/AppInstaller/index.js +13 -133
  47. package/components/AppInstaller/styled.d.ts +4 -4
  48. package/components/EmptyView.js +1 -1
  49. package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +2 -2
  50. package/components/FileManager/DropFilesHere.js +1 -1
  51. package/components/FileManager/File.js +2 -2
  52. package/components/FileManager/FileDetails/Tags.js +2 -2
  53. package/components/FileManager/FileDetails.js +6 -6
  54. package/components/FileManager/FileManagerView.js +2 -2
  55. package/components/FileManager/LeftSidebar.js +1 -1
  56. package/components/FileManager/NoPermissionView.js +1 -1
  57. package/components/FloatingActionButton.js +1 -1
  58. package/components/OverlayLayout/OverlayLayout.js +1 -1
  59. package/components/Routes.d.ts +6 -0
  60. package/components/Routes.js +34 -0
  61. package/components/SearchUI.js +1 -1
  62. package/index.d.ts +28 -0
  63. package/index.js +26 -0
  64. package/package.json +28 -32
  65. package/plugins/MenuPlugin.d.ts +18 -1
  66. package/plugins/fileManager/fileDefault.js +1 -1
  67. package/plugins/fileManager/fileImage/DeleteAction.js +1 -1
  68. package/plugins/fileManager/fileImage/EditAction.js +1 -1
  69. package/plugins/globalSearch/SearchBar.d.ts +6 -3
  70. package/plugins/globalSearch/SearchBar.js +3 -2
  71. package/plugins/globalSearch/SearchBarDropdown.js +1 -1
  72. package/plugins/globalSearch/index.d.ts +0 -3
  73. package/plugins/globalSearch/index.js +0 -18
  74. package/plugins/globalSearch/styled.d.ts +3 -3
  75. package/plugins/index.d.ts +1 -1
  76. package/plugins/index.js +2 -4
  77. package/styles/material-theme-assignments.scss +1 -0
  78. package/types.d.ts +1 -10
  79. package/ui/elements/PanelElement.js +2 -1
  80. package/ui/elements/form/FileManagerElement/EmptyStateElement.js +2 -1
  81. package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +2 -2
  82. package/ui/elements/form/FileManagerElement/styled.d.ts +9 -9
  83. package/ui/elements/form/FileManagerElement.d.ts +3 -2
  84. package/ui/views/AdminView/ContentElement.js +1 -1
  85. package/ui/views/AdminView/components/Hamburger.js +1 -1
  86. package/ui/views/FormView/FormContentElement.js +2 -1
  87. package/ui/views/OverlayView/HeaderElement.js +1 -1
  88. package/ui/views/OverlayView/HeaderTitleElement.js +1 -1
  89. package/plugins/logo/Logo.d.ts +0 -22
  90. package/plugins/logo/Logo.js +0 -108
  91. package/plugins/logo/index.d.ts +0 -5
  92. package/plugins/logo/index.js +0 -32
  93. package/plugins/menu/documentation.d.ts +0 -4
  94. package/plugins/menu/documentation.js +0 -16
  95. package/plugins/menu/fileManager.d.ts +0 -4
  96. package/plugins/menu/fileManager.js +0 -64
  97. package/plugins/menu/index.d.ts +0 -6
  98. package/plugins/menu/index.js +0 -24
  99. package/plugins/menu/renderers/MenuGroupRenderer.d.ts +0 -7
  100. package/plugins/menu/renderers/MenuGroupRenderer.js +0 -126
  101. package/plugins/menu/renderers/MenuLinkRenderer.d.ts +0 -7
  102. package/plugins/menu/renderers/MenuLinkRenderer.js +0 -52
  103. package/plugins/menu/renderers/MenuSectionItemRenderer.d.ts +0 -7
  104. package/plugins/menu/renderers/MenuSectionItemRenderer.js +0 -77
  105. package/plugins/menu/renderers/MenuSectionRenderer.d.ts +0 -7
  106. package/plugins/menu/renderers/MenuSectionRenderer.js +0 -51
  107. package/plugins/menu/slack.d.ts +0 -4
  108. package/plugins/menu/slack.js +0 -16
  109. package/plugins/menu/source.d.ts +0 -4
  110. package/plugins/menu/source.js +0 -16
  111. package/plugins/userMenu/UserMenuElement.d.ts +0 -7
  112. package/plugins/userMenu/UserMenuElement.js +0 -43
  113. package/plugins/userMenu/UserMenuRenderer.d.ts +0 -6
  114. package/plugins/userMenu/UserMenuRenderer.js +0 -47
  115. package/plugins/userMenu/index.d.ts +0 -4
  116. package/plugins/userMenu/index.js +0 -16
  117. package/ui/views/AdminView.d.ts +0 -12
  118. package/ui/views/AdminView.js +0 -90
  119. package/ui/views/NavigationView/ContentElement.d.ts +0 -10
  120. package/ui/views/NavigationView/ContentElement.js +0 -86
  121. package/ui/views/NavigationView/FooterElement.d.ts +0 -13
  122. package/ui/views/NavigationView/FooterElement.js +0 -59
  123. package/ui/views/NavigationView/HeaderElement.d.ts +0 -16
  124. package/ui/views/NavigationView/HeaderElement.js +0 -66
  125. package/ui/views/NavigationView/NavigationViewRenderer.d.ts +0 -6
  126. package/ui/views/NavigationView/NavigationViewRenderer.js +0 -38
  127. package/ui/views/NavigationView/Styled.d.ts +0 -7
  128. package/ui/views/NavigationView/Styled.js +0 -47
  129. package/ui/views/NavigationView/legacyMenu.d.ts +0 -22
  130. package/ui/views/NavigationView/legacyMenu.js +0 -1
  131. package/ui/views/NavigationView/useNavigation.d.ts +0 -6
  132. package/ui/views/NavigationView/useNavigation.js +0 -22
  133. package/ui/views/NavigationView.d.ts +0 -26
  134. package/ui/views/NavigationView.js +0 -204
@@ -1,4 +0,0 @@
1
- import { UIViewPlugin } from "../../ui/UIView";
2
- import { AdminView } from "../../ui/views/AdminView";
3
- declare const _default: UIViewPlugin<AdminView>;
4
- export default _default;
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { GenericElement } from "../../ui/elements/GenericElement";
3
- import { Icon } from "@webiny/ui/Icon";
4
- import { UIViewPlugin } from "../../ui/UIView";
5
- import { UserMenuElement } from "./UserMenuElement";
6
- import { ReactComponent as Account } from "@svgr/webpack!../../assets/icons/round-account_circle-24px.svg";
7
- import { AdminView } from "../../ui/views/AdminView";
8
- export default new UIViewPlugin(AdminView, function (view) {
9
- var rightSection = view.getHeaderElement().getRightSection();
10
- var userMenu = rightSection.addElement(new UserMenuElement());
11
- userMenu.setMenuHandleElement(new GenericElement("handle", function () {
12
- return /*#__PURE__*/React.createElement(Icon, {
13
- icon: /*#__PURE__*/React.createElement(Account, null)
14
- });
15
- }));
16
- });
@@ -1,12 +0,0 @@
1
- import { UIView } from "../UIView";
2
- import { UIElement } from "../UIElement";
3
- import { HeaderElement } from "./AdminView/HeaderElement";
4
- import { ContentElement } from "./AdminView/ContentElement";
5
- export declare class AdminView extends UIView {
6
- private _title;
7
- constructor();
8
- setTitle(title: string): void;
9
- setContentElement(element: UIElement): void;
10
- getHeaderElement(): HeaderElement;
11
- getContentElement(): ContentElement;
12
- }
@@ -1,90 +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 React from "react";
8
- import Helmet from "react-helmet";
9
- import { UIView } from "../UIView";
10
- import { GenericElement } from "../elements/GenericElement";
11
- import { ViewElement } from "../elements/ViewElement";
12
- import { HeaderElement } from "./AdminView/HeaderElement";
13
- import { ContentElement } from "./AdminView/ContentElement";
14
- import { NavigationView } from "./NavigationView";
15
- import Snackbar from "./AdminView/components/Snackbar";
16
- import { DialogContainer } from "./AdminView/components/Dialog";
17
- export var AdminView = /*#__PURE__*/function (_UIView) {
18
- _inherits(AdminView, _UIView);
19
-
20
- var _super = _createSuper(AdminView);
21
-
22
- function AdminView() {
23
- var _this;
24
-
25
- _classCallCheck(this, AdminView);
26
-
27
- _this = _super.call(this, "AdminView");
28
-
29
- _defineProperty(_assertThisInitialized(_this), "_title", void 0);
30
-
31
- _this.useGrid(false);
32
-
33
- _this.addElement(new GenericElement("helmet", function () {
34
- return _this._title ? /*#__PURE__*/React.createElement(Helmet, {
35
- title: _this._title
36
- }) : null;
37
- }));
38
-
39
- _this.addElement(new HeaderElement("header"));
40
-
41
- _this.addElement(new ContentElement("content"));
42
-
43
- _this.addElement(new ViewElement("navigation", {
44
- view: new NavigationView()
45
- }));
46
-
47
- _this.addElement(new GenericElement("snackbarContainer", function () {
48
- return /*#__PURE__*/React.createElement(Snackbar, null);
49
- }));
50
-
51
- _this.addElement(new GenericElement("dialogContainer", function () {
52
- return /*#__PURE__*/React.createElement(DialogContainer, null);
53
- })); // Apply plugins
54
-
55
-
56
- _this.applyPlugins(AdminView);
57
-
58
- return _this;
59
- }
60
-
61
- _createClass(AdminView, [{
62
- key: "setTitle",
63
- value: function setTitle(title) {
64
- this._title = title;
65
- }
66
- }, {
67
- key: "setContentElement",
68
- value: function setContentElement(element) {
69
- var content = this.getContentElement(); // Remove previous content
70
-
71
- content.getChildren().forEach(function (el) {
72
- return el.remove();
73
- }); // Add new content
74
-
75
- content.addElement(element);
76
- }
77
- }, {
78
- key: "getHeaderElement",
79
- value: function getHeaderElement() {
80
- return this.getElement("header");
81
- }
82
- }, {
83
- key: "getContentElement",
84
- value: function getContentElement() {
85
- return this.getElement("content");
86
- }
87
- }]);
88
-
89
- return AdminView;
90
- }(UIView);
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { UIElement } from "../../UIElement";
3
- export declare class ContentElement extends UIElement {
4
- private _sorters;
5
- constructor(id: string);
6
- addElement<TElement extends UIElement = UIElement>(element: TElement): TElement;
7
- addSorter(sorter: Function): void;
8
- render(props?: any): React.ReactNode;
9
- private runSorters;
10
- }
@@ -1,86 +0,0 @@
1
- import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _get from "@babel/runtime/helpers/get";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _inherits from "@babel/runtime/helpers/inherits";
8
- import _createSuper from "@babel/runtime/helpers/createSuper";
9
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- import React from "react";
11
- import { UIElement } from "../../UIElement";
12
- import { DrawerContent } from "@webiny/ui/Drawer";
13
- import { navContent } from "./Styled";
14
- import { TAGS } from "../../elements/NavigationMenuElement";
15
- export var ContentElement = /*#__PURE__*/function (_UIElement) {
16
- _inherits(ContentElement, _UIElement);
17
-
18
- var _super = _createSuper(ContentElement);
19
-
20
- function ContentElement(id) {
21
- var _this;
22
-
23
- _classCallCheck(this, ContentElement);
24
-
25
- _this = _super.call(this, id);
26
-
27
- _defineProperty(_assertThisInitialized(_this), "_sorters", []);
28
-
29
- _this.useGrid(false);
30
-
31
- _this.addSorter(function (a, b) {
32
- if (a.hasTag(TAGS.APP) && b.hasTag(TAGS.UTILS)) {
33
- return -1;
34
- }
35
-
36
- if (a.hasTag(TAGS.UTILS) && b.hasTag(TAGS.APP)) {
37
- return 1;
38
- }
39
-
40
- return a.config.label.localeCompare(b.config.label);
41
- });
42
-
43
- return _this;
44
- }
45
-
46
- _createClass(ContentElement, [{
47
- key: "addElement",
48
- value: function addElement(element) {
49
- _get(_getPrototypeOf(ContentElement.prototype), "addElement", this).call(this, element);
50
-
51
- this.runSorters();
52
- return element;
53
- }
54
- }, {
55
- key: "addSorter",
56
- value: function addSorter(sorter) {
57
- this._sorters.push(sorter);
58
- }
59
- }, {
60
- key: "render",
61
- value: function render(props) {
62
- return /*#__PURE__*/React.createElement(DrawerContent, {
63
- className: navContent
64
- }, _get(_getPrototypeOf(ContentElement.prototype), "render", this).call(this, props));
65
- }
66
- }, {
67
- key: "runSorters",
68
- value: function runSorters() {
69
- var _iterator = _createForOfIteratorHelper(this._sorters),
70
- _step;
71
-
72
- try {
73
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
74
- var sorter = _step.value;
75
- this.getLayout().sort(sorter);
76
- }
77
- } catch (err) {
78
- _iterator.e(err);
79
- } finally {
80
- _iterator.f();
81
- }
82
- }
83
- }]);
84
-
85
- return ContentElement;
86
- }(UIElement);
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { UIElement, UIElementConfig } from "../../UIElement";
3
- import { NavigationMenuElement } from "../../elements/NavigationMenuElement";
4
- interface FooterElementConfig extends UIElementConfig {
5
- closeMenu: () => void;
6
- }
7
- export declare class FooterElement extends UIElement<FooterElementConfig> {
8
- private _footerPlaceholder;
9
- constructor(id: string, config: FooterElementConfig);
10
- addMenuElement(element: NavigationMenuElement): NavigationMenuElement<import("../../elements/NavigationMenuElement").NavigationMenuElementConfig>;
11
- render(props?: any): React.ReactNode;
12
- }
13
- export {};
@@ -1,59 +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 _get from "@babel/runtime/helpers/get";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _createSuper from "@babel/runtime/helpers/createSuper";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import React from "react";
10
- import { List, ListItem } from "@webiny/ui/List";
11
- import { UIElement } from "../../UIElement";
12
- import { GenericElement } from "../../elements/GenericElement";
13
- import { PlaceholderElement } from "../../elements/PlaceholderElement";
14
- import { MenuFooter, subFooter } from "./Styled";
15
- import { config as appConfig } from "@webiny/app/config";
16
- export var FooterElement = /*#__PURE__*/function (_UIElement) {
17
- _inherits(FooterElement, _UIElement);
18
-
19
- var _super = _createSuper(FooterElement);
20
-
21
- function FooterElement(id, config) {
22
- var _this;
23
-
24
- _classCallCheck(this, FooterElement);
25
-
26
- _this = _super.call(this, id, config);
27
-
28
- _defineProperty(_assertThisInitialized(_this), "_footerPlaceholder", void 0);
29
-
30
- _this.useGrid(false);
31
-
32
- _this._footerPlaceholder = _this.addElement(new PlaceholderElement("navigation.footer.placeholder"));
33
- var wbyVersion = appConfig.getKey("WEBINY_VERSION", process.env.REACT_APP_WEBINY_VERSION);
34
- new GenericElement("webiny.version", function () {
35
- return /*#__PURE__*/React.createElement(ListItem, {
36
- ripple: false,
37
- className: subFooter
38
- }, "Webiny v", wbyVersion);
39
- }).moveAfter(_this._footerPlaceholder);
40
- return _this;
41
- }
42
-
43
- _createClass(FooterElement, [{
44
- key: "addMenuElement",
45
- value: function addMenuElement(element) {
46
- element.moveBefore(this._footerPlaceholder);
47
- return element;
48
- }
49
- }, {
50
- key: "render",
51
- value: function render(props) {
52
- return /*#__PURE__*/React.createElement(MenuFooter, null, /*#__PURE__*/React.createElement(List, {
53
- nonInteractive: true
54
- }, _get(_getPrototypeOf(FooterElement.prototype), "render", this).call(this, props)));
55
- }
56
- }]);
57
-
58
- return FooterElement;
59
- }(UIElement);
@@ -1,16 +0,0 @@
1
- import React from "react";
2
- import { UIElement, UIElementConfig } from "../../UIElement";
3
- export declare enum ElementID {
4
- Logo = "headerLogo",
5
- MenuButton = "headerMenuButton"
6
- }
7
- interface HeaderElementConfig extends UIElementConfig {
8
- closeMenu: () => void;
9
- }
10
- export declare class HeaderElement extends UIElement<HeaderElementConfig> {
11
- constructor(id: string, config: HeaderElementConfig);
12
- setLogo(logo: React.ReactElement): void;
13
- setMenuButton(menuButton: React.ReactElement): void;
14
- render(props?: any): React.ReactNode;
15
- }
16
- export {};
@@ -1,66 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _get from "@babel/runtime/helpers/get";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _createSuper from "@babel/runtime/helpers/createSuper";
7
- import React from "react";
8
- import { UIElement } from "../../UIElement";
9
- import { DrawerHeader } from "@webiny/ui/Drawer";
10
- import { GenericElement } from "../../elements/GenericElement";
11
- import { PlaceholderElement } from "../../elements/PlaceholderElement";
12
- import { TopAppBarTitle } from "@webiny/ui/TopAppBar";
13
- import { MenuHeader, navHeader } from "./Styled";
14
- export var ElementID;
15
-
16
- (function (ElementID) {
17
- ElementID["Logo"] = "headerLogo";
18
- ElementID["MenuButton"] = "headerMenuButton";
19
- })(ElementID || (ElementID = {}));
20
-
21
- export var HeaderElement = /*#__PURE__*/function (_UIElement) {
22
- _inherits(HeaderElement, _UIElement);
23
-
24
- var _super = _createSuper(HeaderElement);
25
-
26
- function HeaderElement(id, config) {
27
- var _this;
28
-
29
- _classCallCheck(this, HeaderElement);
30
-
31
- _this = _super.call(this, id, config);
32
-
33
- _this.useGrid(false);
34
-
35
- _this.addElement(new PlaceholderElement(ElementID.MenuButton));
36
-
37
- _this.addElement(new PlaceholderElement(ElementID.Logo));
38
-
39
- return _this;
40
- }
41
-
42
- _createClass(HeaderElement, [{
43
- key: "setLogo",
44
- value: function setLogo(logo) {
45
- this.getElement(ElementID.Logo).replaceWith(new GenericElement(ElementID.Logo, function () {
46
- return /*#__PURE__*/React.createElement(TopAppBarTitle, null, logo);
47
- }));
48
- }
49
- }, {
50
- key: "setMenuButton",
51
- value: function setMenuButton(menuButton) {
52
- this.getElement(ElementID.MenuButton).replaceWith(new GenericElement(ElementID.MenuButton, function () {
53
- return menuButton;
54
- }));
55
- }
56
- }, {
57
- key: "render",
58
- value: function render(props) {
59
- return /*#__PURE__*/React.createElement(DrawerHeader, {
60
- className: navHeader
61
- }, /*#__PURE__*/React.createElement(MenuHeader, null, _get(_getPrototypeOf(HeaderElement.prototype), "render", this).call(this, props)));
62
- }
63
- }]);
64
-
65
- return HeaderElement;
66
- }(UIElement);
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { UIRenderer, UIRenderParams } from "../../UIRenderer";
3
- import { NavigationView } from "../NavigationView";
4
- export declare class NavigationViewRenderer extends UIRenderer<NavigationView> {
5
- render({ element, children }: UIRenderParams<NavigationView>): React.ReactNode;
6
- }
@@ -1,38 +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 { UIRenderer } from "../../UIRenderer";
7
- import { Drawer } from "@webiny/ui/Drawer";
8
- export var NavigationViewRenderer = /*#__PURE__*/function (_UIRenderer) {
9
- _inherits(NavigationViewRenderer, _UIRenderer);
10
-
11
- var _super = _createSuper(NavigationViewRenderer);
12
-
13
- function NavigationViewRenderer() {
14
- _classCallCheck(this, NavigationViewRenderer);
15
-
16
- return _super.apply(this, arguments);
17
- }
18
-
19
- _createClass(NavigationViewRenderer, [{
20
- key: "render",
21
- value: function render(_ref) {
22
- var element = _ref.element,
23
- children = _ref.children;
24
-
25
- var _element$getNavigatio = element.getNavigationHook(),
26
- menuIsShown = _element$getNavigatio.menuIsShown,
27
- hideMenu = _element$getNavigatio.hideMenu;
28
-
29
- return /*#__PURE__*/React.createElement(Drawer, {
30
- modal: true,
31
- open: menuIsShown(),
32
- onClose: hideMenu
33
- }, children());
34
- }
35
- }]);
36
-
37
- return NavigationViewRenderer;
38
- }(UIRenderer);
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const MenuHeader: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "onError" | "className" | "onChange" | "placeholder" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, object>;
3
- export declare const navHeader: string;
4
- export declare const navContent: string;
5
- export declare const logoStyle: string;
6
- export declare const MenuFooter: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "onError" | "className" | "onChange" | "placeholder" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, object>;
7
- export declare const subFooter: string;
@@ -1,47 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { css } from "emotion";
3
- export var MenuHeader = /*#__PURE__*/styled("div", {
4
- target: "e1b4rzuv0",
5
- label: "MenuHeader"
6
- })({
7
- display: "flex",
8
- alignItems: "center",
9
- padding: 5,
10
- backgroundColor: "var(--mdc-theme-surface)",
11
- borderBottom: "1px solid var(--mdc-theme-on-background)"
12
- });
13
- export var navHeader = /*#__PURE__*/css({
14
- padding: 0,
15
- "&.mdc-drawer__header": {
16
- padding: "0 !important",
17
- minHeight: 0
18
- }
19
- }, "label:navHeader;");
20
- export var navContent = /*#__PURE__*/css({
21
- padding: "0 !important"
22
- }, "label:navContent;");
23
- export var logoStyle = /*#__PURE__*/css({
24
- "&.mdc-top-app-bar__title": {
25
- paddingLeft: 15,
26
- ".webiny-logo": {
27
- color: "var(--mdc-theme-primary)"
28
- }
29
- }
30
- }, "label:logoStyle;");
31
- export var MenuFooter = /*#__PURE__*/styled("div", {
32
- target: "e1b4rzuv1",
33
- label: "MenuFooter"
34
- })({
35
- borderTop: "1px solid var(--mdc-theme-on-background)",
36
- a: {
37
- color: "var(--mdc-theme-text-on-primary)",
38
- textDecoration: "none"
39
- }
40
- });
41
- export var subFooter = /*#__PURE__*/css({
42
- ".mdc-drawer &.mdc-list-item": {
43
- borderTop: "1px solid var(--mdc-theme-on-background)",
44
- padding: "10px 16px",
45
- margin: 0
46
- }
47
- }, "label:subFooter;");
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- import { NavigationMenuElement } from "../../elements/NavigationMenuElement";
3
- export declare type MenuProps = {
4
- name: string;
5
- label: React.ReactNode;
6
- icon: React.ReactElement;
7
- children: React.ReactNode;
8
- onClick?: (toggleSection: () => void) => void;
9
- };
10
- export interface SectionProps {
11
- parent?: NavigationMenuElement;
12
- label: React.ReactNode;
13
- children: React.ReactNode;
14
- icon?: React.ReactElement;
15
- }
16
- export interface ItemProps {
17
- parent?: NavigationMenuElement;
18
- label: React.ReactNode;
19
- path: string;
20
- style?: React.CSSProperties;
21
- onClick?: () => any;
22
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export declare type UseNavigation = ReturnType<typeof useNavigation>;
2
- export declare function useNavigation(): {
3
- showMenu: () => void;
4
- hideMenu: () => void;
5
- menuIsShown(): boolean;
6
- };
@@ -1,22 +0,0 @@
1
- import _get from "lodash/get";
2
- import { useUi } from "@webiny/app/hooks/useUi";
3
- import { set } from "dot-prop-immutable";
4
- export function useNavigation() {
5
- var ui = useUi();
6
- var hook = {
7
- showMenu: function showMenu() {
8
- ui.setState(function (ui) {
9
- return set(ui, "appsMenu.show", true);
10
- });
11
- },
12
- hideMenu: function hideMenu() {
13
- ui.setState(function (ui) {
14
- return set(ui, "appsMenu.show", false);
15
- });
16
- },
17
- menuIsShown: function menuIsShown() {
18
- return _get(ui, "appsMenu.show", false);
19
- }
20
- };
21
- return hook;
22
- }
@@ -1,26 +0,0 @@
1
- import { UIView } from "../UIView";
2
- import { UseSecurity } from "@webiny/app-security";
3
- import { HeaderElement } from "./NavigationView/HeaderElement";
4
- import { ContentElement } from "./NavigationView/ContentElement";
5
- import { FooterElement } from "./NavigationView/FooterElement";
6
- import { UseNavigation } from "./NavigationView/useNavigation";
7
- import { NavigationMenuElement } from "../elements/NavigationMenuElement";
8
- export declare enum ElementID {
9
- Header = "navigationHeader",
10
- Content = "navigationContent",
11
- Footer = "navigationFooter",
12
- SettingsMenu = "menu.settings"
13
- }
14
- export declare class NavigationView extends UIView {
15
- constructor();
16
- addAppMenuElement(element: NavigationMenuElement): NavigationMenuElement<import("../elements/NavigationMenuElement").NavigationMenuElementConfig>;
17
- addUtilityMenuElement(element: NavigationMenuElement): NavigationMenuElement<import("../elements/NavigationMenuElement").NavigationMenuElementConfig>;
18
- addSettingsMenuElement(element: NavigationMenuElement): NavigationMenuElement<import("../elements/NavigationMenuElement").NavigationMenuElementConfig>;
19
- getNavigationHook(): UseNavigation;
20
- getSecurityHook(): UseSecurity;
21
- getHeaderElement(): HeaderElement;
22
- getContentElement(): ContentElement;
23
- getFooterElement(): FooterElement;
24
- getSettingsMenuElement(): NavigationMenuElement;
25
- private setupLegacyMenuPlugins;
26
- }