grep-components 2.2.0 → 2.3.0-GREPF-2280.1
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.
|
@@ -12,7 +12,7 @@ export declare const dimensions: {
|
|
|
12
12
|
toolbarMenuWidth: number;
|
|
13
13
|
toolbarMenuHeight: number;
|
|
14
14
|
};
|
|
15
|
-
export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps
|
|
15
|
+
export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
16
16
|
export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
17
|
export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
18
|
export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -26,5 +26,5 @@ export declare const AccountName: import("@emotion/styled").StyledComponent<MUIS
|
|
|
26
26
|
export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
27
27
|
export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
28
28
|
export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
|
-
export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps
|
|
30
|
-
export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps
|
|
29
|
+
export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
30
|
+
export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
|
|
|
9
9
|
import { Button, Box, Typography, Tabs, Tab, Collapse, MenuList, Tooltip, MenuItem as MenuItem$1, Menu as Menu$1, Container, List, ListItem, ListItemText, ListItemButton, CircularProgress, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, IconButton as IconButton$1, TableHead as TableHead$1, TableRow as TableRow$1, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Divider as Divider$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogContentText as DialogContentText$1, DialogActions as DialogActions$1 } from '@mui/material';
|
|
10
10
|
import { useTheme, styled } from '@mui/material/styles';
|
|
11
11
|
import { __unsafe_useEmotionCache } from '@emotion/react';
|
|
12
|
-
import {
|
|
12
|
+
import { useNavigate, NavLink, useBlocker, useLocation } from 'react-router-dom';
|
|
13
13
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
14
14
|
import Box$1 from '@mui/material/Box';
|
|
15
15
|
import IconButton from '@mui/material/IconButton';
|
|
@@ -47,7 +47,7 @@ import Collapse$1 from '@mui/material/Collapse';
|
|
|
47
47
|
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
48
48
|
import Warning from '@mui/icons-material/Warning';
|
|
49
49
|
import { compose, bindActionCreators, createStore as createStore$1, applyMiddleware } from 'redux';
|
|
50
|
-
import { connect, Provider as Provider$1
|
|
50
|
+
import { connect, Provider as Provider$1 } from 'react-redux';
|
|
51
51
|
import ReactDOM from 'react-dom';
|
|
52
52
|
import DragIndicator from '@mui/icons-material/DragIndicator';
|
|
53
53
|
import { ContentBlock, genKey, ContentState, CharacterMetadata, CompositeDecorator, EditorState, RichUtils, getVisibleSelectionRect, Editor, getDefaultKeyBinding, Modifier } from 'draft-js';
|
|
@@ -61,7 +61,6 @@ import DialogActions from '@mui/material/DialogActions';
|
|
|
61
61
|
import DialogContent from '@mui/material/DialogContent';
|
|
62
62
|
import DialogContentText from '@mui/material/DialogContentText';
|
|
63
63
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
64
|
-
import { getHash, getLocation } from 'connected-react-router';
|
|
65
64
|
|
|
66
65
|
dayjs.extend(isBetweenPlugin);
|
|
67
66
|
dayjs.extend(LocalizedFormatPlugin);
|
|
@@ -1628,7 +1627,7 @@ const useMobileStyles = makeStyles()(({ palette, breakpoints }) => ({
|
|
|
1628
1627
|
|
|
1629
1628
|
const MobileAppBarNavList = ({ pages, }) => {
|
|
1630
1629
|
const { classes } = useMobileStyles();
|
|
1631
|
-
const
|
|
1630
|
+
const navigate = useNavigate();
|
|
1632
1631
|
const [anchorElNav, setAnchorElNav] = React.useState(null);
|
|
1633
1632
|
const openNav = Boolean(anchorElNav);
|
|
1634
1633
|
const handleClickNav = (event) => {
|
|
@@ -1644,8 +1643,8 @@ const MobileAppBarNavList = ({ pages, }) => {
|
|
|
1644
1643
|
'aria-labelledby': 'basic-button',
|
|
1645
1644
|
} }, pages.map((page) => (React.createElement(MenuItem, { key: page.id, onClick: () => {
|
|
1646
1645
|
handleCloseNav();
|
|
1647
|
-
|
|
1648
|
-
}, onKeyDown: keyboard.onActivation(() =>
|
|
1646
|
+
navigate(page?.toUrl || '');
|
|
1647
|
+
}, onKeyDown: keyboard.onActivation(() => navigate(page?.toUrl || '')) }, page.label))))));
|
|
1649
1648
|
};
|
|
1650
1649
|
|
|
1651
1650
|
const AppBarNavList = ({ selectedPage, pages, onChange, }) => {
|
|
@@ -2433,7 +2432,7 @@ const useStyles$b = makeStyles()({
|
|
|
2433
2432
|
const isOverflowing = (e) => e.offsetWidth < e.scrollWidth;
|
|
2434
2433
|
const GrepCrumbs = ({ style, onClick, breadcrumbs, }) => {
|
|
2435
2434
|
const { classes } = useStyles$b();
|
|
2436
|
-
const
|
|
2435
|
+
const navigate = useNavigate();
|
|
2437
2436
|
const ref = React__default.useRef(null);
|
|
2438
2437
|
const [showTooltip, setShowTooltip] = React__default.useState(false);
|
|
2439
2438
|
React__default.useEffect(() => {
|
|
@@ -2445,7 +2444,7 @@ const GrepCrumbs = ({ style, onClick, breadcrumbs, }) => {
|
|
|
2445
2444
|
onClick(crumb);
|
|
2446
2445
|
}
|
|
2447
2446
|
else {
|
|
2448
|
-
crumb.path &&
|
|
2447
|
+
crumb.path && navigate(crumb.path);
|
|
2449
2448
|
}
|
|
2450
2449
|
};
|
|
2451
2450
|
return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map((crumb, index) => crumb.path ? (React__default.createElement(Box$1, { key: index, display: "flex" },
|
|
@@ -19577,7 +19576,7 @@ const NavGuard = ({ when, title, txt, txtSave, txtCancel, txtDiscard, onSave, on
|
|
|
19577
19576
|
const [open, setOpen] = React.useState(false);
|
|
19578
19577
|
const [leave, setLeave] = React.useState(false);
|
|
19579
19578
|
const [lastLocation, setLastLocation] = React.useState();
|
|
19580
|
-
const
|
|
19579
|
+
const navigate = useNavigate();
|
|
19581
19580
|
const handleCancel = () => {
|
|
19582
19581
|
setLeave(false);
|
|
19583
19582
|
setOpen(false);
|
|
@@ -19587,31 +19586,32 @@ const NavGuard = ({ when, title, txt, txtSave, txtCancel, txtDiscard, onSave, on
|
|
|
19587
19586
|
setLeave(true);
|
|
19588
19587
|
setOpen(false);
|
|
19589
19588
|
onDiscard && onDiscard();
|
|
19590
|
-
lastLocation &&
|
|
19591
|
-
window.requestAnimationFrame(() => history.push(lastLocation));
|
|
19589
|
+
lastLocation && window.requestAnimationFrame(() => navigate(lastLocation));
|
|
19592
19590
|
};
|
|
19593
19591
|
const handleSave = () => {
|
|
19594
19592
|
onSave && onSave();
|
|
19595
19593
|
setLeave(true);
|
|
19596
19594
|
setOpen(false);
|
|
19597
|
-
lastLocation &&
|
|
19598
|
-
window.requestAnimationFrame(() => history.push(lastLocation));
|
|
19595
|
+
lastLocation && window.requestAnimationFrame(() => navigate(lastLocation));
|
|
19599
19596
|
};
|
|
19600
19597
|
const handleLeave = (location) => {
|
|
19601
19598
|
setLastLocation(location);
|
|
19602
19599
|
setOpen(!leave);
|
|
19603
19600
|
return !!leave;
|
|
19604
19601
|
};
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19602
|
+
const blocker = useBlocker(({ currentLocation, nextLocation }) => {
|
|
19603
|
+
if (when && currentLocation.pathname !== nextLocation.pathname)
|
|
19604
|
+
handleLeave(nextLocation);
|
|
19605
|
+
return currentLocation.pathname !== nextLocation.pathname;
|
|
19606
|
+
});
|
|
19607
|
+
return (React.createElement(React.Fragment, null, blocker.state === 'blocked' ? (React.createElement(Dialog, { open: open, "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description" },
|
|
19608
|
+
React.createElement(DialogTitle, { id: "alert-dialog-title" }, title),
|
|
19609
|
+
React.createElement(DialogContent, null,
|
|
19610
|
+
React.createElement(DialogContentText, { id: "alert-dialog-description" }, txt)),
|
|
19611
|
+
React.createElement(DialogActions, null,
|
|
19612
|
+
React.createElement(Button$1, { onClick: handleCancel, autoFocus: true, color: "inherit" }, txtCancel),
|
|
19613
|
+
React.createElement(Button$1, { onClick: handleDiscard, color: "error" }, txtDiscard),
|
|
19614
|
+
onSave && (React.createElement(Button$1, { onClick: handleSave, color: "primary" }, txtSave))))) : null));
|
|
19615
19615
|
};
|
|
19616
19616
|
|
|
19617
19617
|
const useStyles$3 = makeStyles()(({ palette }) => ({
|
|
@@ -20159,7 +20159,7 @@ const GrepTableOfContentProvider = ({ ...props }) => {
|
|
|
20159
20159
|
const { container, identifier, onSelected, classes, scrollTarget, children, offsetTop = -10, identifyElementFn = identifyElement, } = props;
|
|
20160
20160
|
const [selected, _setSelected] = useState();
|
|
20161
20161
|
const [initialized, setInitialized] = useState();
|
|
20162
|
-
const hash =
|
|
20162
|
+
const hash = useLocation().hash;
|
|
20163
20163
|
const scrollToElement = useCallback$1((element) => {
|
|
20164
20164
|
const target = scrollTarget || window;
|
|
20165
20165
|
const elementBounds = element.getBoundingClientRect();
|
|
@@ -20265,7 +20265,7 @@ const GrepTableOfContentNavTreeNode = (props) => {
|
|
|
20265
20265
|
const className = clsx('grep-toc__nav-tree-node', isSelected && 'grep-toc__nav-tree-node--selected', styles.root, classes?.node, props.className);
|
|
20266
20266
|
const [awaitingRender, setAwaitingRender] = useState(false);
|
|
20267
20267
|
const txt = el.innerText;
|
|
20268
|
-
const location =
|
|
20268
|
+
const location = useLocation();
|
|
20269
20269
|
const url = `${location.pathname}${location.search}#${node.id}`;
|
|
20270
20270
|
useEffect(() => {
|
|
20271
20271
|
const link = linkRef.current;
|