@opengeoweb/cap 9.15.0 → 9.16.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 CHANGED
@@ -2,16 +2,38 @@ import React from 'react';
2
2
  import { useApiContext, useApi, createNonAuthApiInstance, ApiProvider } from '@opengeoweb/api';
3
3
  import { Grid, Typography, Box, Card, CircularProgress } from '@mui/material';
4
4
  import { Box as Box$1 } from '@mui/system';
5
- import { dateUtils, AlertBanner, withEggs } from '@opengeoweb/shared';
5
+ import { dateUtils, AlertBanner } from '@opengeoweb/shared';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { useSelector, useDispatch } from 'react-redux';
8
8
  import { createEntityAdapter, createSlice, createSelector } from '@reduxjs/toolkit';
9
9
  import 'i18next';
10
10
  import { ConfigurableMapConnect } from '@opengeoweb/core';
11
- import { mapSelectors, coreModuleConfig } from '@opengeoweb/store';
11
+ import { mapSelectors } from '@opengeoweb/store';
12
12
  import { webmapUtils } from '@opengeoweb/webmap';
13
13
  import { MapViewLayer, MapWarningProperties } from '@opengeoweb/webmap-react';
14
- import { ThemeWrapper } from '@opengeoweb/theme';
14
+
15
+ var en = {
16
+ "map-view-cap-error-title": "Something went wrong with loading the configuration file",
17
+ "warning-list-cap-alert-banner-title": "Note: Only map is affected by timeslider based filtering",
18
+ "warning-list-cap-error-title": "Something went wrong with loading the configuration file",
19
+ "warning-list-row-event": "Event",
20
+ "warning-list-row-severity": "Severity",
21
+ "warning-list-row-expires": "Expires",
22
+ "warning-list-row-not-expired": "(not expired)"
23
+ };
24
+ var fi = {
25
+ "map-view-cap-error-title": "🚧 ei käännetty",
26
+ "warning-list-cap-alert-banner-title": "🚧 ei käännetty",
27
+ "warning-list-cap-error-title": "🚧 ei käännetty",
28
+ "warning-list-row-event": "🚧 ei käännetty",
29
+ "warning-list-row-severity": "🚧 ei käännetty",
30
+ "warning-list-row-expires": "🚧 ei käännetty",
31
+ "warning-list-row-not-expired": "🚧 ei käännetty"
32
+ };
33
+ var capTrans = {
34
+ en: en,
35
+ fi: fi
36
+ };
15
37
 
16
38
  /* *
17
39
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1872,29 +1894,6 @@ $$c({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }
1872
1894
  assign: assign
1873
1895
  });
1874
1896
 
1875
- var en = {
1876
- "map-view-cap-error-title": "Something went wrong with loading the configuration file",
1877
- "warning-list-cap-alert-banner-title": "Note: Only map is affected by timeslider based filtering",
1878
- "warning-list-cap-error-title": "Something went wrong with loading the configuration file",
1879
- "warning-list-row-event": "Event",
1880
- "warning-list-row-severity": "Severity",
1881
- "warning-list-row-expires": "Expires",
1882
- "warning-list-row-not-expired": "(not expired)"
1883
- };
1884
- var fi = {
1885
- "map-view-cap-error-title": "🚧 ei käännetty",
1886
- "warning-list-cap-alert-banner-title": "🚧 ei käännetty",
1887
- "warning-list-cap-error-title": "🚧 ei käännetty",
1888
- "warning-list-row-event": "🚧 ei käännetty",
1889
- "warning-list-row-severity": "🚧 ei käännetty",
1890
- "warning-list-row-expires": "🚧 ei käännetty",
1891
- "warning-list-row-not-expired": "🚧 ei käännetty"
1892
- };
1893
- var capTrans = {
1894
- en: en,
1895
- fi: fi
1896
- };
1897
-
1898
1897
  const CAP_NAMESPACE = 'cap';
1899
1898
 
1900
1899
  /* *
@@ -4453,54 +4452,6 @@ const MapViewCapConnectWrapper = ({
4453
4452
  });
4454
4453
  };
4455
4454
 
4456
- /* *
4457
- * Licensed under the Apache License, Version 2.0 (the "License");
4458
- * you may not use this file except in compliance with the License.
4459
- * You may obtain a copy of the License at
4460
- *
4461
- * http://www.apache.org/licenses/LICENSE-2.0
4462
- *
4463
- * Unless required by applicable law or agreed to in writing, software
4464
- * distributed under the License is distributed on an "AS IS" BASIS,
4465
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4466
- * See the License for the specific language governing permissions and
4467
- * limitations under the License.
4468
- *
4469
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4470
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
4471
- * */
4472
- const capModuleConfig = {
4473
- id: 'capStore-module',
4474
- reducersMap: {
4475
- capStore: reducer
4476
- }
4477
- };
4478
-
4479
- const CapThemeWrapper = ({
4480
- theme,
4481
- children
4482
- }) => /*#__PURE__*/React.createElement(ThemeWrapper, {
4483
- theme: theme
4484
- }, children);
4485
- withEggs([capModuleConfig, ...coreModuleConfig])(({
4486
- theme,
4487
- children
4488
- }) => ( /*#__PURE__*/React.createElement(CapThemeWrapper, {
4489
- theme: theme
4490
- }, children)));
4491
- const CapTranslationsWrapper = ({
4492
- children
4493
- }) => {
4494
- const {
4495
- i18n
4496
- } = useTranslation();
4497
- React.useEffect(() => {
4498
- i18n.addResourceBundle('en', CAP_NAMESPACE, capTrans.en);
4499
- i18n.addResourceBundle('fi', CAP_NAMESPACE, capTrans.fi);
4500
- }, [i18n]);
4501
- return children;
4502
- };
4503
-
4504
4455
  /* *
4505
4456
  * Licensed under the Apache License, Version 2.0 (the "License");
4506
4457
  * you may not use this file except in compliance with the License.
@@ -4536,7 +4487,7 @@ const ComponentsLookUp = ({
4536
4487
  switch (componentType) {
4537
4488
  case 'CapWarningMap':
4538
4489
  {
4539
- return /*#__PURE__*/React.createElement(CapTranslationsWrapper, null, /*#__PURE__*/React.createElement(ApiProvider, {
4490
+ return /*#__PURE__*/React.createElement(ApiProvider, {
4540
4491
  config: {
4541
4492
  baseURL: config.baseURL
4542
4493
  },
@@ -4547,22 +4498,45 @@ const ComponentsLookUp = ({
4547
4498
  srs: (_b = initialProps.mapPreset.proj) === null || _b === void 0 ? void 0 : _b.srs,
4548
4499
  layers: initialProps.mapPreset.layers,
4549
4500
  productConfigKey: productConfigKey
4550
- })));
4501
+ }));
4551
4502
  }
