@kemu-io/hs-react 0.2.36 → 0.2.37

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 (37) hide show
  1. package/cjs/WidgetWrapper.d.ts +0 -2
  2. package/cjs/components/ResizableContainer.d.ts +71 -0
  3. package/cjs/components/WidgetContainer.d.ts +20 -0
  4. package/cjs/components/index.d.ts +85 -0
  5. package/cjs/constants.d.ts +14 -0
  6. package/cjs/hooks/index.d.ts +695 -0
  7. package/cjs/hooks/useOnBroadcastEvent.d.ts +552 -0
  8. package/cjs/hooks/useOnParentEvent.d.ts +545 -0
  9. package/cjs/hooks/useOnSetOutputsEvent.d.ts +554 -0
  10. package/cjs/hooks/useReactiveWidgetState.d.ts +46 -0
  11. package/cjs/hooks/useResizableWidgetDimensions.d.ts +39 -0
  12. package/cjs/hooks/useWidgetState.d.ts +46 -0
  13. package/cjs/lib/InstanceContext.d.ts +523 -0
  14. package/cjs/lib/cache.d.ts +14 -0
  15. package/cjs/lib/globalContext.d.ts +429 -0
  16. package/cjs/types/context_t.d.ts +427 -0
  17. package/cjs/types/hooks_t.d.ts +44 -0
  18. package/cjs/types/widgetUI_t.d.ts +519 -0
  19. package/mjs/WidgetWrapper.d.ts +0 -2
  20. package/mjs/components/ResizableContainer.d.ts +71 -0
  21. package/mjs/components/WidgetContainer.d.ts +20 -0
  22. package/mjs/components/index.d.ts +85 -0
  23. package/mjs/constants.d.ts +14 -0
  24. package/mjs/hooks/index.d.ts +695 -0
  25. package/mjs/hooks/useOnBroadcastEvent.d.ts +552 -0
  26. package/mjs/hooks/useOnParentEvent.d.ts +545 -0
  27. package/mjs/hooks/useOnSetOutputsEvent.d.ts +554 -0
  28. package/mjs/hooks/useReactiveWidgetState.d.ts +46 -0
  29. package/mjs/hooks/useResizableWidgetDimensions.d.ts +39 -0
  30. package/mjs/hooks/useWidgetState.d.ts +46 -0
  31. package/mjs/lib/InstanceContext.d.ts +523 -0
  32. package/mjs/lib/cache.d.ts +14 -0
  33. package/mjs/lib/globalContext.d.ts +429 -0
  34. package/mjs/types/context_t.d.ts +427 -0
  35. package/mjs/types/hooks_t.d.ts +44 -0
  36. package/mjs/types/widgetUI_t.d.ts +519 -0
  37. package/package.json +1 -1
@@ -1,5 +1,3 @@
1
- // Generated by dts-bundle-generator v9.5.1
2
-
3
1
  import React$1 from 'react';
4
2
 
