@opengeoweb/shared 6.0.1 → 6.0.3
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.d.ts +1 -0
- package/{index.js → index.esm.js} +59 -55
- package/package.json +8 -9
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +1 -1
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +1 -1
- package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +2 -2
- package/src/lib/components/DraggableResizable/types.d.ts +3 -3
- package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +2 -2
- package/src/lib/components/ToolContainer/types.d.ts +1 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +1 -1
- package/src/lib/components/UserMenu/CheatSheet/ShortcutList.d.ts +2 -2
- package/src/lib/types/types.d.ts +1 -0
- package/src/lib/utils/dateUtils/dateUtils.d.ts +2 -2
package/index.esm.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { useRef,
|
|
2
|
+
import React__default, { useRef, useContext } from 'react';
|
|
3
3
|
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
4
|
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
5
|
import require$$2, { flushSync } from 'react-dom';
|
|
@@ -30,7 +30,12 @@ function __rest(s, e) {
|
|
|
30
30
|
t[p[i]] = s[p[i]];
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
36
|
+
var e = new Error(message);
|
|
37
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
38
|
+
};
|
|
34
39
|
|
|
35
40
|
var bgColors = {
|
|
36
41
|
green: 'geowebColors.functional.successOutline.fill',
|
|
@@ -24310,40 +24315,39 @@ if (
|
|
|
24310
24315
|
|
|
24311
24316
|
if (process.env.NODE_ENV === 'production') ;
|
|
24312
24317
|
|
|
24313
|
-
const ContextKey = Symbol.for(`react-redux-context
|
|
24314
|
-
const gT = globalThis
|
|
24318
|
+
const ContextKey = Symbol.for(`react-redux-context`);
|
|
24319
|
+
const gT = typeof globalThis !== "undefined" ? globalThis :
|
|
24320
|
+
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
|
|
24321
|
+
{};
|
|
24315
24322
|
|
|
24316
24323
|
function getContext() {
|
|
24317
|
-
|
|
24324
|
+
var _gT$ContextKey;
|
|
24325
|
+
|
|
24326
|
+
if (!React$1.createContext) return {};
|
|
24327
|
+
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();
|
|
24328
|
+
let realContext = contextMap.get(React$1.createContext);
|
|
24318
24329
|
|
|
24319
24330
|
if (!realContext) {
|
|
24320
|
-
realContext = createContext(null);
|
|
24331
|
+
realContext = React$1.createContext(null);
|
|
24321
24332
|
|
|
24322
24333
|
if (process.env.NODE_ENV !== 'production') {
|
|
24323
24334
|
realContext.displayName = 'ReactRedux';
|
|
24324
24335
|
}
|
|
24325
24336
|
|
|
24326
|
-
|
|
24337
|
+
contextMap.set(React$1.createContext, realContext);
|
|
24327
24338
|
}
|
|
24328
24339
|
|
|
24329
24340
|
return realContext;
|
|
24330
24341
|
}
|
|
24331
24342
|
|
|
24332
|
-
const ReactReduxContext = /*#__PURE__*/
|
|
24333
|
-
get(_, handler) {
|
|
24334
|
-
const target = getContext(); // @ts-ignore
|
|
24335
|
-
|
|
24336
|
-
return (_target, ...args) => Reflect[handler](target, ...args);
|
|
24337
|
-
}
|
|
24338
|
-
|
|
24339
|
-
}));
|
|
24343
|
+
const ReactReduxContext = /*#__PURE__*/getContext();
|
|
24340
24344
|
|
|
24341
|
-
/**
|
|
24342
|
-
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
|
|
24343
|
-
* hook that you should usually not need to call directly.
|
|
24344
|
-
*
|
|
24345
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
24346
|
-
* @returns {Function} A `useReduxContext` hook bound to the specified context.
|
|
24345
|
+
/**
|
|
24346
|
+
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
|
|
24347
|
+
* hook that you should usually not need to call directly.
|
|
24348
|
+
*
|
|
24349
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
24350
|
+
* @returns {Function} A `useReduxContext` hook bound to the specified context.
|
|
24347
24351
|
*/
|
|
24348
24352
|
function createReduxContextHook(context = ReactReduxContext) {
|
|
24349
24353
|
return function useReduxContext() {
|
|
@@ -24356,21 +24360,21 @@ function createReduxContextHook(context = ReactReduxContext) {
|
|
|
24356
24360
|
return contextValue;
|
|
24357
24361
|
};
|
|
24358
24362
|
}
|
|
24359
|
-
/**
|
|
24360
|
-
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
24361
|
-
* hook that you should usually not need to call directly.
|
|
24362
|
-
*
|
|
24363
|
-
* @returns {any} the value of the `ReactReduxContext`
|
|
24364
|
-
*
|
|
24365
|
-
* @example
|
|
24366
|
-
*
|
|
24367
|
-
* import React from 'react'
|
|
24368
|
-
* import { useReduxContext } from 'react-redux'
|
|
24369
|
-
*
|
|
24370
|
-
* export const CounterComponent = () => {
|
|
24371
|
-
* const { store } = useReduxContext()
|
|
24372
|
-
* return <div>{store.getState()}</div>
|
|
24373
|
-
* }
|
|
24363
|
+
/**
|
|
24364
|
+
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
24365
|
+
* hook that you should usually not need to call directly.
|
|
24366
|
+
*
|
|
24367
|
+
* @returns {any} the value of the `ReactReduxContext`
|
|
24368
|
+
*
|
|
24369
|
+
* @example
|
|
24370
|
+
*
|
|
24371
|
+
* import React from 'react'
|
|
24372
|
+
* import { useReduxContext } from 'react-redux'
|
|
24373
|
+
*
|
|
24374
|
+
* export const CounterComponent = () => {
|
|
24375
|
+
* const { store } = useReduxContext()
|
|
24376
|
+
* return <div>{store.getState()}</div>
|
|
24377
|
+
* }
|
|
24374
24378
|
*/
|
|
24375
24379
|
|
|
24376
24380
|
const useReduxContext = /*#__PURE__*/createReduxContextHook();
|
|
@@ -24841,11 +24845,11 @@ reactIs_development.typeOf = typeOf;
|
|
|
24841
24845
|
|
|
24842
24846
|
if (process.env.NODE_ENV === 'production') ;
|
|
24843
24847
|
|
|
24844
|
-
/**
|
|
24845
|
-
* Hook factory, which creates a `useStore` hook bound to a given context.
|
|
24846
|
-
*
|
|
24847
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
24848
|
-
* @returns {Function} A `useStore` hook bound to the specified context.
|
|
24848
|
+
/**
|
|
24849
|
+
* Hook factory, which creates a `useStore` hook bound to a given context.
|
|
24850
|
+
*
|
|
24851
|
+
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
24852
|
+
* @returns {Function} A `useStore` hook bound to the specified context.
|
|
24849
24853
|
*/
|
|
24850
24854
|
|
|
24851
24855
|
function createStoreHook(context = ReactReduxContext) {
|
|
@@ -24860,20 +24864,20 @@ function createStoreHook(context = ReactReduxContext) {
|
|
|
24860
24864
|
return store;
|
|
24861
24865
|
};
|
|
24862
24866
|
}
|
|
24863
|
-
/**
|
|
24864
|
-
* A hook to access the redux store.
|
|
24865
|
-
*
|
|
24866
|
-
* @returns {any} the redux store
|
|
24867
|
-
*
|
|
24868
|
-
* @example
|
|
24869
|
-
*
|
|
24870
|
-
* import React from 'react'
|
|
24871
|
-
* import { useStore } from 'react-redux'
|
|
24872
|
-
*
|
|
24873
|
-
* export const ExampleComponent = () => {
|
|
24874
|
-
* const store = useStore()
|
|
24875
|
-
* return <div>{store.getState()}</div>
|
|
24876
|
-
* }
|
|
24867
|
+
/**
|
|
24868
|
+
* A hook to access the redux store.
|
|
24869
|
+
*
|
|
24870
|
+
* @returns {any} the redux store
|
|
24871
|
+
*
|
|
24872
|
+
* @example
|
|
24873
|
+
*
|
|
24874
|
+
* import React from 'react'
|
|
24875
|
+
* import { useStore } from 'react-redux'
|
|
24876
|
+
*
|
|
24877
|
+
* export const ExampleComponent = () => {
|
|
24878
|
+
* const store = useStore()
|
|
24879
|
+
* return <div>{store.getState()}</div>
|
|
24880
|
+
* }
|
|
24877
24881
|
*/
|
|
24878
24882
|
|
|
24879
24883
|
const useStore = /*#__PURE__*/createStoreHook();
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
|
-
"module": "./index.js",
|
|
11
|
-
"main": "./index.js",
|
|
10
|
+
"module": "./index.esm.js",
|
|
12
11
|
"type": "module",
|
|
13
|
-
"
|
|
12
|
+
"main": "./index.esm.js",
|
|
14
13
|
"dependencies": {},
|
|
15
14
|
"peerDependencies": {
|
|
16
15
|
"@mui/material": "5.12.0",
|
|
17
|
-
"@opengeoweb/theme": "6.0.
|
|
16
|
+
"@opengeoweb/theme": "6.0.3",
|
|
18
17
|
"@redux-eggs/core": "2.2.0",
|
|
19
|
-
"axios": "1.
|
|
20
|
-
"date-fns": "2.
|
|
18
|
+
"axios": "1.4.0",
|
|
19
|
+
"date-fns": "2.30.0",
|
|
21
20
|
"lodash": "4.17.21",
|
|
22
|
-
"re-resizable": "6.9.
|
|
21
|
+
"re-resizable": "6.9.11",
|
|
23
22
|
"react": "18.2.0",
|
|
24
23
|
"react-draggable": "4.4.5",
|
|
25
|
-
"react-redux": "8.1.
|
|
24
|
+
"react-redux": "8.1.2"
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -9,7 +9,7 @@ export interface ConfirmationOptions {
|
|
|
9
9
|
cancelLabel?: string;
|
|
10
10
|
content?: React.ReactNode;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type ConfirmationAction = 'CANCELLED' | DialogAction;
|
|
13
13
|
export interface ConfirmationDialogProps extends ConfirmationOptions {
|
|
14
14
|
disableAutoFocus?: boolean;
|
|
15
15
|
onSubmit: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConfirmationAction, ConfirmationOptions } from './ConfirmationDialog';
|
|
3
|
-
|
|
3
|
+
type ConfirmationContext = (options: ConfirmationOptions) => Promise<void>;
|
|
4
4
|
export declare const useConfirmationDialog: () => ConfirmationContext;
|
|
5
5
|
export declare const useDialogActions: (awaitingPromiseRef: React.MutableRefObject<{
|
|
6
6
|
resolve: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DialogProps } from '@mui/material';
|
|
3
|
-
export
|
|
3
|
+
export type DialogAction = 'CLOSED';
|
|
4
4
|
export interface CustomDialogProps extends DialogProps {
|
|
5
5
|
description?: string;
|
|
6
6
|
actions?: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IconButtonProps, TooltipProps as MuiTooltipProps } from '@mui/material';
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type Variant = 'flat' | 'tool' | 'boxed';
|
|
4
|
+
type TooltipProps = Omit<MuiTooltipProps, 'children'>;
|
|
5
5
|
export interface CustomIconProps extends IconButtonProps {
|
|
6
6
|
tooltipTitle?: string;
|
|
7
7
|
variant?: Variant;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ResizableProps } from 're-resizable';
|
|
3
|
-
export
|
|
3
|
+
export type DraggablePosition = {
|
|
4
4
|
x: number;
|
|
5
5
|
y: number;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type Position = {
|
|
8
8
|
top: number;
|
|
9
9
|
left?: number;
|
|
10
10
|
right?: number;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Size = {
|
|
13
13
|
width?: number | string;
|
|
14
14
|
height?: number | string;
|
|
15
15
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PopoverOrigin, SxProps, Theme } from '@mui/material';
|
|
3
3
|
import { Variant } from '../CustomIconButton';
|
|
4
|
-
|
|
4
|
+
type MenuPosition = 'left' | 'right' | 'bottom';
|
|
5
5
|
export declare const getPosition: (menuPosition: MenuPosition) => {
|
|
6
6
|
anchorOrigin: PopoverOrigin;
|
|
7
7
|
transformOrigin: PopoverOrigin;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type MenuItemType = {
|
|
10
10
|
text: string;
|
|
11
11
|
action: (event: React.MouseEvent) => void;
|
|
12
12
|
icon?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PaperProps } from '@mui/material';
|
|
3
|
-
export
|
|
3
|
+
export type HeaderSize = 'xxs' | 'xs' | 'small' | 'medium' | 'large';
|
|
4
4
|
export interface ToolHeaderProps {
|
|
5
5
|
title?: string;
|
|
6
6
|
size?: HeaderSize;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type ShortCut = {
|
|
3
3
|
title: string;
|
|
4
4
|
description: React.ReactNode;
|
|
5
5
|
descriptionMac?: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Platform = 'windows' | 'mac';
|
|
8
8
|
export declare const shortcuts: ShortCut[];
|
|
9
9
|
export declare const getShortcutList: (shortcutList: ShortCut[], platform?: Platform) => ShortCut[];
|
|
10
10
|
interface ShortcutListProps {
|
package/src/lib/types/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface ConfigType {
|
|
|
16
16
|
GW_TAF_BASE_URL?: string;
|
|
17
17
|
GW_PRESET_BACKEND_URL?: string;
|
|
18
18
|
GW_CAP_BASE_URL?: string;
|
|
19
|
+
GW_DRAWINGS_BASE_URL?: string;
|
|
19
20
|
GW_FEATURE_APP_TITLE?: string;
|
|
20
21
|
GW_FEATURE_FORCE_AUTHENTICATION?: boolean;
|
|
21
22
|
GW_FEATURE_MODULE_SPACE_WEATHER?: boolean;
|
|
@@ -130,7 +130,7 @@ export declare const isBetween: (date: Date, from: Date, to: Date, inclusivity?:
|
|
|
130
130
|
* createDate('2022-12-13T00:00:00.000Z');
|
|
131
131
|
* // => 2022-12-13T00:00:00.000Z
|
|
132
132
|
*/
|
|
133
|
-
export declare const createDate: (yearOrIsoString?:
|
|
133
|
+
export declare const createDate: (yearOrIsoString?: number | string, month?: number, day?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) => Date;
|
|
134
134
|
/**
|
|
135
135
|
*
|
|
136
136
|
* @param date
|
|
@@ -182,7 +182,7 @@ export declare const isAfter: (date: Date | number, dateToCompare: Date | number
|
|
|
182
182
|
* @param dateStr - string containing date
|
|
183
183
|
* @returns {Date} - Date in UTC
|
|
184
184
|
*/
|
|
185
|
-
export declare const utc: (dateStr?: string
|
|
185
|
+
export declare const utc: (dateStr?: string) => Date;
|
|
186
186
|
/**
|
|
187
187
|
* Check if a date object is valid
|
|
188
188
|
* @param {Date} date - date to be checked
|