@opengeoweb/warnings 8.0.0 → 8.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.
Files changed (75) hide show
  1. package/README.md +0 -0
  2. package/index.esm.d.ts +0 -0
  3. package/index.esm.js +19315 -18499
  4. package/package.json +11 -10
  5. package/src/index.d.ts +1 -0
  6. package/src/lib/Warnings.stories.d.ts +0 -2
  7. package/src/lib/WarningsErrors.stories.d.ts +9 -0
  8. package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +0 -0
  9. package/src/lib/components/DrawingTool/DrawingToolConnect.d.ts +0 -0
  10. package/src/lib/components/DrawingTool/DrawingToolConnect.spec.d.ts +0 -0
  11. package/src/lib/components/DrawingTool/DrawingToolConnect.stories.d.ts +0 -0
  12. package/src/lib/components/DrawingTool/DrawingToolDialog.d.ts +2 -12
  13. package/src/lib/components/DrawingTool/DrawingToolDialog.spec.d.ts +0 -0
  14. package/src/lib/components/DrawingTool/DrawingToolMapButtonConnect.d.ts +0 -0
  15. package/src/lib/components/DrawingTool/DrawingToolMapButtonConnect.spec.d.ts +0 -0
  16. package/src/lib/components/DrawingTool/index.d.ts +0 -0
  17. package/src/lib/components/DrawingTool/useObjectDrawDialogAction.d.ts +15 -5
  18. package/src/lib/components/DrawingTool/useObjectDrawDialogAction.spec.d.ts +0 -0
  19. package/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +0 -0
  20. package/src/lib/components/DrawingToolForm/DrawingToolForm.spec.d.ts +0 -0
  21. package/src/lib/components/DrawingToolForm/DrawingToolFormConnect.d.ts +0 -0
  22. package/src/lib/components/DrawingToolForm/DrawingToolFormConnect.spec.d.ts +0 -0
  23. package/src/lib/components/DrawingToolForm/index.d.ts +0 -0
  24. package/src/lib/components/ObjectManager/ConfirmDeleteDialog.d.ts +13 -0
  25. package/src/lib/components/ObjectManager/{Drawings.spec.d.ts → ConfirmDeleteDialog.spec.d.ts} +0 -0
  26. package/src/lib/components/ObjectManager/ObjectManager.d.ts +4 -12
  27. package/src/lib/components/ObjectManager/ObjectManager.spec.d.ts +0 -0
  28. package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +9 -0
  29. package/src/lib/components/ObjectManager/ObjectManagerConnect.d.ts +4 -0
  30. package/src/lib/components/ObjectManager/{ObjectManagerConnect.spec.d.ts → ObjectManagerConnect.integration.spec.d.ts} +0 -0
  31. package/src/lib/components/ObjectManager/ObjectManagerConnect.stories.d.ts +0 -0
  32. package/src/lib/components/ObjectManager/ObjectManagerMapButtonConnect.d.ts +0 -0
  33. package/src/lib/components/ObjectManager/ObjectManagerMapButtonConnect.spec.d.ts +0 -0
  34. package/src/lib/components/ObjectManager/Objects.d.ts +11 -0
  35. package/src/lib/components/ObjectManager/Objects.spec.d.ts +1 -0
  36. package/src/lib/components/ObjectManager/index.d.ts +0 -0
  37. package/src/lib/components/Providers/Providers.d.ts +0 -0
  38. package/src/lib/components/Providers/Providers.spec.d.ts +0 -0
  39. package/src/lib/components/PublicWarnings/PublicWarnings.d.ts +17 -0
  40. package/src/lib/components/PublicWarnings/PublicWarnings.spec.d.ts +1 -0
  41. package/src/lib/components/PublicWarnings/PublicWarnings.stories.d.ts +33 -0
  42. package/src/lib/components/PublicWarnings/PublicWarningsConnect.d.ts +9 -0
  43. package/src/lib/components/PublicWarnings/PublicWarningsConnect.spec.d.ts +1 -0
  44. package/src/lib/components/PublicWarnings/PublicWarningsConnect.stories.d.ts +6 -0
  45. package/src/lib/components/PublicWarnings/index.d.ts +2 -0
  46. package/src/lib/components/PublicWarningsForm/AreaField.d.ts +14 -0
  47. package/src/lib/components/PublicWarningsForm/AreaField.spec.d.ts +1 -0
  48. package/src/lib/components/PublicWarningsForm/AreaField.stories.d.ts +13 -0
  49. package/src/lib/components/PublicWarningsForm/DescriptionField.d.ts +2 -0
  50. package/src/lib/components/PublicWarningsForm/DescriptionField.spec.d.ts +1 -0
  51. package/src/lib/components/PublicWarningsForm/DescriptionField.stories.d.ts +13 -0
  52. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +16 -0
  53. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.spec.d.ts +1 -0
  54. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +13 -0
  55. package/src/lib/components/PublicWarningsForm/index.d.ts +1 -0
  56. package/src/lib/components/WarningsModuleProvider/WarningsModuleProvider.d.ts +0 -0
  57. package/src/lib/components/WarningsModuleProvider/index.d.ts +0 -0
  58. package/src/lib/store/config.d.ts +0 -0
  59. package/src/lib/store/drawings/reducer.d.ts +0 -0
  60. package/src/lib/store/drawings/reducer.spec.d.ts +0 -0
  61. package/src/lib/store/drawings/sagas.d.ts +0 -3
  62. package/src/lib/store/drawings/sagas.spec.d.ts +0 -0
  63. package/src/lib/store/drawings/selectors.d.ts +0 -0
  64. package/src/lib/store/drawings/selectors.spec.d.ts +0 -0
  65. package/src/lib/store/drawings/types.d.ts +0 -0
  66. package/src/lib/store/drawings/utils.d.ts +3 -0
  67. package/src/lib/storybookUtils/defaultStorySettings.d.ts +0 -0
  68. package/src/lib/storybookUtils/storyComponents.d.ts +9 -0
  69. package/src/lib/storybookUtils/testUtils.d.ts +0 -0
  70. package/src/lib/storyshots/Storyshots.spec.d.ts +0 -0
  71. package/src/lib/utils/api.d.ts +0 -0
  72. package/src/lib/utils/api.spec.d.ts +0 -0
  73. package/src/lib/utils/fakeApi.d.ts +0 -0
  74. package/src/lib/utils/fakeApi.spec.d.ts +0 -0
  75. package/src/lib/components/ObjectManager/Drawings.d.ts +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -9,19 +9,20 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@mui/material": "5.12.0",
