Skip to content

Commit

Permalink
Add missing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Dec 18, 2024
1 parent 54351f5 commit aa956f5
Showing 1 changed file with 66 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,14 @@ export const PresentationPanelHoverActions = ({

const { euiTheme } = useEuiTheme();

const EDIT_MODE_OUTLINE = useMemo(()=> `${euiTheme.border.width.thin} dashed ${euiTheme.colors.borderBaseFormsControl}`,[euiTheme.border.width.thin, euiTheme.colors.borderBaseFormsControl]);
const VIEW_MODE_OUTLINE = useMemo(()=> `${euiTheme.border.width.thin} solid ${euiTheme.colors.borderBasePlain}`,[euiTheme.border.width.thin, euiTheme.colors.borderBasePlain]);
const EDIT_MODE_OUTLINE = useMemo(
() => `${euiTheme.border.width.thin} dashed ${euiTheme.colors.borderBaseFormsControl}`,
[euiTheme.border.width.thin, euiTheme.colors.borderBaseFormsControl]
);
const VIEW_MODE_OUTLINE = useMemo(
() => `${euiTheme.border.width.thin} solid ${euiTheme.colors.borderBasePlain}`,
[euiTheme.border.width.thin, euiTheme.colors.borderBasePlain]
);

const ALL_ROUNDED_CORNERS = `
border-radius: ${euiTheme.border.radius.medium};
Expand Down Expand Up @@ -471,11 +477,68 @@ export const PresentationPanelHoverActions = ({
/>
</button>
),
[setDragHandle]
[setDragHandle, euiTheme.size.xs]
);

const hasHoverActions = quickActionElements.length || contextMenuPanels.lastIndexOf.length;

const presentationPanelHoverActionsAnchorStyles = useMemo(
() => `
border-radius: ${euiTheme.border.radius.medium};
position: relative;
height: 100%;
.embPanel {
${
showBorder
? `
outline: ${viewMode === 'edit' ? EDIT_MODE_OUTLINE : VIEW_MODE_OUTLINE};
`
: ''
}
}
.embPanel__hoverActions {
opacity: 0;
padding: calc(${euiTheme.size.xs} - 1px);
display: flex;
flex-wrap: nowrap;
background-color: ${euiTheme.colors.backgroundBasePlain};
height: ${euiTheme.size.xl};
pointer-events: all; // Re-enable pointer-events for hover actions
}
&:hover,
&:focus-within,
&.embPanel__hoverActionsAnchor--lockHoverActions {
.embPanel {
outline: ${viewMode === 'edit' ? EDIT_MODE_OUTLINE : VIEW_MODE_OUTLINE};
z-index: ${euiTheme.levels.menu};
}
.embPanel__hoverActionsWrapper {
z-index: ${euiTheme.levels.toast};
top: -${euiTheme.size.xl};
.embPanel__hoverActions {
opacity: 1;
}
}
}
`,
[
euiTheme.border.radius.medium,
euiTheme.size.xs,
EDIT_MODE_OUTLINE,
VIEW_MODE_OUTLINE,
euiTheme.colors.backgroundBasePlain,
euiTheme.size.xl,
euiTheme.levels.menu,
euiTheme.levels.toast,
]
);

return (
<div
onMouseOver={updateCombineHoverActions}
Expand Down

0 comments on commit aa956f5

Please sign in to comment.