@arcanejs/toolkit 0.0.2 → 0.1.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/dist/backend/components/base.d.mts +2 -0
- package/dist/backend/components/base.d.ts +2 -0
- package/dist/backend/components/base.js +189 -0
- package/dist/backend/components/base.mjs +10 -0
- package/dist/backend/components/button.d.mts +30 -0
- package/dist/backend/components/button.d.ts +30 -0
- package/dist/backend/components/button.js +168 -0
- package/dist/backend/components/button.mjs +7 -0
- package/dist/backend/components/group.d.mts +51 -0
- package/dist/backend/components/group.d.ts +51 -0
- package/dist/backend/components/group.js +287 -0
- package/dist/backend/components/group.mjs +9 -0
- package/dist/backend/components/label.d.mts +21 -0
- package/dist/backend/components/label.d.ts +21 -0
- package/dist/backend/components/label.js +105 -0
- package/dist/backend/components/label.mjs +7 -0
- package/dist/backend/components/rect.d.mts +20 -0
- package/dist/backend/components/rect.d.ts +20 -0
- package/dist/backend/components/rect.js +105 -0
- package/dist/backend/components/rect.mjs +7 -0
- package/dist/backend/components/slider-button.d.mts +31 -0
- package/dist/backend/components/slider-button.d.ts +31 -0
- package/dist/backend/components/slider-button.js +161 -0
- package/dist/backend/components/slider-button.mjs +7 -0
- package/dist/backend/components/switch.d.mts +24 -0
- package/dist/backend/components/switch.d.ts +24 -0
- package/dist/backend/components/switch.js +144 -0
- package/dist/backend/components/switch.mjs +7 -0
- package/dist/backend/components/tabs.d.mts +28 -0
- package/dist/backend/components/tabs.d.ts +28 -0
- package/dist/backend/components/tabs.js +209 -0
- package/dist/backend/components/tabs.mjs +9 -0
- package/dist/backend/components/text-input.d.mts +26 -0
- package/dist/backend/components/text-input.d.ts +26 -0
- package/dist/backend/components/text-input.js +146 -0
- package/dist/backend/components/text-input.mjs +7 -0
- package/dist/backend/components/timeline.d.mts +17 -0
- package/dist/backend/components/timeline.d.ts +17 -0
- package/dist/backend/components/timeline.js +109 -0
- package/dist/backend/components/timeline.mjs +7 -0
- package/dist/base-BJAPu0O1.d.mts +234 -0
- package/dist/base-BJAPu0O1.d.ts +234 -0
- package/dist/chunk-37VNFO5S.mjs +42 -0
- package/dist/chunk-3ZBM7Q4A.mjs +55 -0
- package/dist/chunk-6LL3X7ZZ.mjs +44 -0
- package/dist/chunk-DBW4OPGN.mjs +33 -0
- package/dist/chunk-DP3QFYSS.mjs +66 -0
- package/dist/chunk-GQZA5K4M.mjs +29 -0
- package/dist/chunk-HF77PS7J.mjs +171 -0
- package/dist/chunk-HVFTRNLQ.mjs +59 -0
- package/dist/chunk-P6X5GIDT.mjs +29 -0
- package/dist/chunk-S5DQIYC2.mjs +107 -0
- package/dist/frontend.js +26321 -0
- package/dist/frontend.js.map +7 -0
- package/dist/index.d.mts +75 -1
- package/dist/index.d.ts +75 -1
- package/dist/index.js +852 -1
- package/dist/index.mjs +288 -2
- package/package.json +86 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,76 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import * as http from 'http';
|
|
3
|
+
import { Application } from 'express';
|
|
4
|
+
import { WebSocket } from 'ws';
|
|
5
|
+
import { C as ClientMessage, S as ServerMessage, a as Component } from './base-BJAPu0O1.mjs';
|
|
6
|
+
import { Group } from './backend/components/group.mjs';
|
|
7
|
+
export { GroupHeader } from './backend/components/group.mjs';
|
|
8
|
+
export { Button } from './backend/components/button.mjs';
|
|
9
|
+
export { Label } from './backend/components/label.mjs';
|
|
10
|
+
export { Rect } from './backend/components/rect.mjs';
|
|
11
|
+
export { SliderButton } from './backend/components/slider-button.mjs';
|
|
12
|
+
export { Switch } from './backend/components/switch.mjs';
|
|
13
|
+
export { Tab, Tabs } from './backend/components/tabs.mjs';
|
|
14
|
+
export { TextInput } from './backend/components/text-input.mjs';
|
|
15
|
+
export { Timeline } from './backend/components/timeline.mjs';
|
|
16
|
+
import '@arcanejs/diff';
|
|
1
17
|
|
|
2
|
-
|
|
18
|
+
interface Connection {
|
|
19
|
+
sendMessage(msg: ServerMessage): void;
|
|
20
|
+
}
|
|
21
|
+
declare class Server {
|
|
22
|
+
private readonly options;
|
|
23
|
+
private readonly onNewConnection;
|
|
24
|
+
private readonly onClosedConnection;
|
|
25
|
+
private readonly onMessage;
|
|
26
|
+
constructor(options: LightDeskOptions, onNewConnection: (connection: Connection) => void, onClosedConnection: (connection: Connection) => void, onMessage: (connection: Connection, message: ClientMessage) => void);
|
|
27
|
+
handleHttpRequest: (req: http.IncomingMessage, res: http.ServerResponse) => Promise<void>;
|
|
28
|
+
private sendStaticFile;
|
|
29
|
+
handleWsConnection: <S extends WebSocket>(ws: S) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface LightDeskOptions {
|
|
33
|
+
/**
|
|
34
|
+
* What path should be used to serve the light desk.
|
|
35
|
+
*
|
|
36
|
+
* This is important if a express server will be used that serves other paths.
|
|
37
|
+
*/
|
|
38
|
+
path: string;
|
|
39
|
+
}
|
|
40
|
+
type InitializationOptions =
|
|
41
|
+
/** automatically start a simple */
|
|
42
|
+
{
|
|
43
|
+
mode: 'automatic';
|
|
44
|
+
port: number;
|
|
45
|
+
}
|
|
46
|
+
/** Create a websocket server that attaches to an existing express and http server */
|
|
47
|
+
| {
|
|
48
|
+
mode: 'express';
|
|
49
|
+
express: Application;
|
|
50
|
+
server: http.Server;
|
|
51
|
+
}
|
|
52
|
+
/** Create a websocket server that attaches to an existing express and http server */
|
|
53
|
+
| {
|
|
54
|
+
mode: 'manual';
|
|
55
|
+
setup: (server: Server) => void;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare class Toolkit {
|
|
59
|
+
private readonly options;
|
|
60
|
+
/**
|
|
61
|
+
* Mapping from components to unique IDs that identify them
|
|
62
|
+
*/
|
|
63
|
+
private readonly componentIDMap;
|
|
64
|
+
private readonly connections;
|
|
65
|
+
private rootGroup;
|
|
66
|
+
constructor(options?: Partial<LightDeskOptions>);
|
|
67
|
+
start: (opts: InitializationOptions) => void;
|
|
68
|
+
setRoot: (group: Group) => void;
|
|
69
|
+
updateTree: _.DebouncedFuncLeading<() => void>;
|
|
70
|
+
removeChild: (component: Component) => void;
|
|
71
|
+
private onNewConnection;
|
|
72
|
+
private onClosedConnection;
|
|
73
|
+
private onMessage;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { Component, Group, Toolkit };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,76 @@
|
|
|
1
|
+
import _ from 'lodash';
|
|
2
|
+
import * as http from 'http';
|
|
3
|
+
import { Application } from 'express';
|
|
4
|
+
import { WebSocket } from 'ws';
|
|
5
|
+
import { C as ClientMessage, S as ServerMessage, a as Component } from './base-BJAPu0O1.js';
|
|
6
|
+
import { Group } from './backend/components/group.js';
|
|
7
|
+
export { GroupHeader } from './backend/components/group.js';
|
|
8
|
+
export { Button } from './backend/components/button.js';
|
|
9
|
+
export { Label } from './backend/components/label.js';
|
|
10
|
+
export { Rect } from './backend/components/rect.js';
|
|
11
|
+
export { SliderButton } from './backend/components/slider-button.js';
|
|
12
|
+
export { Switch } from './backend/components/switch.js';
|
|
13
|
+
export { Tab, Tabs } from './backend/components/tabs.js';
|
|
14
|
+
export { TextInput } from './backend/components/text-input.js';
|
|
15
|
+
export { Timeline } from './backend/components/timeline.js';
|
|
16
|
+
import '@arcanejs/diff';
|
|
1
17
|
|
|
2
|
-
|
|
18
|
+
interface Connection {
|
|
19
|
+
sendMessage(msg: ServerMessage): void;
|
|
20
|
+
}
|
|
21
|
+
declare class Server {
|
|
22
|
+
private readonly options;
|
|
23
|
+
private readonly onNewConnection;
|
|
24
|
+
private readonly onClosedConnection;
|
|
25
|
+
private readonly onMessage;
|
|
26
|
+
constructor(options: LightDeskOptions, onNewConnection: (connection: Connection) => void, onClosedConnection: (connection: Connection) => void, onMessage: (connection: Connection, message: ClientMessage) => void);
|
|
27
|
+
handleHttpRequest: (req: http.IncomingMessage, res: http.ServerResponse) => Promise<void>;
|
|
28
|
+
private sendStaticFile;
|
|
29
|
+
handleWsConnection: <S extends WebSocket>(ws: S) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface LightDeskOptions {
|
|
33
|
+
/**
|
|
34
|
+
* What path should be used to serve the light desk.
|
|
35
|
+
*
|
|
36
|
+
* This is important if a express server will be used that serves other paths.
|
|
37
|
+
*/
|
|
38
|
+
path: string;
|
|
39
|
+
}
|
|
40
|
+
type InitializationOptions =
|
|
41
|
+
/** automatically start a simple */
|
|
42
|
+
{
|
|
43
|
+
mode: 'automatic';
|
|
44
|
+
port: number;
|
|
45
|
+
}
|
|
46
|
+
/** Create a websocket server that attaches to an existing express and http server */
|
|
47
|
+
| {
|
|
48
|
+
mode: 'express';
|
|
49
|
+
express: Application;
|
|
50
|
+
server: http.Server;
|
|
51
|
+
}
|
|
52
|
+
/** Create a websocket server that attaches to an existing express and http server */
|
|
53
|
+
| {
|
|
54
|
+
mode: 'manual';
|
|
55
|
+
setup: (server: Server) => void;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare class Toolkit {
|
|
59
|
+
private readonly options;
|
|
60
|
+
/**
|
|
61
|
+
* Mapping from components to unique IDs that identify them
|
|
62
|
+
*/
|
|
63
|
+
private readonly componentIDMap;
|
|
64
|
+
private readonly connections;
|
|
65
|
+
private rootGroup;
|
|
66
|
+
constructor(options?: Partial<LightDeskOptions>);
|
|
67
|
+
start: (opts: InitializationOptions) => void;
|
|
68
|
+
setRoot: (group: Group) => void;
|
|
69
|
+
updateTree: _.DebouncedFuncLeading<() => void>;
|
|
70
|
+
removeChild: (component: Component) => void;
|
|
71
|
+
private onNewConnection;
|
|
72
|
+
private onClosedConnection;
|
|
73
|
+
private onMessage;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { Component, Group, Toolkit };
|