12
- "@opengeoweb/api": "8.0.0",
13
- "@opengeoweb/core": "8.0.0",
14
- "@opengeoweb/form-fields": "8.0.0",
15
- "@opengeoweb/shared": "8.0.0",
16
- "@opengeoweb/store": "8.0.0",
17
- "@opengeoweb/theme": "8.0.0",
18
- "@opengeoweb/webmap": "8.0.0",
19
- "@opengeoweb/webmap-react": "8.0.0",
12
+ "@opengeoweb/api": "8.2.0",
13
+ "@opengeoweb/core": "8.2.0",
14
+ "@opengeoweb/form-fields": "8.2.0",
15
+ "@opengeoweb/shared": "8.2.0",
16
+ "@opengeoweb/store": "8.2.0",
17
+ "@opengeoweb/theme": "8.2.0",
18
+ "@opengeoweb/webmap": "8.2.0",
19
+ "@opengeoweb/webmap-react": "8.2.0",
20
20
  "@reduxjs/toolkit": "1.9.5",
21
21
  "axios": "1.5.0",
22
+ "immer": "9.0.21",
22
23
  "lodash": "4.17.21",
23
24
  "react": "18.2.0",
24
- "react-hook-form": "7.46.1",
25
+ "react-hook-form": "7.46.2",
25
26
  "react-redux": "8.1.2",
26
27
  "redux-saga": "1.2.3"
27
28
  },
package/src/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './lib/components/ObjectManager';
2
2
  export * from './lib/components/WarningsModuleProvider';
3
3
  export * from './lib/components/DrawingTool';
4
4
  export * from './lib/components/DrawingToolForm';
5
+ export * from './lib/components/PublicWarnings';
5
6
  export * from './lib/store/config';
@@ -4,5 +4,3 @@ declare const _default: {
4
4
  };
