@arcanejs/toolkit 5.0.0 → 6.0.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 +1 -1
- package/dist/backend/components/base.d.ts +1 -1
- package/dist/backend/components/button.d.mts +1 -1
- package/dist/backend/components/button.d.ts +1 -1
- package/dist/backend/components/group.d.mts +1 -1
- package/dist/backend/components/group.d.ts +1 -1
- package/dist/backend/components/label.d.mts +1 -1
- package/dist/backend/components/label.d.ts +1 -1
- package/dist/backend/components/rect.d.mts +1 -1
- package/dist/backend/components/rect.d.ts +1 -1
- package/dist/backend/components/slider-button.d.mts +1 -1
- package/dist/backend/components/slider-button.d.ts +1 -1
- package/dist/backend/components/switch.d.mts +1 -1
- package/dist/backend/components/switch.d.ts +1 -1
- package/dist/backend/components/tabs.d.mts +1 -1
- package/dist/backend/components/tabs.d.ts +1 -1
- package/dist/backend/components/text-input.d.mts +1 -1
- package/dist/backend/components/text-input.d.ts +1 -1
- package/dist/backend/components/timeline.d.mts +1 -1
- package/dist/backend/components/timeline.d.ts +1 -1
- package/dist/frontend/entrypoint.js +29 -22
- package/dist/frontend/entrypoint.js.map +2 -2
- package/dist/frontend/index.js +32 -22
- package/dist/frontend/index.mjs +33 -23
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +56 -24
- package/dist/index.mjs +47 -15
- package/dist/{toolkit-C37sQAkD.d.ts → toolkit-C_2Y8N9R.d.ts} +10 -1
- package/dist/{toolkit-CQMnQMOF.d.mts → toolkit-CohVRj6u.d.mts} +10 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@arcanejs/protocol';
|
|
2
2
|
import '../../id-map-DxQ3_gyA.mjs';
|
|
3
3
|
import '@arcanejs/protocol/logging';
|
|
4
|
-
export { A as AnyComponent,
|
|
4
|
+
export { A as AnyComponent, f as Base, g as BaseParent, E as EventEmitter, L as Listenable, P as Parent } from '../../toolkit-CohVRj6u.mjs';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
7
7
|
import 'express';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@arcanejs/protocol';
|
|
2
2
|
import '../../id-map-DxQ3_gyA.js';
|
|
3
3
|
import '@arcanejs/protocol/logging';
|
|
4
|
-
export { A as AnyComponent,
|
|
4
|
+
export { A as AnyComponent, f as Base, g as BaseParent, E as EventEmitter, L as Listenable, P as Parent } from '../../toolkit-C_2Y8N9R.js';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
7
7
|
import 'express';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@arcanejs/protocol/core';
|
|
2
2
|
import '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
export { B as Button,
|
|
3
|
+
export { B as Button, i as ButtonMode, h as Events, I as InternalProps, j as Props } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@arcanejs/protocol/core';
|
|
2
2
|
import '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
export { B as Button,
|
|
3
|
+
export { B as Button, i as ButtonMode, h as Events, I as InternalProps, j as Props } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@arcanejs/protocol/core';
|
|
2
2
|
import '@arcanejs/protocol/styles';
|
|
3
3
|
import '../../id-map-DxQ3_gyA.mjs';
|
|
4
|
-
export {
|
|
4
|
+
export { k as Events, G as Group, e as GroupHeader, l as InternalProps, m as Props } from '../../toolkit-CohVRj6u.mjs';
|
|
5
5
|
import '@arcanejs/protocol';
|
|
6
6
|
import '@arcanejs/protocol/logging';
|
|
7
7
|
import 'lodash';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@arcanejs/protocol/core';
|
|
2
2
|
import '@arcanejs/protocol/styles';
|
|
3
3
|
import '../../id-map-DxQ3_gyA.js';
|
|
4
|
-
export {
|
|
4
|
+
export { k as Events, G as Group, e as GroupHeader, l as InternalProps, m as Props } from '../../toolkit-C_2Y8N9R.js';
|
|
5
5
|
import '@arcanejs/protocol';
|
|
6
6
|
import '@arcanejs/protocol/logging';
|
|
7
7
|
import 'lodash';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
3
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { f as Base } from '../../toolkit-CohVRj6u.mjs';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
7
7
|
import 'http';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
3
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
4
|
-
import {
|
|
4
|
+
import { f as Base } from '../../toolkit-C_2Y8N9R.js';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
7
7
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { f as Base } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as Base } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { g as BaseParent, A as AnyComponent } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import {
|
|
3
|
+
import { g as BaseParent, A as AnyComponent } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import { a as ToolkitConnection,
|
|
3
|
+
import { a as ToolkitConnection, f as Base, L as Listenable } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import { AnyClientComponentMessage } from '@arcanejs/protocol';
|
|
5
5
|
import '@arcanejs/protocol/logging';
|
|
6
6
|
import 'lodash';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { f as Base } from '../../toolkit-CohVRj6u.mjs';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol/core';
|
|
2
2
|
import { I as IDMap } from '../../id-map-DxQ3_gyA.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as Base } from '../../toolkit-C_2Y8N9R.js';
|
|
4
4
|
import '@arcanejs/protocol/logging';
|
|
5
5
|
import 'lodash';
|
|
6
6
|
import 'http';
|
|
@@ -27528,7 +27528,9 @@ body {
|
|
|
27528
27528
|
void 0
|
|
27529
27529
|
);
|
|
27530
27530
|
const socket = (0, import_react15.useRef)(null);
|
|
27531
|
-
const
|
|
27531
|
+
const [connection, setConnection] = (0, import_react15.useState)({
|
|
27532
|
+
state: "connecting"
|
|
27533
|
+
});
|
|
27532
27534
|
const calls = (0, import_react15.useRef)({
|
|
27533
27535
|
nextId: 1,
|
|
27534
27536
|
calls: /* @__PURE__ */ new Map()
|
|
@@ -27553,7 +27555,7 @@ body {
|
|
|
27553
27555
|
const handleMessage = (0, import_react15.useCallback)((msg) => {
|
|
27554
27556
|
switch (msg.type) {
|
|
27555
27557
|
case "metadata":
|
|
27556
|
-
uuid
|
|
27558
|
+
setConnection({ state: "connected", uuid: msg.connectionUuid });
|
|
27557
27559
|
return;
|
|
27558
27560
|
case "tree-full":
|
|
27559
27561
|
setRoot(msg.root);
|
|
@@ -27580,29 +27582,39 @@ body {
|
|
|
27580
27582
|
}
|
|
27581
27583
|
}, []);
|
|
27582
27584
|
const initializeWebsocket = (0, import_react15.useCallback)(async () => {
|
|
27585
|
+
if (socket.current) {
|
|
27586
|
+
socket.current.then((s2) => s2.close()).catch((err) => console.error(err));
|
|
27587
|
+
socket.current = null;
|
|
27588
|
+
}
|
|
27583
27589
|
console.log("initializing websocket");
|
|
27584
27590
|
const wsUrl = new URL(window.location.href);
|
|
27585
27591
|
wsUrl.protocol = wsUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
27586
|
-
const ws = new WebSocket(
|
|
27587
|
-
`ws://${window.location.hostname}:${window.location.port}${window.location.pathname}`
|
|
27588
|
-
);
|
|
27592
|
+
const ws = new WebSocket(wsUrl.href);
|
|
27589
27593
|
ws.onmessage = (event) => {
|
|
27590
27594
|
handleMessage(JSON.parse(event.data));
|
|
27591
27595
|
};
|
|
27592
27596
|
ws.onclose = () => {
|
|
27597
|
+
setConnection({ state: "closed" });
|
|
27593
27598
|
console.log("socket closed");
|
|
27594
27599
|
socket.current = null;
|
|
27595
27600
|
};
|
|
27596
27601
|
socket.current = new Promise((resolve, reject) => {
|
|
27597
27602
|
ws.onopen = () => {
|
|
27603
|
+
console.log("socket opened");
|
|
27604
|
+
setConnection({ state: "connected", uuid: null });
|
|
27598
27605
|
resolve(ws);
|
|
27599
27606
|
};
|
|
27600
27607
|
ws.onerror = (err) => {
|
|
27608
|
+
setConnection({
|
|
27609
|
+
state: "error",
|
|
27610
|
+
error: err instanceof Error ? err : new Error("Unable to connect", { cause: err })
|
|
27611
|
+
});
|
|
27612
|
+
console.error("socket error", err);
|
|
27601
27613
|
reject(err);
|
|
27602
27614
|
socket.current = null;
|
|
27603
27615
|
};
|
|
27604
27616
|
});
|
|
27605
|
-
return
|
|
27617
|
+
return socket.current;
|
|
27606
27618
|
}, []);
|
|
27607
27619
|
const sendMessage = (0, import_react15.useCallback)(async (msg) => {
|
|
27608
27620
|
(await (socket.current || initializeWebsocket())).send(JSON.stringify(msg));
|
|
@@ -27632,23 +27644,18 @@ body {
|
|
|
27632
27644
|
(0, import_react15.useEffect)(() => {
|
|
27633
27645
|
initializeWebsocket();
|
|
27634
27646
|
}, [initializeWebsocket]);
|
|
27635
|
-
|
|
27636
|
-
|
|
27637
|
-
|
|
27638
|
-
|
|
27639
|
-
|
|
27640
|
-
|
|
27641
|
-
|
|
27642
|
-
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
}
|
|
27646
|
-
return uuid.current;
|
|
27647
|
-
}
|
|
27648
|
-
}
|
|
27649
|
-
},
|
|
27650
|
-
/* @__PURE__ */ import_react15.default.createElement(GroupStateWrapper, { openByDefault: false }, /* @__PURE__ */ import_react15.default.createElement("div", { className }, root ? renderComponent(root) : /* @__PURE__ */ import_react15.default.createElement("div", { className: "no-root" }, "No root has been added to the light desk")))
|
|
27647
|
+
const stageContext = (0, import_react15.useMemo)(
|
|
27648
|
+
() => ({
|
|
27649
|
+
sendMessage,
|
|
27650
|
+
renderComponent,
|
|
27651
|
+
call,
|
|
27652
|
+
connectionUuid: connection.state === "connected" ? connection.uuid : null,
|
|
27653
|
+
connection,
|
|
27654
|
+
reconnect: () => void initializeWebsocket()
|
|
27655
|
+
}),
|
|
27656
|
+
[sendMessage, renderComponent, call, initializeWebsocket, connection]
|
|
27651
27657
|
);
|
|
27658
|
+
return /* @__PURE__ */ import_react15.default.createElement(StageContext.Provider, { value: stageContext }, /* @__PURE__ */ import_react15.default.createElement(GroupStateWrapper, { openByDefault: false }, /* @__PURE__ */ import_react15.default.createElement("div", { className }, root ? renderComponent(root) : /* @__PURE__ */ import_react15.default.createElement("div", { className: "no-root" }, "No root has been added to the light desk"))));
|
|
27652
27659
|
};
|
|
27653
27660
|
var StyledStage = dt(Stage)`
|
|
27654
27661
|
width: 100%;
|