@opengeoweb/warnings 20.1.0 → 20.2.0-nightly-20261021
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/dist/index.esm.js +7302 -6874
- package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +4 -3
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +4 -3
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormObjects.d.ts +25 -0
- package/dist/src/lib/components/DrawingToolForm/drawingObjectUtils.d.ts +6 -0
- package/dist/src/lib/components/DrawingToolForm/useDrawingObjectActions.d.ts +3 -0
- package/dist/src/lib/components/DrawingToolForm/useMaskPreviewLayer.d.ts +1 -0
- package/dist/src/lib/components/DrawingToolForm/useSelectDrawFeature.d.ts +9 -1
- package/dist/src/lib/components/PublicWarningsForm/AreaField/AreaField.d.ts +0 -1
- package/dist/src/lib/utils/warningUtils.d.ts +2 -0
- package/package.json +12 -12
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
4
4
|
import type { ComparableDrawing } from './drawingObjectUtils';
|
|
5
5
|
import type { DrawingToolFormValues } from './DrawingToolFormContents';
|
|
6
|
+
import type { DrawingObjectActions } from './DrawingToolFormObjects';
|
|
6
7
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
7
8
|
import type { WarningType } from '../../store/warningsForm/types';
|
|
8
9
|
export declare const opacityOptions: number[];
|
|
@@ -22,12 +23,11 @@ export interface DrawingToolFormComponentProps {
|
|
|
22
23
|
geoJSONProperties: GeoJSON.GeoJsonProperties;
|
|
23
24
|
onChangeProperties: (properties: GeoJSON.GeoJsonProperties) => void;
|
|
24
25
|
onChangeName: (name: string) => void;
|
|
25
|
-
|
|
26
|
-
onSelectFeature: (featureId: string) => void;
|
|
27
|
-
onDeleteFeature: (featureId: string) => void;
|
|
26
|
+
objectActions?: DrawingObjectActions;
|
|
28
27
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
29
28
|
geoJSON: FeatureCollection<Geometry, GeoJsonProperties> | undefined;
|
|
30
29
|
savedDrawing?: ComparableDrawing;
|
|
30
|
+
lastUpdatedTime?: string;
|
|
31
31
|
selectedMask?: FeatureCollection<Geometry, GeoJsonProperties>;
|
|
32
32
|
onClickShare?: (type: WarningType) => void;
|
|
33
33
|
masks?: DrawingListItem[];
|
|
@@ -36,6 +36,7 @@ export interface DrawingToolFormComponentProps {
|
|
|
36
36
|
selectedMaskId?: string;
|
|
37
37
|
onSelectMask?: (maskId?: string) => void;
|
|
38
38
|
onHoverMask?: (maskId?: string) => void;
|
|
39
|
+
selectedFeatureIds?: string[];
|
|
39
40
|
}
|
|
40
41
|
declare const Wrapper: React.FC<DrawingToolFormComponentProps>;
|
|
41
42
|
export { Wrapper as DrawingToolForm };
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { FieldArrayWithId, FieldErrors, FieldValues } from 'react-hook-form';
|
|
4
4
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
5
5
|
import type { DrawingObject } from './drawingObjectUtils';
|
|
6
|
+
import type { DrawingObjectActions } from './DrawingToolFormObjects';
|
|
6
7
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
7
8
|
import type { WarningType } from '../../store/warningsForm/types';
|
|
8
9
|
export declare const opacityOptions: number[];
|
|
@@ -30,13 +31,13 @@ export interface DrawingToolFormContentsProps {
|
|
|
30
31
|
errors: FieldErrors<FieldValues>;
|
|
31
32
|
drawingObjects: DrawingObject[];
|
|
32
33
|
fields: FieldArrayWithId<DrawingToolFormValues, 'features', 'id'>[];
|
|
34
|
+
lastUpdatedTime?: string;
|
|
35
|
+
selectedFeatureIds: string[];
|
|
33
36
|
onClickShare?: (type: WarningType) => void;
|
|
34
37
|
onChangeDrawMode: (newMode: DrawMode) => void;
|
|
35
38
|
onChangeOpacity: (event: SelectChangeEvent<unknown>) => void;
|
|
36
39
|
onBlurName: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
37
|
-
|
|
38
|
-
onBlurObjectName: (featureId: string, objectName: string) => void;
|
|
39
|
-
onDeleteObject: (featureId: string) => void;
|
|
40
|
+
objectActions: DrawingObjectActions;
|
|
40
41
|
onSubmit: () => void;
|
|
41
42
|
geoJSONProperties?: GeoJSON.GeoJsonProperties;
|
|
42
43
|
masks: DrawingListItem[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldArrayWithId } from 'react-hook-form';
|
|
3
|
+
import type { DrawingObject } from './drawingObjectUtils';
|
|
4
|
+
import type { DrawingToolFormValues } from './DrawingToolFormContents';
|
|
5
|
+
export interface DrawingObjectActions {
|
|
6
|
+
onSelect: (featureId: string) => void;
|
|
7
|
+
onDeselect: (featureId: string) => void;
|
|
8
|
+
onHover: (featureId: string | undefined) => void;
|
|
9
|
+
onRename: (featureId: string, objectName: string) => void;
|
|
10
|
+
onDelete: (featureId: string) => void;
|
|
11
|
+
onToggleVisibility: (featureId: string) => void;
|
|
12
|
+
onReorder: (featureIds: string[]) => void;
|
|
13
|
+
}
|
|
14
|
+
interface DrawingToolFormObjectsProps {
|
|
15
|
+
drawingObjects: DrawingObject[];
|
|
16
|
+
fields: FieldArrayWithId<DrawingToolFormValues, 'features', 'id'>[];
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
isNewDrawing: boolean;
|
|
19
|
+
lastUpdatedTime?: string;
|
|
20
|
+
onBlurName: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
21
|
+
selectedFeatureIds: string[];
|
|
22
|
+
objectActions: DrawingObjectActions;
|
|
23
|
+
}
|
|
24
|
+
export declare const DrawingToolFormObjects: React.FC<DrawingToolFormObjectsProps>;
|
|
25
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export interface DrawingObject {
|
|
|
8
8
|
objectName: string;
|
|
9
9
|
storedObjectName?: string;
|
|
10
10
|
selectionType?: string;
|
|
11
|
+
isHidden?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const formatDefaultObjectName: (position: number) => string;
|
|
13
14
|
export declare const getDefaultObjectNamePosition: (name: string) => number | undefined;
|
|
@@ -33,6 +34,11 @@ export declare const createDefaultObjectNameGenerator: () => ((featureId: string
|
|
|
33
34
|
* @returns list of objects for the drawing
|
|
34
35
|
*/
|
|
35
36
|
export declare const getDrawingObjects: (geoJSON: GeoJSON.FeatureCollection | undefined, getDefaultObjectName: (featureId: string, takenNames: string[]) => string) => DrawingObject[];
|
|
37
|
+
/**
|
|
38
|
+
* Orders the features of a drawing like the passed feature ids. Features not
|
|
39
|
+
* passed, such as the placeholder of a shape still to be drawn, stay at the end
|
|
40
|
+
*/
|
|
41
|
+
export declare const orderFeaturesByIds: (geoJSON: GeoJSON.FeatureCollection, featureIds: string[]) => GeoJSON.FeatureCollection;
|
|
36
42
|
/**
|
|
37
43
|
* Checks if the passed name is already used by another object
|
|
38
44
|
* @param objectName name to check
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DrawingObjectActions } from './DrawingToolFormObjects';
|
|
2
|
+
export declare const getFeatureHoverLayerId: (mapId: string) => string;
|
|
3
|
+
export declare const useDrawingObjectActions: (layerId: string | undefined, mapId: string, geoJSON?: GeoJSON.FeatureCollection) => DrawingObjectActions;
|
|
@@ -3,5 +3,6 @@ export declare const MASK_PREVIEW_FILL_OPACITY = 0;
|
|
|
3
3
|
export declare const getMaskPreviewLayerId: (mapId: string) => string;
|
|
4
4
|
export declare const getClippedResultLayerId: (mapId: string) => string;
|
|
5
5
|
export declare const buildMaskPreviewGeoJSON: (mask: DrawingListItem) => GeoJSON.FeatureCollection;
|
|
6
|
+
export declare const useReadonlyFeatureLayer: (mapId: string, layerId: string, geojson: GeoJSON.FeatureCollection) => void;
|
|
6
7
|
export declare const useMaskPreviewLayer: (mapId: string, mask?: DrawingListItem) => void;
|
|
7
8
|
export declare const useClippedResultLayer: (mapId: string, clippedGeoJSON?: GeoJSON.FeatureCollection) => void;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Selects a single feature of a feature layer and puts it in edit mode, the same
|
|
3
|
-
* way as clicking
|
|
3
|
+
* way as clicking it on the map does (handy when shapes overlap). Readonly
|
|
4
|
+
* features are only selected.
|
|
4
5
|
* @param layerId id of the feature layer
|
|
5
6
|
* @returns callback to select a feature by its feature id
|
|
6
7
|
*/
|
|
7
8
|
export declare const useSelectDrawFeature: (layerId?: string) => ((featureId: string) => void);
|
|
9
|
+
/**
|
|
10
|
+
* Deselects a feature of a feature layer and ends its edit mode, so the map no
|
|
11
|
+
* longer highlights it.
|
|
12
|
+
* @param layerId id of the feature layer
|
|
13
|
+
* @returns callback to deselect a feature by its feature id
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDeselectDrawFeature: (layerId?: string) => ((featureId: string) => void);
|
|
@@ -6,6 +6,8 @@ import { PublicWarningStatus } from '../store/warningsForm/types';
|
|
|
6
6
|
import type { Warning, WarningEvent, EventWarningForWarningList } from '../store/warningsForm/types';
|
|
7
7
|
export declare const ERROR_NOT_FOUND = "Request failed with status code 400";
|
|
8
8
|
export declare const MOCK_USERNAME = "user.name";
|
|
9
|
+
/** Formats a date or date string (default: now) like `31/01/2024 14:05 UTC` */
|
|
10
|
+
export declare const getUtcDateLabel: (date?: Date | string) => string;
|
|
9
11
|
interface OverflowCheckResult {
|
|
10
12
|
ref: RefObject<HTMLDivElement | null>;
|
|
11
13
|
isOverflowing: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.2.0-nightly-20261021",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/api": "20.
|
|
24
|
-
"@opengeoweb/shared": "20.
|
|
25
|
-
"@opengeoweb/store": "20.
|
|
26
|
-
"@opengeoweb/webmap-react": "20.
|
|
23
|
+
"@opengeoweb/api": "20.2.0-nightly-20261021",
|
|
24
|
+
"@opengeoweb/shared": "20.2.0-nightly-20261021",
|
|
25
|
+
"@opengeoweb/store": "20.2.0-nightly-20261021",
|
|
26
|
+
"@opengeoweb/webmap-react": "20.2.0-nightly-20261021",
|
|
27
27
|
"@tanstack/react-query": "^5.85.5",
|
|
28
28
|
"react-redux": "^9.2.0",
|
|
29
|
-
"@opengeoweb/theme": "20.
|
|
30
|
-
"@opengeoweb/form-fields": "20.
|
|
29
|
+
"@opengeoweb/theme": "20.2.0-nightly-20261021",
|
|
30
|
+
"@opengeoweb/form-fields": "20.2.0-nightly-20261021",
|
|
31
31
|
"react-hook-form": "^7.50.1",
|
|
32
32
|
"lodash": "^4.18.1",
|
|
33
33
|
"@reduxjs/toolkit": "^2.6.1",
|
|
34
|
-
"@opengeoweb/snackbar": "20.
|
|
34
|
+
"@opengeoweb/snackbar": "20.2.0-nightly-20261021",
|
|
35
35
|
"react-window": "^2.2.6",
|
|
36
36
|
"axios": "^1.20.0",
|
|
37
|
-
"@opengeoweb/core": "20.
|
|
38
|
-
"@opengeoweb/webmap": "20.
|
|
39
|
-
"@opengeoweb/authentication": "20.
|
|
40
|
-
"@opengeoweb/sigmet-airmet": "20.
|
|
37
|
+
"@opengeoweb/core": "20.2.0-nightly-20261021",
|
|
38
|
+
"@opengeoweb/webmap": "20.2.0-nightly-20261021",
|
|
39
|
+
"@opengeoweb/authentication": "20.2.0-nightly-20261021",
|
|
40
|
+
"@opengeoweb/sigmet-airmet": "20.2.0-nightly-20261021",
|
|
41
41
|
"react-i18next": "^15.1.1",
|
|
42
42
|
"i18next": "^25.0.1",
|
|
43
43
|
"@mui/material": "^9.0.1",
|