5
5
  export default _default;
6
6
  export declare const WarningsDemo: () => React.ReactElement;
7
- export declare const DrawingsDemo: () => React.ReactElement;
8
- export declare const WarningsDemoErrorSaveDrawing: () => React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const ErrorSaveDrawing: () => React.ReactElement;
7
+ export declare const ErrorGetList: () => React.ReactElement;
8
+ export declare const ErrorEditDrawing: () => React.ReactElement;
9
+ export declare const ErrorDeleteDrawing: () => React.ReactElement;
@@ -1,15 +1,6 @@
1
1
  import * as React from 'react';
2
- import { HeaderSize } from '@opengeoweb/shared';
2
+ import { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
3
3
  import { uiTypes } from '@opengeoweb/store';
4
- export type Size = {
5
- width: number;
6
- height: number;
7
- };
8
- export type Position = {
9
- top: number;
10
- left?: number;
11
- right?: number;
12
- };
13
4
  interface DrawingToolDialogProps {
14
5
  bounds?: string;
15
6
  title?: string;
@@ -20,12 +11,11 @@ interface DrawingToolDialogProps {
20
11
  source?: uiTypes.Source;
21
12
  isLoading?: boolean;
22
13
  isDocked?: boolean;
23
- size?: Size;
14
+ size?: DraggableSize;
24
15
  startPosition?: Position;
25
16
  setFocused?: (focused: boolean) => void;
26
17
  headerSize?: HeaderSize;
27
18
  children: React.ReactNode;
28
19
  }
29
- export declare const calculateStartSize: (minSize: Size, prefSize: Size, startPosition: Position) => Size;
30
20
  declare const DrawingTool: React.FC<DrawingToolDialogProps>;
31
21
  export default DrawingTool;
File without changes
@@ -1,12 +1,22 @@
1
1
  import { uiTypes } from '@opengeoweb/store';
2
- export declare const objectDialogType = uiTypes.DialogTypes.ObjectManager;
3
- export declare const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
2
+ export declare const useCloseDrawDialog: ({ mapId, source, }: {
3
+ mapId: string;
4
+ source?: uiTypes.Source | undefined;
5
+ }) => {
6
+ closeDrawDialog: () => void;
7
+ };
8
+ export declare const useCloseObjectDialog: ({ mapId, source, }: {
9
+ mapId: string;
10
+ source?: uiTypes.Source | undefined;
11
+ }) => {
12
+ closeObjectDialog: (shouldReset?: boolean) => void;
13
+ };
4
14
  export declare const useObjectDrawDialogAction: ({ mapId, source, }: {
5
15
  mapId: string;
6
16
  source?: uiTypes.Source | undefined;
7
17
  }) => {
8
- openDrawDialog: (geoJSON: GeoJSON.FeatureCollection | undefined, previousGeoJSONLayerId: string, activeDrawModeId: string) => void;
18
+ openDrawDialog: (geoJSON?: GeoJSON.FeatureCollection) => void;
9
19
  closeDrawDialog: () => void;
10
- openObjectDialog: (geoJSON: GeoJSON.FeatureCollection | undefined, previousGeoJSONLayerId: string) => void;
11
- closeObjectDialog: () => void;
20
+ openObjectDialog: () => void;
21
+ closeObjectDialog: (shouldReset?: boolean) => void;
12
22
  };
File without changes
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const DELETE_TITLE = "Delete object";
3
+ export declare const DELETE_CONFIRM = "Delete";
4
+ export declare const CANCEL = "Cancel";
5
+ export declare const getDeleteDescription: (objectName: string) => string;
6
+ export declare const getDeleteSucces: (objectName: string) => string;
7
+ export declare const ConfirmDeleteDialog: React.FC<{
8
+ objectId: string;
9
+ objectName: string;
10
+ onDeleteSucces: (objectId: string, objectName: string) => void;
11
+ onClose: () => void;
12
+ }>;
13
+ export default ConfirmDeleteDialog;
@@ -1,17 +1,7 @@
1
1
  import * as React from 'react';
2
- import { HeaderSize } from '@opengeoweb/shared';
2
+ import { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
3
3
  import { uiTypes } from '@opengeoweb/store';
4
4
  import { DrawingListItem } from '../../store/drawings/types';
5
- export type Size = {
6
- width: number;
7
- height: number;
8
- };
9
- export type Position = {
10
- top: number;
11
- left?: number;
12
- right?: number;
13
- };
14
- export declare const calculateStartSize: (minSize: Size, prefSize: Size, startPosition: Position) => Size;
15
5
  export declare const ObjectManager: React.FC<{
16
6
  bounds?: string;
17
7
  title?: string;
@@ -20,12 +10,14 @@ export declare const ObjectManager: React.FC<{
20
10
  isOpen: boolean;
21
11
  order?: number;
22
12
  source?: uiTypes.Source;
23
- size?: Size;
13
+ size?: DraggableSize;
24
14
  startPosition?: Position;
25
15
  setFocused?: (focused: boolean) => void;
26
16
  headerSize?: HeaderSize;
27
17
  drawingListItems: DrawingListItem[];
28
18
  onClickDrawing?: (drawing: DrawingListItem) => void;
19
+ onEditDrawing?: (drawingId: string) => void;
20
+ onDeleteDrawing?: (drawingId: string) => void;
29
21
  activeDrawingId?: string;
30
22
  error?: string;
31
23
  isLoading?: boolean;
@@ -31,3 +31,12 @@ export declare const ObjectManagerDarkNoResults: {
31
31
  (): React.ReactElement;
32
32
  storyName: string;
33
33
  };
34
+ export declare const ObjectManagerLoading: () => React.ReactElement;
35
+ export declare const ObjectManagerErrorLight: {
36
+ (): React.ReactElement;
37
+ storyName: string;
38
+ };
39
+ export declare const ObjectManagerErrorDark: {
40
+ (): React.ReactElement;
41
+ storyName: string;
42
+ };
@@ -1,5 +1,9 @@
1
1
  import { uiTypes } from '@opengeoweb/store';
2
2
  import React from 'react';
3
+ export declare const DELETE_TITLE = "Delete object";
4
+ export declare const DELETE_CONFIRM = "Delete";
5
+ export declare const getDeleteDescription: (objectName: string) => string;
6
+ export declare const getDeleteSucces: (objectName: string) => string;
3
7
  export declare const ObjectManagerConnect: React.FC<{
4
8
  bounds?: string;
5
9
  source?: uiTypes.Source;
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ import { DrawingListItem } from '../../store/drawings/types';
3
+ export declare const NO_OBJECTS_FOUND = "No objects found";
4
+ export declare const Objects: FC<{
5
+ objects: DrawingListItem[];
6
+ onClickObject: (object: DrawingListItem) => void;
7
+ onClickEdit: (objectId: string) => void;
8
+ onClickDelete: (drawingId: string) => void;
9
+ activeObject: string;
10
+ isLoading?: boolean;
11
+ }>;
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes
File without changes
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
3
+ import { uiTypes } from '@opengeoweb/store';
4
+ export declare const DIALOG_TITLE = "Public Warning";
5
+ export declare const PublicWarnings: React.FC<{
6
+ bounds?: string;
7
+ title?: string;
8
+ onClose: () => void;
9
+ onMouseDown?: () => void;
10
+ isOpen: boolean;
11
+ order?: number;
12
+ source?: uiTypes.Source;
13
+ size?: DraggableSize;
14
+ startPosition?: Position;
15
+ setFocused?: (focused: boolean) => void;
16
+ headerSize?: HeaderSize;
17
+ }>;
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningsLight: {
7
+ (): React.ReactElement;
8
+ parameters: {
9
+ zeplinLink: {
10
+ name: string;
11
+ link: string;
12
+ }[];
13
+ };
14
+ storyName: string;
15
+ };
16
+ export declare const PublicWarningsDark: {
17
+ (): React.ReactElement;
18
+ parameters: {
19
+ zeplinLink: {
20
+ name: string;
21
+ link: string;
22
+ }[];
23
+ };
24
+ storyName: string;
25
+ };
26
+ export declare const PublicWarningsLightBig: {
27
+ (): React.ReactElement;
28
+ storyName: string;
29
+ };
30
+ export declare const PublicWarningsDarkBig: {
31
+ (): React.ReactElement;
32
+ storyName: string;
33
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { uiTypes } from '@opengeoweb/store';
3
+ import { Position } from '@opengeoweb/shared';
4
+ export declare const publicWarningDialogType = uiTypes.DialogTypes.PublicWarnings;
5
+ export declare const PublicWarningsConnect: React.FC<{
6
+ bounds?: string;
7
+ source?: uiTypes.Source;
8
+ startPosition?: Position;
9
+ }>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningsMap: () => React.ReactElement;
@@ -0,0 +1,2 @@
1
+ export * from './PublicWarnings';
2
+ export * from './PublicWarningsConnect';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export declare const LABEL_AREA = "Area";
3
+ export declare const BUTTON_ADD_OBJECT = "Add object";
4
+ export declare const BUTTON_DELETE = "Delete";
5
+ export declare const BUTTON_VIEW = "View";
6
+ export declare const BUTTON_EDIT = "Edit";
7
+ export declare const OBJECTS_MENU = "Object options";
8
+ export declare const AreaField: React.FC<{
9
+ onEditObject: () => void;
10
+ onViewObject: () => void;
11
+ onDeleteObject: () => void;
12
+ onAddObject: () => void;
13
+ isDisabled?: boolean;
14
+ }>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const AreaFieldLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const AreaFieldDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DescriptionField: React.FC;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const DescriptionFieldLight: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const DescriptionFieldDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export declare const LABEL_PHENOMENON = "Phenomenon";
3
+ export declare const LABEL_VALID_FROM = "Valid from";
4
+ export declare const LABEL_VALID_UNTIL = "Valid until";
5
+ export declare const LABEL_CURRENT = "Current";
6
+ export declare const LABEL_EARLY = "Early";
7
+ export declare const LABEL_LEVEL = "Level";
8
+ export declare const LABEL_PROBABILITY = "Probability";
9
+ export declare const BUTTON_CANCEL = "Cancel";
10
+ export declare const BUTTON_SAVE = "Save";
11
+ export declare const BUTTON_PUBLISH = "Publish";
12
+ interface FormProps {
13
+ isDisabled?: boolean;
14
+ }
15
+ export declare const PublicWarningsForm: React.FC<FormProps>;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const PublicWarningsFormDemo: {
7
+ (): React.ReactElement;
8
+ storyName: string;
9
+ };
10
+ export declare const PublicWarningsFormDemoDark: {
11
+ (): React.ReactElement;
12
+ storyName: string;
13
+ };
@@ -0,0 +1 @@
1
+ export * from './PublicWarningsForm';
File without changes
File without changes
File without changes
@@ -1,9 +1,6 @@
1
- import { uiTypes } from '@opengeoweb/store';
2
1
  import { SagaIterator } from 'redux-saga';
3
2
  import { SubmitDrawValuesPayload } from './types';
4
3
  export declare const getSnackbarMessage: (objectName: string, id: string) => string;
5
- export declare const drawDialogType = uiTypes.DialogTypes.DrawingTool;
6
- export declare const objectDialogType = uiTypes.DialogTypes.ObjectManager;
7
4
  export declare function submitDrawValuesSaga({ payload, }: {
8
5
  payload: SubmitDrawValuesPayload;
9
6
  }): SagaIterator;
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ import { uiTypes } from '@opengeoweb/store';
2
+ export declare const objectDialogType = uiTypes.DialogTypes.ObjectManager;
3
+ export declare const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
File without changes
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { uiTypes } from '@opengeoweb/store';
3
+ export declare const AppHamburgerMenu: React.FC<{
4
+ mapId: string;
5
+ }>;
6
+ export declare const MapWithWarnings: React.FC<{
7
+ mapId: string;
8
+ dialogType?: uiTypes.DialogType;
9
+ }>;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +0,0 @@
1
- import { FC } from 'react';
2
- import { DrawingListItem } from '../../store/drawings/types';
3
- export declare const NO_OBJECTS_FOUND = "No objects found";
4
- export declare const Drawings: FC<{
5
- drawings: DrawingListItem[];
6
- onClickDrawing: (drawing: DrawingListItem) => void;
7
- activeDrawing: string;
8
- }>;