@opengeoweb/shared 4.15.0 → 4.16.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/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useRef } from 'react';
3
- import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, Grid, useTheme, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, RadioGroup, FormControlLabel, Radio, Tooltip, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListItemIcon, Checkbox, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
3
+ import { Box, Typography, Dialog, DialogTitle, IconButton, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, Tooltip, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Checkbox, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
4
4
  import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, Delete, VisibilityOff, Visibility, ChevronDown } from '@opengeoweb/theme';
5
5
  import { throttle } from 'lodash';
6
6
  import Draggable from 'react-draggable';
@@ -935,6 +935,7 @@ var styles$5 = {
935
935
  color: theme.palette.common.white,
936
936
  boxShadow: theme.shadows[1],
937
937
  zIndex: 1000,
938
+ display: 'flex',
938
939
  padding: '0 16px'
939
940
  }, theme.breakpoints.up('md'), {
940
941
  padding: '0 24px'
@@ -961,32 +962,16 @@ var styles$5 = {
961
962
  var AppHeader = function AppHeader(_ref2) {
962
963
  var menu = _ref2.menu,
963
964
  userMenu = _ref2.userMenu,
965
+ workspaceTopBar = _ref2.workspaceTopBar,
964
966
  _ref2$title = _ref2.title,
965
967
  title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title;
966
968
  return /*#__PURE__*/React__default.createElement(Box, {
967
969
  component: "header",
968
970
  sx: styles$5.header
969
- }, /*#__PURE__*/React__default.createElement(Grid, {
970
- sx: styles$5.container,
971
- container: true,
972
- alignItems: "center"
973
- }, /*#__PURE__*/React__default.createElement(Grid, {
974
- item: true,
975
- xs: 6,
976
- sm: 6
977
- }, /*#__PURE__*/React__default.createElement(Grid, {
978
- container: true,
979
- alignItems: "center",
980
- wrap: "nowrap",
981
- sx: {
982
- button: {
983
- marginLeft: 4,
984
- color: 'geowebColors.typographyAndIcons.text'
985
- }
986
- }
987
971
  }, /*#__PURE__*/React__default.createElement(Box, {
988
972
  sx: {
989
- display: 'flex'
973
+ display: 'inherit',
974
+ alignItems: 'center'
990
975
  }
991
976
  }, /*#__PURE__*/React__default.createElement(GeoWebLogo, {
992
977
  style: {
@@ -994,16 +979,28 @@ var AppHeader = function AppHeader(_ref2) {
994
979
  top: '-1px',
995
980
  right: '-1px'
996
981
  }
997
- })), /*#__PURE__*/React__default.createElement(Typography, {
982
+ }), /*#__PURE__*/React__default.createElement(Typography, {
998
983
  variant: "h1",
999
984
  sx: styles$5.title
1000
- }, title), menu)), /*#__PURE__*/React__default.createElement(Grid, {
1001
- item: true,
1002
- xs: 6,
1003
- sm: 6,
1004
- container: true,
1005
- justifyContent: "flex-end"
1006
- }, userMenu)));
985
+ }, title)), /*#__PURE__*/React__default.createElement(Box, {
986
+ sx: {
987
+ flexGrow: 1,
988
+ display: 'flex',
989
+ marginLeft: 4,
990
+ alignItems: 'center'
991
+ }
992
+ }, /*#__PURE__*/React__default.createElement(Box, {
993
+ sx: {
994
+ button: {
995
+ color: 'geowebColors.typographyAndIcons.text'
996
+ }
997
+ }
998
+ }, menu), workspaceTopBar), /*#__PURE__*/React__default.createElement(Box, {
999
+ sx: {
1000
+ display: 'flex',
1001
+ alignItems: 'center'
1002
+ }
1003
+ }, userMenu));
1007
1004
  };
1008
1005
 
