@opengeoweb/workspace 9.21.0 → 9.22.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,10 +4,11 @@ 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, ToolContainer, renderCounter, CustomToggleButton, ConfirmationDialog } from '@opengeoweb/shared';
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';
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';
11
+ import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
11
12
  import { takeLatest, takeEvery, debounce, delay, put, all, select, call as call$g, takeLeading } from 'redux-saga/effects';
12
13
  import { snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
13
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -25,7 +26,6 @@ import 'react-mosaic-component/react-mosaic-component.css';
25
26
  import AutoSizer from 'react-virtualized-auto-sizer';
26
27
  import { FixedSizeList } from 'react-window';
27
28
  import { Box as Box$1 } from '@mui/system';
28
- import { ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
29
29
  import { useFormContext } from 'react-hook-form';
30
30
 
31
31
  var en = {
@@ -3560,25 +3560,29 @@ const initWorkspaceTestI18n = () => {
3560
3560
  [WORKSPACE_NAMESPACE]: workspaceTranslations.en,
3561
3561
  [SHARED_NAMESPACE]: sharedTranslations.en,
3562
3562
  [CORE_NAMESPACE]: coreTranslations.en,
3563
- [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en
3563
+ [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.en,
3564
+ [FORM_FIELDS_NAMESPACE]: formFieldsTranslations.en
3564
3565
  },
3565
3566
  fi: {
3566
3567
  [WORKSPACE_NAMESPACE]: workspaceTranslations.fi,
3567
3568
  [SHARED_NAMESPACE]: sharedTranslations.fi,
3568
3569
  [CORE_NAMESPACE]: coreTranslations.fi,
3569
- [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi
3570
+ [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.fi,
3571
+ [FORM_FIELDS_NAMESPACE]: formFieldsTranslations.fi
3570
3572
  },
3571
3573
  no: {
3572
3574
  [WORKSPACE_NAMESPACE]: workspaceTranslations.no,
3573
3575
  [SHARED_NAMESPACE]: sharedTranslations.no,
3574
3576
  [CORE_NAMESPACE]: coreTranslations.no,
3575
- [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no
3577
+ [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.no,
3578
+ [FORM_FIELDS_NAMESPACE]: formFieldsTranslations.no
3576
3579
  },
3577
3580
  nl: {
3578
3581
  [WORKSPACE_NAMESPACE]: workspaceTranslations.nl,
3579
3582
  [SHARED_NAMESPACE]: sharedTranslations.nl,
3580
3583
  [CORE_NAMESPACE]: coreTranslations.nl,
3581
- [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl
3584
+ [WEBMAP_REACT_NAMESPACE]: webmapReactTranslations.nl,
3585
+ [FORM_FIELDS_NAMESPACE]: formFieldsTranslations.nl
3582
3586
  }
3583
3587
  }
3584
3588
  });
@@ -8596,7 +8600,8 @@ const WorkspaceSelectList = ({
8596
8600
  "data-testid": `${_testIdPrefix}-selectList`,
8597
8601
  sx: {
8598
8602
  height: `calc(100% - ${DEFAULT_FILTER_HEIGHT}px)`,
8599
- minHeight: MIN_HEIGHT_SCROLLABLE_LIST
8603
+ minHeight: MIN_HEIGHT_SCROLLABLE_LIST,
8604
+ overflow: 'hidden'
8600
8605
  }
8601
8606
  }, {
8602
8607
  children: [jsxs(Box, Object.assign({
@@ -8825,6 +8830,50 @@ const ViewPresetMenuListConnect = ({
8825
8830
  }));
8826
8831
  };
8827
8832
 
8833
+ const ResizeMenu = ({
8834
+ onCloseMenu,
8835
+ title,
8836
+ children
8837
+ }) => {
8838
+ return jsx(Resizable, Object.assign({
8839
+ defaultSize: {
8840
+ width: 320,
8841
+ height: '90%'
8842
+ },
8843
+ minHeight: 110,
8844
+ minWidth: 280,
8845
+ style: {
8846
+ display: 'flex',
8847
+ alignItems: 'center',
8848
+ justifyContent: 'center'
8849
+ },
8850
+ enable: {
8851
+ top: true,
8852
+ right: true,
8853
+ bottom: true,
8854
+ left: true,
8855
+ topRight: true,
8856
+ bottomRight: true,
8857
+ bottomLeft: true,
8858
+ topLeft: true
8859
+ }
8860
+ }, {
8861
+ children: jsx(ToolContainer, Object.assign({
8862
+ title: title,
8863
+ onClose: onCloseMenu,
8864
+ style: {
8865
+ width: '100%',
8866
+ height: '100%'
8867
+ },
8868
+ onClick: event => {
8869
+ event.stopPropagation();
8870
+ }
8871
+ }, {
8872
+ children: children
8873
+ }))
8874
+ }));
8875
+ };
8876
+
8828
8877
  const ViewPresetMenu = ({
8829
8878
  hideBackdrop: _hideBackdrop = false,
8830
8879
  closeMenu,
@@ -8833,41 +8882,30 @@ const ViewPresetMenu = ({
8833
8882
  const {
8834
8883
  t
8835
8884
  } = useWorkspaceTranslation();
8836
- const toolContainer = jsx(ToolContainer, Object.assign({
8837
- style: {
8838
- width: 320,
8839
- height: 'calc(100% - 80px)',
8840
- position: 'absolute',
8841
- top: '16px'
8842
- },
8885
+ const toolContainer = jsx(ResizeMenu, Object.assign({
8843
8886
  title: t('workspace-viewpreset-menu'),
8844
- onClose: closeMenu,
8845
- onClick: event => {
8846
- event.stopPropagation();
8847
- }
8887
+ onCloseMenu: closeMenu
8848
8888
  }, {
8849
8889
  children: jsx(ViewPresetMenuListConnect, {
8850
8890
  panelId: panelId
8851
8891
  })
8852
8892
  }));
8853
8893
  renderCounter.count(ViewPresetMenu.name);
8854
- return jsx("div", {
8855
- children: _hideBackdrop ?
8856
- // Enable hiding backdrop from snapshot tests
8857
- toolContainer : jsx(Backdrop, Object.assign({
8858
- "data-testid": "viewpresetMenuBackdrop",
8859
- open: true,
8860
- sx: {
8861
- '&.MuiBackdrop-root': {
8862
- position: 'absolute',
8863
- zIndex: 1002
8864
- }
8865
- },
8866
- onClick: closeMenu
8867
- }, {
8868
- children: toolContainer
8869
- }))
8870
- });
8894
+ return _hideBackdrop ?
8895
+ // Enable hiding backdrop from snapshot tests
8896
+ toolContainer : jsx(Backdrop, Object.assign({
8897
+ "data-testid": "viewpresetMenuBackdrop",
8898
+ open: true,
8899
+ sx: {
8900
+ '&.MuiBackdrop-root': {
8901
+ position: 'absolute',
8902
+ zIndex: 1002
8903
+ }
8904
+ },
8905
+ onClick: closeMenu
8906
+ }, {
8907
+ children: toolContainer
8908
+ }));
8871
8909
  };
8872
8910
 
8873
8911
  const WorkspaceOptionsNoMemo = ({
@@ -9682,37 +9720,26 @@ const WorkspaceMenu = ({
9682
9720
  const {
9683
9721
  t
9684
9722
  } = useWorkspaceTranslation();
9685
- const toolContainer = jsx(ToolContainer, Object.assign({
9686
- style: {
9687
- width: 320,
9688
- height: 'calc(100vh - 88px)',
9689
- position: 'absolute',
9690
- top: '16px'
9691
- },
9723
+ const toolContainer = jsx(ResizeMenu, Object.assign({
9692
9724
  title: t('workspace-menu'),
9693
- onClose: closeMenu,
9694
- onClick: event => {
9695
- event.stopPropagation();
9696
- }
9725
+ onCloseMenu: closeMenu
9697
9726
  }, {
9698
9727
  children: jsx(WorkspaceSelectListConnect, {})
9699
9728
  }));
9700
- return jsx("div", {
9701
- children: _hideBackdrop ?
9702
- // Enable hiding backdrop from snapshot tests
9703
- toolContainer : jsx(Backdrop, Object.assign({
9704
- "data-testid": "workspaceMenuBackdrop",
9705
- open: true,
9706
- sx: {
9707
- '&.MuiBackdrop-root': {
9708
- top: '40px'
9709
- }
9710
- },
9711
- onClick: closeMenu
9712
- }, {
9713
- children: toolContainer
9714
- }))
9715
- });
9729
+ return _hideBackdrop ?
9730
+ // Enable hiding backdrop from snapshot tests
9731
+ toolContainer : jsx(Backdrop, Object.assign({
9732
+ "data-testid": "workspaceMenuBackdrop",
9733
+ open: true,
9734
+ sx: {
9735
+ '&.MuiBackdrop-root': {
9736
+ top: '40px'
9737
+ }
9738
+ },
9739
+ onClick: closeMenu
9740
+ }, {
9741
+ children: toolContainer
9742
+ }));
9716
9743
  };
9717
9744
 
9718
9745
  const WorkspaceMenuButton = ({
@@ -10522,4 +10549,4 @@ const WorkspaceDetail = ({
10522
10549
  }));
10523
10550
  };
10524
10551
 
10525
- export { ComponentsLookUpWrapper, DemoWrapper, WorkspaceDetail, WorkspaceErrorType, WorkspaceI18nProvider, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors$1 as selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes, workspaceTranslations };
10552
+ export { ComponentsLookUpWrapper, DemoWrapper, WORKSPACE_NAMESPACE, WorkspaceDetail, WorkspaceErrorType, WorkspaceI18nProvider, WorkspaceModuleProvider, WorkspacePresetAction, WorkspaceTopBar, WorkspaceViewConnect, WorkspaceWrapperProviderWithStore, workspaceActions as actions, createBalancedMosaicNode, createCustomEmptyMapWorkspace, defaultAuthConfig, emptyMapWorkspace, getWorkspaceRouteUrl, selectors$1 as selectors, viewPresetActions, workspaceListActions, workspaceModuleConfig, reducer$1 as workspaceReducer, routes as workspaceRoutes, workspaceTranslations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/workspace",
3
- "version": "9.21.0",
3
+ "version": "9.22.0",
4
4
  "description": "GeoWeb Workspace library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "react-redux": "^8.1.3",
12
12
  "@opengeoweb/shared": "*",
13
- "@mui/material": "~5.15.11",
13
+ "@mui/material": "^5.16.0",
14
14
  "@opengeoweb/store": "*",
15
15
  "@opengeoweb/api": "*",
16
16
  "react-hook-form": "^7.50.1",
@@ -37,7 +37,7 @@
37
37
  "@opengeoweb/warnings": "*",
38
38
  "i18next": "^23.11.5",
39
39
  "react-i18next": "^14.1.2",
40
- "@opengeoweb/webmap-react": "9.21.0"
40
+ "@opengeoweb/webmap-react": "9.22.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": "18"
package/src/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './lib/components/ComponentsLookUpWrapper';
10
10
  export * from './lib/components/WorkspaceView';
11
11
  export * from './lib/components/WorkspaceTopBar';
12
12
  export * from './lib/components/WorkspaceDetail';
13
+ export { WORKSPACE_NAMESPACE } from './lib/utils/i18n';
13
14
  export { workspaceTranslations };
14
15
  export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
15
16
  export { emptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const ResizeMenu: React.FC<{
3
+ onCloseMenu?: () => void;
4
+ title: string;
5
+ children: React.ReactNode;
6
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './ResizeMenu';