@opengeoweb/workspace 9.23.1 → 9.25.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
@@ -4,7 +4,7 @@ import { syncGroupsTypes, syncGroupsActions, layerActions, mapStoreActions, uiAc
4
4
  import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInstance, ApiProvider, useApiContext } from '@opengeoweb/api';
5
5
  import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, Mosaic } from 'react-mosaic-component';
6
6
  import i18n from 'i18next';
7
- import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
7
+ import { SHARED_NAMESPACE, sharedTranslations, isAxiosAuthError, getAxiosErrorMessage, isAxiosError, withEggs, ConfirmationServiceProvider, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, DEFAULT_FILTER_HEIGHT, usePrevious, Filter, Resizable, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
8
8
  import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations } from '@opengeoweb/webmap-react';
9
9
  import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
10
10
  import { CORE_NAMESPACE, coreTranslations } from '@opengeoweb/core';
@@ -13,7 +13,7 @@ import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$
13
13
  import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
14
14
  import { isAxiosError as isAxiosError$1 } from 'axios';
15
15
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
- import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
16
+ import { ThemeWrapper, lightTheme, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, CloudLoading, CloudIdle, WebAssetOff } from '@opengeoweb/theme';
17
17
  import { Provider, useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
18
18
  import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
19
19
  import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
@@ -22,7 +22,7 @@ import { getSagaExtension } from '@redux-eggs/saga-extension';
22
22
  import { produce } from 'immer';
23
23
  import * as React from 'react';
24
24
  import React__default, { useCallback } from 'react';
25
- import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, useTheme, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Box, Backdrop, Menu, ListSubheader, MenuItem, Tabs } from '@mui/material';
25
+ import { LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, Box, Backdrop, Menu, ListSubheader, MenuItem, useTheme, Tabs } from '@mui/material';
26
26
  import 'react-mosaic-component/react-mosaic-component.css';
27
27
  import AutoSizer from 'react-virtualized-auto-sizer';
28
28
  import { FixedSizeList } from 'react-window';
