@opengeoweb/warnings 19.6.0 → 19.6.1-nightly-20260913

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.
@@ -3,6 +3,7 @@ import type { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
3
3
  import type { uiTypes } from '@opengeoweb/store';
4
4
  import type { SelectedAreaFeatureNamesByAreaId } from './Areas';
5
5
  import type { AreaListItem, DrawingListItem } from '../../store/warningsDrawings/types';
6
+ import type { WarningType } from '../../store/warningsForm/types';
6
7
  export declare const AreaDrawingManager: React.FC<{
7
8
  bounds?: string;
8
9
  title?: string;
@@ -26,7 +27,7 @@ export declare const AreaDrawingManager: React.FC<{
26
27
  onHoverDrawingFeatureEnd?: (drawing: DrawingListItem) => void;
27
28
  onEditDrawing?: (drawingId: string) => void;
28
29
  onDeleteDrawing?: (drawingId: string) => void;
29
- onShareDrawing?: (drawing: DrawingListItem) => void;
30
+ onShareDrawing?: (drawing: DrawingListItem, type: WarningType) => void;
30
31
  onCreateNewDrawing?: () => void;
31
32
  activeDrawingId?: string;
32
33
  selectedAreaFeatureNamesByAreaId?: SelectedAreaFeatureNamesByAreaId;
@@ -1,6 +1,7 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import type { FC } from 'react';
3
3
  import type { DrawingListItem } from '../../store/warningsDrawings/types';
4
+ import type { WarningType } from '../../store/warningsForm/types';
4
5
  export declare const getFeatureName: (feature: GeoJSON.Feature, index: number, t: TFunction) => string;
5
6
  export declare const DEFAULT_ADD_BUTTON_HEIGHT = 80;
6
7
  export declare const DEFAULT_AREA_DRAWING_MANAGER_TAB_HEIGHT = 40;
@@ -23,7 +24,7 @@ export declare const Drawings: FC<{
23
24
  onClickDrawing: (drawing: DrawingListItem) => void;
24
25
  onClickEdit: (drawingId: string) => void;
25
26
  onClickDelete: (drawingId: string) => void;
26
- onClickShare: (drawing: DrawingListItem) => void;
27
+ onClickShare: (drawing: DrawingListItem, type: WarningType) => void;
27
28
  onHoverDrawing: (drawing: DrawingListItem) => void;
28
29
  onHoverDrawingEnd: () => void;
29
30
  onHoverDrawingFeature?: (drawing: DrawingListItem, featureIndex: number) => void;
@@ -6,10 +6,12 @@ export interface SyncedWarningFeature {
6
6
  geoJSON: GeoJSON.FeatureCollection;
7
7
  }
8
8
  export declare const getSelectedFormAreaIds: (selectedFormWarning?: Warning) => Set<string>;
9
- export declare const shouldExcludeWarningFromFeatureSync: ({ hiddenWarningIds, hasMatchingAreaId, selectedWarningId, warningIds, }: {
9
+ export declare const isUnsavedAviationCopy: (warning?: Warning) => boolean;
10
+ export declare const shouldExcludeWarningFromFeatureSync: ({ hiddenWarningIds, hasMatchingAreaId, selectedWarningId, warningIds, selectedFormWarning, }: {
10
11
  hiddenWarningIds: Set<string>;
11
12
  hasMatchingAreaId: boolean;
12
13
  selectedWarningId?: string;
13
14
  warningIds: string[];
15
+ selectedFormWarning?: Warning;
14
16
  }) => boolean;
15
17
  export declare const createWarningFeatureCollection: (allFeatures: SyncedWarningFeature[]) => GeoJSON.FeatureCollection<GeoJSON.Geometry, syncGroupsTypes.PotentialDataProperties | null>;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { DraggableSize, Position } from '@opengeoweb/shared';
3
- import type { MapPreset, uiTypes } from '@opengeoweb/store';
3
+ import type { MapPreset } from '@opengeoweb/store';
4
+ import { uiTypes } from '@opengeoweb/store';
4
5
  export interface WarningEventDialogConnectProps {
5
6
  defaultMapPreset?: MapPreset;
6
7
  bounds?: string;
@@ -2,6 +2,7 @@ import type { TFunction } from 'i18next';
2
2
  import React from 'react';
3
3
  import type { ConfirmationOptions, DraggableSize, Position } from '@opengeoweb/shared';
4
4
  import type { MapPreset, uiTypes } from '@opengeoweb/store';
5
+ import type { DrawingListItem } from '../../../store/warningsDrawings/types';
5
6
  import type { FormError } from '../../../store/warningsEventForm/reducer';
6
7
  import type { WarningEvent } from '../../../store/warningsForm/types';
7
8
  export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
@@ -19,6 +20,8 @@ export interface WarningEventFormDialogProps {
19
20
  size?: DraggableSize;
20
21
  source?: uiTypes.Source;
21
22
  startPosition?: Position;
23
+ selectedDrawing?: DrawingListItem;
24
+ onAddDrawing?: () => void;
22
25
  onClose: () => void;
23
26
  onChangeFormMode?: (isReadOnly: boolean) => void;
24
27
  onMouseDown?: () => void;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { FieldErrors } from 'react-hook-form';
3
3
  import type { MapPreset } from '@opengeoweb/store';
4
+ import type { DrawingListItem } from '../../../store/warningsDrawings/types';
4
5
  import type { FormError } from '../../../store/warningsEventForm/reducer';
5
6
  import type { WarningEvent } from '../../../store/warningsForm/types';
6
7
  export declare const CROSS_FIELD_VALIDATIONS: Record<string, {
@@ -13,12 +14,14 @@ export interface WarningEventFormContentProps {
13
14
  error?: FormError;
14
15
  currentEventEditor?: string;
15
16
  isSummaryDialogOpen?: boolean;
17
+ selectedDrawing?: DrawingListItem;
16
18
  selectedEvent?: WarningEvent;
17
19
  shouldHideFormToggleMode?: boolean;
18
20
  isReadOnly?: boolean;
19
21
  isSnapshot?: boolean;
20
22
  isDefaultCollapsed?: boolean;
21
23
  onCancel?: () => void;
24
+ onAddDrawing?: () => void;
22
25
  onChangeFormMode?: (isReadOnly: boolean) => void;
23
26
  onDelete?: () => void;
24
27
  onFormDirty?: (isFormDirty: boolean) => void;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { MapPreset } from '@opengeoweb/store';
3
+ import type { DrawingListItem } from '../../../store/warningsDrawings/types';
3
4
  import { PublicWarningStatus } from '../../../store/warningsForm/types';
4
5
  export declare const probablityOptions: {
5
6
  name: string;
@@ -12,8 +13,10 @@ export declare const WarningEventItem: React.FC<{
12
13
  isSnapshot?: boolean;
13
14
  isCompact: boolean;
14
15
  isDeleteButtonDisabled: boolean;
16
+ selectedDrawing?: DrawingListItem;
15
17
  onExpireWithdraw: (status: PublicWarningStatus, index: number) => void;
16
18
  onToggleCompact: () => void;
19
+ onAddDrawing: () => void;
17
20
  onDeleteWarning: (index: number) => void;
18
21
  }>;
19
22
  export default WarningEventItem;
@@ -1,3 +1,4 @@
1
+ import type { Feature, MultiPolygon, Polygon } from 'geojson';
1
2
  import type { FieldValues, FormState } from 'react-hook-form';
2
3
  import type { Area, WarningEventBody, WarningEvent } from '../../../store/warningsForm/types';
3
4
  import { PublicWarningStatus } from '../../../store/warningsForm/types';
@@ -17,6 +18,8 @@ export declare const getEventStatusActions: (warnings: WarningEventBody[]) => {
17
18
  hasPendingWarnings: boolean;
18
19
  };
19
20
  export declare const getWarningStatusesForEventAction: (warnings: WarningEventBody[], action: PublicWarningStatus.EXPIRED | PublicWarningStatus.WITHDRAWN) => (PublicWarningStatus | undefined)[];
21
+ export declare const isPolygonalFeature: (featureToCheck: GeoJSON.Feature) => featureToCheck is Feature<Polygon | MultiPolygon>;
22
+ export declare const hasAreaData: (areas?: Area[]) => boolean;
20
23
  export declare const doAreasOverlap: (areasA?: Area[], areasB?: Area[]) => boolean;
21
24
  export declare const doTimeRangesOverlap: (aFrom: string, aUntil: string, bFrom: string, bUntil: string) => boolean;
22
25
  export declare const doWarningsOverlap: (warningA: WarningEventBody, warningB: WarningEventBody) => boolean;
@@ -1,8 +1,8 @@
1
1
  import type { TFunction } from 'i18next';
2
2
  import React from 'react';
3
3
  export declare const SUMMARY_HEADLINE_LIMIT = 150;
4
- export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 500;
5
- export declare const SUMMARY_DESCRIPTION_LIMIT = 1500;
4
+ export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 1500;
5
+ export declare const SUMMARY_DESCRIPTION_LIMIT = 2500;
6
6
  export declare const RemainingChars: React.FC<{
7
7
  name: string;
8
8
  limit: number;
@@ -1,6 +1,7 @@
1
1
  import type { FeatureCollection } from 'geojson';
2
2
  import React from 'react';
3
3
  import type { MapPreset } from '@opengeoweb/store';
4
+ import type { ClickOnFeature, HoverSelect } from '@opengeoweb/webmap-react';
4
5
  export declare const EXTENT_PADDING = 50;
5
6
  interface WarningsMapViewProps {
6
7
  geojsonFeature?: FeatureCollection | undefined;
@@ -12,6 +13,8 @@ interface WarningsMapViewProps {
12
13
  };
13
14
  showMapMousePosition?: boolean;
14
15
  showZoomControls?: boolean;
16
+ clickOnFeature?: ClickOnFeature;
17
+ hoverSelect?: HoverSelect;
15
18
  }
16
19
  export declare const WarningsMapView: React.FC<WarningsMapViewProps>;
17
20
  export {};
@@ -1,4 +1,23 @@
1
1
  import { uiTypes } from '@opengeoweb/store';
2
+ import type { AreaListItem, DrawingListItem } from './types';
2
3
  export declare const areaDrawingDialogType = uiTypes.DialogTypes.AreaDrawingManager;
3
4
  export declare const drawingDialogType = uiTypes.DialogTypes.DrawingTool;
4
5
  export declare const areaDrawingLoaderType = uiTypes.DialogTypes.AreaDrawingLoader;
6
+ /**
7
+ * Returns the id to identify a single feature of a drawing by. Drawings saved
8
+ * with the drawing tool have a stable id on every feature (see
9
+ * `ensureFeatureIds` in the layer reducer), but drawings saved before that was
10
+ * introduced do not, so fall back to the position within the drawing.
11
+ * @param drawing The drawing the feature belongs to
12
+ * @param feature The feature to get the id for
13
+ * @param index The index of the feature within the drawing
14
+ * @returns id of the feature
15
+ */
16
+ export declare const getDrawingFeatureId: (drawingId: string, feature: GeoJSON.Feature, index: number) => string;
17
+ /**
18
+ * Makes sure every feature of a drawing has an id, so single features can be
19
+ * identified, selected and assigned.
20
+ * @param drawing The drawing to add feature ids to
21
+ * @returns the drawing, with an id on every feature
22
+ */
23
+ export declare const withDrawingFeatureIds: <T extends DrawingListItem | AreaListItem>(drawing: T) => T;
@@ -1,5 +1,6 @@
1
1
  import type { AlertColor } from '@mui/material';
2
2
  import type { Draft, PayloadAction } from '@reduxjs/toolkit';
3
+ import type { DrawingListItem } from '../warningsDrawings/types';
3
4
  import type { WarningEvent } from '../warningsForm/types';
4
5
  export type FormAction = '' | 'saving' | 'publishing' | 'readonly' | 'edit' | 'amending' | 'cancel';
5
6
  export interface FormError {
@@ -14,6 +15,7 @@ export interface WarningsEventFormState {
14
15
  isFormDirty?: boolean;
15
16
  warningType?: 'warningsEvent';
16
17
  panelId?: string;
18
+ selectedDrawing?: DrawingListItem;
17
19
  }
18
20
  export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
19
21
  export declare const initialState: WarningsEventFormState;
@@ -34,4 +36,7 @@ export declare const warningsEventFormReducer: import("redux").Reducer<WarningsE
34
36
  isFormDirty: boolean;
35
37
  }>) => void;
36
38
  setSelectedEventId: (draft: Draft<WarningsEventFormState>, action: PayloadAction<string>) => void;
39
+ setSelectedDrawing: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
40
+ drawing?: DrawingListItem;
41
+ }>) => void;
37
42
  }, "warningsEventForm">;
@@ -64,3 +64,24 @@ export declare const getWarningsEventIsFormDirty: ((state: WarningModuleStore) =
64
64
  argsMemoize: typeof import("reselect").weakMapMemoize;
65
65
  memoize: typeof import("reselect").weakMapMemoize;
66
66
  };
67
+ export declare const getWarningsEventSelectedDrawing: ((state: WarningModuleStore) => import("../warningsDrawings/types").DrawingListItem | undefined) & {
68
+ clearCache: () => void;
69
+ resultsCount: () => number;
70
+ resetResultsCount: () => void;
71
+ } & {
72
+ resultFunc: (resultFuncArgs_0: WarningsEventFormState) => import("../warningsDrawings/types").DrawingListItem | undefined;
73
+ memoizedResultFunc: ((resultFuncArgs_0: WarningsEventFormState) => import("../warningsDrawings/types").DrawingListItem | undefined) & {
74
+ clearCache: () => void;
75
+ resultsCount: () => number;
76
+ resetResultsCount: () => void;
77
+ };
78
+ lastResult: () => import("../warningsDrawings/types").DrawingListItem | undefined;
79
+ dependencies: [(store: WarningModuleStore) => WarningsEventFormState];
80
+ recomputations: () => number;
81
+ resetRecomputations: () => void;
82
+ dependencyRecomputations: () => number;
83
+ resetDependencyRecomputations: () => void;
84
+ } & {
85
+ argsMemoize: typeof import("reselect").weakMapMemoize;
86
+ memoize: typeof import("reselect").weakMapMemoize;
87
+ };
@@ -1,9 +1,11 @@
1
1
  import type { Airmet, CancelAirmet, CancelSigmet, ProductStatus, Sigmet } from '@opengeoweb/api';
2
+ import type { DrawingListItem } from '../warningsDrawings/types';
2
3
  export interface Area {
3
4
  objectName: string;
4
5
  geoJSON: GeoJSON.FeatureCollection;
5
6
  areaId?: string;
6
7
  published_warning_uuid?: string;
8
+ id?: string;
7
9
  }
8
10
  export interface WarningBodyBase {
9
11
  id?: string;
@@ -114,6 +116,7 @@ export interface WarningEvent {
114
116
  texts: WarningEventTexts;
115
117
  linked_to_id?: string;
116
118
  mode: WarningEventMode;
119
+ selectedDrawing?: DrawingListItem;
117
120
  }
118
121
  export type Warning = PublicWarning | AirmetWarning | SigmetWarning | MaritimeWarning | EventWarningForWarningList;
119
122
  export {};
package/package.json CHANGED
@@ -1,65 +1,64 @@
1
1
  {
2
- "name": "@opengeoweb/warnings",
3
- "version": "19.6.0",
4
- "description": "GeoWeb warinings library for the opengeoweb project",
5
- "license": "Apache-2.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
- },
10
- "main": "./dist/index.esm.js",
11
- "module": "./dist/index.esm.js",
12
- "types": "./dist/index.d.ts",
13
- "exports": {
14
- "./package.json": "./package.json",
15
- ".": {
16
- "@opengeoweb/source": "./src/index.ts",
17
- "types": "./dist/index.d.ts",
18
- "import": "./dist/index.esm.js",
19
- "default": "./dist/index.esm.js"
20
- }
21
- },
22
- "dependencies": {
23
- "@opengeoweb/api": "*",
24
- "@opengeoweb/shared": "*",
25
- "@opengeoweb/store": "*",
26
- "@opengeoweb/webmap-react": "*",
27
- "@tanstack/react-query": "^5.85.5",
28
- "react-redux": "^9.2.0",
29
- "@opengeoweb/theme": "*",
30
- "@opengeoweb/form-fields": "*",
31
- "react-hook-form": "^7.50.1",
32
- "lodash": "^4.18.1",
33
- "@reduxjs/toolkit": "^2.6.1",
34
- "@opengeoweb/snackbar": "*",
35
- "react-window": "^2.2.6",
36
- "axios": "^1.18.0",
37
- "@opengeoweb/core": "*",
38
- "@opengeoweb/webmap": "*",
39
- "@opengeoweb/authentication": "*",
40
- "@opengeoweb/sigmet-airmet": "*",
41
- "react-i18next": "^15.1.1",
42
- "i18next": "^25.0.1",
43
- "@mui/material": "^9.0.1",
44
- "ol": "^10.4.0",
45
- "msw": "^2.7.3",
46
- "@types/geojson": "^7946.0.14",
47
- "@turf/turf": "^7.2.0",
48
- "react-sortablejs": "^6.1.4",
49
- "@mui/x-date-pickers": "^9.3.0"
50
- },
51
- "peerDependencies": {
52
- "react": "19",
53
- "@emotion/react": "*",
54
- "@emotion/styled": "*"
55
- },
56
- "devDependencies": {
57
- "eslint-plugin-storybook": "10.3.3"
58
- },
59
- "files": [
60
- "dist",
61
- "!dist/package.json",
62
- "README.md",
63
- "package.json"
64
- ]
65
- }
2
+ "name": "@opengeoweb/warnings",
3
+ "version": "19.6.1-nightly-20260913",
4
+ "description": "GeoWeb warinings library for the opengeoweb project",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
+ },
10
+ "main": "./dist/index.esm.js",
11
+ "module": "./dist/index.esm.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ "./package.json": "./package.json",
15
+ ".": {
16
+ "@opengeoweb/source": "./src/index.ts",
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.esm.js",
19
+ "default": "./dist/index.esm.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@opengeoweb/api": "19.6.1-nightly-20260913",
24
+ "@opengeoweb/shared": "19.6.1-nightly-20260913",
25
+ "@opengeoweb/store": "19.6.1-nightly-20260913",
26
+ "@opengeoweb/webmap-react": "19.6.1-nightly-20260913",
27
+ "@tanstack/react-query": "^5.85.5",
28
+ "react-redux": "^9.2.0",
29
+ "@opengeoweb/theme": "19.6.1-nightly-20260913",
30
+ "@opengeoweb/form-fields": "19.6.1-nightly-20260913",
31
+ "react-hook-form": "^7.50.1",
32
+ "lodash": "^4.18.1",
33
+ "@reduxjs/toolkit": "^2.6.1",
34
+ "@opengeoweb/snackbar": "19.6.1-nightly-20260913",
35
+ "react-window": "^2.2.6",
36
+ "axios": "^1.18.0",
37
+ "@opengeoweb/core": "19.6.1-nightly-20260913",
38
+ "@opengeoweb/webmap": "19.6.1-nightly-20260913",
39
+ "@opengeoweb/authentication": "19.6.1-nightly-20260913",
40
+ "@opengeoweb/sigmet-airmet": "19.6.1-nightly-20260913",
41
+ "react-i18next": "^15.1.1",
42
+ "i18next": "^25.0.1",
43
+ "@mui/material": "^9.0.1",
44
+ "ol": "^10.4.0",
45
+ "msw": "^2.7.3",
46
+ "@types/geojson": "^7946.0.14",
47
+ "@turf/turf": "^7.2.0",
48
+ "react-sortablejs": "^6.1.4"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "19",
52
+ "@emotion/react": "*",
53
+ "@emotion/styled": "*"
54
+ },
55
+ "devDependencies": {
56
+ "eslint-plugin-storybook": "10.3.3"
57
+ },
58
+ "files": [
59
+ "dist",
60
+ "!dist/package.json",
61
+ "README.md",
62
+ "package.json"
63
+ ]
64
+ }