@opengeoweb/warnings 19.2.0 → 19.4.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 (48) hide show
  1. package/dist/index.esm.js +6785 -1992
  2. package/dist/src/index.d.ts +2 -0
  3. package/dist/src/lib/api/warning-api/api.d.ts +6 -1
  4. package/dist/src/lib/api/warning-api/hooks.d.ts +24 -3
  5. package/dist/src/lib/components/PublicWarningList/PublicWarningList.d.ts +1 -0
  6. package/dist/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +0 -1
  7. package/dist/src/lib/components/PublicWarningList/WarningListItem.d.ts +1 -0
  8. package/dist/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +1 -1
  9. package/dist/src/lib/components/PublicWarningList/useWarningListFeatureSync.d.ts +15 -0
  10. package/dist/src/lib/components/PublicWarningList/warningListFeatureSyncUtils.d.ts +15 -0
  11. package/dist/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +0 -1
  12. package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +0 -1
  13. package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialog.d.ts +16 -0
  14. package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +12 -0
  15. package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +36 -0
  16. package/dist/src/lib/components/WarningEvents/WarningEventDialog/index.d.ts +7 -0
  17. package/dist/src/lib/components/WarningEvents/WarningEventDialog/utils.d.ts +16 -0
  18. package/dist/src/lib/components/WarningEvents/WarningEventForm/CollapseToggleButton.d.ts +9 -0
  19. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventFormContent.d.ts +20 -0
  20. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +10 -0
  21. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimeline.d.ts +21 -0
  22. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlock.d.ts +21 -0
  23. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlockControls.d.ts +15 -0
  24. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineContext.d.ts +7 -0
  25. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/getTimelineRange.d.ts +5 -0
  26. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/index.d.ts +3 -0
  27. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/timelineTestUtils.d.ts +4 -0
  28. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useBlockDrag.d.ts +26 -0
  29. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useModifierKeyHeld.d.ts +1 -0
  30. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/warningEventTimelineDragUtils.d.ts +37 -0
  31. package/dist/src/lib/components/WarningEvents/WarningEventForm/index.d.ts +2 -0
  32. package/dist/src/lib/components/WarningEvents/WarningEventForm/types.d.ts +22 -0
  33. package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +8 -0
  34. package/dist/src/lib/components/WarningEvents/WarningEventForm/warningEventStoryData.d.ts +15 -0
  35. package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryDialog.d.ts +16 -0
  36. package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +16 -0
  37. package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/index.d.ts +1 -0
  38. package/dist/src/lib/store/types.d.ts +2 -0
  39. package/dist/src/lib/store/warningsEventForm/index.d.ts +2 -0
  40. package/dist/src/lib/store/warningsEventForm/listener.d.ts +2 -0
  41. package/dist/src/lib/store/warningsEventForm/reducer.d.ts +37 -0
  42. package/dist/src/lib/store/warningsEventForm/selectors.d.ts +66 -0
  43. package/dist/src/lib/store/warningsForm/types.d.ts +51 -5
  44. package/dist/src/lib/store/warningsForm/utils.d.ts +2 -0
  45. package/dist/src/lib/storybookUtils/testUtils.d.ts +1 -0
  46. package/dist/src/lib/utils/fakeApi/index.d.ts +4 -2
  47. package/dist/src/lib/utils/warningUtils.d.ts +10 -1
  48. package/package.json +2 -2
@@ -3,6 +3,8 @@ export * from './lib/components/ObjectManager';
3
3
  export * from './lib/components/DrawingTool';
4
4
  export * from './lib/components/DrawingToolForm';
5
5
  export * from './lib/components/PublicWarningsFormDialog';
6
+ export * from './lib/components/WarningEvents/WarningEventForm';
7
+ export * from './lib/components/WarningEvents/WarningEventDialog';
6
8
  export * from './lib/components/ComponentsLookUp';
7
9
  export * from './lib/components/WarningsTimeline';
8
10
  export * from './lib/store';
@@ -1,7 +1,7 @@
1
1
  import type { Credentials } from '@opengeoweb/authentication';
2
2
  import type { MaritimeWarningsConfig } from '../../components/MaritimeWarningsForm/types';