@@ -31,10 +31,6 @@ import { useFormContext } from 'react-hook-form';
31
31
  var en = {
32
32
  "workspace-menu": "Workspace menu",
33
33
  "workspace-new": "New workspace",
34
- "workspace-my-presets": "My presets",
35
- "workspace-system-presets": "System presets",
36
- "workspace-all-button": "All",
37
- "workspace-search": "Search",
38
34
  "workspace-loading": "Loading",
39
35
  "workspace-options": "Options",
40
36
  "workspace-results": "results",
@@ -92,10 +88,6 @@ var en = {
92
88
  var fi = {
93
89
  "workspace-menu": "Workspace menu",
94
90
  "workspace-new": "Uusi workspace",
95
- "workspace-my-presets": "Omat presetit",
96
- "workspace-system-presets": "Järestelmä presetit",
97
- "workspace-all-button": "Kaikki",
98
- "workspace-search": "Etsi",
99
91
  "workspace-loading": "Ladataan",
100
92
  "workspace-options": "Valinnat",
101
93
  "workspace-results": "tulokset",
@@ -153,10 +145,6 @@ var fi = {
153
145
  var no = {
154
146
  "workspace-menu": "Arbeidsrommeny",
155
147
  "workspace-new": "Nytt arbeidsrom",
156
- "workspace-my-presets": "Mine presets",
157
- "workspace-system-presets": "System presets",
158
- "workspace-all-button": "Alle",
159
- "workspace-search": "Søk",
160
148
  "workspace-loading": "Laster",
161
149
  "workspace-options": "Valg",
162
150
  "workspace-results": "resultater",
@@ -214,10 +202,6 @@ var no = {
214
202
  var nl = {
215
203
  "workspace-menu": "Workspace menu",
216
204
  "workspace-new": "Nieuwe workspace",
217
- "workspace-my-presets": "Mijn presets",
218
- "workspace-system-presets": "Systeem presets",
219
- "workspace-all-button": "Alle",
220
- "workspace-search": "Zoeken",
221
205
  "workspace-loading": "Laden",
222
206
  "workspace-options": "Opties",
223
207
  "workspace-results": "resultaten",
@@ -1735,13 +1719,13 @@ var WorkspaceErrorType;
1735
1719
  })(WorkspaceErrorType || (WorkspaceErrorType = {}));
1736
1720
 
1737
1721
  const workspaceListFilterOptions = [{
1738
- label: 'workspace-my-presets',
1722
+ label: 'shared-filter-my-presets',
1739
1723
  id: 'user',
1740
1724
  type: 'scope',
1741
1725
  isSelected: true,
1742
1726
  isDisabled: false
1743
1727
  }, {
1744
- label: 'workspace-system-presets',
1728
+ label: 'shared-filter-system-presets',
1745
1729
  id: 'system',
1746
1730
  type: 'scope',
1747
1731
  isSelected: true,
@@ -2885,13 +2869,13 @@ var PresetAction;
2885
2869
  })(PresetAction || (PresetAction = {}));
2886
2870
 
2887
2871
  const viewPresetsListFilterOptions = [{
2888
- label: 'workspace-my-presets',
2872
+ label: 'shared-filter-my-presets',
2889
2873
  id: 'user',
2890
2874
  type: 'scope',
2891
2875
  isSelected: true,
2892
2876
  isDisabled: false
2893
2877
  }, {
2894
- label: 'workspace-system-presets',
2878
+ label: 'shared-filter-system-presets',
2895
2879
  id: 'system',
2896
2880
  type: 'scope',
2897
2881
  isSelected: true,
@@ -3588,7 +3572,7 @@ const initWorkspaceTestI18n = () => {
3588
3572
  });
3589
3573
  };
3590
3574
  initWorkspaceTestI18n();
3591
- const ns = [WORKSPACE_NAMESPACE];
3575
+ const ns = [WORKSPACE_NAMESPACE, SHARED_NAMESPACE];
3592
3576
  const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
3593
3577
  ns
3594
3578
  }, params));
@@ -8446,155 +8430,6 @@ const WorkspaceSelectListRow = ({
8446
8430
  }));
8447
8431
  };
8448
8432
 
