egui-workbench 0.0.0-stage → 0.17.0
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/README.md +5 -2
- package/js/index.js +112 -0
- package/package.json +26 -4
- package/pkg/egui_workbench_wasm.d.ts +103 -0
- package/pkg/egui_workbench_wasm.js +1947 -0
- package/pkg/egui_workbench_wasm_bg.wasm +0 -0
- package/pkg/egui_workbench_wasm_bg.wasm.d.ts +28 -0
- package/types/index.d.ts +42 -0
- package/types/schema.d.ts +226 -0
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_webworkbench_free: (a: number, b: number) => void;
|
|
5
|
+
export const webworkbench_apply_patch: (a: number, b: number, c: number) => [number, number];
|
|
6
|
+
export const webworkbench_destroy: (a: number) => void;
|
|
7
|
+
export const webworkbench_new: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const webworkbench_poll_events_json: (a: number) => [number, number];
|
|
9
|
+
export const webworkbench_schema: () => [number, number];
|
|
10
|
+
export const webworkbench_set_spec: (a: number, b: number, c: number) => [number, number];
|
|
11
|
+
export const webworkbench_set_theme: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const webworkbench_spec_json: (a: number) => [number, number];
|
|
13
|
+
export const webworkbench_start: (a: number, b: any) => any;
|
|
14
|
+
export const webworkbench_version: () => [number, number];
|
|
15
|
+
export const wasm_bindgen_e8fadb86c21d1ac6___convert__closures_____invoke___js_sys_4d64f92870bcf95f___Function_fn_wasm_bindgen_e8fadb86c21d1ac6___JsValue_____wasm_bindgen_e8fadb86c21d1ac6___sys__Undefined___js_sys_4d64f92870bcf95f___Function_fn_wasm_bindgen_e8fadb86c21d1ac6___JsValue_____wasm_bindgen_e8fadb86c21d1ac6___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
16
|
+
export const wasm_bindgen_e8fadb86c21d1ac6___convert__closures_____invoke___wasm_bindgen_e8fadb86c21d1ac6___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_e8fadb86c21d1ac6___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
17
|
+
export const wasm_bindgen_e8fadb86c21d1ac6___convert__closures_____invoke___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_e8fadb86c21d1ac6___JsValue___true_: (a: number, b: number) => [number, number];
|
|
18
|
+
export const wasm_bindgen_e8fadb86c21d1ac6___convert__closures_____invoke___js_sys_4d64f92870bcf95f___Array______true_: (a: number, b: number, c: any) => void;
|
|
19
|
+
export const wasm_bindgen_e8fadb86c21d1ac6___convert__closures_____invoke___js_sys_4d64f92870bcf95f___Array______true__13: (a: number, b: number, c: any) => void;
|
|
20
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
21
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
22
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
23
|
+
export const __externref_table_alloc: () => number;
|
|
24
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
25
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
26
|
+
export const __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
27
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
28
|
+
export const __wbindgen_start: () => void;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HostSpec } from "./schema.js";
|
|
2
|
+
|
|
3
|
+
export type Patch =
|
|
4
|
+
| { op: "set"; path: string; value: unknown }
|
|
5
|
+
| { op: "replace"; path: string; value: unknown }
|
|
6
|
+
| { op: "remove"; path: string }
|
|
7
|
+
| { op: "append"; path: string; values: unknown[] }
|
|
8
|
+
| { op: "batch"; patches: Patch[] };
|
|
9
|
+
|
|
10
|
+
export interface Workbench {
|
|
11
|
+
applyPatch(patch: Patch): void;
|
|
12
|
+
setSpec(spec: HostSpec | string): void;
|
|
13
|
+
spec(): HostSpec;
|
|
14
|
+
pollEvents(): Array<Record<string, unknown>>;
|
|
15
|
+
setTheme(id: string): void;
|
|
16
|
+
schema(): Record<string, unknown>;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface WorkbenchOptions {
|
|
21
|
+
spec: HostSpec | string;
|
|
22
|
+
canvas: HTMLCanvasElement;
|
|
23
|
+
wasmUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function createWorkbench(options: WorkbenchOptions): Promise<Workbench>;
|
|
27
|
+
|
|
28
|
+
export interface RemoteOptions extends WorkbenchOptions {
|
|
29
|
+
url: string;
|
|
30
|
+
onEvent?: (event: Record<string, unknown>) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RemoteWorkbench {
|
|
34
|
+
workbench: Workbench;
|
|
35
|
+
applyPatch(patch: Patch): void;
|
|
36
|
+
sendCommand(id: string): void;
|
|
37
|
+
close(): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function connectRemote(options: RemoteOptions): Promise<RemoteWorkbench>;
|
|
41
|
+
|
|
42
|
+
export * from "./schema.js";
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Generated from the egui-workbench host JSON Schema. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface CommandSpec {
|
|
6
|
+
"category"?: string;
|
|
7
|
+
"checked"?: boolean;
|
|
8
|
+
"enabled"?: boolean;
|
|
9
|
+
"id"?: string;
|
|
10
|
+
"shortcut"?: string | null;
|
|
11
|
+
"title"?: string;
|
|
12
|
+
"when"?: string | null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface DialogSpec {
|
|
16
|
+
"cancel"?: string;
|
|
17
|
+
"confirm"?: string;
|
|
18
|
+
"id"?: string;
|
|
19
|
+
"message"?: string;
|
|
20
|
+
"open"?: boolean;
|
|
21
|
+
"title"?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface GroupSpec {
|
|
25
|
+
"active"?: number;
|
|
26
|
+
"id"?: string;
|
|
27
|
+
"tabs"?: Array<TabSpec>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface LayoutSpec {
|
|
31
|
+
"active"?: number;
|
|
32
|
+
"direction"?: string;
|
|
33
|
+
"groups"?: Array<GroupSpec>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface MenuItemSpec {
|
|
37
|
+
"command"?: string | null;
|
|
38
|
+
"label"?: string;
|
|
39
|
+
"separator"?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface MenuSpec {
|
|
43
|
+
"items"?: Array<MenuItemSpec>;
|
|
44
|
+
"title"?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PanelsSpec {
|
|
48
|
+
"bottom"?: boolean;
|
|
49
|
+
"inspector"?: boolean;
|
|
50
|
+
"sidebar"?: boolean;
|
|
51
|
+
"status"?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface SeriesSpec {
|
|
55
|
+
"color"?: string | null;
|
|
56
|
+
"dataset"?: string | null;
|
|
57
|
+
"name"?: string;
|
|
58
|
+
"points"?: Array<Array<number>>;
|
|
59
|
+
"style"?: string;
|
|
60
|
+
"width"?: number | null;
|
|
61
|
+
"x"?: string | null;
|
|
62
|
+
"y"?: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface StatusSpec {
|
|
66
|
+
"left"?: Array<string>;
|
|
67
|
+
"right"?: Array<string>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface TabSpec {
|
|
71
|
+
"id"?: string;
|
|
72
|
+
"pinned"?: boolean;
|
|
73
|
+
"title"?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ThemeSpec {
|
|
77
|
+
"follow_system"?: boolean;
|
|
78
|
+
"id"?: string;
|
|
79
|
+
"reduced_motion"?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface ToastSpec {
|
|
83
|
+
"description"?: string | null;
|
|
84
|
+
"kind"?: string;
|
|
85
|
+
"title"?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface TreeSpec {
|
|
89
|
+
"children"?: Array<TreeSpec>;
|
|
90
|
+
"expanded"?: boolean;
|
|
91
|
+
"icon"?: string | null;
|
|
92
|
+
"key"?: string;
|
|
93
|
+
"label"?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type WidgetSpec =
|
|
97
|
+
| {
|
|
98
|
+
"kind": "label";
|
|
99
|
+
"size": number;
|
|
100
|
+
"strong": boolean;
|
|
101
|
+
"text": string;
|
|
102
|
+
"tone": string;
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
"enabled": boolean;
|
|
106
|
+
"id": string;
|
|
107
|
+
"kind": "button";
|
|
108
|
+
"label": string;
|
|
109
|
+
"variant": string;
|
|
110
|
+
}
|
|
111
|
+
| {
|
|
112
|
+
"hint": string;
|
|
113
|
+
"id": string;
|
|
114
|
+
"kind": "text_field";
|
|
115
|
+
"label": string;
|
|
116
|
+
"value": string;
|
|
117
|
+
}
|
|
118
|
+
| {
|
|
119
|
+
"checked": boolean;
|
|
120
|
+
"id": string;
|
|
121
|
+
"kind": "checkbox";
|
|
122
|
+
"label": string;
|
|
123
|
+
}
|
|
124
|
+
| {
|
|
125
|
+
"id": string;
|
|
126
|
+
"kind": "switch";
|
|
127
|
+
"label": string;
|
|
128
|
+
"on": boolean;
|
|
129
|
+
}
|
|
130
|
+
| {
|
|
131
|
+
"id": string;
|
|
132
|
+
"kind": "select";
|
|
133
|
+
"label": string;
|
|
134
|
+
"options": Array<string>;
|
|
135
|
+
"selected": number;
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
"id": string;
|
|
139
|
+
"kind": "slider";
|
|
140
|
+
"label": string;
|
|
141
|
+
"max": number;
|
|
142
|
+
"min": number;
|
|
143
|
+
"step": number;
|
|
144
|
+
"value": number;
|
|
145
|
+
}
|
|
146
|
+
| {
|
|
147
|
+
"kind": "separator";
|
|
148
|
+
}
|
|
149
|
+
| {
|
|
150
|
+
"height": number;
|
|
151
|
+
"kind": "spacer";
|
|
152
|
+
}
|
|
153
|
+
| {
|
|
154
|
+
"children": Array<WidgetSpec>;
|
|
155
|
+
"gap": number;
|
|
156
|
+
"kind": "row";
|
|
157
|
+
}
|
|
158
|
+
| {
|
|
159
|
+
"children": Array<WidgetSpec>;
|
|
160
|
+
"gap": number;
|
|
161
|
+
"kind": "column";
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
"children": Array<WidgetSpec>;
|
|
165
|
+
"kind": "card";
|
|
166
|
+
"title": string;
|
|
167
|
+
}
|
|
168
|
+
| {
|
|
169
|
+
"active": number;
|
|
170
|
+
"children": Array<Array<WidgetSpec>>;
|
|
171
|
+
"id": string;
|
|
172
|
+
"kind": "tabs";
|
|
173
|
+
"tabs": Array<string>;
|
|
174
|
+
}
|
|
175
|
+
| {
|
|
176
|
+
"id": string;
|
|
177
|
+
"kind": "tree";
|
|
178
|
+
"nodes": Array<TreeSpec>;
|
|
179
|
+
"selected"?: string | null;
|
|
180
|
+
}
|
|
181
|
+
| {
|
|
182
|
+
"dataset": string;
|
|
183
|
+
"height": number;
|
|
184
|
+
"id": string;
|
|
185
|
+
"kind": "data_grid";
|
|
186
|
+
}
|
|
187
|
+
| {
|
|
188
|
+
"height": number;
|
|
189
|
+
"id": string;
|
|
190
|
+
"kind": "plot";
|
|
191
|
+
"renderer": string;
|
|
192
|
+
"series": Array<SeriesSpec>;
|
|
193
|
+
"title": string;
|
|
194
|
+
}
|
|
195
|
+
| {
|
|
196
|
+
"kind": "custom";
|
|
197
|
+
"props": unknown;
|
|
198
|
+
"widget": string;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export interface WindowSpec {
|
|
202
|
+
"custom_title_bar"?: boolean;
|
|
203
|
+
"height"?: number;
|
|
204
|
+
"resizable"?: boolean;
|
|
205
|
+
"title"?: string;
|
|
206
|
+
"width"?: number;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface HostSpec {
|
|
210
|
+
"commands"?: Array<CommandSpec>;
|
|
211
|
+
"dialogs"?: Array<DialogSpec>;
|
|
212
|
+
"explorer"?: Array<TreeSpec>;
|
|
213
|
+
"layout"?: LayoutSpec;
|
|
214
|
+
"menus"?: Array<MenuSpec>;
|
|
215
|
+
"metadata"?: {
|
|
216
|
+
|
|
217
|
+
};
|
|
218
|
+
"panels"?: PanelsSpec;
|
|
219
|
+
"status"?: StatusSpec;
|
|
220
|
+
"theme"?: ThemeSpec;
|
|
221
|
+
"toasts"?: Array<ToastSpec>;
|
|
222
|
+
"version"?: number;
|
|
223
|
+
"widgets"?: Array<WidgetSpec>;
|
|
224
|
+
"window"?: WindowSpec;
|
|
225
|
+
}
|
|
226
|
+
|