@arcanejs/toolkit 0.2.2 → 0.3.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 +4 -1
- package/dist/backend/components/base.d.ts +4 -1
- package/dist/backend/components/base.js +2 -2
- package/dist/backend/components/base.mjs +1 -1
- package/dist/backend/components/button.d.mts +1 -0
- package/dist/backend/components/button.d.ts +1 -0
- package/dist/backend/components/button.js +3 -3
- package/dist/backend/components/button.mjs +2 -2
- package/dist/backend/components/group.d.mts +1 -0
- package/dist/backend/components/group.d.ts +1 -0
- package/dist/backend/components/group.js +3 -3
- package/dist/backend/components/group.mjs +2 -2
- package/dist/backend/components/label.d.mts +1 -0
- package/dist/backend/components/label.d.ts +1 -0
- package/dist/backend/components/label.js +3 -3
- package/dist/backend/components/label.mjs +2 -2
- package/dist/backend/components/rect.d.mts +1 -0
- package/dist/backend/components/rect.d.ts +1 -0
- package/dist/backend/components/rect.js +3 -3
- package/dist/backend/components/rect.mjs +2 -2
- package/dist/backend/components/slider-button.d.mts +1 -0
- package/dist/backend/components/slider-button.d.ts +1 -0
- package/dist/backend/components/slider-button.js +3 -3
- package/dist/backend/components/slider-button.mjs +2 -2
- package/dist/backend/components/switch.d.mts +1 -0
- package/dist/backend/components/switch.d.ts +1 -0
- package/dist/backend/components/switch.js +3 -3
- package/dist/backend/components/switch.mjs +2 -2
- package/dist/backend/components/tabs.d.mts +1 -0
- package/dist/backend/components/tabs.d.ts +1 -0
- package/dist/backend/components/tabs.js +3 -3
- package/dist/backend/components/tabs.mjs +2 -2
- package/dist/backend/components/text-input.d.mts +1 -0
- package/dist/backend/components/text-input.d.ts +1 -0
- package/dist/backend/components/text-input.js +3 -3
- package/dist/backend/components/text-input.mjs +2 -2
- package/dist/backend/components/timeline.d.mts +1 -0
- package/dist/backend/components/timeline.d.ts +1 -0
- package/dist/backend/components/timeline.js +3 -3
- package/dist/backend/components/timeline.mjs +2 -2
- package/dist/{chunk-3O4P67DM.mjs → chunk-3Y3HRYLC.mjs} +1 -1
- package/dist/{chunk-HNEUZVCX.mjs → chunk-7ITSSJE2.mjs} +1 -1
- package/dist/{chunk-M6EFK4GP.js → chunk-DNCHAOYH.js} +3 -3
- package/dist/{chunk-OEIGZ3NQ.js → chunk-DV5WTSFW.js} +2 -2
- package/dist/{chunk-ZCHM3JJJ.mjs → chunk-EDTJ75FT.mjs} +4 -3
- package/dist/{chunk-TAZH4BBH.mjs → chunk-EH73E5FP.mjs} +1 -1
- package/dist/{chunk-JW4GXS54.mjs → chunk-H2UQDFTS.mjs} +1 -1
- package/dist/{chunk-MDFDWKGW.js → chunk-IW3JCC73.js} +3 -3
- package/dist/{chunk-KVJU3EAD.js → chunk-J46AJUGE.js} +3 -3
- package/dist/{chunk-IXTM35YM.mjs → chunk-NKNDCRUR.mjs} +1 -1
- package/dist/{chunk-UBWCVW2U.js → chunk-NZUYU32Z.js} +21 -20
- package/dist/{chunk-SOC4TF3J.mjs → chunk-POUQGJN4.mjs} +1 -1
- package/dist/{chunk-K24YPCR5.js → chunk-QUA3NBLD.js} +4 -4
- package/dist/{chunk-ZU5H6SVA.mjs → chunk-SMTUN6HG.mjs} +1 -1
- package/dist/{chunk-P43QUQ4T.js → chunk-TSC5C5XR.js} +2 -2
- package/dist/{chunk-RGIB65TI.js → chunk-WIPEQNWR.js} +2 -2
- package/dist/{chunk-RJS32OOA.js → chunk-WXSKMMCV.js} +3 -3
- package/dist/{chunk-TQ27Y7F4.mjs → chunk-YIXRQHTA.mjs} +1 -1
- package/dist/{chunk-T2PJEXYO.js → chunk-YN3FZMXY.js} +3 -3
- package/dist/{chunk-APCR3ITH.mjs → chunk-YYM7PBRN.mjs} +1 -1
- package/dist/frontend.js +0 -3
- package/dist/frontend.js.map +2 -2
- package/dist/index.d.mts +21 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +30 -26
- package/dist/index.mjs +28 -24
- package/package.json +4 -4
|
@@ -6,27 +6,30 @@ var Base = (_class = class {
|
|
|
6
6
|
|
|
7
7
|
/** @hidden */
|
|
8
8
|
|
|
9
|
-
constructor(defaultProps, props) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);
|
|
9
|
+
constructor(defaultProps, props) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);
|
|
10
10
|
this.defaultProps = defaultProps;
|
|
11
11
|
this._props = Object.freeze({
|
|
12
12
|
...defaultProps,
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
+
__init2() {this.log = () => {
|
|
17
|
+
return _optionalChain([this, 'access', _4 => _4.parent, 'optionalAccess', _5 => _5.log, 'call', _6 => _6()]) || null;
|
|
18
|
+
}}
|
|
16
19
|
get props() {
|
|
17
20
|
return this._props;
|
|
18
21
|
}
|
|
19
22
|
set props(props) {
|
|
20
23
|
this.setProps(props);
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
__init3() {this.setProps = (props) => {
|
|
23
26
|
this._props = Object.freeze({
|
|
24
27
|
...this.defaultProps,
|
|
25
28
|
...props
|
|
26
29
|
});
|
|
27
30
|
this.updateTree();
|
|
28
31
|
}}
|
|
29
|
-
|
|
32
|
+
__init4() {this.updateProps = (updates) => {
|
|
30
33
|
this._props = Object.freeze({
|
|
31
34
|
...this._props,
|
|
32
35
|
...updates
|
|
@@ -45,16 +48,15 @@ var Base = (_class = class {
|
|
|
45
48
|
if (this.parent) this.parent.updateTree();
|
|
46
49
|
}
|
|
47
50
|
/** @hidden */
|
|
48
|
-
handleMessage(
|
|
49
|
-
console.log("Component Received Message:", message);
|
|
51
|
+
handleMessage(_message) {
|
|
50
52
|
}
|
|
51
53
|
routeMessage(_idMap, _message) {
|
|
52
54
|
}
|
|
53
55
|
}, _class);
|
|
54
|
-
var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(...args2); _class2.prototype.
|
|
56
|
+
var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(...args2); _class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this); }
|
|
55
57
|
/** @hidden */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
__init5() {this.children = []}
|
|
59
|
+
__init6() {this.appendChildren = (...children) => {
|
|
58
60
|
for (const c of children) {
|
|
59
61
|
const newChildren = [...this.children.filter((ch) => ch !== c), c];
|
|
60
62
|
this.validateChildren(newChildren);
|
|
@@ -64,11 +66,11 @@ var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(..
|
|
|
64
66
|
this.updateTree();
|
|
65
67
|
return children;
|
|
66
68
|
}}
|
|
67
|
-
|
|
69
|
+
__init7() {this.appendChild = (child) => {
|
|
68
70
|
this.appendChildren(child);
|
|
69
71
|
return child;
|
|
70
72
|
}}
|
|
71
|
-
|
|
73
|
+
__init8() {this.removeChild = (component) => {
|
|
72
74
|
const match = this.children.findIndex((c) => c === component);
|
|
73
75
|
if (match >= 0) {
|
|
74
76
|
const removingChild = this.children[match];
|
|
@@ -78,11 +80,11 @@ var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(..
|
|
|
78
80
|
];
|
|
79
81
|
this.validateChildren(newChildren);
|
|
80
82
|
this.children = Object.freeze(newChildren);
|
|
81
|
-
_optionalChain([removingChild, 'optionalAccess',
|
|
83
|
+
_optionalChain([removingChild, 'optionalAccess', _9 => _9.setParent, 'call', _10 => _10(null)]);
|
|
82
84
|
this.updateTree();
|
|
83
85
|
}
|
|
84
86
|
}}
|
|
85
|
-
|
|
87
|
+
__init9() {this.removeAllChildren = () => {
|
|
86
88
|
this.children.map((c) => c.setParent(null));
|
|
87
89
|
this.children = Object.freeze([]);
|
|
88
90
|
this.updateTree();
|
|
@@ -90,7 +92,7 @@ var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(..
|
|
|
90
92
|
/**
|
|
91
93
|
* Return all children components that messages need to be routed to
|
|
92
94
|
*/
|
|
93
|
-
|
|
95
|
+
__init10() {this.getChildren = () => this.children}
|
|
94
96
|
/**
|
|
95
97
|
* TODO: we can do this better, right now it broadcasts the message to all
|
|
96
98
|
* components of the tree
|
|
@@ -113,7 +115,6 @@ var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(..
|
|
|
113
115
|
insertBefore(child, beforeChild) {
|
|
114
116
|
const filteredChildren = this.children.filter((c) => c !== child);
|
|
115
117
|
let match = filteredChildren.findIndex((c) => c === beforeChild);
|
|
116
|
-
console.log("match", match);
|
|
117
118
|
if (match === -1) {
|
|
118
119
|
match = filteredChildren.length;
|
|
119
120
|
}
|
|
@@ -128,9 +129,9 @@ var BaseParent = (_class2 = class extends Base {constructor(...args2) { super(..
|
|
|
128
129
|
this.updateTree();
|
|
129
130
|
}
|
|
130
131
|
}, _class2);
|
|
131
|
-
var EventEmitter = (_class3 = class {constructor() { _class3.prototype.
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
var EventEmitter = (_class3 = class {constructor() { _class3.prototype.__init11.call(this);_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this); }
|
|
133
|
+
__init11() {this.listeners = /* @__PURE__ */ new Map()}
|
|
134
|
+
__init12() {this.addListener = (type, listener) => {
|
|
134
135
|
let set = this.listeners.get(type);
|
|
135
136
|
if (!set) {
|
|
136
137
|
set = /* @__PURE__ */ new Set();
|
|
@@ -138,10 +139,10 @@ var EventEmitter = (_class3 = class {constructor() { _class3.prototype.__init10.
|
|
|
138
139
|
}
|
|
139
140
|
set.add(listener);
|
|
140
141
|
}}
|
|
141
|
-
|
|
142
|
-
_optionalChain([this, 'access',
|
|
142
|
+
__init13() {this.removeListener = (type, listener) => {
|
|
143
|
+
_optionalChain([this, 'access', _16 => _16.listeners, 'access', _17 => _17.get, 'call', _18 => _18(type), 'optionalAccess', _19 => _19.delete, 'call', _20 => _20(listener)]);
|
|
143
144
|
}}
|
|
144
|
-
|
|
145
|
+
__init14() {this.emit = (type, ...args) => {
|
|
145
146
|
return Promise.all(
|
|
146
147
|
[...this.listeners.get(type) || []].map(
|
|
147
148
|
(l) => new Promise((resolve, reject) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class; var _class2;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
|
|
5
5
|
|
|
6
6
|
// src/backend/components/group.ts
|
|
7
7
|
var GROUP_DEFAULT_STYLE = {
|
|
@@ -12,7 +12,7 @@ var DEFAULT_PROPS = {
|
|
|
12
12
|
title: null,
|
|
13
13
|
labels: null
|
|
14
14
|
};
|
|
15
|
-
var GroupHeader = (_class = class extends
|
|
15
|
+
var GroupHeader = (_class = class extends _chunkNZUYU32Zjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
|
|
16
16
|
__init() {this.validateChildren = () => {
|
|
17
17
|
}}
|
|
18
18
|
/** @hidden */
|
|
@@ -22,9 +22,9 @@ var GroupHeader = (_class = class extends _chunkUBWCVW2Ujs.BaseParent {construct
|
|
|
22
22
|
children: this.getChildren().map((c) => c.getProtoInfo(idMap))
|
|
23
23
|
})}
|
|
24
24
|
}, _class);
|
|
25
|
-
var Group = (_class2 = class extends
|
|
25
|
+
var Group = (_class2 = class extends _chunkNZUYU32Zjs.BaseParent {
|
|
26
26
|
/** @hidden */
|
|
27
|
-
__init3() {this.events = new (0,
|
|
27
|
+
__init3() {this.events = new (0, _chunkNZUYU32Zjs.EventEmitter)()}
|
|
28
28
|
constructor(props) {
|
|
29
29
|
super(DEFAULT_PROPS, props);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);;
|
|
30
30
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
|
|
4
4
|
|
|
5
5
|
// src/backend/components/label.ts
|
|
6
|
-
var Label = class extends
|
|
6
|
+
var Label = class extends _chunkNZUYU32Zjs.Base {
|
|
7
7
|
constructor(props) {
|
|
8
8
|
super({ text: null }, props);
|
|
9
9
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
|
|
4
4
|
|
|
5
5
|
// src/backend/components/rect.ts
|
|
6
6
|
var DEFAULT_PROPS = {
|
|
7
7
|
color: "rgba(0, 0, 0, 0)"
|
|
8
8
|
};
|
|
9
|
-
var Rect = class extends
|
|
9
|
+
var Rect = class extends _chunkNZUYU32Zjs.Base {
|
|
10
10
|
constructor(props) {
|
|
11
11
|
super(DEFAULT_PROPS, props);
|
|
12
12
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
|
|
4
4
|
|
|
5
5
|
// src/backend/components/tabs.ts
|
|
6
|
-
var Tab = (_class = class extends
|
|
6
|
+
var Tab = (_class = class extends _chunkNZUYU32Zjs.BaseParent {constructor(...args) { super(...args); _class.prototype.__init.call(this);_class.prototype.__init2.call(this); }
|
|
7
7
|
__init() {this.validateChildren = (children) => {
|
|
8
8
|
if (children.length > 1) {
|
|
9
9
|
throw new Error("Tab can only have one child");
|
|
@@ -17,7 +17,7 @@ var Tab = (_class = class extends _chunkUBWCVW2Ujs.BaseParent {constructor(...ar
|
|
|
17
17
|
child: this.getChildren().slice(0, 1).map((c) => c.getProtoInfo(idMap))[0]
|
|
18
18
|
})}
|
|
19
19
|
}, _class);
|
|
20
|
-
var Tabs = (_class2 = class extends
|
|
20
|
+
var Tabs = (_class2 = class extends _chunkNZUYU32Zjs.BaseParent {
|
|
21
21
|
__init3() {this.validateChildren = (children) => {
|
|
22
22
|
for (const child of children) {
|
|
23
23
|
if (!(child instanceof Tab)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNZUYU32Zjs = require('./chunk-NZUYU32Z.js');
|
|
5
5
|
|
|
6
6
|
// src/backend/components/slider-button.ts
|
|
7
7
|
var DEFAULT_PROPS = {
|
|
@@ -11,9 +11,9 @@ var DEFAULT_PROPS = {
|
|
|
11
11
|
step: 5,
|
|
12
12
|
mode: "writeBack"
|
|
13
13
|
};
|
|
14
|
-
var SliderButton = (_class = class extends
|
|
14
|
+
var SliderButton = (_class = class extends _chunkNZUYU32Zjs.Base {
|
|
15
15
|
/** @hidden */
|
|
16
|
-
__init() {this.events = new (0,
|
|
16
|
+
__init() {this.events = new (0, _chunkNZUYU32Zjs.EventEmitter)()}
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(DEFAULT_PROPS, props);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);;
|
|
19
19
|
}
|
package/dist/frontend.js
CHANGED
|
@@ -26757,7 +26757,6 @@ body {
|
|
|
26757
26757
|
const onClick = (0, import_react8.useMemo)(
|
|
26758
26758
|
() => () => {
|
|
26759
26759
|
if (!sendMessage) return;
|
|
26760
|
-
console.log("sending message");
|
|
26761
26760
|
sendMessage({
|
|
26762
26761
|
type: "component-message",
|
|
26763
26762
|
componentKey: info.key,
|
|
@@ -27143,7 +27142,6 @@ body {
|
|
|
27143
27142
|
`ws://${window.location.hostname}:${window.location.port}${window.location.pathname}`
|
|
27144
27143
|
);
|
|
27145
27144
|
ws.onmessage = (event) => {
|
|
27146
|
-
console.log("message", event.data);
|
|
27147
27145
|
handleMessage(JSON.parse(event.data));
|
|
27148
27146
|
};
|
|
27149
27147
|
ws.onclose = () => {
|
|
@@ -27165,7 +27163,6 @@ body {
|
|
|
27165
27163
|
(await (socket.current || initializeWebsocket())).send(JSON.stringify(msg));
|
|
27166
27164
|
};
|
|
27167
27165
|
const handleMessage = (msg) => {
|
|
27168
|
-
console.log("handleMessage", msg);
|
|
27169
27166
|
switch (msg.type) {
|
|
27170
27167
|
case "tree-full":
|
|
27171
27168
|
setRoot(msg.root);
|