8449
- const FilterChip = ({
8450
- label,
8451
- id,
8452
- isSelected: _isSelected = false,
8453
- isDisabled: _isDisabled = false,
8454
- handleClick: _handleClick = () => {}
8455
- }) => {
8456
- const theme = useTheme();
8457
- return jsx(Chip, {
8458
- size: "small",
8459
- id: id,
8460
- label: label,
8461
- disabled: _isDisabled,
8462
- variant: _isSelected ? 'filled' : 'outlined',
8463
- color: _isSelected ? 'secondary' : 'default',
8464
- sx: {
8465
- borderColor: `${theme.palette.geowebColors.buttons.tertiary.default.borderColor}`,
8466
- padding: '0px 4px'
8467
- },
8468
- onClick: () => _handleClick(id)
8469
- });
8470
- };
8471
-
8472
- const FilterList = ({
8473
- filters: _filters = workspaceListFilterOptions,
8474
- onChipClick: _onChipClick = () => {},
8475
- isAllSelected: _isAllSelected = false
8476
- }) => {
8477
- const {
8478
- t
8479
- } = useWorkspaceTranslation();
8480
- return jsxs(Stack, Object.assign({
8481
- direction: "row",
8482
- spacing: 1,
8483
- "data-testid": "filterList"
8484
- }, {
8485
- children: [jsx(FilterChip, {
8486
- id: "all",
8487
- label: t('workspace-all-button'),
8488
- isSelected: _isAllSelected,
8489
- handleClick: key => _onChipClick(key, !_isAllSelected)
8490
- }), _filters.map(filter => {
8491
- return jsx(FilterChip, {
8492
- id: filter.id,
8493
- label: t(filter.label),
8494
- isSelected: _isAllSelected ? false : filter.isSelected,
8495
- isDisabled: filter.isDisabled,
8496
- handleClick: key => {
8497
- // If they are all isSelected ensure that if one is clicked that one will be the only one set to selected
8498
- const selected = _isAllSelected ? true : !filter.isSelected;
8499
- _onChipClick(key, selected);
8500
- }
8501
- }, filter.id);
8502
- })]
8503
- }));
8504
- };
8505
-
8506
- const DEBOUNCE_TIMEOUT = 300;
8507
- const SearchButton = ({
8508
- label
8509
- }) => jsx(CustomIconButton, Object.assign({
8510
- tooltipTitle: label,
8511
- edge: "end",
8512
- size: "large"
8513
- }, {
8514
- children: jsx(Search, {})
8515
- }));
8516
- const ClearButton = ({
8517
- onClick
8518
- }) => jsx(CustomIconButton, Object.assign({
8519
- tooltipTitle: "Clear",
8520
- edge: "end",
8521
- onClick: onClick,
8522
- size: "large"
8523
- }, {
8524
- children: jsx(Clear, {})
8525
- }));
8526
- const SearchField = ({
8527
- valueChanged,
8528
- value: _value = ''
8529
- }) => {
8530
- const [localValue, setLocalValue] = React.useState(_value);
8531
- const {
8532
- t
8533
- } = useWorkspaceTranslation();
8534
- const label = t('workspace-search');
8535
- // eslint-disable-next-line react-hooks/exhaustive-deps
8536
- const handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
8537
- return jsx(TextField, {
8538
- variant: "filled",
8539
- size: "small",
8540
- sx: {
8541
- '& input': {
8542
- paddingTop: '18px'
8543
- }
8544
- },
8545
- label: label,
8546
- value: localValue,
8547
- autoFocus: true,
8548
- fullWidth: true,
8549
- onChange: e => {
8550
- handleValueChangeDebounced(e.target.value);
8551
- setLocalValue(e.target.value);
8552
- },
8553
- InputProps: {
8554
- endAdornment: jsx(InputAdornment, Object.assign({
8555
- position: "end"
8556
- }, {
8557
- children: localValue ? jsx(ClearButton, {
8558
- onClick: () => {
8559
- setLocalValue('');
8560
- valueChanged('');
8561
- }
8562
- }) : jsx(SearchButton, {
8563
- label: label
8564
- })
8565
- }))
8566
- }
8567
- });
8568
- };
8569
-
8570
- const DEFAULT_FILTER_HEIGHT = 85;
8571
- const WorkspaceFilter = ({
8572
- filters,
8573
- onClickFilterChip: _onClickFilterChip = () => {},
8574
- onSearch: _onSearch = () => {},
8575
- isAllSelected,
8576
- searchQuery
8577
- }) => {
8578
- return jsx(Box, Object.assign({
8579
- sx: {
8580
- marginBottom: '8px'
8581
- }
8582
- }, {
8583
- children: jsxs(Stack, Object.assign({
8584
- spacing: 1
8585
- }, {
8586
- children: [jsx(SearchField, {
8587
- value: searchQuery,
8588
- valueChanged: _onSearch
8589
- }), jsx(FilterList, {
8590
- filters: filters,
8591
- onChipClick: _onClickFilterChip,
8592
- isAllSelected: isAllSelected
8593
- })]
8594
- }))
8595
- }));
8596
- };
8597
-
8598
8433
  const MIN_HEIGHT_SCROLLABLE_LIST = 88; // Slightly less than 2 rows
8599
8434
  const LIST_PADDING_TOP = 8;
8600
8435
  const DEFAULT_RESULTS_HEIGHT = 22;
