@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,284 +1,10 @@
|
|
|
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
|
-
// src/backend/components/group.ts
|
|
21
|
-
var group_exports = {};
|
|
22
|
-
__export(group_exports, {
|
|
23
|
-
Group: () => Group,
|
|
24
|
-
GroupHeader: () => GroupHeader
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(group_exports);
|
|
27
3
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
parent = null;
|
|
32
|
-
/** @hidden */
|
|
33
|
-
defaultProps;
|
|
34
|
-
/** @hidden */
|
|
35
|
-
_props;
|
|
36
|
-
constructor(defaultProps, props) {
|
|
37
|
-
this.defaultProps = defaultProps;
|
|
38
|
-
this._props = Object.freeze({
|
|
39
|
-
...defaultProps,
|
|
40
|
-
...props
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
get props() {
|
|
44
|
-
return this._props;
|
|
45
|
-
}
|
|
46
|
-
set props(props) {
|
|
47
|
-
this.setProps(props);
|
|
48
|
-
}
|
|
49
|
-
setProps = (props) => {
|
|
50
|
-
this._props = Object.freeze({
|
|
51
|
-
...this.defaultProps,
|
|
52
|
-
...props
|
|
53
|
-
});
|
|
54
|
-
this.updateTree();
|
|
55
|
-
};
|
|
56
|
-
updateProps = (updates) => {
|
|
57
|
-
this._props = Object.freeze({
|
|
58
|
-
...this._props,
|
|
59
|
-
...updates
|
|
60
|
-
});
|
|
61
|
-
this.updateTree();
|
|
62
|
-
};
|
|
63
|
-
/** @hidden */
|
|
64
|
-
setParent(parent) {
|
|
65
|
-
if (this.parent && this.parent !== parent) {
|
|
66
|
-
this.parent.removeChild(this);
|
|
67
|
-
}
|
|
68
|
-
this.parent = parent;
|
|
69
|
-
}
|
|
70
|
-
/** @hidden */
|
|
71
|
-
updateTree() {
|
|
72
|
-
if (this.parent) this.parent.updateTree();
|
|
73
|
-
}
|
|
74
|
-
/** @hidden */
|
|
75
|
-
handleMessage(message) {
|
|
76
|
-
console.log("Component Received Message:", message);
|
|
77
|
-
}
|
|
78
|
-
routeMessage(_idMap, _message) {
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
var BaseParent = class extends Base {
|
|
82
|
-
/** @hidden */
|
|
83
|
-
children = [];
|
|
84
|
-
appendChildren = (...children) => {
|
|
85
|
-
for (const c of children) {
|
|
86
|
-
const newChildren = [...this.children.filter((ch) => ch !== c), c];
|
|
87
|
-
this.validateChildren(newChildren);
|
|
88
|
-
this.children = Object.freeze(newChildren);
|
|
89
|
-
c.setParent(this);
|
|
90
|
-
}
|
|
91
|
-
this.updateTree();
|
|
92
|
-
return children;
|
|
93
|
-
};
|
|
94
|
-
appendChild = (child) => {
|
|
95
|
-
this.appendChildren(child);
|
|
96
|
-
return child;
|
|
97
|
-
};
|
|
98
|
-
removeChild = (component) => {
|
|
99
|
-
const match = this.children.findIndex((c) => c === component);
|
|
100
|
-
if (match >= 0) {
|
|
101
|
-
const removingChild = this.children[match];
|
|
102
|
-
const newChildren = [
|
|
103
|
-
...this.children.slice(0, match),
|
|
104
|
-
...this.children.slice(match + 1)
|
|
105
|
-
];
|
|
106
|
-
this.validateChildren(newChildren);
|
|
107
|
-
this.children = Object.freeze(newChildren);
|
|
108
|
-
removingChild?.setParent(null);
|
|
109
|
-
this.updateTree();
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
removeAllChildren = () => {
|
|
113
|
-
this.children.map((c) => c.setParent(null));
|
|
114
|
-
this.children = Object.freeze([]);
|
|
115
|
-
this.updateTree();
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Return all children components that messages need to be routed to
|
|
119
|
-
*/
|
|
120
|
-
getChildren = () => this.children;
|
|
121
|
-
/**
|
|
122
|
-
* TODO: we can do this better, right now it broadcasts the message to all
|
|
123
|
-
* components of the tree
|
|
124
|
-
*
|
|
125
|
-
* @hidden
|
|
126
|
-
*/
|
|
127
|
-
routeMessage(idMap, message) {
|
|
128
|
-
if (idMap.getId(this) === message.componentKey) {
|
|
129
|
-
this.handleMessage(message);
|
|
130
|
-
} else {
|
|
131
|
-
for (const c of this.children) {
|
|
132
|
-
if (idMap.getId(c) === message.componentKey) {
|
|
133
|
-
c.handleMessage(message);
|
|
134
|
-
} else {
|
|
135
|
-
c.routeMessage(idMap, message);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
insertBefore(child, beforeChild) {
|
|
141
|
-
const filteredChildren = this.children.filter((c) => c !== child);
|
|
142
|
-
let match = filteredChildren.findIndex((c) => c === beforeChild);
|
|
143
|
-
console.log("match", match);
|
|
144
|
-
if (match === -1) {
|
|
145
|
-
match = filteredChildren.length;
|
|
146
|
-
}
|
|
147
|
-
const newChildren = [
|
|
148
|
-
...filteredChildren.slice(0, match),
|
|
149
|
-
child,
|
|
150
|
-
...filteredChildren.slice(match)
|
|
151
|
-
];
|
|
152
|
-
this.validateChildren(newChildren);
|
|
153
|
-
this.children = Object.freeze(newChildren);
|
|
154
|
-
child.setParent(this);
|
|
155
|
-
this.updateTree();
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var EventEmitter = class {
|
|
159
|
-
listeners = /* @__PURE__ */ new Map();
|
|
160
|
-
addListener = (type, listener) => {
|
|
161
|
-
let set = this.listeners.get(type);
|
|
162
|
-
if (!set) {
|
|
163
|
-
set = /* @__PURE__ */ new Set();
|
|
164
|
-
this.listeners.set(type, set);
|
|
165
|
-
}
|
|
166
|
-
set.add(listener);
|
|
167
|
-
};
|
|
168
|
-
removeListener = (type, listener) => {
|
|
169
|
-
this.listeners.get(type)?.delete(listener);
|
|
170
|
-
};
|
|
171
|
-
emit = (type, ...args) => {
|
|
172
|
-
return Promise.all(
|
|
173
|
-
[...this.listeners.get(type) || []].map(
|
|
174
|
-
(l) => new Promise((resolve, reject) => {
|
|
175
|
-
try {
|
|
176
|
-
resolve(l(...args));
|
|
177
|
-
} catch (e) {
|
|
178
|
-
reject(e);
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
)
|
|
182
|
-
);
|
|
183
|
-
};
|
|
184
|
-
};
|
|
4
|
+
var _chunkQUA3NBLDjs = require('../../chunk-QUA3NBLD.js');
|
|
5
|
+
require('../../chunk-NZUYU32Z.js');
|
|
6
|
+
require('../../chunk-3RG5ZIWI.js');
|
|
185
7
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
var DEFAULT_PROPS = {
|
|
191
|
-
...GROUP_DEFAULT_STYLE,
|
|
192
|
-
title: null,
|
|
193
|
-
labels: null
|
|
194
|
-
};
|
|
195
|
-
var GroupHeader = class extends BaseParent {
|
|
196
|
-
validateChildren = () => {
|
|
197
|
-
};
|
|
198
|
-
/** @hidden */
|
|
199
|
-
getProtoInfo = (idMap) => ({
|
|
200
|
-
component: "group-header",
|
|
201
|
-
key: idMap.getId(this),
|
|
202
|
-
children: this.getChildren().map((c) => c.getProtoInfo(idMap))
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
var Group = class extends BaseParent {
|
|
206
|
-
/** @hidden */
|
|
207
|
-
events = new EventEmitter();
|
|
208
|
-
constructor(props) {
|
|
209
|
-
super(DEFAULT_PROPS, props);
|
|
210
|
-
}
|
|
211
|
-
addListener = this.events.addListener;
|
|
212
|
-
removeListener = this.events.removeListener;
|
|
213
|
-
validateChildren = () => {
|
|
214
|
-
};
|
|
215
|
-
setOptions = (options) => {
|
|
216
|
-
this.updateProps(options);
|
|
217
|
-
};
|
|
218
|
-
setTitle = (title) => {
|
|
219
|
-
this.updateProps({ title });
|
|
220
|
-
};
|
|
221
|
-
addLabel = (label) => {
|
|
222
|
-
this.updateProps({ labels: [...this.props.labels || [], label] });
|
|
223
|
-
};
|
|
224
|
-
setLabels = (labels) => {
|
|
225
|
-
this.updateProps({ labels });
|
|
226
|
-
};
|
|
227
|
-
addHeaderChild = (child) => {
|
|
228
|
-
const header = new GroupHeader({});
|
|
229
|
-
header.appendChild(child);
|
|
230
|
-
this.appendChild(header);
|
|
231
|
-
return child;
|
|
232
|
-
};
|
|
233
|
-
removeHeaderChild = (child) => {
|
|
234
|
-
for (const c of this.getChildren()) {
|
|
235
|
-
if (c instanceof GroupHeader) {
|
|
236
|
-
c.removeChild(child);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
removeAllHeaderChildren = () => {
|
|
241
|
-
for (const child of this.getChildren()) {
|
|
242
|
-
if (child instanceof GroupHeader) {
|
|
243
|
-
child.removeAllChildren();
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
/** @hidden */
|
|
248
|
-
getProtoInfo = (idMap) => {
|
|
249
|
-
const children = [];
|
|
250
|
-
const headers = [];
|
|
251
|
-
for (const c of this.getChildren()) {
|
|
252
|
-
const childProto = c.getProtoInfo(idMap);
|
|
253
|
-
if (childProto.component === "group-header") {
|
|
254
|
-
headers.push(childProto);
|
|
255
|
-
} else {
|
|
256
|
-
children.push(childProto);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return {
|
|
260
|
-
component: "group",
|
|
261
|
-
key: idMap.getId(this),
|
|
262
|
-
title: this.props.title ?? void 0,
|
|
263
|
-
direction: this.props.direction,
|
|
264
|
-
border: this.props.border,
|
|
265
|
-
wrap: this.props.wrap,
|
|
266
|
-
children,
|
|
267
|
-
headers: headers.length > 0 ? headers : void 0,
|
|
268
|
-
labels: this.props.labels ?? void 0,
|
|
269
|
-
editableTitle: this.props.editableTitle || false,
|
|
270
|
-
defaultCollapsibleState: this.props.defaultCollapsibleState
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
/** @hidden */
|
|
274
|
-
handleMessage = (message) => {
|
|
275
|
-
if (message.component === "group") {
|
|
276
|
-
this.events.emit("title-changed", message.title);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
281
|
-
0 && (module.exports = {
|
|
282
|
-
Group,
|
|
283
|
-
GroupHeader
|
|
284
|
-
});
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.Group = _chunkQUA3NBLDjs.Group; exports.GroupHeader = _chunkQUA3NBLDjs.GroupHeader;
|
|
@@ -2,6 +2,7 @@ import * as proto from '@arcanejs/protocol';
|
|
|
2
2
|
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
3
|
import { IDMap } from '../util/index.mjs';
|
|
4
4
|
import { Base } from './base.mjs';
|
|
5
|
+
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type InternalProps = LabelComponentStyle & {
|
|
7
8
|
text: string | null;
|
|
@@ -2,6 +2,7 @@ import * as proto from '@arcanejs/protocol';
|
|
|
2
2
|
import { LabelComponentStyle } from '@arcanejs/protocol/styles';
|
|
3
3
|
import { IDMap } from '../util/index.js';
|
|
4
4
|
import { Base } from './base.js';
|
|
5
|
+
import '@arcanejs/protocol/logging';
|
|
5
6
|
|
|
6
7
|
type InternalProps = LabelComponentStyle & {
|
|
7
8
|
text: string | null;
|
|
@@ -1,105 +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
|
-
Label: () => Label
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(label_exports);
|
|
3
|
+
var _chunkTSC5C5XRjs = require('../../chunk-TSC5C5XR.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
7
|
|
|
81
|
-
|
|
82
|
-
var Label = class extends Base {
|
|
83
|
-
constructor(props) {
|
|
84
|
-
super({ text: null }, props);
|
|
85
|
-
}
|
|
86
|
-
/** @hidden */
|
|
87
|
-
getProtoInfo(idMap) {
|
|
88
|
-
return {
|
|
89
|
-
component: "label",
|
|
90
|
-
key: idMap.getId(this),
|
|
91
|
-
bold: this.props.bold,
|
|
92
|
-
text: this.props.text ?? ""
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
setText(text) {
|
|
96
|
-
this.updateProps({
|
|
97
|
-
text
|
|
98
|
-
});
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
-
0 && (module.exports = {
|
|
104
|
-
Label
|
|
105
|
-
});
|
|
8
|
+
exports.Label = _chunkTSC5C5XRjs.Label;
|
|
@@ -1,105 +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
|
-
Rect: () => Rect
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(rect_exports);
|
|
3
|
+
var _chunkWIPEQNWRjs = require('../../chunk-WIPEQNWR.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
7
|
|
|
81
|
-
|
|
82
|
-
var DEFAULT_PROPS = {
|
|
83
|
-
color: "rgba(0, 0, 0, 0)"
|
|
84
|
-
};
|
|
85
|
-
var Rect = class extends Base {
|
|
86
|
-
constructor(props) {
|
|
87
|
-
super(DEFAULT_PROPS, props);
|
|
88
|
-
}
|
|
89
|
-
/** @hidden */
|
|
90
|
-
getProtoInfo(idMap) {
|
|
91
|
-
return {
|
|
92
|
-
component: "rect",
|
|
93
|
-
key: idMap.getId(this),
|
|
94
|
-
color: this.props.color
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
setColor(color) {
|
|
98
|
-
this.updateProps({ color });
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
-
0 && (module.exports = {
|
|
104
|
-
Rect
|
|
105
|
-
});
|
|
8
|
+
exports.Rect = _chunkWIPEQNWRjs.Rect;
|