From bac8caad272efac227dfaab3161eaee7b42a2bc2 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 9 May 2023 15:15:37 -0400 Subject: [PATCH 1/2] [v5] [core] fix: add back HotkeysDialogLegacy functions to public API --- packages/core/src/index.ts | 9 ++++++++- packages/core/src/legacy/hotkeysDialogLegacy.tsx | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 883f9c2722..7e99d66793 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -23,6 +23,13 @@ export * from "./hooks"; /* eslint-disable deprecation/deprecation */ export { HotkeysTargetLegacy as HotkeysTarget, - HotkeysTargetLegacyComponent as IHotkeysTargetComponent, + type HotkeysTargetLegacyComponent as IHotkeysTargetComponent, } from "./legacy/hotkeysTargetLegacy"; +export { + isHotkeysDialogShowing, + setHotkeysDialogProps, + showHotkeysDialog, + hideHotkeysDialog, + hideHotkeysDialogAfterDelay, +} from "./legacy/hotkeysDialogLegacy"; export { ContextMenuTargetLegacy, ContextMenuTargetLegacyComponent } from "./legacy/contextMenuTargetLegacy"; diff --git a/packages/core/src/legacy/hotkeysDialogLegacy.tsx b/packages/core/src/legacy/hotkeysDialogLegacy.tsx index dc47aba0c8..854bc5f879 100644 --- a/packages/core/src/legacy/hotkeysDialogLegacy.tsx +++ b/packages/core/src/legacy/hotkeysDialogLegacy.tsx @@ -153,10 +153,12 @@ class HotkeysDialogLegacy { // singleton instance const HOTKEYS_DIALOG = new HotkeysDialogLegacy(); +/** @deprecated use HotkeysProvider */ export function isHotkeysDialogShowing() { return HOTKEYS_DIALOG.isShowing(); } +/** @deprecated use HotkeysProvider */ export function setHotkeysDialogProps(props: Partial) { for (const key in props) { if (props.hasOwnProperty(key)) { @@ -165,10 +167,12 @@ export function setHotkeysDialogProps(props: Partial) { } } +/** @deprecated use HotkeysProvider */ export function showHotkeysDialog(hotkeys: HotkeyProps[]) { HOTKEYS_DIALOG.enqueueHotkeysForDisplay(hotkeys); } +/** @deprecated use HotkeysProvider */ export function hideHotkeysDialog() { HOTKEYS_DIALOG.hide(); } @@ -177,6 +181,8 @@ export function hideHotkeysDialog() { * Use this function instead of `hideHotkeysDialog` if you need to ensure that all hotkey listeners * have time to execute with the dialog in a consistent open state. This can avoid flickering the * dialog between open and closed states as successive listeners fire. + * + * @deprecated use HotkeysProvider */ export function hideHotkeysDialogAfterDelay() { HOTKEYS_DIALOG.hideAfterDelay(); From e586c364e7aabddf1cf42248f7a768fb16863cc8 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 9 May 2023 15:24:32 -0400 Subject: [PATCH 2/2] hotkeysEvents is deprecated --- packages/core/src/legacy/hotkeysEvents.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/src/legacy/hotkeysEvents.ts b/packages/core/src/legacy/hotkeysEvents.ts index b0cc8cf540..232b1d5083 100644 --- a/packages/core/src/legacy/hotkeysEvents.ts +++ b/packages/core/src/legacy/hotkeysEvents.ts @@ -14,6 +14,13 @@ * limitations under the License. */ +/** + * @fileoverview This component is DEPRECATED, and the code is frozen. + * All changes & bugfixes should be made to HotkeysDialog2 instead. + */ + +/* eslint-disable deprecation/deprecation */ + import { Children, ReactNode } from "react"; import { isElementOfType } from "../common/utils";