@opengeoweb/sigmet-airmet 11.1.0 → 12.0.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 +43 -18
- package/package.json +36 -21
- package/src/lib/components/MapViewGeoJson/MapViewGeoJson.d.ts +3 -2
- package/src/lib/components/MapViewGeoJson/MapViewGeoJson.stories.d.ts +1 -0
- package/src/lib/components/MapViewGeoJson/OrgMapViewGeoJson.d.ts +10 -0
- package/src/lib/components/ProductForms/ProductFormLayout.d.ts +3 -2
- package/src/lib/components/ProductForms/utils.d.ts +2 -2
package/index.esm.js
CHANGED
|
@@ -5,11 +5,11 @@ import { FormControlLabel, Radio, Grid2, Typography, Box, Button, Checkbox, Menu
|
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { FORM_FIELDS_NAMESPACE, formFieldsTranslations, useDraftFormHelpers, ReactHookFormRadioGroup, hasValidGeometry, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, countIntersectionPoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, isValidGeoJsonCoordinates, hasIntersectionWithFIR, isXHoursBefore, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
7
7
|
import { useApiContext, useApi, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
8
|
-
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, DRAWMODE, defaultDelete, getIcon,
|
|
8
|
+
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, DRAWMODE, defaultDelete, getIcon, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle, OpenLayersMapDraw, useMapDrawTool, addFeatureProperties, rewindGeometry } from '@opengeoweb/webmap-react';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
10
|
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
11
11
|
import { SHARED_NAMESPACE, sharedTranslations, PROJECTION, ToggleMenu, useIsMounted, dateUtils, CustomTooltip, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, AlertBanner, isAxiosError, getAxiosErrorMessage, StatusTag, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
|
-
import { CORE_NAMESPACE, coreTranslations, LegendConnect,
|
|
12
|
+
import { CORE_NAMESPACE, coreTranslations, LegendConnect, OlMapViewConnect, TimeSliderConnect } from '@opengeoweb/core';
|
|
13
13
|
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
|
|
14
14
|
import { uiSelectors, useUpdateSharedData, mapSelectors, syncGroupsActions, layerActions, mapActions, defaultLayers, syncConstants } from '@opengeoweb/store';
|
|
15
15
|
import { DrawFIRLand, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
@@ -4466,7 +4466,8 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
4466
4466
|
var initialBaseLayers = _ref.baseLayers,
|
|
4467
4467
|
initialProjection = _ref.projection,
|
|
4468
4468
|
_ref$geoJSONLayers = _ref.geoJSONLayers,
|
|
4469
|
-
geoJSONLayers = _ref$geoJSONLayers === void 0 ? [] : _ref$geoJSONLayers
|
|
4469
|
+
geoJSONLayers = _ref$geoJSONLayers === void 0 ? [] : _ref$geoJSONLayers,
|
|
4470
|
+
children = _ref.children;
|
|
4470
4471
|
var dispatch = useDispatch();
|
|
4471
4472
|
var mapWindowRef = React.useRef(null);
|
|
4472
4473
|
var firstMap = useSelector(function (store) {
|
|
@@ -4492,7 +4493,7 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
4492
4493
|
// use maplayers, but change layerId and current mapId
|
|
4493
4494
|
var layers = mapLayers.map(function (layer) {
|
|
4494
4495
|
return Object.assign({}, layer, {
|
|
4495
|
-
id: webmapUtils.generateLayerId(),
|
|
4496
|
+
id: layer.id || webmapUtils.generateLayerId(),
|
|
4496
4497
|
mapId: mapId
|
|
4497
4498
|
});
|
|
4498
4499
|
});
|
|
@@ -4546,7 +4547,7 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
4546
4547
|
children: [jsx(LegendConnect, {
|
|
4547
4548
|
showMapId: true,
|
|
4548
4549
|
mapId: mapId
|
|
4549
|
-
}),
|
|
4550
|
+
}), jsxs(OlMapViewConnect, {
|
|
4550
4551
|
mapId: mapId,
|
|
4551
4552
|
controls: {
|
|
4552
4553
|
mapControlsPositionTop: 0,
|
|
@@ -4554,9 +4555,30 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
4554
4555
|
zoomControls: true,
|
|
4555
4556
|
dimensionSelect: true
|
|
4556
4557
|
},
|
|
4557
|
-
children: geoJSONLayers.map(function (layer) {
|
|
4558
|
-
return
|
|
4559
|
-
|
|
4558
|
+
children: [children, geoJSONLayers.map(function (layer) {
|
|
4559
|
+
return jsxs("div", {
|
|
4560
|
+
"data-testid": "" + layer.id,
|
|
4561
|
+
children: [jsx(OpenLayersFeatureLayer, {
|
|
4562
|
+
featureCollection: !layer.isInEditMode ? layer.geojson : undefined,
|
|
4563
|
+
style: genericOpenLayersFeatureStyle,
|
|
4564
|
+
zIndex: 1000
|
|
4565
|
+
}), jsx(OpenLayersMapDraw, {
|
|
4566
|
+
viewOnlyStyle: genericOpenLayersFeatureStyle,
|
|
4567
|
+
selectedFeatureIndex: layer.selectedFeatureIndex || 0,
|
|
4568
|
+
geojson: layer.geojson,
|
|
4569
|
+
drawMode: layer.drawMode,
|
|
4570
|
+
isInEditMode: layer.isInEditMode || false,
|
|
4571
|
+
updateGeojson: layer.updateGeojson,
|
|
4572
|
+
exitDrawModeCallback: function exitDrawModeCallback(reason) {
|
|
4573
|
+
try {
|
|
4574
|
+
(layer == null ? void 0 : layer.exitDrawModeCallback) && (layer == null ? void 0 : layer.exitDrawModeCallback(reason));
|
|
4575
|
+
} catch (e) {
|
|
4576
|
+
window.console.trace(e);
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
})]
|
|
4580
|
+
}, layer.id);
|
|
4581
|
+
})]
|
|
4560
4582
|
}), jsx("div", {
|
|
4561
4583
|
style: {
|
|
4562
4584
|
position: 'absolute',
|
|
@@ -4577,6 +4599,7 @@ var MapViewGeoJson = function MapViewGeoJson(_ref) {
|
|
|
4577
4599
|
var ProductFormLayout = function ProductFormLayout(_ref) {
|
|
4578
4600
|
var _sx, _sx2, _sx3;
|
|
4579
4601
|
var children = _ref.children,
|
|
4602
|
+
mapChildren = _ref.mapChildren,
|
|
4580
4603
|
productConfig = _ref.productConfig,
|
|
4581
4604
|
_ref$geoJSONLayers = _ref.geoJSONLayers,
|
|
4582
4605
|
geoJSONLayers = _ref$geoJSONLayers === void 0 ? [] : _ref$geoJSONLayers;
|
|
@@ -4607,7 +4630,8 @@ var ProductFormLayout = function ProductFormLayout(_ref) {
|
|
|
4607
4630
|
children: jsx(MapViewGeoJson, {
|
|
4608
4631
|
baseLayers: baseLayers,
|
|
4609
4632
|
projection: projection,
|
|
4610
|
-
geoJSONLayers: geoJSONLayers
|
|
4633
|
+
geoJSONLayers: geoJSONLayers,
|
|
4634
|
+
children: mapChildren
|
|
4611
4635
|
})
|
|
4612
4636
|
}), jsx(Grid2, {
|
|
4613
4637
|
sx: (_sx3 = {
|
|
@@ -8099,16 +8123,15 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8099
8123
|
onUpdateEndGeoJson(newTool.shape, newTool.shape);
|
|
8100
8124
|
}
|
|
8101
8125
|
};
|
|
8102
|
-
var
|
|
8103
|
-
|
|
8104
|
-
var _setStartGeoJSON = setStartGeoJSON(newGeoJSON),
|
|
8126
|
+
var updateStartGeoJson = function updateStartGeoJson(geoJson) {
|
|
8127
|
+
var _setStartGeoJSON = setStartGeoJSON(geoJson),
|
|
8105
8128
|
newStartGeoJson = _setStartGeoJSON[0],
|
|
8106
8129
|
newStartIntersection = _setStartGeoJSON[1];
|
|
8107
8130
|
var newGeoStart = rewindGeometry(newStartGeoJson);
|
|
8108
8131
|
var newGeoStartIntersect = rewindGeometry(newStartIntersection);
|
|
8109
8132
|
onUpdateStartgeoJSON(newGeoStart, newGeoStartIntersect);
|
|
8110
8133
|
};
|
|
8111
|
-
var
|
|
8134
|
+
var updateEndGeoJson = function updateEndGeoJson(newGeoJSON) {
|
|
8112
8135
|
deactivateEndTool();
|
|
8113
8136
|
var _setEndGeoJSON = setEndGeoJSON(newGeoJSON),
|
|
8114
8137
|
newEndGeoJson = _setEndGeoJSON[0],
|
|
@@ -8118,9 +8141,11 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8118
8141
|
onUpdateEndGeoJson(newGeoEnd, newGeoEndIntersect);
|
|
8119
8142
|
};
|
|
8120
8143
|
var layers = [getStartLayer('geoJSONIntersectionBounds', 'geojsonlayer-fir'), Object.assign({}, getEndLayer('geoJSON', 'geojsonlayer-end'), {
|
|
8121
|
-
exitDrawModeCallback:
|
|
8144
|
+
exitDrawModeCallback: deactivateEndTool,
|
|
8145
|
+
updateGeojson: updateEndGeoJson
|
|
8122
8146
|
}), Object.assign({}, getStartLayer('geoJSON', 'geojsonlayer-start'), {
|
|
8123
|
-
exitDrawModeCallback:
|
|
8147
|
+
exitDrawModeCallback: deactivateStartTool,
|
|
8148
|
+
updateGeojson: updateStartGeoJson
|
|
8124
8149
|
}), getEndLayer('geoJSONIntersection', 'geojsonlayer-intersection-end'), getStartLayer('geoJSONIntersection', 'geojsonlayer-intersection-start')];
|
|
8125
8150
|
useFormLayers(layers);
|
|
8126
8151
|
var _useFormContext2 = useFormContext(),
|
|
@@ -8399,8 +8424,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8399
8424
|
onUpdateStartgeoJSON(newTool.shape, newTool.shape);
|
|
8400
8425
|
}
|
|
8401
8426
|
};
|
|
8402
|
-
var
|
|
8403
|
-
deactivateStartTool();
|
|
8427
|
+
var updateStartGeoJson = function updateStartGeoJson(newGeoJSON) {
|
|
8404
8428
|
var _setGeoJSON = setGeoJSON(newGeoJSON),
|
|
8405
8429
|
newStartGeoJson = _setGeoJSON[0],
|
|
8406
8430
|
newStartIntersection = _setGeoJSON[1];
|
|
@@ -8409,7 +8433,8 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8409
8433
|
onUpdateStartgeoJSON(newGeoStart, newGeoStartIntersect);
|
|
8410
8434
|
};
|
|
8411
8435
|
var layers = [getStartLayer('geoJSONIntersectionBounds', 'geojsonlayer-fir'), Object.assign({}, getStartLayer('geoJSON', 'geojsonlayer-start'), {
|
|
8412
|
-
exitDrawModeCallback:
|
|
8436
|
+
exitDrawModeCallback: deactivateStartTool,
|
|
8437
|
+
updateGeojson: updateStartGeoJson
|
|
8413
8438
|
}), getStartLayer('geoJSONIntersection', 'geojsonlayer-intersection-start')];
|
|
8414
8439
|
useFormLayers(layers);
|
|
8415
8440
|
var _useFormContext2 = useFormContext(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/sigmet-airmet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,29 +8,44 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"@
|
|
14
|
-
"@opengeoweb/store": "*",
|
|
15
|
-
"@opengeoweb/webmap": "*",
|
|
16
|
-
"@opengeoweb/webmap-react": "*",
|
|
17
|
-
"react-redux": "^8.1.3",
|
|
18
|
-
"@opengeoweb/core": "*",
|
|
19
|
-
"@opengeoweb/authentication": "*",
|
|
11
|
+
"@emotion/react": "11.14.0",
|
|
12
|
+
"@emotion/styled": "11.14.0",
|
|
13
|
+
"@mui/material": "^6.1.1",
|
|
20
14
|
"@mui/system": "^6.1.1",
|
|
21
|
-
"@
|
|
22
|
-
"react-hook-form": "^7.50.1",
|
|
23
|
-
"axios": "^1.7.7",
|
|
24
|
-
"lodash": "^4.17.21",
|
|
15
|
+
"@mui/x-date-pickers": "7.27.1",
|
|
25
16
|
"@reduxjs/toolkit": "^1.9.7",
|
|
17
|
+
"@sentry/react": "8.54.0",
|
|
18
|
+
"@storybook/core-events": "8.4.2",
|
|
19
|
+
"@storybook/preview-api": "8.4.2",
|
|
20
|
+
"@storybook/react": "8.4.2",
|
|
21
|
+
"@tanstack/query-core": "5.67.1",
|
|
22
|
+
"@tanstack/react-query": "^5.67.1",
|
|
23
|
+
"@testing-library/react": "16.0.1",
|
|
24
|
+
"@testing-library/user-event": "14.5.2",
|
|
25
|
+
"@turf/turf": "7.2.0",
|
|
26
|
+
"axios": "^1.7.7",
|
|
27
|
+
"date-fns": "4.1.0",
|
|
28
|
+
"dompurify": "3.2.4",
|
|
26
29
|
"i18next": "^23.11.5",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
30
|
+
"immer": "10.1.1",
|
|
31
|
+
"jest-canvas-mock": "2.5.2",
|
|
32
|
+
"jest-date-mock": "1.0.10",
|
|
33
|
+
"lodash": "^4.17.21",
|
|
34
|
+
"msw": "2.7.3",
|
|
35
|
+
"msw-storybook-addon": "2.0.4",
|
|
36
|
+
"ol": "10.4.0",
|
|
37
|
+
"proj4": "2.15.0",
|
|
38
|
+
"re-resizable": "6.11.2",
|
|
39
|
+
"react": "18.3.1",
|
|
40
|
+
"react-draggable": "4.4.6",
|
|
41
|
+
"react-hook-form": "^7.50.1",
|
|
42
|
+
"react-i18next": "^15.1.1",
|
|
43
|
+
"react-redux": "^8.1.3",
|
|
44
|
+
"react-resize-detector": "9.1.1",
|
|
45
|
+
"react-router-dom": "6.23.1",
|
|
46
|
+
"react-sortablejs": "6.1.4",
|
|
47
|
+
"react-window": "1.8.10",
|
|
48
|
+
"sortablejs": "1.15.2"
|
|
34
49
|
},
|
|
35
50
|
"module": "./index.esm.js",
|
|
36
51
|
"type": "module",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { mapTypes, layerTypes } from '@opengeoweb/store';
|
|
3
|
-
import {
|
|
3
|
+
import { OpenLayersLayerProps } from '@opengeoweb/webmap-react';
|
|
4
4
|
export interface MapViewGeoJsonProps {
|
|
5
5
|
baseLayers?: layerTypes.Layer[];
|
|
6
6
|
projection?: mapTypes.MapPreset['proj'];
|
|
7
|
-
geoJSONLayers:
|
|
7
|
+
geoJSONLayers: OpenLayersLayerProps[];
|
|
8
|
+
children?: React.ReactNode;
|
|
8
9
|
}
|
|
9
10
|
declare const MapViewGeoJson: React.FC<MapViewGeoJsonProps>;
|
|
10
11
|
export default MapViewGeoJson;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { mapTypes, layerTypes } from '@opengeoweb/store';
|
|
3
|
+
import { MapViewLayerProps } from '@opengeoweb/webmap-react';
|
|
4
|
+
export interface OrgMapViewGeoJsonProps {
|
|
5
|
+
baseLayers?: layerTypes.Layer[];
|
|
6
|
+
projection?: mapTypes.MapPreset['proj'];
|
|
7
|
+
geoJSONLayers: MapViewLayerProps[];
|
|
8
|
+
}
|
|
9
|
+
declare const OrgMapViewGeoJson: React.FC<OrgMapViewGeoJsonProps>;
|
|
10
|
+
export default OrgMapViewGeoJson;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { OpenLayersLayerProps } from '@opengeoweb/webmap-react';
|
|
3
3
|
import { ProductConfig } from '../../types';
|
|
4
4
|
interface ProducFormLayoutProps {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
+
mapChildren?: React.ReactNode;
|
|
6
7
|
productConfig: ProductConfig;
|
|
7
|
-
geoJSONLayers:
|
|
8
|
+
geoJSONLayers: OpenLayersLayerProps[];
|
|
8
9
|
}
|
|
9
10
|
declare const ProductFormLayout: React.FC<ProducFormLayoutProps>;
|
|
10
11
|
export default ProductFormLayout;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
|
|
3
3
|
import { layerTypes, mapTypes } from '@opengeoweb/store';
|
|
4
|
-
import { DrawMode,
|
|
4
|
+
import { DrawMode, OpenLayersLayerProps } from '@opengeoweb/webmap-react';
|
|
5
5
|
import { LevelUnits, ATSRLocation, ICAOLocation, ProductStatus, CancelSigmet, Sigmet, ProductCanbe, SigmetFromBackend, SigmetFromFrontend, ProductAction, Airmet, CancelAirmet, ProductConfig, Firareas, FIRConfigSigmet, AirmetFromBackend, AirmetFromFrontend, ProductType, AviationProduct, FIRLocationGeoJson, AirmetConfig, FIRConfigAirmet, StartOrEndDrawing, AviationPhenomenon } from '../../types';
|
|
6
6
|
export declare const getDefaultPhenomena: (productConfig: ProductConfig, currentFir?: string) => {
|
|
7
7
|
phenomena: AviationPhenomenon[];
|
|
@@ -77,5 +77,5 @@ export declare const firSelectionType = "fir";
|
|
|
77
77
|
export declare const getDrawTools: (type: StartOrEndDrawing, firShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
78
78
|
export declare const updateDrawToolsWithFir: (drawTools: DrawMode[], newFirShape: GeoJSON.FeatureCollection) => DrawMode[];
|
|
79
79
|
export declare const getToolIcon: (selectionType: string) => React.ReactElement;
|
|
80
|
-
export declare const useFormLayers: (layers:
|
|
80
|
+
export declare const useFormLayers: (layers: OpenLayersLayerProps[]) => void;
|
|
81
81
|
export {};
|