5
3
  export type Rect = {
@@ -0,0 +1,71 @@
1
+ import { CSSObject } from '@emotion/styled';
2
+ import React$1 from 'react';
3
+ import { CSSProperties } from 'react';
4
+
5
+ export type ResizableContainerProps = {
6
+ css?: CSSObject;
7
+ minWidth?: number;
8
+ minHeight?: number;
9
+ maxWidth?: number;
10
+ maxHeight?: number;
11
+ defaultWidth?: number;
12
+ defaultHeight?: number;
13
+ children: React$1.ReactNode;
14
+ /**
15
+ * The lockAspectRatio property is used to lock aspect ratio. Set to true to lock
16
+ * the aspect ratio based on the initial size. Set to a numeric value to lock a
17
+ * specific aspect ratio (such as 16/9). If set to numeric, make sure to set initial
18
+ * height/width to values with correct aspect ratio. If omitted, set false.
19
+ */
20
+ lockAspectRatio?: boolean | number;
21
+ /**
22
+ * Callback when the component is being resized.
23
+ */
24
+ onResize?: (width: number, height: number, originalEvent: MouseEvent | TouchEvent) => void;
25
+ /**
26
+ * Callback when the component has been resized.
27
+ */
28
+ onStopResize?: (width: number, height: number, originalEvent: MouseEvent | TouchEvent) => void;
29
+ };
30
+ export type WrapperProps = {
31
+ cWidth?: number | string;
32
+ cHeight?: number | string;
33
+ noPadding?: boolean;
34
+ noBorderRadius?: boolean;
35
+ className?: string;
36
+ style?: React$1.CSSProperties;
37
+ };
38
+ /**
39
+ * A resizable container for the widget's canvas. It implements styles to handle
40
+ * the widget's appearance when selected or offline.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * import packageJson from '../package.json';
45
+ * import { CustomWidgetProps, components, createWidgetUI } from '@kemu-io/hs-react';
46
+ *
47
+ * const { ResizableContainer } = components;
48
+ *
49
+ * const MyWidgetUI = (props: CustomWidgetProps) => {
50
+ *
51
+ * const handleResize = useCallback((width: number, height: number) => {
52
+ * console.log('Widget resized: ', width, height);
53
+ * }, []);
54
+ *
55
+ * return (
56
+ * <ResizableContainer>
57
+ * <button>Click Me</button>
58
+ * </ResizableContainer>
59
+ * );
60
+ * };
61
+ *
62
+ * export default createWidgetUI(MyWidgetUI, packageJson.name, packageJson.version);
63
+ * ```
64
+ */
65
+ declare const ResizableContainer: (props: ResizableContainerProps & WrapperProps) => import("react/jsx-runtime").JSX.Element;
66
+
67
+ export {
68
+ ResizableContainer as default,
69
+ };
70
+
71
+ export {};
@@ -0,0 +1,20 @@
1
+ export type WrapperProps = {
2
+ cWidth?: number | string;
3
+ cHeight?: number | string;
4
+ noPadding?: boolean;
5
+ noBorderRadius?: boolean;
6
+ };
7
+ export type WidthLessProps = Omit<WrapperProps, "cWidth" | "cHeight"> & {
8
+ width?: number | string;
9
+ height?: number | string;
10
+ children: React.ReactNode;
11
+ className?: string;
12
+ style?: React.CSSProperties;
13
+ };
14
+ declare const Wrap: (p: WidthLessProps) => import("react/jsx-runtime").JSX.Element;
15
+
16
+ export {
17
+ Wrap as default,
18
+ };
19
+
20
+ export {};
@@ -0,0 +1,85 @@
1
+ import { CSSObject } from '@emotion/styled';
2
+ import React$1 from 'react';
3
+ import { CSSProperties } from 'react';
4
+
5
+ export type ResizableContainerProps = {
6
+ css?: CSSObject;
7
+ minWidth?: number;
8
+ minHeight?: number;
9
+ maxWidth?: number;
10
+ maxHeight?: number;
11
+ defaultWidth?: number;
12
+ defaultHeight?: number;
13
+ children: React$1.ReactNode;
14
+ /**
15
+ * The lockAspectRatio property is used to lock aspect ratio. Set to true to lock
16
+ * the aspect ratio based on the initial size. Set to a numeric value to lock a
17
+ * specific aspect ratio (such as 16/9). If set to numeric, make sure to set initial
18
+ * height/width to values with correct aspect ratio. If omitted, set false.
19
+ */
20
+ lockAspectRatio?: boolean | number;
21
+ /**
22
+ * Callback when the component is being resized.
23
+ */
24
+ onResize?: (width: number, height: number, originalEvent: MouseEvent | TouchEvent) => void;
25
+ /**
26
+ * Callback when the component has been resized.
27
+ */
28
+ onStopResize?: (width: number, height: number, originalEvent: MouseEvent | TouchEvent) => void;
29
+ };
30
+ export type WrapperProps = {
31
+ cWidth?: number | string;
32
+ cHeight?: number | string;
33
+ noPadding?: boolean;
34
+ noBorderRadius?: boolean;
35
+ className?: string;
36
+ style?: React$1.CSSProperties;
37
+ };
38
+ /**
39
+ * A resizable container for the widget's canvas. It implements styles to handle
40
+ * the widget's appearance when selected or offline.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * import packageJson from '../package.json';
45
+ * import { CustomWidgetProps, components, createWidgetUI } from '@kemu-io/hs-react';
46
+ *
47
+ * const { ResizableContainer } = components;
48
+ *
49
+ * const MyWidgetUI = (props: CustomWidgetProps) => {
50
+ *
51
+ * const handleResize = useCallback((width: number, height: number) => {
52
+ * console.log('Widget resized: ', width, height);
53
+ * }, []);
54
+ *
55
+ * return (
56
+ * <ResizableContainer>
57
+ * <button>Click Me</button>
58
+ * </ResizableContainer>
59
+ * );
60
+ * };
61
+ *
62
+ * export default createWidgetUI(MyWidgetUI, packageJson.name, packageJson.version);
63
+ * ```
64
+ */
65
+ export declare const ResizableContainer: (props: ResizableContainerProps & WrapperProps) => import("react/jsx-runtime").JSX.Element;
66
+ type WrapperProps$1 = {
67
+ cWidth?: number | string;
68
+ cHeight?: number | string;
69
+ noPadding?: boolean;
70
+ noBorderRadius?: boolean;
71
+ };
72
+ export type WidthLessProps = Omit<WrapperProps$1, "cWidth" | "cHeight"> & {
73
+ width?: number | string;
74
+ height?: number | string;
75
+ children: React$1.ReactNode;
76
+ className?: string;
77
+ style?: React$1.CSSProperties;
78
+ };
79
+ declare const Wrap: (p: WidthLessProps) => import("react/jsx-runtime").JSX.Element;
80
+
81
+ export {
82
+ Wrap as WidgetContainer,
83
+ };
84
+
85
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Prevents any element with this class from being used as a drag handle.
3
+ */
4
+ export declare const PREVENT_DRAGGING_CLS = "no-dragging";
5
+ /**
6
+ * Any child node of an element with this class will not trigger dragging.
7
+ */
8
+ export declare const ABORT_CHILD_DRAGGING_CLS = "no-child-drag";
9
+ /**
10
+ * Class added to widgets when they are selected via 'useDragSelection'
11
+ */
12
+ export declare const WIDGET_SELECTED_CLS = "widget-selected";
13
+
14
+ export {};