@devtron-labs/devtron-fe-common-lib 0.4.3-beta-2 → 0.4.3-beta-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutContext.d.ts +1 -1
  2. package/dist/Common/Hooks/UseRegisterShortcut/UseRegisterShortcutProvider.d.ts +1 -1
  3. package/dist/Common/Hooks/UseRegisterShortcut/types.d.ts +48 -4
  4. package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +5 -1
  5. package/dist/Common/Tooltip/index.d.ts +0 -1
  6. package/dist/Common/Tooltip/types.d.ts +1 -10
  7. package/dist/Shared/Components/CICDHistory/types.d.ts +2 -1
  8. package/dist/{cssMode-DaN1uwbA.js → cssMode-Dmc4Vpv7.js} +1 -1
  9. package/dist/{freemarker2-DcXEsCuh.js → freemarker2-pY6C60XR.js} +1 -1
  10. package/dist/{handlebars-CmvWyA9v.js → handlebars-CsebEZmQ.js} +1 -1
  11. package/dist/{html-CnxJdlMG.js → html-DohSL0rJ.js} +1 -1
  12. package/dist/{htmlMode-C8FDGtom.js → htmlMode-6BXeiMsO.js} +1 -1
  13. package/dist/{index-DxV1RT4a.js → index-B1zg3M7m.js} +14347 -14305
  14. package/dist/index.js +1 -1
  15. package/dist/{javascript-BSxHAzQA.js → javascript-CWNl_eXv.js} +1 -1
  16. package/dist/{jsonMode-DjkBzFns.js → jsonMode-C5IkHDzq.js} +1 -1
  17. package/dist/{liquid-CHACoQzO.js → liquid-CZMZLtDX.js} +1 -1
  18. package/dist/{mdx-D6g3PMDY.js → mdx-BMccoHeE.js} +1 -1
  19. package/dist/{python-R6G9rulX.js → python-DnilY4C9.js} +1 -1
  20. package/dist/{razor-De29BstI.js → razor-CoNJe45G.js} +1 -1
  21. package/dist/{tsMode-98rjVWKG.js → tsMode-Yr62fJBX.js} +1 -1
  22. package/dist/{typescript-CbConEe5.js → typescript-D2lkcEkx.js} +1 -1
  23. package/dist/{xml-O5d7JMbz.js → xml-BVmTyr_9.js} +1 -1
  24. package/dist/{yaml-C5OedARR.js → yaml-DqMNZ9_T.js} +1 -1
  25. package/package.json +1 -2
@@ -1,2 +1,2 @@
1
1
  import { UseRegisterShortcutContextType } from './types';
2
- export declare const context: import('react').Context<UseRegisterShortcutContextType>;
2
+ export declare const UseRegisterShortcutContext: import('react').Context<UseRegisterShortcutContextType>;
@@ -1,3 +1,3 @@
1
1
  import { UseRegisterShortcutProviderType } from './types';
2
- declare const UseRegisterShortcutProvider: ({ children }: UseRegisterShortcutProviderType) => JSX.Element;
2
+ declare const UseRegisterShortcutProvider: ({ ignoreTags, preventDefault, shortcutTimeout, children, }: UseRegisterShortcutProviderType) => JSX.Element;
3
3
  export default UseRegisterShortcutProvider;
@@ -1,13 +1,57 @@
1
- import { SupportedKeyboardKeysType } from '../../Tooltip';
1
+ export declare const KEYBOARD_KEYS_MAP: {
2
+ readonly Control: "Ctrl";
3
+ readonly Shift: "⇧";
4
+ readonly Meta: "⌘" | "Win";
5
+ readonly Alt: "⌥" | "Alt";
6
+ readonly F: "F";
7
+ readonly E: "E";
8
+ readonly R: "R";
9
+ readonly K: "K";
10
+ };
11
+ export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP;
2
12
  export interface ShortcutType {
3
13
  keys: SupportedKeyboardKeysType[];
4
- callback: () => void;
14
+ callbackStack: Array<() => void>;
15
+ description?: string;
16
+ }
17
+ interface RegisterShortcutType extends Pick<ShortcutType, 'keys' | 'description'> {
18
+ callback: ShortcutType['callbackStack'][number];
5
19
  }
