@opengeoweb/sigmet-airmet 5.2.1 → 6.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/sigmet-airmet",
3
- "version": "5.2.1",
3
+ "version": "6.0.1",
4
4
  "description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,17 +14,19 @@
14
14
  "dependencies": {
15
15
  "@mui/material": "5.12.0",
16
16
  "@mui/system": "5.12.0",
17
- "@opengeoweb/api": "5.2.1",
18
- "@opengeoweb/authentication": "5.2.1",
19
- "@opengeoweb/core": "5.2.1",
20
- "@opengeoweb/form-fields": "5.2.1",
21
- "@opengeoweb/shared": "5.2.1",
22
- "@opengeoweb/theme": "5.2.1",
17
+ "@opengeoweb/api": "6.0.1",
18
+ "@opengeoweb/authentication": "6.0.1",
19
+ "@opengeoweb/core": "6.0.1",
20
+ "@opengeoweb/form-fields": "6.0.1",
21
+ "@opengeoweb/shared": "6.0.1",
22
+ "@opengeoweb/store": "6.0.1",
23
+ "@opengeoweb/theme": "6.0.1",
24
+ "@opengeoweb/webmap": "6.0.1",
23
25
  "@redux-eggs/redux-toolkit": "2.2.0",
24
26
  "@redux-eggs/saga-extension": "2.2.0",
25
27
  "@reduxjs/toolkit": "1.9.5",
26
28
  "@turf/turf": "6.5.0",
27
- "axios": "1.4.0",
29
+ "axios": "1.2.0",
28
30
  "immer": "9.0.21",
29
31
  "lodash": "4.17.21",
30
32
  "moment": "2.29.4",
@@ -1,18 +1,10 @@
1
1
  import * as React from 'react';
2
- import { mapTypes, layerTypes } from '@opengeoweb/core';
3
- import { FeatureCollection, Polygon } from 'geojson';
4
- import { MapDrawMode, MapGeoJSONS, SetMapDrawModes } from '../../types';
2
+ import { mapTypes, layerTypes } from '@opengeoweb/store';
3
+ import { MapViewLayerProps } from '@opengeoweb/core';
5
4
  export interface MapViewGeoJsonProps {
6
- geoJSONs: MapGeoJSONS;
7
5
  baseLayers?: layerTypes.Layer[];
8
6
  projection?: mapTypes.MapPreset['proj'];
9
- setLayerGeoJSONs?: (geoJSONs: MapGeoJSONS) => void;
10
- layerDrawModes?: SetMapDrawModes;
11
- drawMode?: SetMapDrawModes;
12
- setDrawMode?: (drawMode: SetMapDrawModes) => void;
13
- exitDrawModeCallbackStart?: () => void;
14
- exitDrawModeCallbackEnd?: () => void;
7
+ geoJSONLayers: MapViewLayerProps[];
15
8
  }
16
- export declare const allowOneGeoJSONFeature: (mode: MapDrawMode, geojson: FeatureCollection<Polygon>) => FeatureCollection<Polygon>;
17
9
  declare const MapViewGeoJson: React.FC<MapViewGeoJsonProps>;
18
10
  export default MapViewGeoJson;
@@ -1,4 +1,3 @@
1
- import { GeoJSONTemplate } from '../../types';
2
1
  export declare const srsAndBboxDefault: {
3
2
  bbox: {
4
3
  left: number;
@@ -10,13 +9,7 @@ export declare const srsAndBboxDefault: {
10
9
  };
11
10
  export declare const simplePolygonGeoJSON: GeoJSON.FeatureCollection;
12
11
  export declare const simplePolygonGeoJSONHalfOfNL: GeoJSON.FeatureCollection;
13
- export declare const featurePropsStart: {
14
- stroke: string;
15
- 'stroke-width': number;
16
- 'stroke-opacity': number;
17
- fill: string;
18
- 'fill-opacity': number;
19
- };
12
+ export declare const featurePropsStart: import("geojson").GeoJsonProperties;
20
13
  export declare const featurePropsEnd: {
21
14
  stroke: string;
22
15
  'stroke-width': number;
@@ -24,19 +17,13 @@ export declare const featurePropsEnd: {
24
17
  fill: string;
25
18
  'fill-opacity': number;
26
19
  };
27
- export declare const featurePropsIntersectionStart: {
28
- stroke: string;
29
- 'stroke-width': number;
30
- 'stroke-opacity': number;
31
- fill: string;
32
- 'fill-opacity': number;
33
- };
20
+ export declare const featurePropsIntersectionStart: import("geojson").GeoJsonProperties;
34
21
  export declare const featurePropsIntersectionEnd: {
22
+ 'fill-opacity': number;
35
23
  stroke: string;
36
24
  'stroke-width': number;
37
25
  'stroke-opacity': number;
38
26
  fill: string;
39
- 'fill-opacity': number;
40
27
  };
41
28
  export declare const featurePropsFIR: {
42
29
  stroke: string;
@@ -52,4 +39,3 @@ export declare const featurePropsUnStyled: {
52
39
  fill: string;
53
40
  'fill-opacity': number;
54
41
  };
55
- export declare const geoJSONTemplate: GeoJSONTemplate;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { MapDrawMode, StartOrEndDrawing } from '../../../types';
2
+ import { EditMode } from '@opengeoweb/core';
3
3
  interface DrawToolsProps {
4
- type?: StartOrEndDrawing | '';
5
- drawMode: MapDrawMode;
6
- setDrawMode: (newMapDrawMode: MapDrawMode) => void;
4
+ activeTool: string;
5
+ tools: EditMode[];
6
+ onChangeTool: (newToolMode: EditMode) => void;
7
7
  }
8
8
  declare const DrawTools: React.FC<DrawToolsProps>;
9
9
  export default DrawTools;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { MapDrawMode, StartOrEndDrawing, SetMapDrawModes, MapGeoJSONS, ConfigurableFormFieldProps, ProductConfig } from '../../../types';
2
+ import { EditMode } from '@opengeoweb/core';
3
+ import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
3
4
  export declare const DEFAULT_ROUNDING_MOVEMENT_KT = 5;
4
5
  export declare const DEFAULT_ROUNDING_MOVEMENT_KMH = 10;
5
6
  export declare const getMovementStepValKTMessage: (value?: number) => string;
@@ -9,9 +10,11 @@ export declare const noIntersectionMessage = "The end position needs to be (part
9
10
  export declare const maximum6PointsMessage = "The end position drawing allows a maximum of 6 individual points";
10
11
  export declare const validateMovementSteps: (value: string, unit: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
11
12
  interface ProgressProps extends ConfigurableFormFieldProps {
12
- drawMode?: SetMapDrawModes;
13
- geoJSONs?: MapGeoJSONS;
14
- setDrawModeType?: (mapDrawMode: MapDrawMode, startOrEnd: StartOrEndDrawing) => void;
13
+ geoJSON?: GeoJSON.FeatureCollection;
14
+ geoJSONIntersection?: GeoJSON.FeatureCollection;
15
+ activeTool?: string;
16
+ tools?: EditMode[];
17
+ onChangeTool?: (newToolMode: EditMode) => void;
15
18
  }
16
19
  declare const Progress: React.FC<ProgressProps>;
17
20
  export default Progress;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { MapDrawMode, MapGeoJSONS, SetMapDrawModes, StartOrEndDrawing } from '../../../types';
2
+ import { EditMode } from '@opengeoweb/core';
3
3
  export declare const coordinatesEmptyMessage = "A start position drawing is required";
4
4
  export declare const noIntersectionMessage = "The start position needs to be (partly) inside the FIR";
5
5
  export declare const maximum6PointsMessage = "The start position drawing allows a maximum of 6 individual points";
@@ -8,9 +8,11 @@ export declare const maxFeaturePointsMessage = "Intersection of the drawn polygo
8
8
  export declare const multiIntersectionsMessage = "The drawn polygon has multiple intersections with the FIR-boundary. The drawn polygon will be used for the TAC-code.";
9
9
  interface StartGeometryProps {
10
10
  isReadOnly?: boolean;
11
- drawMode: SetMapDrawModes;
12
- geoJSONs: MapGeoJSONS;
13
- setDrawModeType: (mapDrawMode: MapDrawMode, startOrEnd: StartOrEndDrawing) => void;
11
+ geoJSON: GeoJSON.FeatureCollection;
12
+ geoJSONIntersection: GeoJSON.FeatureCollection | undefined;
13
+ activeTool: string;
14
+ tools: EditMode[];
15
+ onChangeTool: (newToolMode: EditMode) => void;
14
16
  }
15
17
  declare const StartGeometry: React.FC<StartGeometryProps>;
16
18
  export default StartGeometry;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { MapViewGeoJsonProps } from '../MapViewGeoJson/MapViewGeoJson';
2
+ import { MapViewLayerProps } from '@opengeoweb/core';
3
3
  import { ProductConfig } from '../../types';
4
- interface ProducFormLayoutProps extends MapViewGeoJsonProps {
4
+ interface ProducFormLayoutProps {
5
5
  children: React.ReactNode;
6
6
  productConfig: ProductConfig;
7
+ geoJSONLayers: MapViewLayerProps[];
7
8
  }
8
9
  declare const ProductFormLayout: React.FC<ProducFormLayoutProps>;
9
10
  export default ProductFormLayout;
@@ -1,8 +1,10 @@
1
1
  import * as React from 'react';
2
+ import { Feature } from '@turf/turf';
2
3
  import { FeatureCollection } from 'geojson';
3
4
  import { FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
4
- import { mapTypes } from '@opengeoweb/core';
5
- import { LevelUnits, ATSRLocation, ICAOLocation, ProductStatus, CancelSigmet, Sigmet, ProductCanbe, SigmetFromBackend, SigmetFromFrontend, ProductActions, Airmet, CancelAirmet, ProductConfig, Firareas, FIRConfigSigmet, AirmetFromBackend, AirmetFromFrontend, ProductType, AviationProduct, FIRLocationGeoJson, AirmetConfig, FIRConfigAirmet } from '../../types';
5
+ import { layerTypes, mapTypes } from '@opengeoweb/store';
6
+ import { EditMode } from '@opengeoweb/core';
7
+ import { LevelUnits, ATSRLocation, ICAOLocation, ProductStatus, CancelSigmet, Sigmet, ProductCanbe, SigmetFromBackend, SigmetFromFrontend, ProductActions, Airmet, CancelAirmet, ProductConfig, Firareas, FIRConfigSigmet, AirmetFromBackend, AirmetFromFrontend, ProductType, AviationProduct, FIRLocationGeoJson, AirmetConfig, FIRConfigAirmet, StartOrEndDrawing } from '../../types';
6
8
  export declare const getHoursBeforeValidity: (phenomenon: string, fir: string, config: ProductConfig) => number;
7
9
  export declare const getMaxHoursOfValidity: (phenomenon: string, fir: string, config: ProductConfig) => number;
8
10
  export declare const getValidFromDelayTimeMinutesFromConfig: (config: ProductConfig) => number;
@@ -54,10 +56,14 @@ export declare const getFir: (productConfig: ProductConfig, firName?: string | u
54
56
  export declare const isFir: (geojson: GeoJSON.FeatureCollection) => boolean;
55
57
  export declare const rewindGeometry: (geoJSON: FeatureCollection) => FeatureCollection;
56
58
  export declare const getFieldLabel: (title: string, isDisabled: boolean, action?: string) => string;
57
- export declare const getBaseLayers: (productConfig: ProductConfig) => mapTypes.Layer[];
59
+ export declare const getBaseLayers: (productConfig: ProductConfig) => layerTypes.Layer[];
58
60
  export declare const getMaxMovementSpeedValue: (unit: string, selectedFIR: string, productConfig: ProductConfig) => number | null;
59
61
  export declare const DEFAULT_MIN_MOVEMENT_SPEED = 0;
60
62
  export declare const getMinMovementSpeedValue: (unit: string, selectedFIR: string, productConfig: ProductConfig) => number;
61
63
  /** Trigger form validations for given list of field names if field has a value */
62
64
  export declare const triggerValidations: (fieldNames: string[], getValues: UseFormGetValues<FieldValues>, trigger: UseFormTrigger<FieldValues>) => void;
63
65
  export declare const getProjection: (productConfig: ProductConfig) => mapTypes.MapPreset['proj'];
66
+ export declare const getShapeWithProperties: (shape: GeoJSON.Feature, properties: GeoJSON.GeoJsonProperties) => GeoJSON.Feature;
67
+ export declare const firID = "drawtools-fir";
68
+ export declare const getDrawTools: (type: StartOrEndDrawing, firShape: GeoJSON.FeatureCollection) => EditMode[];
69
+ export declare const updateDrawToolsWithFir: (drawTools: EditMode[], newFirShape: GeoJSON.FeatureCollection) => EditMode[];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { mapTypes } from '@opengeoweb/core';
2
+ import { mapTypes } from '@opengeoweb/store';
3
3
  export declare type ProductType = 'sigmet' | 'airmet';
4
4
  /**
5
5
  * The possible phenomena for the sigmet
@@ -299,34 +299,10 @@ export declare const isInstanceOfAirmet: (obj: Airmet | CancelAirmet) => obj is
299
299
  export declare const isInstanceOfCancelAirmet: (obj: AviationProduct) => obj is CancelAirmet;
300
300
  export declare const isInstanceOfSigmetOrAirmet: (obj: AviationProduct) => obj is Sigmet | Airmet;
301
301
  export declare const isInstanceOfCancelSigmetOrAirmet: (obj: AviationProduct) => obj is CancelSigmet | CancelAirmet;
302
- export declare enum MapDrawMode {
303
- 'POINT' = "POINT",
304
- 'BOX' = "BOX",
305
- 'POLYGON' = "POLYGON",
306
- 'FIR' = "FIR",
307
- 'DELETE' = "DELETE"
308
- }
309
302
  export declare enum StartOrEndDrawing {
310
303
  'start' = "start",
311
304
  'end' = "end"
312
305
  }
313
- export interface SetMapDrawModes {
314
- start: MapDrawMode;
315
- end: MapDrawMode;
316
- }
317
- export interface MapGeoJSONS {
318
- start?: GeoJSON.FeatureCollection;
319
- end?: GeoJSON.FeatureCollection;
320
- intersectionStart?: GeoJSON.FeatureCollection;
321
- intersectionEnd?: GeoJSON.FeatureCollection;
322
- fir?: GeoJSON.FeatureCollection;
323
- }
324
- export interface GeoJSONTemplate {
325
- POINT: MapGeoJSONS;
326
- BOX: MapGeoJSONS;
327
- POLYGON: MapGeoJSONS;
328
- FIR: MapGeoJSONS;
329
- }
330
306
  export declare type FormMode = 'new' | 'edit' | 'view';
331
307
  export interface FormFieldProps {
332
308
  productType?: ProductType;
@@ -23,5 +23,6 @@ export declare const fakeBackendNestedError: AxiosError<{
23
23
  message: string;
24
24
  }>;
25
25
  export declare const fakeBackendDifferentError: AxiosError;
26
+ export declare const testFir: GeoJSON.FeatureCollection;
26
27
  export declare const StoryWrapperFakeApiWithErrors: React.FC<StoryWrapperProps>;
27
28
  export {};
@@ -1,32 +0,0 @@
1
- import { SetMapDrawModes, MapGeoJSONS, MapDrawMode, StartOrEndDrawing, ProductConfig } from '../../types';
2
- /**
3
- * Adds properties to the first geojson feature based on the given property object.
4
- * It only extends or changes the properties which are defined in styleConfig,
5
- * all other properties in the geojson are left unchanged.
6
- * @param geojson
7
- * @param featureProperties
8
- */
9
- export declare const addFeatureProperties: (geojson: GeoJSON.FeatureCollection | undefined, featureProperties: GeoJSON.GeoJsonProperties) => GeoJSON.FeatureCollection;
10
- export declare const getInitialGeoJSONState: (productConfig: ProductConfig, currentSelectedFIR?: string | undefined, initialGeometry?: MapGeoJSONS | undefined) => MapGeoJSONS;
11
- export declare const useDrawMode: (productConfig: ProductConfig, initialGeometry?: MapGeoJSONS | undefined, currentSelectedFIR?: string | undefined) => {
12
- geoJSONs: MapGeoJSONS;
13
- setLayerGeoJSONs: (geoJSONs: MapGeoJSONS) => void;
14
- layerDrawModes: SetMapDrawModes;
15
- setLayersDrawModes: (layerDrawModes: SetMapDrawModes) => void;
16
- drawMode: SetMapDrawModes;
17
- setDrawMode: (drawMode: SetMapDrawModes) => void;
18
- setDrawModeType: (mapDrawMode: MapDrawMode, startOrEnd: StartOrEndDrawing, updateCallback?: ((mapGeoJSONS: MapGeoJSONS) => void) | undefined) => void;
19
- };
20
- /**
21
- * Returns the intersection of two features. In case of a polygon, only the first feature is used.
22
- * @param a Feature A
23
- * @param b Feature B
24
- * @returns The intersection of the two features.
25
- */
26
- export declare const intersectGeoJSONS: (a: GeoJSON.FeatureCollection, b: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
27
- /**
28
- * Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
29
- * @param geoJSONs
30
- * @returns GeoJSONS extend with intersections
31
- */
32
- export declare const createInterSections: (geoJSONs: MapGeoJSONS) => MapGeoJSONS;
@@ -1 +0,0 @@
1
- export {};