1009
1006
  /* *
@@ -2702,6 +2699,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
2702
2699
  buttonSx = _ref.buttonSx,
2703
2700
  _ref$tooltipTitle = _ref.tooltipTitle,
2704
2701
  tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
2702
+ _ref$menuTitle = _ref.menuTitle,
2703
+ menuTitle = _ref$menuTitle === void 0 ? '' : _ref$menuTitle,
2705
2704
  variant = _ref.variant,
2706
2705
  _ref$isDefaultOpen = _ref.isDefaultOpen,
2707
2706
  isDefaultOpen = _ref$isDefaultOpen === void 0 ? false : _ref$isDefaultOpen;
@@ -2762,7 +2761,13 @@ var ToggleMenu = function ToggleMenu(_ref) {
2762
2761
  padding: '0px'
2763
2762
  }
2764
2763
  })
2765
- }, menuItems && menuItems.map(function (menuItem) {
2764
+ }, menuTitle && /*#__PURE__*/React.createElement(ListSubheader, {
2765
+ "data-testid": "toggleMenuTitle"
2766
+ }, /*#__PURE__*/React.createElement(Typography, {
2767
+ sx: {
2768
+ fontSize: '12px'
2769
+ }
2770
+ }, menuTitle)), menuItems && menuItems.map(function (menuItem) {
2766
2771
  var text = menuItem.text,
2767
2772
  icon = menuItem.icon,
2768
2773
  action = menuItem.action;
@@ -2891,7 +2896,8 @@ var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
2891
2896
  var tooltipTitle = _ref.tooltipTitle,
2892
2897
  onClickDelete = _ref.onClickDelete,
2893
2898
  _ref$isEnabled = _ref.isEnabled,
2894
- isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
2899
+ isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
2900
+ sx = _ref.sx;
2895
2901
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ManagerButton, {
2896
2902
  tooltipTitle: tooltipTitle,
2897
2903
  onClick: onClickDelete,
@@ -2903,15 +2909,16 @@ var ManagerDeleteButton = function ManagerDeleteButton(_ref) {
2903
2909
  variant: "tertiary",
2904
2910
  onClick: onClickDelete,
2905
2911
  startIcon: /*#__PURE__*/React.createElement(Delete, null),
2906
- sx: {
2912
+ sx: Object.assign({
2907
2913
  display: 'none'
2908
- }
2914
+ }, sx)
2909
2915
  }, "Delete")), /*#__PURE__*/React.createElement(ManagerButton, {
2910
2916
  tooltipTitle: tooltipTitle,
2911
2917
  onClick: onClickDelete,
2912
2918
  icon: /*#__PURE__*/React.createElement(Delete, null),
2913
2919
  testId: "deleteButton",
2914
- isEnabled: isEnabled
2920
+ isEnabled: isEnabled,
2921
+ sx: sx
2915
2922
  }));
2916
2923
  };
2917
2924
 
package/index.umd.js CHANGED
@@ -815,6 +815,7 @@
815
815
  color: theme.palette.common.white,
816
816
  boxShadow: theme.shadows[1],
817
817
  zIndex: 1000,
818
+ display: 'flex',
818
819
  padding: '0 16px'
819
820
  }, _a[theme.breakpoints.up('md')] = {
820
821
  padding: '0 24px'
@@ -841,32 +842,16 @@
841
842
  var AppHeader = function AppHeader(_a) {
842
843
  var menu = _a.menu,
843
844
  userMenu = _a.userMenu,
845
+ workspaceTopBar = _a.workspaceTopBar,
844
846
  _b = _a.title,
845
847
  title = _b === void 0 ? 'GeoWeb' : _b;
846
848
  return /*#__PURE__*/React__default["default"].createElement(material.Box, {
847
849
  component: "header",
848
850
  sx: styles$5.header
849
- }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
850
- sx: styles$5.container,
851
- container: true,
852
- alignItems: "center"
853
- }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
854
- item: true,
855
- xs: 6,
856
- sm: 6
857
- }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
858
- container: true,
859
- alignItems: "center",
860
- wrap: "nowrap",
861
- sx: {
862
- button: {
863
- marginLeft: 4,
864
- color: 'geowebColors.typographyAndIcons.text'
865
- }
866
- }
867
851
  }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
868
852
  sx: {
869
- display: 'flex'
853
+ display: 'inherit',
854
+ alignItems: 'center'
870
855
  }
871
856
  }, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, {
872
857
  style: {
@@ -874,16 +859,28 @@
874
859
  top: '-1px',
875
860
  right: '-1px'
876
861
  }
877
- })), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
862
+ }), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
878
863
  variant: "h1",
879
864
  sx: styles$5.title
880
- }, title), menu)), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
881
- item: true,
882
- xs: 6,
883
- sm: 6,
884
- container: true,
885
- justifyContent: "flex-end"
886
- }, userMenu)));
865
+ }, title)), /*#__PURE__*/React__default["default"].createElement(material.Box, {
866
+ sx: {
867
+ flexGrow: 1,
868
+ display: 'flex',
869
+ marginLeft: 4,
870
+ alignItems: 'center'
871
+ }
872
+ }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
873
+ sx: {
874
+ button: {
875
+ color: 'geowebColors.typographyAndIcons.text'
876
+ }
877
+ }
878
+ }, menu), workspaceTopBar), /*#__PURE__*/React__default["default"].createElement(material.Box, {
879
+ sx: {
880
+ display: 'flex',
881
+ alignItems: 'center'
882
+ }
883
+ }, userMenu));
887
884
  };
888
885
 