6
20
  export interface UseRegisterShortcutContextType {
7
- registerShortcut: (props: ShortcutType) => void;
21
+ /**
22
+ * This method registers a shortcut with its corresponding callback
23
+ *
24
+ * If keys is undefined or null this method will throw an error
25
+ */
26
+ registerShortcut: (props: RegisterShortcutType) => void;
27
+ /**
28
+ * This method unregisters the provided shortcut if found
29
+ *
30
+ * If keys is undefined or null this method will throw an error
31
+ */
8
32
  unregisterShortcut: (keys: ShortcutType['keys']) => void;
33
+ /**
34
+ * Globally disable all shortcuts with this function
35
+ */
9
36
  setDisableShortcuts: (shouldDisable: boolean) => void;
37
+ /**
38
+ * Programmatically trigger a shortcut if already registered
39
+ */
40
+ triggerShortcut: (keys: ShortcutType['keys']) => void;
10
41
  }
11
42
  export interface UseRegisterShortcutProviderType {
12
- children: React.ReactElement;
43
+ children: React.ReactNode;
44
+ /**
45
+ * Defines how long after holding the keys down do we trigger the callback in milliseconds
46
+ */
47
+ shortcutTimeout?: number;
48
+ /**
49
+ * Defines which html tags to ignore as source of an event
50
+ */
51
+ ignoreTags?: string[];
52
+ /**
53
+ * If true, call preventDefault on the event
54
+ */
55
+ preventDefault?: boolean;
13
56
  }
57
+ export {};
@@ -1,2 +1,6 @@
1
1
  import { ShortcutType } from './types';
2
- export declare const preprocessKeys: (keys: ShortcutType["keys"]) => ShortcutType["keys"];
2
+ export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
3
+ keys: ("Control" | "Alt" | "F" | "E" | "R" | "K" | "Shift" | "Meta")[];
4
+ id: string;
5
+ };
6
+ export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
@@ -1,3 +1,2 @@
1
1
  export { default as Tooltip } from './Tooltip';
2
- export type { SupportedKeyboardKeysType } from './types';
3
2
  export { TOOLTIP_CONTENTS } from './constants';
@@ -1,14 +1,5 @@
1
+ import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types';
1
2
  import { TippyProps } from '@tippyjs/react';
2
- export declare const KEYBOARD_KEYS_MAP: {
3
- readonly Control: "Ctrl";
4
- readonly Shift: "⇧";
5
- readonly F: "F";
6
- readonly E: "E";
7
- readonly R: "R";
8
- readonly K: "K";
9
- readonly Meta: "⌘" | "Win";
10
- };
11
- export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP;
12
3
  type BaseTooltipProps = {
13
4
  /**
14
5
  * If true, show tippy on truncate
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps, useScrollable, SortingOrder, SupportedKeyboardKeysType } from '../../../Common';
2
+ import { SupportedKeyboardKeysType } from '@Common/Hooks/UseRegisterShortcut/types';
3
+ import { OptionType, UserApprovalMetadataType, ReleaseTag, ImageComment, PromotionApprovalMetadataType, FilterConditionsListType, DeploymentAppTypes, ResponseType, PaginationProps, useScrollable, SortingOrder } from '../../../Common';
3
4
  import { DeploymentStageType } from '../../constants';
4
5
  import { AggregationKeys, GitTriggers, Node, NodeType, ResourceKindType, ResourceVersionType } from '../../types';
5
6
  export declare enum HistoryComponentType {
@@ -1,7 +1,7 @@
1
1
  var Fe = Object.defineProperty;
2
2
  var Le = (e, n, i) => n in e ? Fe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => Le(e, typeof n != "symbol" ? n + "" : n, i);
4
- import { m as je } from "./index-DxV1RT4a.js";
4
+ import { m as je } from "./index-B1zg3M7m.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as f } from "./index-DxV1RT4a.js";
1
+ import { m as f } from "./index-B1zg3M7m.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-DxV1RT4a.js";
1
+ import { m as l } from "./index-B1zg3M7m.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-DxV1RT4a.js";
1
+ import { m as s } from "./index-B1zg3M7m.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,7 +1,7 @@
1
1
  var Be = Object.defineProperty;
2
2
  var $e = (e, n, i) => n in e ? Be(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => $e(e, typeof n != "symbol" ? n + "" : n, i);
4
- import { m as qe } from "./index-DxV1RT4a.js";
4
+ import { m as qe } from "./index-B1zg3M7m.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)