@clayui/shared
Advanced tools
Comparing version 3.85.0 to 3.86.0
@@ -28,4 +28,5 @@ /** | ||
export { useIsMobileDevice } from './useIsMobileDevice'; | ||
export * from './platform'; | ||
export type { AlignPoints } from './useOverlayPositon'; | ||
export type { IBaseProps as IPortalBaseProps } from './Portal'; | ||
export type { InternalDispatch } from './useInternalState'; |
@@ -6,2 +6,30 @@ "use strict"; | ||
}); | ||
var _exportNames = { | ||
noop: true, | ||
ClayPortal: true, | ||
delegate: true, | ||
doAlign: true, | ||
FocusScope: true, | ||
getEllipsisItems: true, | ||
Keys: true, | ||
LinkOrButton: true, | ||
MouseSafeArea: true, | ||
observeRect: true, | ||
Overlay: true, | ||
setElementFullHeight: true, | ||
sub: true, | ||
useDebounce: true, | ||
useFocusManagement: true, | ||
FOCUSABLE_ELEMENTS: true, | ||
useId: true, | ||
useInteractionFocus: true, | ||
useInternalState: true, | ||
useMousePosition: true, | ||
useNavigation: true, | ||
isTypeahead: true, | ||
getFocusableList: true, | ||
useOverlayPosition: true, | ||
useHover: true, | ||
useIsMobileDevice: true | ||
}; | ||
Object.defineProperty(exports, "ClayPortal", { | ||
@@ -203,2 +231,16 @@ enumerable: true, | ||
var _platform = require("./platform"); | ||
Object.keys(_platform).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _platform[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _platform[key]; | ||
} | ||
}); | ||
}); | ||
/** | ||
@@ -205,0 +247,0 @@ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com> |
@@ -10,2 +10,4 @@ "use strict"; | ||
var _platform = require("./platform"); | ||
/** | ||
@@ -20,12 +22,5 @@ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com> | ||
function testPlatform(re) { | ||
var _window$navigator$use; | ||
return typeof window !== 'undefined' && window.navigator != null ? re.test( // @ts-ignore | ||
((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false; | ||
} | ||
function isValidKey(event) { | ||
// Control and Shift keys trigger when navigating back to the tab with keyboard. | ||
return !(event.metaKey || !testPlatform(/^Mac/i) && event.altKey || event.ctrlKey || event.key === 'Control' || event.key === 'Shift' || event.key === 'Meta'); | ||
return !(event.metaKey || !(0, _platform.isMac)() && event.altKey || event.ctrlKey || event.key === 'Control' || event.key === 'Shift' || event.key === 'Meta'); | ||
} | ||
@@ -32,0 +27,0 @@ |
{ | ||
"name": "@clayui/shared", | ||
"version": "3.85.0", | ||
"version": "3.86.0", | ||
"description": "ClayShared component", | ||
@@ -45,3 +45,3 @@ "license": "BSD-3-Clause", | ||
], | ||
"gitHead": "f6f5a2415198707bd0910fb016a0c32c1a99a318" | ||
"gitHead": "81096487752eac344033ca2fc033e69dc9019e10" | ||
} |
@@ -8,2 +8,4 @@ /** | ||
import {isMac} from './platform'; | ||
export type Interaction = 'keyboard' | 'pointer' | 'virtual'; | ||
@@ -16,12 +18,2 @@ | ||
function testPlatform(re: RegExp) { | ||
return typeof window !== 'undefined' && window.navigator != null | ||
? re.test( | ||
// @ts-ignore | ||
window.navigator['userAgentData']?.platform || | ||
window.navigator.platform | ||
) | ||
: false; | ||
} | ||
function isValidKey(event: KeyboardEvent) { | ||
@@ -31,3 +23,3 @@ // Control and Shift keys trigger when navigating back to the tab with keyboard. | ||
event.metaKey || | ||
(!testPlatform(/^Mac/i) && event.altKey) || | ||
(!isMac() && event.altKey) || | ||
event.ctrlKey || | ||
@@ -34,0 +26,0 @@ event.key === 'Control' || |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166302
80
4699