889
886
  /* *
@@ -2574,19 +2571,21 @@
2574
2571
  buttonSx = _a.buttonSx,
2575
2572
  _d = _a.tooltipTitle,
2576
2573
  tooltipTitle = _d === void 0 ? '' : _d,
2574
+ _e = _a.menuTitle,
2575
+ menuTitle = _e === void 0 ? '' : _e,
2577
2576
  variant = _a.variant,
2578
- _e = _a.isDefaultOpen,
2579
- isDefaultOpen = _e === void 0 ? false : _e;
2577
+ _f = _a.isDefaultOpen,
2578
+ isDefaultOpen = _f === void 0 ? false : _f;
2580
2579
 
2581
- var _f = __read(React__namespace.useState(null), 2),
2582
- anchorEl = _f[0],
2583
- setAnchorEl = _f[1];
2580
+ var _g = __read(React__namespace.useState(null), 2),
2581
+ anchorEl = _g[0],
2582
+ setAnchorEl = _g[1];
2584
2583
 
2585
2584
  var isOpen = Boolean(anchorEl);
2586
2585
 
2587
- var _g = getPosition(menuPosition),
2588
- anchorOrigin = _g.anchorOrigin,
2589
- transformOrigin = _g.transformOrigin;
2586
+ var _h = getPosition(menuPosition),
2587
+ anchorOrigin = _h.anchorOrigin,
2588
+ transformOrigin = _h.transformOrigin;
2590
2589
 
2591
2590
  var handleClick = function handleClick(event) {
2592
2591
  event.stopPropagation();
@@ -2633,7 +2632,13 @@
2633
2632
  padding: '0px'
2634
2633
  }
2635
2634
  })
2636
- }, menuItems && menuItems.map(function (menuItem) {
2635
+ }, menuTitle && /*#__PURE__*/React__namespace.createElement(material.ListSubheader, {
2636
+ "data-testid": "toggleMenuTitle"
2637
+ }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
2638
+ sx: {
2639
+ fontSize: '12px'
2640
+ }
2641
+ }, menuTitle)), menuItems && menuItems.map(function (menuItem) {
2637
2642
  var text = menuItem.text,
2638
2643
  icon = menuItem.icon,
2639
2644
  action = menuItem.action;
@@ -2762,7 +2767,8 @@
2762
2767
  var tooltipTitle = _a.tooltipTitle,
2763
2768
  onClickDelete = _a.onClickDelete,
2764
2769
  _b = _a.isEnabled,
2765
- isEnabled = _b === void 0 ? true : _b;
2770
+ isEnabled = _b === void 0 ? true : _b,
2771
+ sx = _a.sx;
2766
2772
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ManagerButton, {
2767
2773
  tooltipTitle: tooltipTitle,
2768
2774
  onClick: onClickDelete,
@@ -2774,15 +2780,16 @@
2774
2780
  variant: "tertiary",
2775
2781
  onClick: onClickDelete,
2776
2782
  startIcon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
2777
- sx: {
2783
+ sx: __assign({
2778
2784
  display: 'none'
2779
- }
2785
+ }, sx)
2780
2786
  }, "Delete")), /*#__PURE__*/React__namespace.createElement(ManagerButton, {
2781
2787
  tooltipTitle: tooltipTitle,
2782
2788
  onClick: onClickDelete,
2783
2789
  icon: /*#__PURE__*/React__namespace.createElement(theme.Delete, null),
2784
2790
  testId: "deleteButton",
2785
- isEnabled: isEnabled
2791
+ isEnabled: isEnabled,
2792
+ sx: sx
2786
2793
  }));
2787
2794
  };
2788
2795
 
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface AppHeaderProps {
3
3
  menu?: React.ReactNode;
4
4
  userMenu?: React.ReactNode;
5
+ workspaceTopBar?: React.ReactNode;
5
6
  title?: string;
6
7
  }
7
8
  declare const AppHeader: React.FC<AppHeaderProps>;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface DeleteButtonProps {
2
+ import { IconButtonProps } from '@mui/material';
3
+ interface DeleteButtonProps extends IconButtonProps {
3
4
  tooltipTitle: string;
4
5
  onClickDelete: () => void;
5
6
  isEnabled?: boolean;
@@ -15,6 +15,7 @@ interface ToggleMenuProps {
15
15
  buttonTestId?: string;
16
16
  menuPosition?: MenuPosition;
17
17
  menuItems?: MenuItemType[];
18
+ menuTitle?: string;
18
19
  children?: React.ReactNode;
19
20
  buttonSx?: SxProps<Theme>;
20
21
  tooltipTitle?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "4.15.0",
3
+ "version": "4.16.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "peerDependencies": {
15
15
  "react": "^18.2.0",
16
16
  "@mui/material": "^5.10.8",
17
- "@opengeoweb/theme": "4.15.0",
17
+ "@opengeoweb/theme": "4.16.0",
18
18
  "react-draggable": "^4.4.5",
19
19
  "re-resizable": "^6.9.0",
20
20
  "@redux-eggs/core": "^2.2.0",