@@ -8826,7 +8661,7 @@ const ViewPresetMenuListConnect = ({
8826
8661
  height: '100%'
8827
8662
  }
8828
8663
  }, {
8829
- children: [!error && jsx(WorkspaceFilter, {
8664
+ children: [!error && jsx(Filter, {
8830
8665
  filters: viewPresetListFilters,
8831
8666
  onClickFilterChip: onClickFilterChip,
8832
8667
  isAllSelected: isAllSelectedForFilters,
@@ -9713,7 +9548,7 @@ const WorkspaceSelectListConnect = () => {
9713
9548
  height: '100%'
9714
9549
  }
9715
9550
  }, {
9716
- children: [!error && jsx(WorkspaceFilter, {
9551
+ children: [!error && jsx(Filter, {
9717
9552
  filters: workspaceListFilters,
9718
9553
  onClickFilterChip: onClickFilterChip,
9719
9554
  isAllSelected: isAllSelected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/workspace",
3
- "version": "9.23.1",
3
+ "version": "9.25.0",
4
4
  "description": "GeoWeb Workspace library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -10,7 +10,6 @@
10
10
  "dependencies": {
11
11
  "react-redux": "^8.1.3",
12
12
  "@opengeoweb/shared": "*",
13
- "@mui/material": "^5.16.0",
14
13
  "@opengeoweb/store": "*",
15
14
  "@opengeoweb/api": "*",
16
15
  "react-hook-form": "^7.50.1",
@@ -36,7 +35,8 @@
36
35
  "@opengeoweb/warnings": "*",
37
36
  "i18next": "^23.11.5",
38
37
  "react-i18next": "^14.1.2",
39
- "@opengeoweb/webmap-react": "9.23.1"
38
+ "@mui/material": "^5.16.0",
39
+ "@opengeoweb/webmap-react": "9.25.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": "18"
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- interface FilterChipProps {
3
- id: string;
4
- label: string;
5
- isSelected?: boolean;
6
- isDisabled?: boolean;
7
- handleClick?: (label: string) => void;
8
- }
9
- declare const FilterChip: React.FC<FilterChipProps>;
10
- export default FilterChip;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { WorkspaceListFilter } from '../../store/workspaceList/types';
3
- interface FilterListProps {
4
- filters?: WorkspaceListFilter[];
5
- onChipClick?: (id: string, selected: boolean) => void;
6
- isAllSelected?: boolean;
7
- }
8
- declare const FilterList: React.FC<FilterListProps>;
9
- export default FilterList;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- export declare const DEBOUNCE_TIMEOUT = 300;
3
- interface SearchFieldProps {
4
- valueChanged: (value: string) => void;
5
- value?: string;
6
- }
7
- declare const SearchField: React.FC<SearchFieldProps>;
8
- export default SearchField;
@@ -1,13 +0,0 @@
1
- import { BoxProps } from '@mui/material';
2
- import * as React from 'react';
3
- import { WorkspaceListFilter } from '../../store/workspaceList/types';
4
- export declare const DEFAULT_FILTER_HEIGHT = 85;
5
- interface WorkspaceFilterProps extends BoxProps {
6
- filters: WorkspaceListFilter[];
7
- onClickFilterChip?: (id: string, selected: boolean) => void;
8
- onSearch?: (value: string) => void;
9
- isAllSelected?: boolean;
10
- searchQuery?: string;
11
- }
12
- declare const WorkspaceFilter: React.FC<WorkspaceFilterProps>;
13
- export default WorkspaceFilter;
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const WorkspaceFilterLight: {
7
- (): React.ReactElement;
8
- parameters: {
9
- zeplinLink: {
10
- name: string;
11
- link: string;
12
- }[];
13
- };
14
- tags: string[];
15
- };
16
- export declare const WorkspaceFilterDark: {
17
- (): React.ReactElement;
18
- parameters: {
19
- zeplinLink: {
20
- name: string;
21
- link: string;
22
- }[];
23
- };
24
- tags: string[];
25
- };