@kemu-io/hs-react 0.2.36 → 0.2.38
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.
- package/cjs/WidgetWrapper.d.ts +17 -2
- package/cjs/components/ResizableContainer.d.ts +71 -0
- package/cjs/components/WidgetContainer.d.ts +20 -0
- package/cjs/components/index.d.ts +85 -0
- package/cjs/constants.d.ts +14 -0
- package/cjs/hooks/index.d.ts +712 -0
- package/cjs/hooks/useOnBroadcastEvent.d.ts +569 -0
- package/cjs/hooks/useOnParentEvent.d.ts +562 -0
- package/cjs/hooks/useOnSetOutputsEvent.d.ts +571 -0
- package/cjs/hooks/useReactiveWidgetState.d.ts +46 -0
- package/cjs/hooks/useReactiveWidgetState.js +1 -1
- package/cjs/hooks/useResizableWidgetDimensions.d.ts +39 -0
- package/cjs/hooks/useWidgetState.d.ts +46 -0
- package/cjs/lib/InstanceContext.d.ts +540 -0
- package/cjs/lib/cache.d.ts +14 -0
- package/cjs/lib/globalContext.d.ts +446 -0
- package/cjs/types/context_t.d.ts +444 -0
- package/cjs/types/hooks_t.d.ts +44 -0
- package/cjs/types/widgetUI_t.d.ts +536 -0
- package/mjs/WidgetWrapper.d.ts +17 -2
- package/mjs/components/ResizableContainer.d.ts +71 -0
- package/mjs/components/WidgetContainer.d.ts +20 -0
- package/mjs/components/index.d.ts +85 -0
- package/mjs/constants.d.ts +14 -0
- package/mjs/hooks/index.d.ts +712 -0
- package/mjs/hooks/useOnBroadcastEvent.d.ts +569 -0
- package/mjs/hooks/useOnParentEvent.d.ts +562 -0
- package/mjs/hooks/useOnSetOutputsEvent.d.ts +571 -0
- package/mjs/hooks/useReactiveWidgetState.d.ts +46 -0
- package/mjs/hooks/useReactiveWidgetState.js +1 -1
- package/mjs/hooks/useResizableWidgetDimensions.d.ts +39 -0
- package/mjs/hooks/useWidgetState.d.ts +46 -0
- package/mjs/lib/InstanceContext.d.ts +540 -0
- package/mjs/lib/cache.d.ts +14 -0
- package/mjs/lib/globalContext.d.ts +446 -0
- package/mjs/types/context_t.d.ts +444 -0
- package/mjs/types/hooks_t.d.ts +44 -0
- package/mjs/types/widgetUI_t.d.ts +536 -0
- package/package.json +1 -1
package/cjs/WidgetWrapper.d.ts
CHANGED
|
@@ -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 = {
|
|
@@ -14,6 +12,7 @@ export type Point = {
|
|
|
14
12
|
};
|
|
15
13
|
export type BinaryFile<D extends ArrayBuffer | Uint8Array | Uint8ClampedArray | Buffer = ArrayBuffer> = {
|
|
16
14
|
format: string;
|
|
15
|
+
fileName?: string;
|
|
17
16
|
data: D;
|
|
18
17
|
};
|
|
19
18
|
declare enum DataType {
|
|
@@ -121,6 +120,12 @@ export type WidgetPort = {
|
|
|
121
120
|
jsonShape?: JsonTypeShape;
|
|
122
121
|
/** help description markdown */
|
|
123
122
|
description?: string;
|
|
123
|
+
/**
|
|
124
|
+
* If true, the port will be highlighted in the UI
|
|
125
|
+
* to indicate events on this port will start the
|
|
126
|
+
* processor execution.
|
|
127
|
+
*/
|
|
128
|
+
triggerPort?: boolean;
|
|
124
129
|
};
|
|
125
130
|
export type WidgetState<T extends Record<string, any> = Record<string, unknown>> = T;
|
|
126
131
|
export type TargetOutput = {
|
|
@@ -174,6 +179,7 @@ export type ServiceWidgetVariant<P extends WidgetPort | WidgetPortStr> = {
|
|
|
174
179
|
inputs?: P[];
|
|
175
180
|
outputs?: P[];
|
|
176
181
|
};
|
|
182
|
+
export type ValidPlatformArch = "win-x64" | "win-x86" | "win-arm" | "win-arm64" | "osx-x64" | "osx-arm64";
|
|
177
183
|
export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
178
184
|
/** the unique name defined by the service */
|
|
179
185
|
name: string;
|
|
@@ -185,6 +191,10 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
|
185
191
|
shortTitle?: string;
|
|
186
192
|
description: string;
|
|
187
193
|
processor: ProcessorType;
|
|
194
|
+
/** Id of the user that published the service */
|
|
195
|
+
author: string;
|
|
196
|
+
/** id of the item in the marketplace */
|
|
197
|
+
publicationId?: string;
|
|
188
198
|
/**
|
|
189
199
|
* if true, it indicates other services can subscribe
|
|
190
200
|
* to events emitted by this service. Only services
|
|
@@ -292,6 +302,11 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
|
292
302
|
requiredSecrets?: {
|
|
293
303
|
[name: string]: ServiceSecret;
|
|
294
304
|
};
|
|
305
|
+
/**
|
|
306
|
+
* A list of platforms that this service supports.
|
|
307
|
+
* If not provided, it will default to 'win-x86', 'win-x64', 'osx-x64' and 'osx-arm64'.
|
|
308
|
+
*/
|
|
309
|
+
supportedPlatforms?: ValidPlatformArch[];
|
|
295
310
|
};
|
|
296
311
|
export type ServiceWidgetInfo = {
|
|
297
312
|
name: string;
|
|
@@ -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.js").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.js").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.js").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.js").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 {};
|