@opengeoweb/workspace 9.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/workspace",
3
- "version": "9.14.0",
3
+ "version": "9.16.0",
4
4
  "description": "GeoWeb Workspace library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -34,7 +34,9 @@
34
34
  "@opengeoweb/core": "*",
35
35
  "@opengeoweb/taf": "*",
36
36
  "@opengeoweb/sigmet-airmet": "*",
37
- "@opengeoweb/warnings": "*"
37
+ "@opengeoweb/warnings": "*",
38
+ "i18next": "^23.7.11",
39
+ "react-i18next": "^13.5.0"
38
40
  },
39
41
  "peerDependencies": {
40
42
  "react": "18"
package/src/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import workspaceTranslations from '../locales/workspace.json';
1
2
  export { workspaceActions as actions, reducer as workspaceReducer, } from './lib/store/workspace/reducer';
2
3
  export { workspaceListActions } from './lib/store/workspaceList/reducer';
3
4
  export { viewPresetActions } from './lib/store/viewPresets';
@@ -9,6 +10,7 @@ export * from './lib/components/ComponentsLookUpWrapper';
9
10
  export * from './lib/components/WorkspaceView';
10
11
  export * from './lib/components/WorkspaceTopBar';
11
12
  export * from './lib/components/WorkspaceDetail';
13
+ export { workspaceTranslations };
12
14
  export { routes as workspaceRoutes, getWorkspaceRouteUrl, } from './lib/utils/routes';
13
15
  export { emptyMapWorkspace, createCustomEmptyMapWorkspace, } from './lib/store/workspaceList/utils';
14
16
  export type { WorkspaceModuleStore } from './lib/store/config';
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { ThemeProviderProps } from '@opengeoweb/theme';
3
3
  import { Store } from '@reduxjs/toolkit';
4
4
  import { AuthenticationDefaultStateProps } from '@opengeoweb/authentication';
5
+ export declare const DemoWrapper: React.FC<ThemeProviderProps>;
5
6
  interface WorkspaceWrapperProviderWithStoreProps extends ThemeProviderProps {
6
7
  store?: Store;
7
8
  createApi?: () => void;
@@ -19,4 +20,8 @@ export declare const defaultAuthConfig: {
19
20
  sessionStorageProvider: never;
20
21
  };
21
22
  export declare const WorkspaceWrapperProviderWithStore: React.FC<WorkspaceWrapperProviderWithStoreProps>;
23
+ interface WorkspaceTranslationsWrapperProps {
24
+ children?: React.ReactNode;
25
+ }
26
+ export declare const WorkspaceI18nProvider: React.FC<WorkspaceTranslationsWrapperProps>;
22
27
  export {};
@@ -1,6 +1,4 @@
1
1
  import * as React from 'react';
2
- export declare const ERROR_TITLE = "View presets not available";
3
- export declare const ERROR_RETRY = "Try again";
4
2
  interface ViewPresetMenuListConnectProps {
5
3
  panelId: string;
6
4
  }
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
+ export declare const GetViewPresetError: () => React.ReactElement;
6
7
  export declare const GetViewPresetsError: {
7
8
  (): React.ReactElement;
8
9
  storyName: string;
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { WorkspaceListFilter } from '../../store/workspaceList/types';
3
- export declare const allLabel = "All";
4
3
  interface FilterListProps {
5
4
  filters?: WorkspaceListFilter[];
6
5
  onChipClick?: (id: string, selected: boolean) => void;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export declare const DEBOUNCE_TIMEOUT = 300;
3
3
  interface SearchFieldProps {
4
- label?: string;
5
4
  valueChanged: (value: string) => void;
6
5
  value?: string;
7
6
  }
@@ -1,7 +1,4 @@
1
1
  import * as React from 'react';
2
- export declare const TITLE_SUFFIX_NEW_WORKSPACE = "modified";
3
- export declare const TITLE_SUFFIX_EXISTING_WORKSPACE = "not saved";
4
- export declare const getTitle: (title: string, hasChanges: boolean, workspaceId: string) => string;
5
2
  export interface WorkspaceOptionsConnectProps {
6
3
  title: string;
7
4
  activeTab?: boolean;
@@ -1,15 +1,6 @@
1
1
  import React from 'react';
2
2
  import { WorkspacePreset, WorkspacePresetAction } from '../../store/workspace/types';
3
3
  import { WorkspacePresetFormValues } from '../../store/workspaceList/types';
4
- export declare const DIALOG_TITLE_SAVE_AS = "Save as";
5
- export declare const DIALOG_TITLE_SAVE_ALL = "Save (incl. viewpresets)";
6
- export declare const DIALOG_TITLE_DELETE = "Delete workspace";
7
- export declare const DIALOG_TITLE_DUPLICATE = "Duplicate";
8
- export declare const DIALOG_BUTTON_SAVE = "Save";
9
- export declare const DIALOG_BUTTON_DELETE = "Delete";
10
- export declare const DIALOG_BUTTON_EDIT = "Edit (name and abstract)";
11
- export declare const getDialogTitle: (action: WorkspacePresetAction) => string;
12
- export declare const getConfirmLabel: (action: WorkspacePresetAction) => string;
13
4
  export interface WorkspacePresetsFormDialogProps {
14
5
  isOpen: boolean;
15
6
  action: WorkspacePresetAction;
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { BoxProps } from '@mui/material';
3
3
  import { WorkspacePresetListItem, WorkspacePresetAction } from '../../store/workspace/types';
4
- export declare const emptyWorkspaceListItem: WorkspacePresetListItem;
5
4
  export interface WorkspaceSelectListProps extends BoxProps {
6
5
  workspacePresets: WorkspacePresetListItem[];
7
6
  currentSelectedId: string;
@@ -7,8 +7,5 @@ interface WorkspaceViewTitleConnectProps {
7
7
  panelId: string;
8
8
  isViewPresetDialogOpen: boolean;
9
9
  }
10
- export declare const NEW_TITLE_SUFFIX = "(not saved)";
11
- export declare const EXISTING_TITLE_SUFFIX = "(modified)";
12
- export declare const getPresetTitle: (title: string, hasChanges: boolean, isNew: boolean) => string;
13
10
  export declare const WorkspaceViewTitleConnect: React.NamedExoticComponent<WorkspaceViewTitleConnectProps>;
14
11
  export {};
@@ -1,7 +1,6 @@
1
1
  import { mapEnums, layerTypes } from '@opengeoweb/store';
2
2
  import { Draft, PayloadAction } from '@reduxjs/toolkit';
3
- import { ErrorInitialViewPresetsPayload, ErrorViewPresetPayload, FetchedInitialViewPresetsPayload, FetchedViewPresetPayload, FetchedViewPresetsPayload, FetchViewPresetsPayload, ViewPresetEntity, ViewPresetState, OnSuccesViewPresetActionPayload, RegisterViewPresetPayload, SavedViewPresetPayload, SaveViewPresetPayload, SelectViewPresetPayload, SetActiveViewPresetIdPayload, SetViewPresetHasChangePayload, UnregisterViewPresetPayload, ToggleViewPresetListDialogPayload, OpenViewPresetDialogPayload, ToggleSelectFilterChip, SetSelectAllFilterChip, ViewPresetsListFilter, SearchWorkspaceFilter } from './types';
4
- export declare const viewPresetsListFilterOptions: ViewPresetsListFilter[];
3
+ import { ErrorInitialViewPresetsPayload, ErrorViewPresetPayload, FetchedInitialViewPresetsPayload, FetchedViewPresetPayload, FetchedViewPresetsPayload, FetchViewPresetsPayload, ViewPresetEntity, ViewPresetState, OnSuccesViewPresetActionPayload, RegisterViewPresetPayload, SavedViewPresetPayload, SaveViewPresetPayload, SelectViewPresetPayload, SetActiveViewPresetIdPayload, SetViewPresetHasChangePayload, UnregisterViewPresetPayload, ToggleViewPresetListDialogPayload, OpenViewPresetDialogPayload, ToggleSelectFilterChip, SetSelectAllFilterChip, SearchWorkspaceFilter } from './types';
5
4
  export declare const viewPresetsAdapter: import("@reduxjs/toolkit").EntityAdapter<ViewPresetEntity>;
6
5
  export declare const initialState: ViewPresetState;
7
6
  export type SupportedOrigins = layerTypes.LayerActionOrigin | mapEnums.MapActionOrigin;
@@ -1,7 +1,5 @@
1
1
  import { SagaIterator } from 'redux-saga';
2
2
  import { viewPresetActions } from './reducer';
3
- export declare const MESSAGE_FETCH_PRESET = "Preset could not be loaded: Select a different one or try again.";
4
- export declare const MESSAGE_SAVE_PRESET = "Map preset not saved: an error occurred during saving. Please try again later.";
5
3
  export declare function fetchInitialViewPresetsSaga(): SagaIterator;
6
4
  export declare function fetchViewPresetsSaga({ payload, }: ReturnType<typeof viewPresetActions.fetchViewPresets>): SagaIterator;
7
5
  export declare function saveViewPresetSaga({ payload, }: ReturnType<typeof viewPresetActions.saveViewPreset>): SagaIterator;
@@ -1,10 +1,6 @@
1
1
  import { PresetsApi } from '../../utils/api';
2
2
  import { PresetAction, ViewPresetsListFilter } from './types';
3
3
  import { FetchViewPresetsListParams } from '../viewPresetsList/types';
4
- export declare const MAPPRESET_ACTIVE_TITLE = "New map preset";
5
- export declare const MAPPRESET_DIALOG_TITLE_SAVE_AS = "Save map preset as";
6
- export declare const MAPPRESET_DIALOG_TITLE_DELETE = "Delete map preset";
7
- export declare const MAPPRESET_DIALOG_TITLE_EDIT = "Edit map preset";
8
4
  export declare const getSnackbarMessage: (action: PresetAction, title: string) => string;
9
5
  export declare const getPresetsApi: () => PresetsApi;
10
6
  export declare const emptyMapViewPreset: {
@@ -1,8 +1,10 @@
1
1
  import { MapPreset } from '@opengeoweb/store';
2
- import { WorkspacePreset, WorkspacePresetAction } from '../workspace/types';
2
+ import { WorkspacePreset, WorkspacePresetAction, WorkspacePresetListItem } from '../workspace/types';
3
3
  import { FetchWorkspaceParams, WorkspaceListFilter } from './types';
4
4
  export declare const getSnackbarMessage: (action: WorkspacePresetAction, title: string) => string;
5
+ export declare const getEmptyWorkspaceListItem: () => WorkspacePresetListItem;
5
6
  export declare const emptyMapWorkspace: WorkspacePreset;
7
+ export declare const getEmptyWorkspacePreset: () => WorkspacePreset;
6
8
  export declare const createCustomEmptyMapWorkspace: (customMapPreset?: MapPreset) => WorkspacePreset;
7
9
  export declare const constructFilterParams: (filters: WorkspaceListFilter[], searchQuery: string) => FetchWorkspaceParams;
8
10
  export declare const generateUID: () => string;
@@ -1,4 +1,3 @@
1
- export declare const DEFAULT_ERROR_TITLE = "Something went wrong, try again";
2
1
  export declare const TIMEOUT = 1000;
3
2
  export declare const useFirstTimeError: (initialValue?: number, errorTitle?: string) => {
4
3
  fetch: <T>(promise: Promise<T>) => Promise<T>;
@@ -0,0 +1,248 @@
1
+ import i18n from 'i18next';
2
+ import { UseTranslationResponse } from 'react-i18next';
3
+ export declare const WORKSPACE_NAMESPACE = "workspace";
4
+ export declare const initWorkspaceTestI18n: () => void;
5
+ export declare const outsideComponentTranslations: {
6
+ "workspace-menu": string;
7
+ "workspace-new": string;
8
+ "workspace-my-presets": string;
9
+ "workspace-system-presets": string;
10
+ "workspace-all-button": string;
11
+ "workspace-search": string;
12
+ "workspace-loading": string;
13
+ "workspace-options": string;
14
+ "workspace-results": string;
15
+ "workspace-delete": string;
16
+ "workspce-clear": string;
17
+ "workspace-save": string;
18
+ "workspace-save-as": string;
19
+ "workspace-save-incl-viewpresets": string;
20
+ "workspace-edit": string;
21
+ "workspace-edit-both": string;
22
+ "geoweb-welcome": string;
23
+ "workspace-modified-new": string;
24
+ "workspace-modified-existing": string;
25
+ "workspace-dialog-delete": string;
26
+ "workspace-duplicate": string;
27
+ "workspace-cancel": string;
28
+ "workspace-dialog-name": string;
29
+ "workspace-dialog-abstract": string;
30
+ "workspace-dialog-confirm-delete-message": string;
31
+ "workspace-error-fetch": string;
32
+ "workspace-error-fetch-detail": string;
33
+ "workspace-retry": string;
34
+ "workspace-delete-tooltip": string;
35
+ "workspace-control-split-horizontal": string;
36
+ "workspace-control-split-vertical": string;
37
+ "workspace-control-expand": string;
38
+ "workspace-control-unexpand": string;
39
+ "workspace-control-close": string;
40
+ "workspace-control-close-message-title": string;
41
+ "workspace-control-close-message-description": string;
42
+ "workspace-mappreset-delete-message": string;
43
+ "workspace-viewpresets-fail-fetch": string;
44
+ "workspace-viewpresets-error": string;
45
+ "workspace-mappreset-dialog-title": string;
46
+ "workspace-mappreset-save-as": string;
47
+ "workspace-mappreset-new": string;
48
+ "workspace-mappreset-dialog-title-delete": string;
49
+ "workspace-mappreset-dialog-title-edit": string;
50
+ "workspace-mappreset-error-save": string;
51
+ "workspace-mappreset-error-fetch": string;
52
+ "workspace-list-error": string;
53
+ "workspace-list-success-save-all": string;
54
+ "workspace-list-success-delete": string;
55
+ "workspace-list-success-duplicate": string;
56
+ "workspace-list-success-edit": string;
57
+ "workspace-list-success-save": string;
58
+ "workspace-save-error": string;
59
+ "workspace-error-generic": string;
60
+ "workspace-viewpreset-success-delete": string;
61
+ "workspace-viewpreset-success-save-as": string;
62
+ "workspace-viewpreset-success-edit": string;
63
+ "workspace-viewpreset-success-save": string;
64
+ "workspace-viewpreset-menu": string;
65
+ } | {
66
+ "workspace-menu": string;
67
+ "workspace-new": string;
68
+ "workspace-my-presets": string;
69
+ "workspace-system-presets": string;
70
+ "workspace-all-button": string;
71
+ "workspace-search": string;
72
+ "workspace-loading": string;
73
+ "workspace-options": string;
74
+ "workspace-results": string;
75
+ "workspace-delete": string;
76
+ "workspce-clear": string;
77
+ "workspace-save": string;
78
+ "workspace-save-as": string;
79
+ "workspace-save-incl-viewpresets": string;
80
+ "workspace-edit": string;
81
+ "workspace-edit-both": string;
82
+ "geoweb-welcome": string;
83
+ "workspace-modified-new": string;
84
+ "workspace-modified-existing": string;
85
+ "workspace-dialog-delete": string;
86
+ "workspace-duplicate": string;
87
+ "workspace-cancel": string;
88
+ "workspace-dialog-name": string;
89
+ "workspace-dialog-abstract": string;
90
+ "workspace-dialog-confirm-delete-message": string;
91
+ "workspace-error-fetch": string;
92
+ "workspace-error-fetch-detail": string;
93
+ "workspace-retry": string;
94
+ "workspace-delete-tooltip": string;
95
+ "workspace-control-split-horizontal": string;
96
+ "workspace-control-split-vertical": string;
97
+ "workspace-control-expand": string;
98
+ "workspace-control-unexpand": string;
99
+ "workspace-control-close": string;
100
+ "workspace-control-close-message-title": string;
101
+ "workspace-control-close-message-description": string;
102
+ "workspace-mappreset-delete-message": string;
103
+ "workspace-viewpresets-fail-fetch": string;
104
+ "workspace-viewpresets-error": string;
105
+ "workspace-mappreset-dialog-title": string;
106
+ "workspace-mappreset-save-as": string;
107
+ "workspace-mappreset-new": string;
108
+ "workspace-mappreset-dialog-title-delete": string;
109
+ "workspace-mappreset-dialog-title-edit": string;
110
+ "workspace-mappreset-error-save": string;
111
+ "workspace-mappreset-error-fetch": string;
112
+ "workspace-list-error": string;
113
+ "workspace-list-success-save-all": string;
114
+ "workspace-list-success-delete": string;
115
+ "workspace-list-success-duplicate": string;
116
+ "workspace-list-success-edit": string;
117
+ "workspace-list-success-save": string;
118
+ "workspace-save-error": string;
119
+ "workspace-error-generic": string;
120
+ "workspace-viewpreset-success-delete": string;
121
+ "workspace-viewpreset-success-save-as": string;
122
+ "workspace-viewpreset-success-edit": string;
123
+ "workspace-viewpreset-success-save": string;
124
+ "workspace-viewpreset-menu": string;
125
+ } | {
126
+ "workspace-menu": string;
127
+ "workspace-new": string;
128
+ "workspace-my-presets": string;
129
+ "workspace-system-presets": string;
130
+ "workspace-all-button": string;
131
+ "workspace-search": string;
132
+ "workspace-loading": string;
133
+ "workspace-options": string;
134
+ "workspace-results": string;
135
+ "workspace-delete": string;
136
+ "workspce-clear": string;
137
+ "workspace-save": string;
138
+ "workspace-save-as": string;
139
+ "workspace-save-incl-viewpresets": string;
140
+ "workspace-edit": string;
141
+ "workspace-edit-both": string;
142
+ "geoweb-welcome": string;
143
+ "workspace-modified-new": string;
144
+ "workspace-modified-existing": string;
145
+ "workspace-dialog-delete": string;
146
+ "workspace-duplicate": string;
147
+ "workspace-cancel": string;
148
+ "workspace-dialog-name": string;
149
+ "workspace-dialog-abstract": string;
150
+ "workspace-dialog-confirm-delete-message": string;
151
+ "workspace-error-fetch": string;
152
+ "workspace-error-fetch-detail": string;
153
+ "workspace-viewpresets-error": string;
154
+ "workspace-retry": string;
155
+ "workspace-delete-tooltip": string;
156
+ "workspace-control-split-horizontal": string;
157
+ "workspace-control-split-vertical": string;
158
+ "workspace-control-expand": string;
159
+ "workspace-control-unexpand": string;
160
+ "workspace-control-close": string;
161
+ "workspace-control-close-message-title": string;
162
+ "workspace-control-close-message-description": string;
163
+ "workspace-mappreset-delete-message": string;
164
+ "workspace-viewpresets-fail-fetch": string;
165
+ "workspace-mappreset-dialog-title": string;
166
+ "workspace-mappreset-save-as": string;
167
+ "workspace-mappreset-new": string;
168
+ "workspace-mappreset-dialog-title-delete": string;
169
+ "workspace-mappreset-dialog-title-edit": string;
170
+ "workspace-mappreset-error-save": string;
171
+ "workspace-mappreset-error-fetch": string;
172
+ "workspace-list-error": string;
173
+ "workspace-list-success-save-all": string;
174
+ "workspace-list-success-delete": string;
175
+ "workspace-list-success-duplicate": string;
176
+ "workspace-list-success-edit": string;
177
+ "workspace-list-success-save": string;
178
+ "workspace-save-error": string;
179
+ "workspace-error-generic": string;
180
+ "workspace-viewpreset-success-delete": string;
181
+ "workspace-viewpreset-success-save-as": string;
182
+ "workspace-viewpreset-success-edit": string;
183
+ "workspace-viewpreset-success-save": string;
184
+ "workspace-viewpreset-menu": string;
185
+ } | {
186
+ "workspace-menu": string;
187
+ "workspace-new": string;
188
+ "workspace-my-presets": string;
189
+ "workspace-system-presets": string;
190
+ "workspace-all-button": string;
191
+ "workspace-search": string;
192
+ "workspace-loading": string;
193
+ "workspace-options": string;
194
+ "workspace-results": string;
195
+ "workspace-delete": string;
196
+ "workspce-clear": string;
197
+ "workspace-save": string;
198
+ "workspace-save-as": string;
199
+ "workspace-save-incl-viewpresets": string;
200
+ "workspace-edit": string;
201
+ "workspace-edit-both": string;
202
+ "geoweb-welcome": string;
203
+ "workspace-modified-new": string;
204
+ "workspace-modified-existing": string;
205
+ "workspace-dialog-delete": string;
206
+ "workspace-duplicate": string;
207
+ "workspace-cancel": string;
208
+ "workspace-dialog-name": string;
209
+ "workspace-dialog-abstract": string;
210
+ "workspace-dialog-confirm-delete-message": string;
211
+ "workspace-error-fetch": string;
212
+ "workspace-error-fetch-detail": string;
213
+ "workspace-viewpresets-error": string;
214
+ "workspace-retry": string;
215
+ "workspace-delete-tooltip": string;
216
+ "workspace-control-split-horizontal": string;
217
+ "workspace-control-split-vertical": string;
218
+ "workspace-control-expand": string;
219
+ "workspace-control-unexpand": string;
220
+ "workspace-control-close": string;
221
+ "workspace-control-close-message-title": string;
222
+ "workspace-control-close-message-description": string;
223
+ "workspace-mappreset-delete-message": string;
224
+ "workspace-viewpresets-fail-fetch": string;
225
+ "workspace-mappreset-dialog-title": string;
226
+ "workspace-mappreset-save-as": string;
227
+ "workspace-mappreset-new": string;
228
+ "workspace-mappreset-dialog-title-delete": string;
229
+ "workspace-mappreset-dialog-title-edit": string;
230
+ "workspace-mappreset-error-save": string;
231
+ "workspace-mappreset-error-fetch": string;
232
+ "workspace-list-error": string;
233
+ "workspace-list-success-save-all": string;
234
+ "workspace-list-success-delete": string;
235
+ "workspace-list-success-duplicate": string;
236
+ "workspace-list-success-edit": string;
237
+ "workspace-list-success-save": string;
238
+ "workspace-save-error": string;
239
+ "workspace-error-generic": string;
240
+ "workspace-viewpreset-success-delete": string;
241
+ "workspace-viewpreset-success-save-as": string;
242
+ "workspace-viewpreset-success-edit": string;
243
+ "workspace-viewpreset-success-save": string;
244
+ "workspace-viewpreset-menu": string;
245
+ };
246
+ export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
247
+ export declare const useWorkspaceTranslation: () => UseTranslationResponse<typeof WORKSPACE_NAMESPACE, typeof i18n>;
248
+ export { i18n };