@opengeoweb/sigmet-airmet 9.32.1 → 9.33.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 +54 -8
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -3,13 +3,13 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { FormControlLabel, Radio, Grid2, Typography, Box, Button, Checkbox, MenuItem, FormHelperText, useTheme, Dialog, DialogTitle, DialogContent, Backdrop, CircularProgress, Card, LinearProgress, List, ListItemButton } from '@mui/material';
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
|
-
import { FORM_FIELDS_NAMESPACE, 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';
|
|
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
8
|
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, defaultPoint, addGeoJSONProperties, defaultBox, defaultPolygon, DRAWMODE, defaultDelete, getIcon, MapControls, MapViewLayer, useMapDrawTool, addFeatureProperties, rewindGeometry } from '@opengeoweb/webmap-react';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
|
-
import { useTranslation } from 'react-i18next';
|
|
11
|
-
import { PROJECTION, ToggleMenu, useIsMounted, dateUtils, CustomTooltip, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, AlertBanner, isAxiosError, getAxiosErrorMessage, StatusTag, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
12
|
-
import { LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, TimeSliderConnect, LegendConnect, LayerManagerConnect } from '@opengeoweb/core';
|
|
10
|
+
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
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, LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, TimeSliderConnect, LegendConnect, LayerManagerConnect } from '@opengeoweb/core';
|
|
13
13
|
import { DrawFIRLand, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
14
14
|
import { LayerType, webmapUtils } from '@opengeoweb/webmap';
|
|
15
15
|
import { debounce } from 'lodash';
|
|
@@ -2529,11 +2529,57 @@ const useShortTestHelpers = () => {
|
|
|
2529
2529
|
};
|
|
2530
2530
|
|
|
2531
2531
|
const SA_NAMESPACE = 'sigmetairmet';
|
|
2532
|
+
const initSigmetAirmetI18n = () => {
|
|
2533
|
+
void i18n.use(initReactI18next).init({
|
|
2534
|
+
lng: 'en',
|
|
2535
|
+
fallbackLng: 'en',
|
|
2536
|
+
ns: SA_NAMESPACE,
|
|
2537
|
+
interpolation: {
|
|
2538
|
+
escapeValue: false
|
|
2539
|
+
},
|
|
2540
|
+
resources: {
|
|
2541
|
+
en: {
|
|
2542
|
+
[SA_NAMESPACE]: sigmetAirmetTranslations.en,
|
|
2543
|
+
[SHARED_NAMESPACE]: sharedTranslations.en,
|
|
2544
|
+
[CORE_NAMESPACE]: coreTranslations.en,
|
|
2545
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.en
|
|
2546
|
+
},
|
|
2547
|
+
fi: {
|
|
2548
|
+
[SA_NAMESPACE]: sigmetAirmetTranslations.fi,
|
|
2549
|
+
[SHARED_NAMESPACE]: sharedTranslations.fi,
|
|
2550
|
+
[CORE_NAMESPACE]: coreTranslations.fi,
|
|
2551
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.fi
|
|
2552
|
+
},
|
|
2553
|
+
no: {
|
|
2554
|
+
[SA_NAMESPACE]: sigmetAirmetTranslations.no,
|
|
2555
|
+
[SHARED_NAMESPACE]: sharedTranslations.no,
|
|
2556
|
+
[CORE_NAMESPACE]: coreTranslations.no,
|
|
2557
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.no
|
|
2558
|
+
},
|
|
2559
|
+
nl: {
|
|
2560
|
+
[SA_NAMESPACE]: sigmetAirmetTranslations.nl,
|
|
2561
|
+
[SHARED_NAMESPACE]: sharedTranslations.nl,
|
|
2562
|
+
[CORE_NAMESPACE]: coreTranslations.nl,
|
|
2563
|
+
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.nl
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2567
|
+
};
|
|
2532
2568
|
const ns = [SA_NAMESPACE, FORM_FIELDS_NAMESPACE];
|
|
2533
|
-
const translateKeyOutsideComponents = (key, params = undefined) =>
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2569
|
+
const translateKeyOutsideComponents = (key, params = undefined) => {
|
|
2570
|
+
if (!i18n.isInitialized) {
|
|
2571
|
+
initSigmetAirmetI18n();
|
|
2572
|
+
}
|
|
2573
|
+
return i18n.t(key, Object.assign({
|
|
2574
|
+
ns
|
|
2575
|
+
}, params));
|
|
2576
|
+
};
|
|
2577
|
+
const useSigmetAirmetTranslation = () => {
|
|
2578
|
+
if (!i18n.isInitialized) {
|
|
2579
|
+
initSigmetAirmetI18n();
|
|
2580
|
+
}
|
|
2581
|
+
return useTranslation(ns);
|
|
2582
|
+
};
|
|
2537
2583
|
|
|
2538
2584
|
const Change = ({
|
|
2539
2585
|
isDisabled,
|