@opengeoweb/workspace 9.0.0 → 9.2.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 +69 -49
- package/package.json +1 -1
- package/src/lib/components/WorkspaceView/WorkspaceControls.d.ts +0 -2
- package/src/lib/components/WorkspaceViewTitle/WorkspaceViewTitleConnect.d.ts +5 -0
- package/src/lib/storyUtils/componentsLookUp.d.ts +2 -1
- package/src/lib/storyUtils/componentsLookUp.stories.d.ts +4 -0
package/index.esm.js
CHANGED
|
@@ -5,11 +5,11 @@ import { isAxiosError, getAxiosErrorMessage, withEggs, ConfirmationServiceProvid
|
|
|
5
5
|
import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import React__default, { useContext, useRef, useCallback, useDebugValue, createElement, PureComponent, forwardRef } from 'react';
|
|
8
|
-
import { ThemeWrapper, lightTheme,
|
|
8
|
+
import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, WebAssetOff } from '@opengeoweb/theme';
|
|
9
9
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
10
10
|
import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
|
|
11
11
|
import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
|
|
12
|
-
import {
|
|
12
|
+
import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, useTheme as useTheme$2, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Box as Box$2, Backdrop, Menu, ListSubheader, MenuItem, Tabs } from '@mui/material';
|
|
13
13
|
import 'react-mosaic-component/react-mosaic-component.css';
|
|
14
14
|
import { jsx } from 'react/jsx-runtime';
|
|
15
15
|
import { ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
@@ -22733,6 +22733,13 @@ var viewPresetsListFullContent = [
|
|
|
22733
22733
|
componentType: "CapWarningList",
|
|
22734
22734
|
initialProps: {
|
|
22735
22735
|
}
|
|
22736
|
+
},
|
|
22737
|
+
{
|
|
22738
|
+
id: "warningList",
|
|
22739
|
+
title: "Warning List",
|
|
22740
|
+
componentType: "WarningList",
|
|
22741
|
+
initialProps: {
|
|
22742
|
+
}
|
|
22736
22743
|
}
|
|
22737
22744
|
];
|
|
22738
22745
|
|
|
@@ -22898,6 +22905,12 @@ var viewPresetsList = [
|
|
|
22898
22905
|
id: "capView",
|
|
22899
22906
|
date: "2022-06-01T12:34:27.787184",
|
|
22900
22907
|
scope: "system"
|
|
22908
|
+
},
|
|
22909
|
+
{
|
|
22910
|
+
title: "Warning List",
|
|
22911
|
+
id: "warningList",
|
|
22912
|
+
date: "2022-06-01T12:34:27.787184",
|
|
22913
|
+
scope: "system"
|
|
22901
22914
|
}
|
|
22902
22915
|
];
|
|
22903
22916
|
|
|
@@ -25784,12 +25797,7 @@ var WorkspaceControls = function WorkspaceControls(_ref) {
|
|
|
25784
25797
|
var createNode = _ref.createNode,
|
|
25785
25798
|
path = _ref.path,
|
|
25786
25799
|
_ref$shouldPreventClo = _ref.shouldPreventCloseView,
|
|
25787
|
-
shouldPreventCloseView = _ref$shouldPreventClo === void 0 ? false : _ref$shouldPreventClo
|
|
25788
|
-
_ref$isViewPresetDial = _ref.isViewPresetDialogOpen,
|
|
25789
|
-
isViewPresetDialogOpen = _ref$isViewPresetDial === void 0 ? false : _ref$isViewPresetDial,
|
|
25790
|
-
_ref$onToggleViewPres = _ref.onToggleViewPresetDialog,
|
|
25791
|
-
onToggleViewPresetDialog = _ref$onToggleViewPres === void 0 ? function () {} : _ref$onToggleViewPres;
|
|
25792
|
-
var theme = useTheme$2();
|
|
25800
|
+
shouldPreventCloseView = _ref$shouldPreventClo === void 0 ? false : _ref$shouldPreventClo;
|
|
25793
25801
|
var confirmDialog = useConfirmationDialog();
|
|
25794
25802
|
var _React$useContext = React.useContext(MosaicContext),
|
|
25795
25803
|
actions = _React$useContext.mosaicActions;
|
|
@@ -25849,25 +25857,6 @@ var WorkspaceControls = function WorkspaceControls(_ref) {
|
|
|
25849
25857
|
}));
|
|
25850
25858
|
};
|
|
25851
25859
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
25852
|
-
"data-testid": "open-viewpresets",
|
|
25853
|
-
sx: Object.assign(Object.assign({}, buttonStyle), {
|
|
25854
|
-
'&&': {
|
|
25855
|
-
backgroundColor: !isViewPresetDialogOpen ? 'transparent' : undefined,
|
|
25856
|
-
'&:hover': {
|
|
25857
|
-
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
25858
|
-
},
|
|
25859
|
-
'.MuiSvgIcon-root > path': {
|
|
25860
|
-
fill: isViewPresetDialogOpen ? theme.palette.geowebColors.iconButtons.tool.active.color : undefined
|
|
25861
|
-
}
|
|
25862
|
-
}
|
|
25863
|
-
}),
|
|
25864
|
-
variant: "tool",
|
|
25865
|
-
onClick: function onClick() {
|
|
25866
|
-
onToggleViewPresetDialog(!isViewPresetDialogOpen);
|
|
25867
|
-
},
|
|
25868
|
-
tooltipTitle: "Open view presets",
|
|
25869
|
-
isSelected: isViewPresetDialogOpen
|
|
25870
|
-
}, /*#__PURE__*/React.createElement(Menu, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
25871
25860
|
"data-testid": "split-horizontal-btn",
|
|
25872
25861
|
sx: buttonStyle,
|
|
25873
25862
|
onClick: function onClick() {
|
|
@@ -27635,7 +27624,7 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
27635
27624
|
paddingRight: '4px !important',
|
|
27636
27625
|
display: 'block',
|
|
27637
27626
|
width: '100%',
|
|
27638
|
-
height:
|
|
27627
|
+
height: 20,
|
|
27639
27628
|
fontStyle: hasChanges ? 'italic' : undefined,
|
|
27640
27629
|
fontWeight: 500,
|
|
27641
27630
|
textOverflow: 'ellipsis',
|
|
@@ -27645,7 +27634,9 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
27645
27634
|
textAlign: 'left',
|
|
27646
27635
|
textTransform: 'none',
|
|
27647
27636
|
'&.MuiButtonBase-root': {
|
|
27648
|
-
paddingLeft:
|
|
27637
|
+
paddingLeft: 1,
|
|
27638
|
+
paddingTop: 1,
|
|
27639
|
+
paddingBottom: 1,
|
|
27649
27640
|
border: 'none'
|
|
27650
27641
|
}
|
|
27651
27642
|
}
|
|
@@ -27658,7 +27649,7 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
27658
27649
|
marginLeft: 1,
|
|
27659
27650
|
color: 'geowebColors.captions.captionStatus.rgba'
|
|
27660
27651
|
}
|
|
27661
|
-
}, panelId), /*#__PURE__*/React.createElement(Menu
|
|
27652
|
+
}, panelId), /*#__PURE__*/React.createElement(Menu, {
|
|
27662
27653
|
BackdropProps: {
|
|
27663
27654
|
style: {
|
|
27664
27655
|
opacity: 0,
|
|
@@ -27723,6 +27714,7 @@ var WorkspaceOptions = function WorkspaceOptions(_ref) {
|
|
|
27723
27714
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
27724
27715
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
27725
27716
|
* */
|
|
27717
|
+
var VIEW_PRESET_MENU_TOOLTIP = 'View presets menu';
|
|
27726
27718
|
var NEW_TITLE_SUFFIX = '(not saved)';
|
|
27727
27719
|
var EXISTING_TITLE_SUFFIX = '(modified)';
|
|
27728
27720
|
var getPresetTitle = function getPresetTitle(title, hasChanges, isNew) {
|
|
@@ -27735,8 +27727,10 @@ var getPresetTitle = function getPresetTitle(title, hasChanges, isNew) {
|
|
|
27735
27727
|
return title;
|
|
27736
27728
|
};
|
|
27737
27729
|
var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
27738
|
-
var panelId = _ref.panelId
|
|
27730
|
+
var panelId = _ref.panelId,
|
|
27731
|
+
isViewPresetDialogOpen = _ref.isViewPresetDialogOpen;
|
|
27739
27732
|
var dispatch = useDispatch();
|
|
27733
|
+
var theme = useTheme$2();
|
|
27740
27734
|
var currentMapPreset = useSelector(function (store) {
|
|
27741
27735
|
return mapSelectors.getMapPreset(store, panelId);
|
|
27742
27736
|
});
|
|
@@ -27813,11 +27807,43 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
27813
27807
|
}
|
|
27814
27808
|
});
|
|
27815
27809
|
};
|
|
27810
|
+
var toggleViewPresetDialog = React.useCallback(function (_ref2) {
|
|
27811
|
+
var panelId = _ref2.panelId,
|
|
27812
|
+
isViewPresetDialogOpen = _ref2.isViewPresetDialogOpen;
|
|
27813
|
+
dispatch(viewPresetActions.toggleViewPresetListDialog({
|
|
27814
|
+
panelId: panelId,
|
|
27815
|
+
isViewPresetListDialogOpen: isViewPresetDialogOpen
|
|
27816
|
+
}));
|
|
27817
|
+
}, [dispatch]);
|
|
27816
27818
|
var isNewActive = activeMapPresetId === '';
|
|
27817
27819
|
var title = (workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.title) || MAPPRESET_ACTIVE_TITLE;
|
|
27818
27820
|
var viewScope = workspaceView === null || workspaceView === void 0 ? void 0 : workspaceView.scope;
|
|
27819
27821
|
var fullTitle = getPresetTitle(title, hasMapPresetChanges, isNewActive);
|
|
27820
|
-
return /*#__PURE__*/React.createElement(
|
|
27822
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
27823
|
+
"data-testid": "open-viewpresets",
|
|
27824
|
+
sx: {
|
|
27825
|
+
marginLeft: -1,
|
|
27826
|
+
marginRight: 1,
|
|
27827
|
+
'&&': {
|
|
27828
|
+
backgroundColor: !isViewPresetDialogOpen ? 'transparent' : undefined,
|
|
27829
|
+
'&:hover': {
|
|
27830
|
+
backgroundColor: 'geowebColors.workspace.tabButtonHover'
|
|
27831
|
+
},
|
|
27832
|
+
'.MuiSvgIcon-root > path': {
|
|
27833
|
+
fill: isViewPresetDialogOpen ? theme.palette.geowebColors.iconButtons.tool.active.color : undefined
|
|
27834
|
+
}
|
|
27835
|
+
}
|
|
27836
|
+
},
|
|
27837
|
+
variant: "tool",
|
|
27838
|
+
onClick: function onClick() {
|
|
27839
|
+
toggleViewPresetDialog({
|
|
27840
|
+
panelId: panelId,
|
|
27841
|
+
isViewPresetDialogOpen: !isViewPresetDialogOpen
|
|
27842
|
+
});
|
|
27843
|
+
},
|
|
27844
|
+
tooltipTitle: VIEW_PRESET_MENU_TOOLTIP,
|
|
27845
|
+
isSelected: isViewPresetDialogOpen
|
|
27846
|
+
}, /*#__PURE__*/React.createElement(Preset, null)), /*#__PURE__*/React.createElement(WorkspaceOptions, {
|
|
27821
27847
|
panelId: panelId,
|
|
27822
27848
|
title: fullTitle,
|
|
27823
27849
|
hasChanges: hasMapPresetChanges || isNewActive,
|
|
@@ -27826,7 +27852,7 @@ var WorkspaceViewTitleConnect = function WorkspaceViewTitleConnect(_ref) {
|
|
|
27826
27852
|
handleSaveAs: onSaveAs,
|
|
27827
27853
|
handleEdit: viewScope === 'user' ? onEdit : undefined,
|
|
27828
27854
|
id: "viewpreset-options-toolbutton"
|
|
27829
|
-
});
|
|
27855
|
+
}));
|
|
27830
27856
|
};
|
|
27831
27857
|
|
|
27832
27858
|
/* *
|
|
@@ -27948,19 +27974,13 @@ var WorkspaceTileConnect = function WorkspaceTileConnect(_ref) {
|
|
|
27948
27974
|
path: path,
|
|
27949
27975
|
createNode: createNode,
|
|
27950
27976
|
title: /*#__PURE__*/React.createElement(WorkspaceViewTitleConnect, {
|
|
27951
|
-
panelId: mosaicNodeId
|
|
27977
|
+
panelId: mosaicNodeId,
|
|
27978
|
+
isViewPresetDialogOpen: isViewPresetDialogOpen || false
|
|
27952
27979
|
}),
|
|
27953
27980
|
toolbarControls: /*#__PURE__*/React.createElement(WorkspaceControls, {
|
|
27954
27981
|
createNode: createNode,
|
|
27955
27982
|
path: path,
|
|
27956
|
-
shouldPreventCloseView: shouldPreventCloseView
|
|
27957
|
-
isViewPresetDialogOpen: isViewPresetDialogOpen,
|
|
27958
|
-
onToggleViewPresetDialog: function onToggleViewPresetDialog(isViewPresetDialogOpen) {
|
|
27959
|
-
toggleViewPresetDialog({
|
|
27960
|
-
panelId: mosaicNodeId,
|
|
27961
|
-
isViewPresetDialogOpen: isViewPresetDialogOpen
|
|
27962
|
-
});
|
|
27963
|
-
}
|
|
27983
|
+
shouldPreventCloseView: shouldPreventCloseView
|
|
27964
27984
|
})
|
|
27965
27985
|
}, isViewPresetsFetching && /*#__PURE__*/React.createElement(LinearProgress, {
|
|
27966
27986
|
"data-testid": "loading-bar",
|
|
@@ -33132,7 +33152,7 @@ var WorkspaceMenuButton = function WorkspaceMenuButton(_ref) {
|
|
|
33132
33152
|
};
|
|
33133
33153
|
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Box$2, {
|
|
33134
33154
|
sx: {
|
|
33135
|
-
padding:
|
|
33155
|
+
padding: '4px 8px',
|
|
33136
33156
|
flexGrow: 1
|
|
33137
33157
|
}
|
|
33138
33158
|
}, /*#__PURE__*/React__default.createElement(CustomIconButton, {
|
|
@@ -33143,6 +33163,7 @@ var WorkspaceMenuButton = function WorkspaceMenuButton(_ref) {
|
|
|
33143
33163
|
isSelected: showMenu,
|
|
33144
33164
|
"aria-label": "workspace menu",
|
|
33145
33165
|
variant: "tool",
|
|
33166
|
+
tooltipTitle: "Workspace menu",
|
|
33146
33167
|
sx: {
|
|
33147
33168
|
'&&': {
|
|
33148
33169
|
backgroundColor: !showMenu ? 'transparent' : undefined,
|
|
@@ -33151,7 +33172,7 @@ var WorkspaceMenuButton = function WorkspaceMenuButton(_ref) {
|
|
|
33151
33172
|
}
|
|
33152
33173
|
}
|
|
33153
33174
|
}
|
|
33154
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
33175
|
+
}, /*#__PURE__*/React__default.createElement(PresetWorkspace, null))), /*#__PURE__*/React__default.createElement(WorkspaceMenu, {
|
|
33155
33176
|
isOpen: showMenu,
|
|
33156
33177
|
closeMenu: onCloseMenu
|
|
33157
33178
|
}));
|
|
@@ -33319,16 +33340,15 @@ var WorkspaceTab = function WorkspaceTab(_ref) {
|
|
|
33319
33340
|
sx: {
|
|
33320
33341
|
display: 'flex',
|
|
33321
33342
|
flexDirection: 'row',
|
|
33322
|
-
alignItems: 'center'
|
|
33323
|
-
paddingLeft: 1
|
|
33343
|
+
alignItems: 'center'
|
|
33324
33344
|
},
|
|
33325
33345
|
"data-testid": "workspaceTab"
|
|
33326
|
-
}, /*#__PURE__*/React.createElement(
|
|
33346
|
+
}, /*#__PURE__*/React.createElement(WorkspaceMenuButtonConnect, {
|
|
33347
|
+
workspaceId: workspaceId
|
|
33348
|
+
}), /*#__PURE__*/React.createElement(WorkspaceOptionsConnect, {
|
|
33327
33349
|
title: title,
|
|
33328
33350
|
activeTab: activeTab,
|
|
33329
33351
|
workspaceId: workspaceId
|
|
33330
|
-
}), /*#__PURE__*/React.createElement(WorkspaceMenuButtonConnect, {
|
|
33331
|
-
workspaceId: workspaceId
|
|
33332
33352
|
}));
|
|
33333
33353
|
};
|
|
33334
33354
|
|
package/package.json
CHANGED
|
@@ -4,8 +4,6 @@ interface WorkspaceControlsProps {
|
|
|
4
4
|
path: MosaicBranch[];
|
|
5
5
|
createNode?: () => MosaicNode<string>;
|
|
6
6
|
shouldPreventCloseView?: boolean;
|
|
7
|
-
isViewPresetDialogOpen?: boolean;
|
|
8
|
-
onToggleViewPresetDialog?: (isOpen: boolean) => void;
|
|
9
7
|
}
|
|
10
8
|
declare const WorkspaceControls: React.FC<WorkspaceControlsProps>;
|
|
11
9
|
export default WorkspaceControls;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export interface ToggleViewPresetDialogProps {
|
|
3
|
+
panelId: string;
|
|
4
|
+
isViewPresetDialogOpen: boolean;
|
|
5
|
+
}
|
|
2
6
|
interface WorkspaceViewTitleConnectProps {
|
|
3
7
|
panelId: string;
|
|
8
|
+
isViewPresetDialogOpen: boolean;
|
|
4
9
|
}
|
|
5
10
|
export declare const NEW_TITLE_SUFFIX = "(not saved)";
|
|
6
11
|
export declare const EXISTING_TITLE_SUFFIX = "(modified)";
|
|
@@ -3,9 +3,10 @@ import { ComponentsLookUpPayload as CoreComponentsLookUpPayload } from '@opengeo
|
|
|
3
3
|
import { ComponentsLookUpPayload as TimeseriesComponentsLookUpPayload } from '@opengeoweb/timeseries';
|
|
4
4
|
import { ComponentsLookUpPayload as TafComponentsLookUpPayload } from '@opengeoweb/taf';
|
|
5
5
|
import { SigmetComponentsLookUpPayload, AirmetComponentsLookUpPayload } from '@opengeoweb/sigmet-airmet';
|
|
6
|
+
import { ComponentsLookUpPayload as WarningListComponentsLookUpPayLoad } from '@opengeoweb/warnings';
|
|
6
7
|
/**
|
|
7
8
|
* The lookup table is for registering your own components with the workspace.
|
|
8
9
|
* @param payload
|
|
9
10
|
* @returns
|
|
10
11
|
*/
|
|
11
|
-
export declare const componentsLookUp: (payload: CoreComponentsLookUpPayload | TimeseriesComponentsLookUpPayload | TafComponentsLookUpPayload | SigmetComponentsLookUpPayload | AirmetComponentsLookUpPayload) => React.ReactElement;
|
|
12
|
+
export declare const componentsLookUp: (payload: CoreComponentsLookUpPayload | TimeseriesComponentsLookUpPayload | TafComponentsLookUpPayload | SigmetComponentsLookUpPayload | AirmetComponentsLookUpPayload | WarningListComponentsLookUpPayLoad) => React.ReactElement;
|