[tiny] rename show menu paste (#1332)

This PR renames `showUiPaste` to `showMenuPaste`, since we use
`MENU_PASTE` elsewhere.
This commit is contained in:
Steve Ruiz 2023-05-08 21:06:10 +01:00 committed by GitHub
parent 0800dbe087
commit 2a36d6342c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -194,7 +194,7 @@ function _findMenuItem(menu: MenuSchema | MenuChild[], path: string[]): MenuChil
} }
} }
export const showUiPaste = export const showMenuPaste =
typeof window !== 'undefined' && typeof window !== 'undefined' &&
'navigator' in window && 'navigator' in window &&
Boolean(navigator.clipboard) && Boolean(navigator.clipboard) &&

View file

@ -8,7 +8,7 @@ import {
menuItem, menuItem,
MenuSchema, MenuSchema,
menuSubmenu, menuSubmenu,
showUiPaste, showMenuPaste,
useAllowGroup, useAllowGroup,
useAllowUngroup, useAllowUngroup,
useThreeStackableItems, useThreeStackableItems,
@ -163,7 +163,7 @@ export const ContextMenuSchemaProvider = track(function ContextMenuSchemaProvide
'clipboard-group', 'clipboard-group',
oneSelected && menuItem(actions['cut']), oneSelected && menuItem(actions['cut']),
oneSelected && menuItem(actions['copy']), oneSelected && menuItem(actions['copy']),
showUiPaste && menuCustom('MENU_PASTE', { readonlyOk: false }) showMenuPaste && menuCustom('MENU_PASTE', { readonlyOk: false })
), ),
atLeastOneShapeOnPage && atLeastOneShapeOnPage &&
menuGroup( menuGroup(

View file

@ -8,7 +8,7 @@ import {
menuGroup, menuGroup,
menuItem, menuItem,
menuSubmenu, menuSubmenu,
showUiPaste, showMenuPaste,
useAllowGroup, useAllowGroup,
useAllowUngroup, useAllowUngroup,
} from './menuHelpers' } from './menuHelpers'
@ -100,7 +100,7 @@ export function MenuSchemaProvider({ overrides, children }: MenuSchemaProviderPr
{ {
id: 'MENU_PASTE', id: 'MENU_PASTE',
type: 'custom', type: 'custom',
disabled: !showUiPaste, disabled: !showMenuPaste,
readonlyOk: false, readonlyOk: false,
} }
), ),