4552
4503
  case 'CapWarningList':
4553
4504
  {
4554
- return /*#__PURE__*/React.createElement(CapTranslationsWrapper, null, /*#__PURE__*/React.createElement(ApiProvider, {
4505
+ return /*#__PURE__*/React.createElement(ApiProvider, {
4555
4506
  config: {
4556
4507
  baseURL: config.baseURL
4557
4508
  },
4558
4509
  createApi: createApi
4559
4510
  }, /*#__PURE__*/React.createElement(WarningListCapConnectWrapper, {
4560
4511
  productConfigKey: productConfigKey
4561
- })));
4512
+ }));
4562
4513
  }
4563
4514
  default:
4564
4515
  return null;
4565
4516
  }
4566
4517
  };
4567
4518
 
4568
- export { ComponentsLookUp, capModuleConfig, reducer as capReducer };
4519
+ /* *
4520
+ * Licensed under the Apache License, Version 2.0 (the "License");
4521
+ * you may not use this file except in compliance with the License.
4522
+ * You may obtain a copy of the License at
4523
+ *
4524
+ * http://www.apache.org/licenses/LICENSE-2.0
4525
+ *
4526
+ * Unless required by applicable law or agreed to in writing, software
4527
+ * distributed under the License is distributed on an "AS IS" BASIS,
4528
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4529
+ * See the License for the specific language governing permissions and
4530
+ * limitations under the License.
4531
+ *
4532
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4533
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
4534
+ * */
4535
+ const capModuleConfig = {
4536
+ id: 'capStore-module',
4537
+ reducersMap: {
4538
+ capStore: reducer
4539
+ }
4540
+ };
4541
+
4542
+ export { ComponentsLookUp, capModuleConfig, reducer as capReducer, capTrans };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/cap",
3
- "version": "9.15.0",
3
+ "version": "9.16.0",
4
4
  "description": "GeoWeb Common Alerting Protocol (CAP) library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/index.d.ts CHANGED
@@ -1 +1,3 @@
1
+ import capTrans from '../locales/cap.json';
1
2
  export * from './lib';
3
+ export { capTrans };
@@ -25,6 +25,5 @@ export interface CapStoreProviderProps extends ThemeProviderProps {
25
25
  store: Store;
26
26
  }
27
27
  export declare const CapThemeStoreProvider: React.FC<CapThemeStoreProviderProps>;
28
- export declare const CapTranslationsWrapper: React.FC<CapTranslationsWrapperProps>;
29
28
  export declare const CapI18nProvider: React.FC<CapTranslationsWrapperProps>;
30
29
  export {};