mirror of
https://ghproxy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-07-22 12:27:13 +08:00
* [APP-1923] change remediation management (#411) * [APP-1988] Add tabs * [APP-1988][APP-1989] add tabs, remove menu item * [APP-1988][APP-1989] add tabs, remove menu item * [APP-1992] add empty state and tab navigation * [APP-1993][APP-1994] Change view for manage AI fixes, change delete confirmation modal * [APP-1996] add view for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1996] add edit for alt text fixes * [APP-1995] Color contrast form * [APP-2001] add global remediation logic (#415) * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2001] add global remediation logic * [APP-2003] add disable across scans (#418) * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * [APP-2003] add disable across scans * add logs * add logs * add logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * remove logs * change to theme value * change to theme value * change to theme value * change to theme value * add edit mode * add edit mode * add edit mode
80 lines
2 KiB
JavaScript
80 lines
2 KiB
JavaScript
import XIcon from '@elementor/icons/XIcon';
|
|
import Box from '@elementor/ui/Box';
|
|
import IconButton from '@elementor/ui/IconButton';
|
|
import Paper from '@elementor/ui/Paper';
|
|
import { styled } from '@elementor/ui/styles';
|
|
import { APIScanner } from '@ea11y-apps/scanner/api/APIScanner';
|
|
import { DropdownMenu } from '@ea11y-apps/scanner/components/header/dropdown-menu';
|
|
import AppTitle from '@ea11y-apps/scanner/components/header/title/app-title';
|
|
import { ROOT_ID } from '@ea11y-apps/scanner/constants';
|
|
import { useScannerWizardContext } from '@ea11y-apps/scanner/context/scanner-wizard-context';
|
|
import { StyledHeaderContent } from '@ea11y-apps/scanner/styles/app.styles';
|
|
import { closeWidget } from '@ea11y-apps/scanner/utils/close-widget';
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
const AppHeader = () => {
|
|
const { isChanged } = useScannerWizardContext();
|
|
|
|
const onClose = () => {
|
|
const widget = document.getElementById(ROOT_ID);
|
|
|
|
closeWidget(widget);
|
|
|
|
if (isChanged) {
|
|
void APIScanner.triggerSave({
|
|
object_id: window?.ea11yScannerData?.pageData?.object_id,
|
|
object_type: window?.ea11yScannerData?.pageData?.object_type,
|
|
});
|
|
}
|
|
};
|
|
|
|
return (
|
|
<StyledHeaderContainer>
|
|
<Paper color="secondary" elevation={0} square>
|
|
<StyledHeaderContent>
|
|
<Box
|
|
display="flex"
|
|
justifyContent="space-between"
|
|
alignItems="center"
|
|
>
|
|
<StyledTitleWrapper>
|
|
<Box display="flex" alignItems="center" gap={1}>
|
|
<AppTitle />
|
|
</Box>
|
|
</StyledTitleWrapper>
|
|
|
|
<Box display="flex" gap={1}>
|
|
<DropdownMenu />
|
|
|
|
<IconButton
|
|
onClick={onClose}
|
|
aria-label={__('Close', 'pojo-accessibility')}
|
|
>
|
|
<XIcon />
|
|
</IconButton>
|
|
</Box>
|
|
</Box>
|
|
</StyledHeaderContent>
|
|
</Paper>
|
|
</StyledHeaderContainer>
|
|
);
|
|
};
|
|
|
|
const StyledHeaderContainer = styled(Box)`
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 2;
|
|
|
|
overflow: visible;
|
|
`;
|
|
|
|
const StyledTitleWrapper = styled(Box)`
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.MuiButtonBase-root {
|
|
margin-inline-end: 8px;
|
|
}
|
|
`;
|
|
|
|
export default AppHeader;
|