@arcanejs/toolkit 0.2.1 → 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 +10 -188
- 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 +5 -165
- 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 +7 -281
- 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 +5 -102
- 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 +5 -102
- 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 +5 -158
- 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 +5 -141
- 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 +7 -206
- 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 +5 -143
- 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 +5 -106
- package/dist/backend/components/timeline.mjs +2 -2
- package/dist/backend/util/index.js +5 -41
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-3O4P67DM.mjs → chunk-3Y3HRYLC.mjs} +1 -1
- package/dist/{chunk-HNEUZVCX.mjs → chunk-7ITSSJE2.mjs} +1 -1
- package/dist/chunk-DNCHAOYH.js +42 -0
- package/dist/chunk-DV5WTSFW.js +33 -0
- package/dist/chunk-EABM5X65.js +17 -0
- 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-IW3JCC73.js +44 -0
- package/dist/chunk-J46AJUGE.js +66 -0
- package/dist/{chunk-IXTM35YM.mjs → chunk-NKNDCRUR.mjs} +1 -1
- package/dist/chunk-NZUYU32Z.js +164 -0
- package/dist/{chunk-SOC4TF3J.mjs → chunk-POUQGJN4.mjs} +1 -1
- package/dist/chunk-QUA3NBLD.js +104 -0
- package/dist/{chunk-ZU5H6SVA.mjs → chunk-SMTUN6HG.mjs} +1 -1
- package/dist/chunk-TSC5C5XR.js +29 -0
- package/dist/chunk-WIPEQNWR.js +29 -0
- package/dist/chunk-WXSKMMCV.js +55 -0
- package/dist/{chunk-TQ27Y7F4.mjs → chunk-YIXRQHTA.mjs} +1 -1
- package/dist/chunk-YN3FZMXY.js +59 -0
- 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 +99 -669
- package/dist/index.mjs +28 -24
- package/package.json +5 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol';
|
|
2
2
|
import { IDMap } from '../util/index.mjs';
|
|
3
|
+
import { Logger } from '@arcanejs/protocol/logging';
|
|
3
4
|
|
|
4
5
|
interface Component {
|
|
5
6
|
getProtoInfo(idMap: IDMap): proto.Component;
|
|
@@ -15,6 +16,7 @@ declare abstract class Base<Props> implements Component {
|
|
|
15
16
|
/** @hidden */
|
|
16
17
|
private _props;
|
|
17
18
|
constructor(defaultProps: Props, props?: Partial<Props>);
|
|
19
|
+
log: () => Logger | null;
|
|
18
20
|
get props(): Props;
|
|
19
21
|
set props(props: Partial<Props>);
|
|
20
22
|
setProps: (props: Partial<Props>) => void;
|
|
@@ -26,13 +28,14 @@ declare abstract class Base<Props> implements Component {
|
|
|
26
28
|
/** @hidden */
|
|
27
29
|
abstract getProtoInfo(idMap: IDMap): proto.Component;
|
|
28
30
|
/** @hidden */
|
|
29
|
-
handleMessage(
|
|
31
|
+
handleMessage(_message: proto.ClientComponentMessage): void;
|
|
30
32
|
routeMessage(_idMap: IDMap, _message: proto.ClientComponentMessage): void;
|
|
31
33
|
}
|
|
32
34
|
/** @hidden */
|
|
33
35
|
interface Parent {
|
|
34
36
|
updateTree(): void;
|
|
35
37
|
removeChild(component: Component): void;
|
|
38
|
+
log(): Logger | null;
|
|
36
39
|
}
|
|
37
40
|
declare abstract class BaseParent<T> extends Base<T> implements Parent {
|
|
38
41
|
/** @hidden */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as proto from '@arcanejs/protocol';
|
|
2
2
|
import { IDMap } from '../util/index.js';
|
|
3
|
+
import { Logger } from '@arcanejs/protocol/logging';
|
|
3
4
|
|
|
4
5
|
interface Component {
|
|
5
6
|
getProtoInfo(idMap: IDMap): proto.Component;
|
|
@@ -15,6 +16,7 @@ declare abstract class Base<Props> implements Component {
|
|
|
15
16
|
/** @hidden */
|
|
16
17
|
private _props;
|
|
17
18
|
constructor(defaultProps: Props, props?: Partial<Props>);
|
|
19
|
+
log: () => Logger | null;
|
|
18
20
|
get props(): Props;
|
|
19
21
|
set props(props: Partial<Props>);
|
|
20
22
|
setProps: (props: Partial<Props>) => void;
|
|
@@ -26,13 +28,14 @@ declare abstract class Base<Props> implements Component {
|
|
|
26
28
|
/** @hidden */
|
|
27
29
|
abstract getProtoInfo(idMap: IDMap): proto.Component;
|
|
28
30
|
/** @hidden */
|
|
29
|
-
handleMessage(
|
|
31
|
+
handleMessage(_message: proto.ClientComponentMessage): void;
|
|
30
32
|
routeMessage(_idMap: IDMap, _message: proto.ClientComponentMessage): void;
|
|
31
33
|
}
|
|
32
34
|
/** @hidden */
|
|
33
35
|
interface Parent {
|
|
34
36
|
updateTree(): void;
|
|
35
37
|
removeChild(component: Component): void;
|
|
38
|
+
log(): Logger | null;
|
|
36
39
|
}
|
|
37
40
|
declare abstract class BaseParent<T> extends Base<T> implements Parent {
|
|
38
41
|
/** @hidden */
|
|
@@ -1,189 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/** @hidden */
|
|
30
|
-
parent = null;
|
|
31
|
-
/** @hidden */
|
|
32
|
-
defaultProps;
|
|
33
|
-
/** @hidden */
|
|
34
|
-
_props;
|
|
35
|
-
constructor(defaultProps, props) {
|
|
36
|
-
this.defaultProps = defaultProps;
|
|
37
|
-
this._props = Object.freeze({
|
|
38
|
-
...defaultProps,
|
|
39
|
-
...props
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
get props() {
|
|
43
|
-
return this._props;
|
|
44
|
-
}
|
|
45
|
-
set props(props) {
|
|
46
|
-
this.setProps(props);
|
|
47
|
-
}
|
|
48
|
-
setProps = (props) => {
|
|
49
|
-
this._props = Object.freeze({
|
|
50
|
-
...this.defaultProps,
|
|
51
|
-
...props
|
|
52
|
-
});
|
|
53
|
-
this.updateTree();
|
|
54
|
-
};
|
|
55
|
-
updateProps = (updates) => {
|
|
56
|
-
this._props = Object.freeze({
|
|
57
|
-
...this._props,
|
|
58
|
-
...updates
|
|
59
|
-
});
|
|
60
|
-
this.updateTree();
|
|
61
|
-
};
|
|
62
|
-
/** @hidden */
|
|
63
|
-
setParent(parent) {
|
|
64
|
-
if (this.parent && this.parent !== parent) {
|
|
65
|
-
this.parent.removeChild(this);
|
|
66
|
-
}
|
|
67
|
-
this.parent = parent;
|
|
68
|
-
}
|
|
69
|
-
/** @hidden */
|
|
70
|
-
updateTree() {
|
|
71
|
-
if (this.parent) this.parent.updateTree();
|
|
72
|
-
}
|
|
73
|
-
/** @hidden */
|
|
74
|
-
handleMessage(message) {
|
|
75
|
-
console.log("Component Received Message:", message);
|
|
76
|
-
}
|
|
77
|
-
routeMessage(_idMap, _message) {
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
var BaseParent = class extends Base {
|
|
81
|
-
/** @hidden */
|
|
82
|
-
children = [];
|
|
83
|
-
appendChildren = (...children) => {
|
|
84
|
-
for (const c of children) {
|
|
85
|
-
const newChildren = [...this.children.filter((ch) => ch !== c), c];
|
|
86
|
-
this.validateChildren(newChildren);
|
|
87
|
-
this.children = Object.freeze(newChildren);
|
|
88
|
-
c.setParent(this);
|
|
89
|
-
}
|
|
90
|
-
this.updateTree();
|
|
91
|
-
return children;
|
|
92
|
-
};
|
|
93
|
-
appendChild = (child) => {
|
|
94
|
-
this.appendChildren(child);
|
|
95
|
-
return child;
|
|
96
|
-
};
|
|
97
|
-
removeChild = (component) => {
|
|
98
|
-
const match = this.children.findIndex((c) => c === component);
|
|
99
|
-
if (match >= 0) {
|
|
100
|
-
const removingChild = this.children[match];
|
|
101
|
-
const newChildren = [
|
|
102
|
-
...this.children.slice(0, match),
|
|
103
|
-
...this.children.slice(match + 1)
|
|
104
|
-
];
|
|
105
|
-
this.validateChildren(newChildren);
|
|
106
|
-
this.children = Object.freeze(newChildren);
|
|
107
|
-
removingChild?.setParent(null);
|
|
108
|
-
this.updateTree();
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
removeAllChildren = () => {
|
|
112
|
-
this.children.map((c) => c.setParent(null));
|
|
113
|
-
this.children = Object.freeze([]);
|
|
114
|
-
this.updateTree();
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* Return all children components that messages need to be routed to
|
|
118
|
-
*/
|
|
119
|
-
getChildren = () => this.children;
|
|
120
|
-
/**
|
|
121
|
-
* TODO: we can do this better, right now it broadcasts the message to all
|
|
122
|
-
* components of the tree
|
|
123
|
-
*
|
|
124
|
-
* @hidden
|
|
125
|
-
*/
|
|
126
|
-
routeMessage(idMap, message) {
|
|
127
|
-
if (idMap.getId(this) === message.componentKey) {
|
|
128
|
-
this.handleMessage(message);
|
|
129
|
-
} else {
|
|
130
|
-
for (const c of this.children) {
|
|
131
|
-
if (idMap.getId(c) === message.componentKey) {
|
|
132
|
-
c.handleMessage(message);
|
|
133
|
-
} else {
|
|
134
|
-
c.routeMessage(idMap, message);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
insertBefore(child, beforeChild) {
|
|
140
|
-
const filteredChildren = this.children.filter((c) => c !== child);
|
|
141
|
-
let match = filteredChildren.findIndex((c) => c === beforeChild);
|
|
142
|
-
console.log("match", match);
|
|
143
|
-
if (match === -1) {
|
|
144
|
-
match = filteredChildren.length;
|
|
145
|
-
}
|
|
146
|
-
const newChildren = [
|
|
147
|
-
...filteredChildren.slice(0, match),
|
|
148
|
-
child,
|
|
149
|
-
...filteredChildren.slice(match)
|
|
150
|
-
];
|
|
151
|
-
this.validateChildren(newChildren);
|
|
152
|
-
this.children = Object.freeze(newChildren);
|
|
153
|
-
child.setParent(this);
|
|
154
|
-
this.updateTree();
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
var EventEmitter = class {
|
|
158
|
-
listeners = /* @__PURE__ */ new Map();
|
|
159
|
-
addListener = (type, listener) => {
|
|
160
|
-
let set = this.listeners.get(type);
|
|
161
|
-
if (!set) {
|
|
162
|
-
set = /* @__PURE__ */ new Set();
|
|
163
|
-
this.listeners.set(type, set);
|
|
164
|
-
}
|
|
165
|
-
set.add(listener);
|
|
166
|
-
};
|
|
167
|
-
removeListener = (type, listener) => {
|
|
168
|
-
this.listeners.get(type)?.delete(listener);
|
|
169
|
-
};
|
|
170
|
-
emit = (type, ...args) => {
|
|
171
|
-
return Promise.all(
|
|
172
|
-
[...this.listeners.get(type) || []].map(
|
|
173
|
-
(l) => new Promise((resolve, reject) => {
|
|
174
|
-
try {
|
|
175
|
-
resolve(l(...args));
|
|
176
|
-
} catch (e) {
|
|
177
|
-
reject(e);
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
)
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
185
|
-
0 && (module.exports = {
|
|
186
|
-
Base,
|
|
187
|
-
BaseParent,
|
|
188
|
-
EventEmitter
|
|
189
|
-
});
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkNZUYU32Zjs = require('../../chunk-NZUYU32Z.js');
|
|
6
|
+
require('../../chunk-3RG5ZIWI.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.Base = _chunkNZUYU32Zjs.Base; exports.BaseParent = _chunkNZUYU32Zjs.BaseParent; exports.EventEmitter = _chunkNZUYU32Zjs.EventEmitter;
|
|
@@ -1,168 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Button: () => Button
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(button_exports);
|
|
3
|
+
var _chunkJ46AJUGEjs = require('../../chunk-J46AJUGE.js');
|
|
4
|
+
require('../../chunk-NZUYU32Z.js');
|
|
5
|
+
require('../../chunk-3RG5ZIWI.js');
|
|
26
6
|
|
|
27
|
-
// src/backend/components/base.ts
|
|
28
|
-
var Base = class {
|
|
29
|
-
/** @hidden */
|
|
30
|
-
parent = null;
|
|
31
|
-
/** @hidden */
|
|
32
|
-
defaultProps;
|
|
33
|
-
/** @hidden */
|
|
34
|
-
_props;
|
|
35
|
-
constructor(defaultProps, props) {
|
|
36
|
-
this.defaultProps = defaultProps;
|
|
37
|
-
this._props = Object.freeze({
|
|
38
|
-
...defaultProps,
|
|
39
|
-
...props
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
get props() {
|
|
43
|
-
return this._props;
|
|
44
|
-
}
|
|
45
|
-
set props(props) {
|
|
46
|
-
this.setProps(props);
|
|
47
|
-
}
|
|
48
|
-
setProps = (props) => {
|
|
49
|
-
this._props = Object.freeze({
|
|
50
|
-
...this.defaultProps,
|
|
51
|
-
...props
|
|
52
|
-
});
|
|
53
|
-
this.updateTree();
|
|
54
|
-
};
|
|
55
|
-
updateProps = (updates) => {
|
|
56
|
-
this._props = Object.freeze({
|
|
57
|
-
...this._props,
|
|
58
|
-
...updates
|
|
59
|
-
});
|
|
60
|
-
this.updateTree();
|
|
61
|
-
};
|
|
62
|
-
/** @hidden */
|
|
63
|
-
setParent(parent) {
|
|
64
|
-
if (this.parent && this.parent !== parent) {
|
|
65
|
-
this.parent.removeChild(this);
|
|
66
|
-
}
|
|
67
|
-
this.parent = parent;
|
|
68
|
-
}
|
|
69
|
-
/** @hidden */
|
|
70
|
-
updateTree() {
|
|
71
|
-
if (this.parent) this.parent.updateTree();
|
|
72
|
-
}
|
|
73
|
-
/** @hidden */
|
|
74
|
-
handleMessage(message) {
|
|
75
|
-
console.log("Component Received Message:", message);
|
|
76
|
-
}
|
|
77
|
-
routeMessage(_idMap, _message) {
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
var EventEmitter = class {
|
|
81
|
-
listeners = /* @__PURE__ */ new Map();
|
|
82
|
-
addListener = (type, listener) => {
|
|
83
|
-
let set = this.listeners.get(type);
|
|
84
|
-
if (!set) {
|
|
85
|
-
set = /* @__PURE__ */ new Set();
|
|
86
|
-
this.listeners.set(type, set);
|
|
87
|
-
}
|
|
88
|
-
set.add(listener);
|
|
89
|
-
};
|
|
90
|
-
removeListener = (type, listener) => {
|
|
91
|
-
this.listeners.get(type)?.delete(listener);
|
|
92
|
-
};
|
|
93
|
-
emit = (type, ...args) => {
|
|
94
|
-
return Promise.all(
|
|
95
|
-
[...this.listeners.get(type) || []].map(
|
|
96
|
-
(l) => new Promise((resolve, reject) => {
|
|
97
|
-
try {
|
|
98
|
-
resolve(l(...args));
|
|
99
|
-
} catch (e) {
|
|
100
|
-
reject(e);
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
)
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
7
|
|
|
108
|
-
|
|
109
|
-
var DEFAULT_PROPS = {
|
|
110
|
-
text: null,
|
|
111
|
-
icon: null,
|
|
112
|
-
mode: "normal",
|
|
113
|
-
error: null
|
|
114
|
-
};
|
|
115
|
-
var Button = class extends Base {
|
|
116
|
-
/** @hidden */
|
|
117
|
-
events = new EventEmitter();
|
|
118
|
-
constructor(props) {
|
|
119
|
-
super(DEFAULT_PROPS, props);
|
|
120
|
-
}
|
|
121
|
-
addListener = this.events.addListener;
|
|
122
|
-
removeListener = this.events.removeListener;
|
|
123
|
-
setText = (text) => {
|
|
124
|
-
this.updateProps({ text });
|
|
125
|
-
return this;
|
|
126
|
-
};
|
|
127
|
-
setIcon = (icon) => {
|
|
128
|
-
this.updateProps({ icon: icon ?? null });
|
|
129
|
-
return this;
|
|
130
|
-
};
|
|
131
|
-
setMode = (mode) => {
|
|
132
|
-
this.updateProps({
|
|
133
|
-
mode,
|
|
134
|
-
error: null
|
|
135
|
-
});
|
|
136
|
-
return this;
|
|
137
|
-
};
|
|
138
|
-
/** @hidden */
|
|
139
|
-
getProtoInfo = (idMap) => {
|
|
140
|
-
return {
|
|
141
|
-
component: "button",
|
|
142
|
-
key: idMap.getId(this),
|
|
143
|
-
text: this.props.text || "",
|
|
144
|
-
state: this.props.error ? { state: "error", error: this.props.error } : { state: this.props.mode },
|
|
145
|
-
icon: this.props.icon ?? void 0
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
/** @hidden */
|
|
149
|
-
handleMessage = (message) => {
|
|
150
|
-
if (message.component === "button") {
|
|
151
|
-
this.events.emit("click").then(() => {
|
|
152
|
-
if (this.props.error) {
|
|
153
|
-
this.updateProps({
|
|
154
|
-
error: null
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}).catch((e) => {
|
|
158
|
-
this.updateProps({
|
|
159
|
-
error: `${e}`
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
166
|
-
0 && (module.exports = {
|
|
167
|
-
Button
|
|
168
|
-
});
|
|
8
|
+
exports.Button = _chunkJ46AJUGEjs.Button;
|
|
@@ -3,6 +3,7 @@ import { GroupComponentStyle } from '@arcanejs/protocol/styles';
|
|
|
3
3
|
import { IDMap } from '../util/index.mjs';
|
|
4
4
|
import { BaseParent, Listenable } from './base.mjs';
|
|
5
5
|
import { Button } from './button.mjs';
|
|
6
|
+
import '@arcanejs/protocol/logging';
|
|
6
7
|
|
|
7
8
|
type Label = (proto.GroupComponent['labels'] & Array<unknown>)[number];
|
|
8
9
|
type GroupOptions = {
|
|
@@ -3,6 +3,7 @@ import { GroupComponentStyle } from '@arcanejs/protocol/styles';
|
|
|
3
3
|
import { IDMap } from '../util/index.js';
|
|
4
4
|
import { BaseParent, Listenable } from './base.js';
|
|
5
5
|
import { Button } from './button.js';
|
|
6
|
+
import '@arcanejs/protocol/logging';
|
|
6
7
|
|
|
7
8
|
type Label = (proto.GroupComponent['labels'] & Array<unknown>)[number];
|
|
8
9
|
type GroupOptions = {
|