@kemu-io/hs-react 0.2.39 → 0.3.1
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 +64 -4
- package/cjs/components/BaseWidget.d.ts +66 -0
- package/cjs/components/BaseWidget.js +6 -0
- package/cjs/components/CheckboxField.d.ts +27 -0
- package/cjs/components/CheckboxField.js +3 -0
- package/cjs/components/CommonElements.d.ts +9 -0
- package/cjs/components/CommonElements.js +1 -0
- package/cjs/components/Field.d.ts +25 -0
- package/cjs/components/Field.js +9 -0
- package/cjs/components/FieldWithLabel.d.ts +35 -0
- package/cjs/components/FieldWithLabel.js +1 -0
- package/cjs/components/HorizontalField.d.ts +24 -0
- package/cjs/components/HorizontalField.js +9 -0
- package/cjs/components/KemuLightButton.d.ts +16 -0
- package/cjs/components/KemuLightButton.js +43 -0
- package/cjs/components/KemuPrimaryButton.d.ts +16 -0
- package/cjs/components/KemuPrimaryButton.js +43 -0
- package/cjs/components/KemuThemeWrapper.d.ts +44 -0
- package/cjs/components/KemuThemeWrapper.js +1 -0
- package/cjs/components/SettingsBar.d.ts +36 -0
- package/cjs/components/SettingsBar.js +8 -0
- package/cjs/components/SettingsDialog.d.ts +81 -0
- package/cjs/components/SettingsDialog.js +74 -0
- package/cjs/components/SvgContainer.d.ts +26 -0
- package/cjs/components/SvgContainer.js +9 -0
- package/cjs/components/WidgetBody.d.ts +20 -0
- package/cjs/components/WidgetBody.js +9 -0
- package/cjs/components/index.d.ts +326 -1
- package/cjs/components/index.js +1 -1
- package/cjs/hooks/index.d.ts +64 -4
- package/cjs/hooks/useOnBroadcastEvent.d.ts +64 -4
- package/cjs/hooks/useOnParentEvent.d.ts +64 -4
- package/cjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
- package/cjs/lib/InstanceContext.d.ts +64 -4
- package/cjs/lib/globalContext.d.ts +64 -4
- package/cjs/types/context_t.d.ts +64 -4
- package/cjs/types/widgetUI_t.d.ts +64 -4
- package/mjs/WidgetWrapper.d.ts +64 -4
- package/mjs/components/BaseWidget.d.ts +66 -0
- package/mjs/components/BaseWidget.js +6 -0
- package/mjs/components/CheckboxField.d.ts +27 -0
- package/mjs/components/CheckboxField.js +3 -0
- package/mjs/components/CommonElements.d.ts +9 -0
- package/mjs/components/CommonElements.js +1 -0
- package/mjs/components/Field.d.ts +25 -0
- package/mjs/components/Field.js +9 -0
- package/mjs/components/FieldWithLabel.d.ts +35 -0
- package/mjs/components/FieldWithLabel.js +1 -0
- package/mjs/components/HorizontalField.d.ts +24 -0
- package/mjs/components/HorizontalField.js +9 -0
- package/mjs/components/KemuLightButton.d.ts +16 -0
- package/mjs/components/KemuLightButton.js +43 -0
- package/mjs/components/KemuPrimaryButton.d.ts +16 -0
- package/mjs/components/KemuPrimaryButton.js +43 -0
- package/mjs/components/KemuThemeWrapper.d.ts +44 -0
- package/mjs/components/KemuThemeWrapper.js +1 -0
- package/mjs/components/SettingsBar.d.ts +36 -0
- package/mjs/components/SettingsBar.js +8 -0
- package/mjs/components/SettingsDialog.d.ts +81 -0
- package/mjs/components/SettingsDialog.js +74 -0
- package/mjs/components/SvgContainer.d.ts +26 -0
- package/mjs/components/SvgContainer.js +9 -0
- package/mjs/components/WidgetBody.d.ts +20 -0
- package/mjs/components/WidgetBody.js +9 -0
- package/mjs/components/index.d.ts +326 -1
- package/mjs/components/index.js +1 -1
- package/mjs/hooks/index.d.ts +64 -4
- package/mjs/hooks/useOnBroadcastEvent.d.ts +64 -4
- package/mjs/hooks/useOnParentEvent.d.ts +64 -4
- package/mjs/hooks/useOnSetOutputsEvent.d.ts +64 -4
- package/mjs/lib/InstanceContext.d.ts +64 -4
- package/mjs/lib/globalContext.d.ts +64 -4
- package/mjs/types/context_t.d.ts +64 -4
- package/mjs/types/widgetUI_t.d.ts +64 -4
- package/package.json +3 -1
|
@@ -124,6 +124,17 @@ export type WidgetPort = {
|
|
|
124
124
|
* processor execution.
|
|
125
125
|
*/
|
|
126
126
|
triggerPort?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* A path to a markdown file that will be rendered as the ports documentation.
|
|
129
|
+
* If provided it will override the default 'description' property. Useful if the documentation of this port requires more than a simple text.
|
|
130
|
+
*
|
|
131
|
+
* The path can be relative to the service's `docs` folder. For example:
|
|
132
|
+
*
|
|
133
|
+
* ```
|
|
134
|
+
* docs/ports/inputA.md
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
mdHelp?: string;
|
|
127
138
|
};
|
|
128
139
|
export type WidgetState<T extends Record<string, any> = Record<string, unknown>> = T;
|
|
129
140
|
export type TargetOutput = {
|
|
@@ -148,6 +159,9 @@ export type TargetOutput = {
|
|
|
148
159
|
/** id of the variant that defined the output */
|
|
149
160
|
variantId?: string;
|
|
150
161
|
};
|
|
162
|
+
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
163
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
164
|
+
}[Keys];
|
|
151
165
|
export type WidgetPortStr = Omit<WidgetPort, "type"> & {
|
|
152
166
|
type: string;
|
|
153
167
|
};
|
|
@@ -177,7 +191,20 @@ export type ServiceWidgetVariant<P extends WidgetPort | WidgetPortStr> = {
|
|
|
177
191
|
inputs?: P[];
|
|
178
192
|
outputs?: P[];
|
|
179
193
|
};
|
|
180
|
-
|
|
194
|
+
/**
|
|
195
|
+
* A list of supported Linux distributions. This can be extended in the future.
|
|
196
|
+
* Use 'generic' for distribution-agnostic services.
|
|
197
|
+
*/
|
|
198
|
+
export type LinuxDistribution =
|
|
199
|
+
/** For distribution-agnostic services that run on most Linux systems. */
|
|
200
|
+
"generic"
|
|
201
|
+
/** Includes Debian, Ubuntu, Linux Mint, etc. (uses APT) */
|
|
202
|
+
| "debian"
|
|
203
|
+
/** Includes RHEL, Fedora, CentOS, etc. (uses YUM/DNF) */
|
|
204
|
+
| "rhel"
|
|
205
|
+
/** Includes Arch Linux, Manjaro, etc. (uses Pacman) */
|
|
206
|
+
| "arch";
|
|
207
|
+
export type ValidPlatformArch = "win-x64" | "win-x86" | "win-arm" | "win-arm64" | "osx-x64" | "osx-arm64" | `linux-${LinuxDistribution}-x64` | `linux-${LinuxDistribution}-arm64`;
|
|
181
208
|
export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
182
209
|
/** the unique name defined by the service */
|
|
183
210
|
name: string;
|
|
@@ -187,7 +214,17 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
|
187
214
|
title?: string;
|
|
188
215
|
/** a shorten title to be used in the canvas */
|
|
189
216
|
shortTitle?: string;
|
|
217
|
+
/** generic description shown when a service is selected from the Hub Services Grid */
|
|
190
218
|
description: string;
|
|
219
|
+
/**
|
|
220
|
+
* Relative to the markdown file that will be rendered when the user clicks on the 'help' icon for this service.
|
|
221
|
+
* The description is meant to be short and include video/sample images or a link to the description page. Eg:
|
|
222
|
+
*
|
|
223
|
+
* ```
|
|
224
|
+
* docs/help.md
|
|
225
|
+
* ```
|
|
226
|
+
**/
|
|
227
|
+
mdHelp?: string;
|
|
191
228
|
processor: ProcessorType;
|
|
192
229
|
/** Id of the user that published the service */
|
|
193
230
|
author: string;
|
|
@@ -269,6 +306,32 @@ export type ServiceManifest<P extends WidgetPort | WidgetPortStr> = {
|
|
|
269
306
|
* and be visually distinct.
|
|
270
307
|
*/
|
|
271
308
|
variants?: ServiceWidgetVariant<P>[];
|
|
309
|
+
/**
|
|
310
|
+
* The default variant info. If provided, it allows overriding the default info
|
|
311
|
+
* of the service. Useful when the default variant behaviour does not match the service description.
|
|
312
|
+
*/
|
|
313
|
+
defaultVariantInfo?: {
|
|
314
|
+
/**
|
|
315
|
+
* The title of the default variant. If provided, it will override the `title` property.
|
|
316
|
+
*/
|
|
317
|
+
title?: string;
|
|
318
|
+
/**
|
|
319
|
+
* The short title of the default variant. If provided, it will override the `shortTitle` property.
|
|
320
|
+
*/
|
|
321
|
+
shortTitle?: string;
|
|
322
|
+
/**
|
|
323
|
+
* The description of the default variant. If provided, it will override the `description` property.
|
|
324
|
+
*/
|
|
325
|
+
description?: string;
|
|
326
|
+
/**
|
|
327
|
+
* The color of the default variant. If provided, it will override the `color` property.
|
|
328
|
+
*/
|
|
329
|
+
color?: string;
|
|
330
|
+
/**
|
|
331
|
+
* The SVG icon of the default variant. If provided, it will override the `svgIcon` property.
|
|
332
|
+
*/
|
|
333
|
+
svgIcon?: string;
|
|
334
|
+
};
|
|
272
335
|
/**
|
|
273
336
|
* A list of relative paths to folders containing extra services that are part of this service. Eg:
|
|
274
337
|
* ```json
|
|
@@ -341,9 +404,6 @@ export type ProcessedManifest<B extends Buffer | ArrayBuffer = Buffer> = Omit<Pa
|
|
|
341
404
|
version: string;
|
|
342
405
|
};
|
|
343
406
|
};
|
|
344
|
-
export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
345
|
-
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
346
|
-
}[Keys];
|
|
347
407
|
export type DefineDynamicPortsArgs = RequireAtLeastOne<{
|
|
348
408
|
/**
|
|
349
409
|
* Set to null to remove any previously defined ports or
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kemu-io/hs-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "Kemu Hub Service library for React",
|
|
6
6
|
"author": "Kemu Pty Ltd",
|
|
7
7
|
"main": "cjs/WidgetWrapper.js",
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"@emotion/cache": "^11.13.1",
|
|
39
39
|
"@emotion/react": "^11.13.0",
|
|
40
40
|
"@emotion/styled": "^11.13.0",
|
|
41
|
+
"@mui/icons-material": "^7.3.4",
|
|
42
|
+
"@mui/material": "^7.3.4",
|
|
41
43
|
"re-resizable": "^6.9.17",
|
|
42
44
|
"react": "^18.3.1",
|
|
43
45
|
"react-dom": "^18.3.1"
|