3
3
  import type { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
4
- import type { MaritimeWarning, MaritimeWarningsType, PublicWarning } from '../../store/warningsForm/types';
4
+ import type { MaritimeWarning, MaritimeWarningsType, PublicWarning, WarningEvent } from '../../store/warningsForm/types';
5
5
  export declare const getPublicWarningList: (auth: Credentials, apiParams?: Record<string, string>) => Promise<PublicWarning[]>;
6
6
  export declare const updatePublicWarningEditor: (warningId: string, isEditor: boolean, auth: Credentials, force?: boolean) => Promise<Headers | null>;
7
7
  export declare const updatePublicWarning: (warningId: string, auth: Credentials, data: PublicWarning) => Promise<Headers | null>;
@@ -17,3 +17,8 @@ export declare const saveDrawingAs: (auth: Credentials, data: DrawingFromFE) =>
17
17
  export declare const updateDrawing: (auth: Credentials, drawingId: string, data: DrawingFromFE) => Promise<void>;
18
18
  export declare const deleteDrawing: (auth: Credentials, drawingId: string) => Promise<void>;
19
19
  export declare const getMaritimeWarningsConfig: (auth: Credentials) => Promise<MaritimeWarningsConfig>;
20
+ export declare const getWarningEventList: (auth: Credentials, apiParams?: Record<string, string>) => Promise<WarningEvent[]>;
21
+ export declare const updateWarningEventEditor: (eventId: string, isEditor: boolean, auth: Credentials, force?: boolean) => Promise<Headers | null>;
22
+ export declare const updateWarningEvent: (eventId: string, auth: Credentials, data: WarningEvent) => Promise<Headers | null>;
23
+ export declare const postWarningEvent: (auth: Credentials, data: WarningEvent) => Promise<Headers | null>;
24
+ export declare const deleteWarningEvent: (eventId: string, auth: Credentials) => Promise<null>;
@@ -1,15 +1,15 @@
1
- import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
1
+ import type { QueryKey, UseMutationResult, UseQueryResult } from '@tanstack/react-query';
2
2
  import type { TimeFilter } from '../../components/FilterList/filter-utils';
3
3
  import type { MaritimeWarningsConfig } from '../../components/MaritimeWarningsForm/types';
4
4
  import type { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
5
- import type { MaritimeWarning, MaritimeWarningsType, PublicWarning } from '../../store/warningsForm/types';
5
+ import type { MaritimeWarning, MaritimeWarningsType, PublicWarning, WarningEvent } from '../../store/warningsForm/types';
6
6
  /**
7
7
  * @param disabled - Disables fetching, but still returns cached values.
8
8
  * https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
9
9
  */
10
10
  export declare const usePublicWarnings: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<(PublicWarning | MaritimeWarning)[]>;
11
11
  type MutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
12
- oldData: PublicWarning[] | undefined;
12
+ previousData: [QueryKey, PublicWarning[] | undefined][];
13
13
  }>;
14
14
  type DrawingMutationReturnType<T> = UseMutationResult<{
15
15
  id: string;
@@ -55,4 +55,25 @@ interface MutateMaritimeEditorParams {
55
55
  }
56
56
  export declare const useMutateMaritimeWarningsEditor: () => MutationReturnType<MutateMaritimeEditorParams>;
57
57
  export declare const useMaritimeWarningsConfig: (disabled?: boolean) => UseQueryResult<MaritimeWarningsConfig>;
58
+ export declare const useWarningEventsList: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<WarningEvent[]>;
59
+ type EventMutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
60
+ previousData: [QueryKey, WarningEvent[] | undefined][];
61
+ }>;
62
+ interface UpdateWarningEventProps {
63
+ eventId?: string;
64
+ data: WarningEvent;
65
+ panelId?: string;
66
+ }
67
+ export declare const usePublishWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
68
+ export declare const useSaveWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
69
+ export declare const useMutateWarningEvent: (snackBarMessage: string) => EventMutationReturnType<UpdateWarningEventProps>;
70
+ export declare const useMutateDeleteWarningEvent: () => EventMutationReturnType<{
71
+ eventId: string;
72
+ }>;
73
+ interface MutateEventEditorProps {
74
+ eventId: string;
75
+ isEditor: boolean;
76
+ force?: boolean;
77
+ }
78
+ export declare const useMutateEventEditor: () => EventMutationReturnType<MutateEventEditorProps>;
58
79
  export {};
@@ -8,6 +8,7 @@ export interface PublicWarningListProps extends WarningListItemActions {
8
8
  isLoading?: boolean;
9
9
  error?: Error;
10
10
  selectedWarningId?: string;
11
+ selectedEventId?: string;
11
12
  lastUpdatedTime?: string;
12
13
  onCreateWarning?: () => void;
13
14
  onRefetchWarnings?: () => void;
@@ -6,5 +6,4 @@ export interface PublicWarningListConnectProps {
6
6
  presetFilterState?: PickedFilterState;
7
7
  presetExpandedSections?: ExpandedWarningSections;
8
8
  }
9
- export declare const WARNING_HOVER_DISPATCH_DELAY = 50;
10
9
  export declare const PublicWarningListConnect: React.FC<PublicWarningListConnectProps>;
@@ -6,6 +6,7 @@ export interface WarningListItemProps extends ListItemProps, WarningListItemActi
6
6
  warning: Warning;
7
7
  highlightedItem?: boolean;
8
8
  activeWarningId: string;
9
+ activeEventId: string;
9
10
  onHoverWarning?: (warningId?: string) => void;
10
11
  onSelectWarning?: (warning: Warning) => void;
11
12
  shouldDisableAviationAmendOption?: boolean;
@@ -5,7 +5,7 @@ import type { MaritimeWarning, Warning } from '../../store/warningsForm/types';
5
5
  import { MaritimeWarningAction } from '../../store/warningsForm/types';
6
6
  export interface WarningListItemActions {
7
7
  onEditWarning?: (warning: Warning) => void;
8
- onDeleteWarning?: (warningId: string, warningEditor?: string) => void;
8
+ onDeleteWarning?: (warning: Warning) => void;
9
9
  onDeleteReviewWarning?: (warning: Warning) => void;
10
10
  onExpireWarning?: (warning: Warning) => void;
11
11
  onWithdrawWarning?: (warning: Warning) => void;
@@ -0,0 +1,15 @@
1
+ import type { Warning } from '../../store/warningsForm/types';
2
+ export declare const WARNING_HOVER_DISPATCH_DELAY = 50;
3
+ interface UseWarningListFeatureSyncProps {
4
+ filteredWarningsByExpandedSections: Warning[];
5
+ hiddenWarningIds: Set<string>;
6
+ panelId: string;
7
+ selectedFormWarning?: Warning;
8
+ selectedWarningId?: string;
9
+ }
10
+ interface UseWarningListFeatureSyncResult {
11
+ handleHoverWarning: (warningId?: string) => void;
12
+ hoveredFeatureId?: string;
13
+ }
14
+ export declare const useWarningListFeatureSync: ({ filteredWarningsByExpandedSections, hiddenWarningIds, panelId, selectedFormWarning, selectedWarningId, }: UseWarningListFeatureSyncProps) => UseWarningListFeatureSyncResult;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { syncGroupsTypes } from '@opengeoweb/store';
2
+ import type { Warning } from '../../store/warningsForm/types';
3
+ export interface SyncedWarningFeature {
4
+ id: string;
5
+ originalId: string;
6
+ geoJSON: GeoJSON.FeatureCollection;
7
+ }
8
+ export declare const getSelectedFormAreaIds: (selectedFormWarning?: Warning) => Set<string>;
9
+ export declare const shouldExcludeWarningFromFeatureSync: ({ hiddenWarningIds, hasMatchingAreaId, selectedWarningId, warningIds, }: {
10
+ hiddenWarningIds: Set<string>;
11
+ hasMatchingAreaId: boolean;
12
+ selectedWarningId?: string;
13
+ warningIds: string[];
14
+ }) => boolean;
15
+ export declare const createWarningFeatureCollection: (allFeatures: SyncedWarningFeature[]) => GeoJSON.FeatureCollection<GeoJSON.Geometry, syncGroupsTypes.PotentialDataProperties | null>;
@@ -8,7 +8,6 @@ import type { BaseDrawingListItem, DrawingListItem } from '../../store/warningsD
8
8
  import type { FormError } from '../../store/warningsForm/reducer';
9
9
  import type { Area, PublicWarningDetail, WarningType } from '../../store/warningsForm/types';
10
10
  import { PublicWarningStatus } from '../../store/warningsForm/types';
11
- export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement | null>;
12
11
  export declare const getEmptyPublicWarning: () => PublicWarningDetail;
13
12
  export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => FormData;
14
13
  interface FormData extends PublicWarningDetail {
@@ -4,7 +4,6 @@ import type { ConfirmationOptions, Position } from '@opengeoweb/shared';
4
4
  import { uiTypes } from '@opengeoweb/store';
5
5
  import type { MapPreset } from '@opengeoweb/store';
6
6
  export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
7
- export declare const isAlreadyEdited: (publicWarningEditor: string | undefined, username: string | undefined) => boolean;
8
7
  export declare const PublicWarningsFormDialogConnect: React.FC<{
9
8
  bounds?: string;
10
9
  source?: uiTypes.Source;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { DraggableSize, HeaderSize, Position } from '@opengeoweb/shared';
3
+ import type { uiTypes } from '@opengeoweb/store';
4
+ export interface WarningEventDialogProps {
5
+ bounds?: string;
6
+ isOpen: boolean;
7
+ onClose: () => void;
8
+ onMouseDown?: () => void;
9
+ order?: number;
10
+ source?: uiTypes.Source;
11
+ size?: DraggableSize;
12
+ startPosition?: Position;
13
+ headerSize?: HeaderSize;
14
+ children: React.ReactNode;
15
+ }
16
+ export declare const WarningEventDialog: React.FC<WarningEventDialogProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { DraggableSize, Position } from '@opengeoweb/shared';
3
+ import type { uiTypes } from '@opengeoweb/store';
4
+ export interface WarningEventDialogConnectProps {
5
+ bounds?: string;
6
+ source?: uiTypes.Source;
7
+ size?: DraggableSize;
8
+ startPosition?: Position;
9
+ startPositionSummary?: Position;
10
+ isDefaultCollapsed?: boolean;
11
+ }
12
+ export declare const WarningEventDialogConnect: React.FC<WarningEventDialogConnectProps>;
@@ -0,0 +1,36 @@
1
+ import type { TFunction } from 'i18next';
2
+ import React from 'react';
3
+ import type { ConfirmationOptions, DraggableSize, Position } from '@opengeoweb/shared';
4
+ import type { uiTypes } from '@opengeoweb/store';
5
+ import type { FormError } from '../../../store/warningsEventForm/reducer';
6
+ import type { WarningEvent } from '../../../store/warningsForm/types';
7
+ export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
8
+ export interface WarningEventFormDialogProps {
9
+ bounds?: string;
10
+ currentEventEditor?: string;
11
+ shouldHideFormToggleMode?: boolean;
12
+ selectedEvent?: WarningEvent;
13
+ error?: FormError;
14
+ isOpen: boolean;
15
+ isReadOnly?: boolean;
16
+ order?: number;
17
+ size?: DraggableSize;
18
+ source?: uiTypes.Source;
19
+ startPosition?: Position;
20
+ onClose: () => void;
21
+ onChangeFormMode?: (isReadOnly: boolean) => void;
22
+ onMouseDown?: () => void;
23
+ onDelete?: () => void;
24
+ onFormDirty?: (isFormDirty: boolean) => void;
25
+ onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
26
+ onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
27
+ isSummaryOpen: boolean;
28
+ summaryOrder?: number;
29
+ summarySource?: uiTypes.Source;
30
+ startPositionSummary?: Position;
31
+ onOpenSummary: () => void;
32
+ onCloseSummary: () => void;
33
+ onAddSummary: () => void;
34
+ onMouseDownSummary?: () => void;
35
+ }
36
+ export declare const WarningEventFormDialog: React.FC<WarningEventFormDialogProps>;
@@ -0,0 +1,7 @@
1
+ export { WarningEventDialog } from './WarningEventDialog';
2
+ export type { WarningEventFormDialogProps } from './WarningEventFormDialog';
3
+ export { WarningEventFormDialog } from './WarningEventFormDialog';
4
+ export type { WarningEventDialogProps } from './WarningEventDialog';
5
+ export { WarningEventDialogConnect } from './WarningEventDialogConnect';
6
+ export type { WarningEventDialogConnectProps } from './WarningEventDialogConnect';
7
+ export { useWarningEventActions } from './utils';
@@ -0,0 +1,16 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { ConfirmationOptions } from '@opengeoweb/shared';
3
+ import type { FormAction } from '../../../store/warningsEventForm/reducer';
4
+ import type { EventWarningForWarningList, WarningEvent } from '../../../store/warningsForm/types';
5
+ import type { TimeFilter } from '../../FilterList/filter-utils';
6
+ import type { ConfirmDialogProps } from '../../PublicWarningList/ConfirmWarningDialog';
7
+ export declare const getNewEventWithLinkedToId: (event: WarningEvent) => WarningEvent;
8
+ export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
9
+ interface WarningEventsActions {
10
+ selectedEventId: string;
11
+ openWarningsEventDialog: (formAction?: FormAction, warning?: EventWarningForWarningList) => Promise<void>;
12
+ deleteWarningsEvent: (warningEventId: string, currentUser: string, setConfirmDialogOptions: React.Dispatch<React.SetStateAction<ConfirmDialogProps | undefined>>) => Promise<void>;
13
+ updateWarningsEvent: (warningEventId: string, currentUser: string) => Promise<void>;
14
+ }
15
+ export declare const useWarningEventActions: (panelId: string, timeFilter?: TimeFilter) => WarningEventsActions;
16
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface CollapseToggleButtonProps {
3
+ isCollapsed: boolean;
4
+ onToggle: () => void;
5
+ collapseLabel: string;
6
+ expandLabel: string;
7
+ }
8
+ export declare const CollapseToggleButton: React.FC<CollapseToggleButtonProps>;
9
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { FormError } from '../../../store/warningsEventForm/reducer';
3
+ import type { WarningEvent } from '../../../store/warningsForm/types';
4
+ export interface WarningEventFormContentProps {
5
+ error?: FormError;
6
+ currentEventEditor?: string;
7
+ isSummaryDialogOpen?: boolean;
8
+ selectedEvent?: WarningEvent;
9
+ shouldHideFormToggleMode?: boolean;
10
+ isReadOnly?: boolean;
11
+ isDefaultCollapsed?: boolean;
12
+ onCancel?: () => void;
13
+ onChangeFormMode?: (isReadOnly: boolean) => void;
14
+ onDelete?: () => void;
15
+ onFormDirty?: (isFormDirty: boolean) => void;
16
+ onOpenWarningSummary?: () => void;
17
+ onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
18
+ onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
19
+ }
20
+ export declare const WarningEventFormContent: React.FC<WarningEventFormContentProps>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export declare const WarningEventItem: React.FC<{
3
+ index: number;
4
+ isReadOnly: boolean;
5
+ isCompact: boolean;
6
+ isDeleteButtonDisabled: boolean;
7
+ onToggleCompact: () => void;
8
+ onDeleteWarning: (index: number) => void;
9
+ }>;
10
+ export default WarningEventItem;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { TimelineEditing } from './WarningEventTimelineBlock';
3
+ import type { PublicWarningStatus } from '../../../../store/warningsForm/types';
4
+ export type { TimelineEditing };
5
+ export interface WarningEventTimelineProps {
6
+ start: Date;
7
+ end: Date;
8
+ validFrom: string;
9
+ validUntil: string;
10
+ level: string;
11
+ status?: PublicWarningStatus;
12
+ now?: Date;
13
+ isCompact?: boolean;
14
+ editing?: TimelineEditing;
15
+ }
16
+ interface AxisIntervals {
17
+ tickHours: number;
18
+ labelHours: number;
19
+ }
20
+ export declare const getAxisIntervals: (rangeDays: number) => AxisIntervals;
21
+ export declare const WarningEventTimeline: React.FC<WarningEventTimelineProps>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { PublicWarningStatus } from '../../../../store/warningsForm/types';
3
+ import { WarningLevel } from '../../../PublicWarningsForm/LevelField';
4
+ export interface TimelineEditing {
5
+ onTimesChange: (validFrom: string, validUntil: string) => void;
6
+ onLevelChange?: (level: WarningLevel) => void;
7
+ }
8
+ interface WarningEventTimelineBlockProps {
9
+ start: Date;
10
+ end: Date;
11
+ now: Date;
12
+ drawableWidth: number;
13
+ validFrom: string;
14
+ validUntil: string;
15
+ level: string;
16
+ status?: PublicWarningStatus;
17
+ isCompact?: boolean;
18
+ editing?: TimelineEditing;
19
+ }
20
+ export declare const WarningEventTimelineBlock: React.FC<WarningEventTimelineBlockProps>;
21
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { TimelineEditing } from './WarningEventTimelineBlock';
3
+ interface WarningEventTimelineBlockControlsProps {
4
+ left: number;
5
+ width: number;
6
+ containerWidth: number;
7
+ from: Date;
8
+ until: Date;
9
+ now: Date;
10
+ maxPickerDate: Date;
11
+ editing: TimelineEditing;
12
+ showEditAffordances: boolean;
13
+ }
14
+ export declare const WarningEventTimelineBlockControls: React.FC<WarningEventTimelineBlockControlsProps>;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { TimelineRange } from './getTimelineRange';
3
+ export declare const WarningEventTimelineRangeProvider: React.FC<{
4
+ range: TimelineRange;
5
+ children: React.ReactNode;
6
+ }>;
7
+ export declare const useTimelineRange: () => TimelineRange;
@@ -0,0 +1,5 @@
1
+ export interface TimelineRange {
2
+ start: Date;
3
+ end: Date;
4
+ }
5
+ export declare const getTimelineRange: (selectedDays: readonly number[], now?: Date) => TimelineRange;
@@ -0,0 +1,3 @@
1
+ export * from './WarningEventTimeline';
2
+ export * from './WarningEventTimelineContext';
3
+ export * from './getTimelineRange';
@@ -0,0 +1,4 @@
1
+ export declare const mockTimelineLayout: ({ width, height, }?: {
2
+ width?: number | undefined;
3
+ height?: number | undefined;
4
+ }) => void;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import type { DragMode } from './warningEventTimelineDragUtils';
3
+ interface DragPreview {
4
+ from: Date;
5
+ until: Date;
6
+ }
7
+ export interface UseBlockDragParams {
8
+ from: Date | null;
9
+ until: Date | null;
10
+ rangeStart: Date;
11
+ rangeEnd: Date;
12
+ now: Date;
13
+ maxUntil: Date;
14
+ drawableWidth: number;
15
+ onTimesChange?: (validFrom: string, validUntil: string) => void;
16
+ }
17
+ export interface UseBlockDragResult {
18
+ dragPreview: DragPreview | null;
19
+ dragMode: DragMode | null;
20
+ beginDrag: (mode: DragMode, event: React.PointerEvent) => void;
21
+ onPointerMove: (event: React.PointerEvent) => void;
22
+ onPointerUp: (event: React.PointerEvent) => void;
23
+ onPointerCancel: (event: React.PointerEvent) => void;
24
+ }
25
+ export declare const useBlockDrag: ({ from, until, rangeStart, rangeEnd, now, maxUntil, drawableWidth, onTimesChange, }: UseBlockDragParams) => UseBlockDragResult;
26
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useModifierKeyHeld: (isEnabled?: boolean) => boolean;
@@ -0,0 +1,37 @@
1
+ export declare const SNAP_MINUTES = 30;
2
+ export declare const MIN_DURATION_MINUTES = 30;
3
+ export declare const MIN_VISIBLE_MINUTES = 30;
4
+ export declare const ABSOLUTE_MAX_DAY = 7;
5
+ export declare const EDGE_HIT_ZONE_PX = 8;
6
+ export declare const EXPANDED_BLOCK_TOP = 58;
7
+ export declare const EXPANDED_BLOCK_HEIGHT = 56;
8
+ export declare const TIME_FIELD_WIDTH = 200;
9
+ export declare const TIME_FIELD_GAP = 8;
10
+ export type DragMode = 'start' | 'end' | 'move';
11
+ export declare const snapToInterval: (timeMs: number, intervalMs?: number) => number;
12
+ export declare const formatOverflowHours: (overflowMs: number) => string;
13
+ export declare const getEndTimeForMovedStart: (fromMs: number, untilMs: number, newFromMs: number, maxUntilMs: number) => number;
14
+ export interface TimeFieldPositions {
15
+ startLeft: number;
16
+ endLeft: number;
17
+ isStacked: boolean;
18
+ }
19
+ export declare const getTimeFieldPositions: ({ left, width, containerWidth, }: {
20
+ left: number;
21
+ width: number;
22
+ containerWidth: number;
23
+ }) => TimeFieldPositions;
24
+ export interface ComputeDraggedTimesParams {
25
+ mode: DragMode;
26
+ deltaMs: number;
27
+ fromMs: number;
28
+ untilMs: number;
29
+ rangeStartMs: number;
30
+ rangeEndMs: number;
31
+ nowMs: number;
32
+ maxUntilMs: number;
33
+ }
34
+ export declare const computeDraggedTimes: ({ mode, deltaMs, fromMs, untilMs, rangeStartMs, rangeEndMs, nowMs, maxUntilMs, }: ComputeDraggedTimesParams) => {
35
+ fromMs: number;
36
+ untilMs: number;
37
+ };
@@ -0,0 +1,2 @@
1
+ export { WarningEventFormContent } from './WarningEventFormContent';
2
+ export type { WarningEventFormContentProps } from './WarningEventFormContent';
@@ -0,0 +1,22 @@
1
+ import type { WarningEvent, WarningEventBody } from '../../../store/warningsForm/types';
2
+ import { WarningEventMode, WarningEventType } from '../../../store/warningsForm/types';
3
+ export declare const warningEventTypes: {
4
+ translationKey: string;
5
+ key: WarningEventType;
6
+ defaultDayRange: [number, number];
7
+ minSelectableDay: number;
8
+ }[];
9
+ export declare const warningEventModes: {
10
+ translationKey: string;
11
+ key: WarningEventMode;
12
+ }[];
13
+ export declare const getDefaultDayRangeForType: (type: WarningEventType) => [number, number];
14
+ export declare const getMinSelectableDayForType: (type: WarningEventType) => number;
15
+ export declare const getDefaultWarningTimes: (type: WarningEventType, now?: Date) => {
16
+ validFrom: string;
17
+ validUntil: string;
18
+ };
19
+ export declare const defaultValues: WarningEvent;
20
+ export declare const warningEventItemDefaultValues: WarningEventBody;
21
+ export declare const buildDefaultWarningItem: (event: Pick<WarningEvent, "warningEventType" | "incident" | "phenomenon">) => WarningEventBody;
22
+ export declare const getDefaultValues: (initialValues?: Partial<WarningEvent>) => WarningEvent;
@@ -0,0 +1,8 @@
1
+ import type { WarningEventBody, WarningEvent, PublicWarningStatus } from '../../../store/warningsForm/types';
2
+ interface FormData extends WarningEvent {
3
+ IS_DRAFT?: boolean | string;
4
+ }
5
+ export declare const buildSubmitValues: (values: FormData) => WarningEvent;
6
+ export declare const getFormData: (warningsEvent: WarningEvent | undefined) => FormData;
7
+ export declare const constructWarningWithNewStatus: (warningsEvent: WarningEvent, status: PublicWarningStatus) => WarningEventBody[];
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { WarningEvent } from '../../../store/warningsForm/types';
2
+ export declare const emptyWarning: {
3
+ incident: string;
4
+ validFrom: string;
5
+ validUntil: string;
6
+ level: string;
7
+ domain: string;
8
+ warningProposalSource: string;
9
+ authority: string;
10
+ phenomenon: string;
11
+ type: number;
12
+ warning_handle_uuid: string;
13
+ };
14
+ export declare const buildEarlyWarningInitialValues: () => Partial<WarningEvent>;
15
+ export declare const buildLiveInitialValues: () => Partial<WarningEvent>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
3
+ import type { uiTypes } from '@opengeoweb/store';
4
+ export declare const WarningEventSummaryDialog: React.FC<{
5
+ bounds?: string;
6
+ title?: string;
7
+ onClose: () => void;
8
+ onMouseDown?: () => void;
9
+ isOpen: boolean;
10
+ order?: number;
11
+ source?: uiTypes.Source;
12
+ size?: DraggableSize;
13
+ startPosition?: Position;
14
+ headerSize?: HeaderSize;
15
+ onClickAdd?: () => void;
16
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { TFunction } from 'i18next';
2
+ import React from 'react';
3
+ export declare const SUMMARY_HEADLINE_LIMIT = 80;
4
+ export declare const SUMMARY_CONCISE_SUMMARY_LIMIT = 300;
5
+ export declare const SUMMARY_DESCRIPTION_LIMIT = 500;
6
+ export declare const RemainingChars: React.FC<{
7
+ name: string;
8
+ limit: number;
9
+ t: TFunction<'warn'>;
10
+ }>;
11
+ interface FormProps {
12
+ isReadOnly?: boolean;
13
+ onClickAdd?: () => void;
14
+ }
15
+ export declare const WarningEventSummaryForm: React.FC<FormProps>;
16
+ export {};
@@ -0,0 +1 @@
1
+ export { WarningEventSummaryDialog } from './WarningEventSummaryDialog';
@@ -1,9 +1,11 @@
1
1
  import type { CoreAppStore } from '@opengeoweb/store';
2
2
  import type { DrawState } from './warningsDrawings/types';
3
+ import type { WarningsEventFormState } from './warningsEventForm/reducer';
3
4
  import type { WarningsFiltersState } from './warningsFilters/types';
4
5
  import type { WarningFormState } from './warningsForm/reducer';
5
6
  export interface WarningModuleStore extends CoreAppStore {
6
7
  drawings?: DrawState;
8
+ warningsEventForm?: WarningsEventFormState;
7
9
  warningsForm?: WarningFormState;
8
10
  warningsFilters?: WarningsFiltersState;
9
11
  }
@@ -0,0 +1,2 @@
1
+ export { warningsEventFormReducer, warningsEventFormActions } from './reducer';
2
+ export { warningsEventFormListener } from './listener';
@@ -0,0 +1,2 @@
1
+ import type { WarningModuleStore } from '../types';
2
+ export declare const warningsEventFormListener: import("@reduxjs/toolkit").ListenerMiddlewareInstance<WarningModuleStore, import("redux-thunk").ThunkDispatch<WarningModuleStore, unknown, import("redux").UnknownAction>, unknown>;
@@ -0,0 +1,37 @@
1
+ import type { AlertColor } from '@mui/material';
2
+ import type { Draft, PayloadAction } from '@reduxjs/toolkit';
3
+ import type { WarningEvent } from '../warningsForm/types';
4
+ export type FormAction = '' | 'saving' | 'publishing' | 'readonly' | 'edit' | 'amending' | 'cancel';
5
+ export interface FormError {
6
+ severity?: AlertColor;
7
+ message: string;
8
+ }
9
+ export interface WarningsEventFormState {
10
+ event?: WarningEvent;
11
+ formState?: FormAction;
12
+ error?: FormError;
13
+ selectedEventId?: string;
14
+ isFormDirty?: boolean;
15
+ warningType?: 'warningsEvent';
16
+ panelId?: string;
17
+ }
18
+ export declare const TAKEOVER_MESSAGE = "You are no longer the editor of this warning";
19
+ export declare const initialState: WarningsEventFormState;
20
+ export declare const warningsEventFormReducer: import("redux").Reducer<WarningsEventFormState>, warningsEventFormActions: import("@reduxjs/toolkit").CaseReducerActions<{
21
+ setFormValues: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
22
+ event?: WarningEvent;
23
+ formState?: FormAction;
24
+ }>) => void;
25
+ openWarningsEventFormDialog: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
26
+ formState?: FormAction;
27
+ event?: WarningEvent;
28
+ panelId?: string;
29
+ selectedEventId?: string;
30
+ }>) => void;
31
+ setFormError: (draft: Draft<WarningsEventFormState>, action: PayloadAction<FormError>) => void;
32
+ removeFormError: (draft: Draft<WarningsEventFormState>) => void;
33
+ setFormDirty: (draft: Draft<WarningsEventFormState>, action: PayloadAction<{
34
+ isFormDirty: boolean;
35
+ }>) => void;
36
+ setSelectedEventId: (draft: Draft<WarningsEventFormState>, action: PayloadAction<string>) => void;
37
+ }, "warningsEventForm">;