@teselagen/ui 0.8.6-beta.24 → 0.8.6-beta.26

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 (56) hide show
  1. package/DataTable/utils/formatPasteData.d.ts +11 -5
  2. package/DataTable/utils/getAllRows.d.ts +4 -1
  3. package/DataTable/utils/getCellCopyText.d.ts +1 -1
  4. package/DataTable/utils/getCellInfo.d.ts +20 -15
  5. package/DataTable/utils/getFieldPathToField.d.ts +5 -1
  6. package/DataTable/utils/getIdOrCodeOrIndex.d.ts +2 -1
  7. package/DataTable/utils/getLastSelectedEntity.d.ts +7 -1
  8. package/DataTable/utils/getNewEntToSelect.d.ts +7 -6
  9. package/DataTable/utils/getRowCopyText.d.ts +1 -1
  10. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +22 -1
  11. package/DataTable/utils/types/Entity.d.ts +5 -0
  12. package/DataTable/utils/types/Field.d.ts +4 -0
  13. package/DataTable/utils/types/OrderBy.d.ts +11 -0
  14. package/DataTable/utils/types/Schema.d.ts +4 -0
  15. package/DataTable/utils/utils.d.ts +16 -5
  16. package/MenuBar/index.d.ts +3 -1
  17. package/Timeline/TimelineEvent.d.ts +7 -4
  18. package/Timeline/index.d.ts +5 -1
  19. package/index.cjs.js +1638 -1806
  20. package/index.d.ts +0 -1
  21. package/index.es.js +1638 -1806
  22. package/package.json +3 -3
  23. package/src/DataTable/utils/formatPasteData.ts +34 -0
  24. package/src/DataTable/utils/getAllRows.ts +11 -0
  25. package/src/DataTable/utils/getCellCopyText.ts +7 -0
  26. package/src/DataTable/utils/getCellInfo.ts +46 -0
  27. package/src/DataTable/utils/getFieldPathToField.ts +10 -0
  28. package/src/DataTable/utils/getIdOrCodeOrIndex.ts +14 -0
  29. package/src/DataTable/utils/getLastSelectedEntity.ts +15 -0
  30. package/src/DataTable/utils/getNewEntToSelect.ts +32 -0
  31. package/src/DataTable/utils/initializeHasuraWhereAndFilter.ts +35 -0
  32. package/src/DataTable/utils/types/Entity.ts +7 -0
  33. package/src/DataTable/utils/types/Field.ts +4 -0
  34. package/src/DataTable/utils/types/OrderBy.ts +15 -0
  35. package/src/DataTable/utils/types/Schema.ts +5 -0
  36. package/src/DataTable/utils/utils.ts +39 -0
  37. package/src/Timeline/TimelineEvent.tsx +36 -0
  38. package/src/Timeline/index.tsx +21 -0
  39. package/src/index.js +0 -1
  40. package/src/utils/browserUtils.ts +3 -0
  41. package/src/utils/determineBlackOrWhiteTextColor.ts +11 -0
  42. package/src/utils/getTextFromEl.ts +45 -0
  43. package/src/utils/handlerHelpers.ts +32 -0
  44. package/src/utils/hooks/index.ts +1 -0
  45. package/src/utils/hooks/useDeepEqualMemo.ts +10 -0
  46. package/src/utils/hooks/useStableReference.ts +9 -0
  47. package/src/utils/hotkeyUtils.tsx +155 -0
  48. package/src/utils/isBeingCalledExcessively.ts +37 -0
  49. package/utils/browserUtils.d.ts +1 -1
  50. package/utils/determineBlackOrWhiteTextColor.d.ts +1 -1
  51. package/utils/getTextFromEl.d.ts +8 -1
  52. package/utils/handlerHelpers.d.ts +7 -7
  53. package/utils/hooks/useDeepEqualMemo.d.ts +1 -2
  54. package/utils/hooks/useStableReference.d.ts +1 -1
  55. package/utils/hotkeyUtils.d.ts +21 -4
  56. package/utils/isBeingCalledExcessively.d.ts +3 -3
