@opengeoweb/shared 12.1.2 → 12.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "12.1.2",
3
+ "version": "12.3.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,17 +8,16 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/theme": "12.1.2",
11
+ "@opengeoweb/theme": "12.3.0",
12
12
  "react-draggable": "^4.4.6",
13
13
  "re-resizable": "^6.9.11",
14
14
  "lodash": "^4.17.21",
15
15
  "axios": "^1.7.7",
16
16
  "date-fns": "^4.1.0",
17
- "@reduxjs/toolkit": "^1.9.7",
18
17
  "react-i18next": "^15.1.1",
19
18
  "i18next": "^23.11.5",
20
19
  "@sentry/react": "^8.34.0",
21
- "@mui/material": "^6.1.1"
20
+ "@mui/material": "^7.0.1"
22
21
  },
23
22
  "peerDependencies": {
24
23
  "react": "18",
package/src/index.d.ts CHANGED
@@ -3,5 +3,5 @@ export * from './lib/components';
3
3
  export * from './lib/hooks';
4
4
  export * from './lib/utils';
5
5
  export * from './lib/types';
6
- export { SHARED_NAMESPACE } from './lib/utils/i18n';
6
+ export { SHARED_NAMESPACE, loadAllTranslations, safelyInitI18nForTestsAndStories, } from './lib/utils/i18n';
7
7
  export { sharedTranslations };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { DialogAction } from '../CustomDialog';
2
+ import { DialogAction } from '../CustomDialog/types';
3
3
  export type ConfirmationAction = 'CANCELLED' | DialogAction;
4
4
  export interface ConfirmationButtonsProps {
5
5
  confirmLabel?: string;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ModalProps, SxProps, Theme } from '@mui/material';
3
- import { DialogAction } from '../CustomDialog';
3
+ import { DialogAction } from '../CustomDialog/types';
4
4
  export interface ConfirmationOptions {
5
5
  title?: string;
6
6
  description?: string;
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { DialogProps } from '@mui/material';
3
3
  import { Size } from '../DraggableResizable';
4
- export type DialogAction = 'CLOSED';
4
+ import { DialogAction } from './types';
5
+ import { HeaderAction } from './CustomDialogHeader';
5
6
  export interface CustomDialogProps extends DialogProps {
6
7
  description?: string;
7
8
  actions?: React.ReactNode;
@@ -10,6 +11,7 @@ export interface CustomDialogProps extends DialogProps {
10
11
  resizableDefaultSize?: Size;
11
12
  hasLayout?: boolean;
12
13
  shouldRenderInline?: boolean;
14
+ headerActions?: HeaderAction[];
13
15
  }
14
16
  export declare const CustomDialog: React.FC<CustomDialogProps>;
15
17
  export default CustomDialog;
@@ -10,6 +10,8 @@ export default _default;
10
10
  type Story = StoryObj<typeof CustomDialog>;
11
11
  export declare const CustomDialogLight: Story;
12
12
  export declare const CustomDialogDark: Story;
13
+ export declare const CustomDialogFullWidth: Story;
14
+ export declare const CustomDialogFixedWith: Story;
13
15
  export declare const CustomDialogLargeContent: Story;
14
16
  export declare const CustomDialogLargeContentResizable: Story;
15
17
  export declare const CustomDialogResizable: Story;
@@ -17,3 +19,4 @@ export declare const CustomDialogResizableWithInitialSize: Story;
17
19
  export declare const CustomDialogRenderInline: Story;
18
20
  export declare const CustomDialogResizableNoLayout: Story;
19
21
  export declare const CustomDialogWithAutofocus: Story;
22
+ export declare const CustomDialogHeaderActions: Story;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { ButtonVariant } from '@opengeoweb/theme';
3
+ import { DialogAction } from './types';
4
+ import { MenuItemType } from '../ToggleMenu';
5
+ export type HeaderAction = MenuItemType & {
6
+ variant?: ButtonVariant;
7
+ };
8
+ export declare const CustomDialogHeader: React.FC<{
9
+ headerActions?: HeaderAction[];
10
+ title?: string;
11
+ onClose: (reason: DialogAction) => void;
12
+ }>;
13
+ export default CustomDialogHeader;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { CustomDialogHeader } from './CustomDialogHeader';
3
+ type Story = StoryObj<typeof CustomDialogHeader>;
4
+ declare const meta: Meta<typeof CustomDialogHeader>;
5
+ export default meta;
6
+ export declare const HeaderActions: Story;
7
+ export declare const HeaderActionsDark: Story;
8
+ export declare const HeaderTitle: Story;
9
+ export declare const HeaderTitleDark: Story;
10
+ export declare const HeaderActionsDisabled: Story;
11
+ export declare const HeaderActionsEmpty: Story;
@@ -1 +1,2 @@
1
1
  export * from './CustomDialog';
2
+ export * from './CustomDialogHeader';
@@ -0,0 +1 @@
1
+ export type DialogAction = 'CLOSED';
@@ -1,10 +1,11 @@
1
- import React from 'react';
2
1
  import { TFunction } from 'i18next';
2
+ import React from 'react';
3
3
  export declare const getLastUpdateTitle: (time: string, t: TFunction) => string;
4
4
  interface LastUpdateTimeProps {
5
5
  onPressRefresh: () => void;
6
6
  lastUpdateTime?: string;
7
7
  dataTestId?: string;
8
+ hideLabel?: boolean;
8
9
  }
9
10
  declare const LastUpdateTime: React.FC<LastUpdateTimeProps>;
10
11
  export default LastUpdateTime;
@@ -16,5 +16,9 @@ type TooltipSelectProps = Omit<BaseSelectProps, 'sx'> & {
16
16
  skipLocalStyling?: boolean;
17
17
  };
18
18
  export declare const TooltipSelect: React.FC<TooltipSelectProps>;
19
+ interface StyledSelectProps extends Omit<TooltipSelectProps, 'tooltip' | 'skipLocalStyling'> {
20
+ skipLocalStyling: boolean;
21
+ }
22
+ export declare const StyledSelect: import("@emotion/styled").StyledComponent<Omit<StyledSelectProps, "ref"> & React.RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
19
23
  export declare const tooltipContainerStyles: (theme: Theme, isEnabled: boolean, hasBackgroundColor?: boolean) => object;
20
24
  export {};
@@ -20,6 +20,8 @@ export interface ConfigType {
20
20
  GW_PRESET_BACKEND_URL?: string;
21
21
  GW_CAP_BASE_URL?: string;
22
22
  GW_DRAWINGS_BASE_URL?: string;
23
+ GW_WARNINGS_WORKSPACE_ID?: string;
24
+ GW_SPACEWEATHER_WORKSPACE_ID?: string;
23
25
  GW_TECHNICAL_RELEASE_NOTES_URL?: string;
24
26
  GW_VERSION_PROGRESS_NOTES_URL?: string;
25
27
  GW_LOCATION_BASE_URL?: string;
@@ -36,6 +38,12 @@ export interface ConfigType {
36
38
  GW_FEATURE_TAF_AUTOTAF_ENABLED?: boolean;
37
39
  GW_LANGUAGE?: string;
38
40
  }
41
+ export interface SoundingsCollection {
42
+ name: string;
43
+ id: string;
44
+ url: string;
45
+ description: string;
46
+ }
39
47
  export interface TimeSeriesService {
40
48
  id: string;
41
49
  description: string;
@@ -50,12 +58,6 @@ export declare const SystemScope: {
50
58
  readonly user: SystemScope;
51
59
  readonly system: SystemScope;
52
60
  };
53
- export type PresetScope = SystemScope | 'shared';
54
- export declare const PresetScope: {
55
- readonly shared: PresetScope;
56
- readonly user: SystemScope;
57
- readonly system: SystemScope;
58
- };
59
61
  export interface PlotPreset {
60
62
  connectedMap?: string;
61
63
  mapId: string;
@@ -1,6 +1,13 @@
1
1
  import i18n from 'i18next';
2
2
  import { UseTranslationResponse } from 'react-i18next';
3
3
  export declare const SHARED_NAMESPACE = "shared";
4
+ type GeoWebLanguage = 'en' | 'fi' | 'no' | 'nl';
5
+ interface TranslationToLoad {
6
+ ns: string;
7
+ translations: Record<GeoWebLanguage, Record<string, string>>;
8
+ }
9
+ export declare const loadAllTranslations: (i18nInstance: typeof i18n, translationsToLoad: TranslationToLoad[]) => void;
10
+ export declare const safelyInitI18nForTestsAndStories: (i18nInstance: typeof i18n, namespace: string, translationsToLoad: TranslationToLoad[], initLanguage?: string) => void;
4
11
  export declare const initSharedI18n: () => void;
5
12
  export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
6
13
  export declare const useSharedTranslation: () => UseTranslationResponse<typeof SHARED_NAMESPACE, typeof i18n>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export * from './axiosErrorUtils';
2
2
  export * as dateUtils from './dateUtils';
3
- export * from './reduxTestUtils';
4
3
  export * from './mapProjections';
5
4
  export { renderCounter } from './renderCounter';
5
+ export { sessionStorageProvider, SessionStorageKey } from './sessionStorage';
6
+ export type { SessionStorageProvider } from './sessionStorage';
@@ -0,0 +1,28 @@
1
+ import { ConfigType } from '../types';
2
+ export interface SessionStorageProvider {
3
+ setConfig: (value: ConfigType) => void;
4
+ getConfig: () => ConfigType;
5
+ setOauthState: (value: string) => void;
6
+ getOauthState: () => string;
7
+ removeOauthState: () => void;
8
+ setOauthCodeVerifier: (value: string) => void;
9
+ getOauthCodeVerifier: () => string;
10
+ removeOauthCodeVerifier: () => void;
11
+ setOauthCodeChallenge: (value: string) => void;
12
+ getOauthCodeChallenge: () => string;
13
+ removeOauthCodeChallenge: () => void;
14
+ setHasAuthenticated: (value: string) => void;
15
+ getHasAuthenticated: () => string;
16
+ removeHasAuthenticated: () => void;
17
+ getCallbackUrl: () => string;
18
+ setCallbackUrl: (value: string) => void;
19
+ }
20
+ export declare enum SessionStorageKey {
21
+ CONFIG = "config",
22
+ OAUTH_STATE = "oauth_state",
23
+ OAUTH_CODE_VERIFIER = "code_verifier",
24
+ OAUTH_CODE_CHALLENGE = "code_challenge",
25
+ HAS_AUTHENTICATED = "has_authenticated",
26
+ CALLBACK_URL = "callback_url"
27
+ }
28
+ export declare const sessionStorageProvider: SessionStorageProvider;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +0,0 @@
1
- import { ConfigureStoreOptions, ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
2
- export declare const createToolkitMockStore: (storeConfig: ConfigureStoreOptions) => ToolkitStore;
@@ -1 +0,0 @@
1
- export * from './createMockStore';