@@ -0,0 +1,37 @@
1
+ const keyCount: { [key: string]: number | null } = {};
2
+ const timeout: { [key: string]: NodeJS.Timeout | null } = {};
3
+
4
+ // if this function is hit more than 20 times in a row in 2 seconds with the same uniqName then throw an error
5
+ export const isBeingCalledExcessively = ({
6
+ uniqName
7
+ }: {
8
+ uniqName: string;
9
+ }) => {
10
+ if (process.env["NODE_ENV"] !== "development") {
11
+ return;
12
+ }
13
+ if (!uniqName) {
14
+ throw new Error("uniqName is required");
15
+ }
16
+ // Initialize the count if it doesn't exist
17
+ keyCount[uniqName] = keyCount[uniqName] || 0;
18
+ (keyCount[uniqName] as number)++;
19
+
20
+ // Only set the timeout if it doesn't exist already to ensure it runs exactly once every 2 seconds
21
+ if (!timeout[uniqName]) {
22
+ timeout[uniqName] = setTimeout(() => {
23
+ keyCount[uniqName] = 0;
24
+ timeout[uniqName] = null;
25
+ }, 2000);
26
+ }
27
+
28
+ if ((keyCount[uniqName] as number) > 20) {
29
+ keyCount[uniqName] = 0;
30
+ // Also clear the timeout when throwing an error
31
+ if (timeout[uniqName]) {
32
+ clearTimeout(timeout[uniqName]);
33
+ timeout[uniqName] = null;
34
+ }
35
+ throw new Error(`isBeingCalledExcessively: ${uniqName}`);
36
+ }
37
+ };
@@ -1 +1 @@
1
- export const isSafari: boolean;
1
+ export declare const isSafari: boolean;
@@ -1 +1 @@
1
- export default function determineBlackOrWhiteTextColor(c: any): "#000000" | "#FFFFFF";
1
+ export default function determineBlackOrWhiteTextColor(c: string): "#000000" | "#FFFFFF";
@@ -1 +1,8 @@
1
- export default function getTextFromEl(el: any, options?: {}): any;
1
+ import { default as React } from '../../../../node_modules/react';
2
+ type Node = React.ReactElement<{
3
+ children?: Node[] | Node;
4
+ }> | string | number;
5
+ export default function getTextFromEl<T extends Node>(el: T, options?: {
6
+ lowerCase?: boolean;
7
+ }): string;
8
+ export {};
@@ -1,10 +1,10 @@
1
- export function onEnterHelper(callback: any): {
2
- onKeyDown: (event: any) => void;
1
+ export declare const onEnterHelper: (callback: (event: React.KeyboardEvent<Element>) => void) => {
2
+ onKeyDown: (event: React.KeyboardEvent<Element>) => void;
3
3
  };
4
- export function onBlurHelper(callback: any): {
5
- onBlur: (event: any) => void;
4
+ export declare const onBlurHelper: (callback: (event: React.FocusEvent<Element>) => void) => {
5
+ onBlur: (event: React.FocusEvent<Element>) => void;
6
6
  };
7
- export function onEnterOrBlurHelper(callback: any): {
8
- onKeyDown: (event: any) => void;
9
- onBlur: (event: any) => void;
7
+ export declare const onEnterOrBlurHelper: (callback: (event: React.KeyboardEvent<Element> | React.FocusEvent<Element>) => void) => {
8
+ onKeyDown: (event: React.KeyboardEvent<Element>) => void;
9
+ onBlur: (event: React.FocusEvent<Element>) => void;
10
10
  };
@@ -1,2 +1 @@
1
- export function useDeepEqualMemo(value: any): undefined;
2
- export function useDeepEqualEffect(effect: any, deps: any): void;
1
+ export declare const useDeepEqualMemo: (value: unknown) => unknown;
@@ -1 +1 @@
1
- export function useStableReference(value: any): import('../../../../../node_modules/react').MutableRefObject<undefined>;
1
+ export declare const useStableReference: (value: unknown) => import('../../../../../node_modules/react').MutableRefObject<unknown>;
@@ -1,4 +1,21 @@
1
- export function comboToLabel(def: any, useSymbols?: boolean): any;
2
- export function hotkeysById(hotkeys: any, mode?: string): (id: any) => any;
3
- export function getHotkeyProps(def: any, id: any): any;
4
- export function withHotkeys(hotkeys: any, handlers: any): ({ children }?: {}) => import("react/jsx-runtime").JSX.Element;
1
+ import { default as React } from '../../../../node_modules/react';
2
+ type Out = {
3
+ combo: string;
4
+ label: string;
5
+ [key: string]: unknown;
6
+ global?: boolean;
7
+ };
8
+ type Hotkeys = {
9
+ [key: string]: string | [string, string, object] | Out;
10
+ };
11
+ export declare function comboToLabel(def: string | {
12
+ combo: string;
13
+ }, useSymbols?: boolean): string;
14
+ export declare const hotkeysById: (hotkeys: Hotkeys, mode?: string) => (id: string) => string;
15
+ export declare const getHotkeyProps: (def: string | [string, string, object] | Out, id?: string) => Out;
16
+ export declare const withHotkeys: (hotkeys: Hotkeys, handlers: {
17
+ [key: string]: (e: KeyboardEvent) => void;
18
+ }) => ({ children }?: {
19
+ children?: React.ReactElement;
20
+ }) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -1,3 +1,3 @@
1
- export function isBeingCalledExcessively({ uniqName }: {
2
- uniqName: any;
3
- }): void;
1
+ export declare const isBeingCalledExcessively: ({ uniqName }: {
2
+ uniqName: string;
3
+ }) => void;