@awesome-flow/ecs 0.9.3 → 0.9.5
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/index.cjs +513 -1233
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +92 -56
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +92 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +472 -1226
- package/dist/index.js.map +1 -0
- package/package.json +13 -14
package/dist/index.cjs
CHANGED
|
@@ -1,1291 +1,571 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
const react = __toESM(require("react"));
|
|
25
|
+
const __awesome_flow_core_layout = __toESM(require("@awesome-flow/core/layout"));
|
|
26
|
+
const __mantine_core = __toESM(require("@mantine/core"));
|
|
27
|
+
const __mantine_hooks = __toESM(require("@mantine/hooks"));
|
|
28
|
+
const react_inspector = __toESM(require("react-inspector"));
|
|
29
|
+
const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
|
|
30
|
+
const __awesome_ecs_abstract_systems = __toESM(require("@awesome-ecs/abstract/systems"));
|
|
31
|
+
const __xyflow_react = __toESM(require("@xyflow/react"));
|
|
32
|
+
const __awesome_flow_core_canvas = __toESM(require("@awesome-flow/core/canvas"));
|
|
33
|
+
const __awesome_flow_core_abstract = __toESM(require("@awesome-flow/core/abstract"));
|
|
34
|
+
const __awesome_flow_core_hooks = __toESM(require("@awesome-flow/core/hooks"));
|
|
35
|
+
|
|
36
|
+
//#region src/abstract/ecs-flow-context.ts
|
|
37
|
+
const EcsFlowContext = (0, react.createContext)(null);
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/utils/id-generator.ts
|
|
6
41
|
var EcsIdGenerator = class {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
42
|
+
static entityProxy(proxy) {
|
|
43
|
+
return `${proxy.entityType}:${proxy.entityUid}`;
|
|
44
|
+
}
|
|
10
45
|
};
|
|
11
46
|
|
|
12
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/abstract/ecs-flow-repository.ts
|
|
13
49
|
var EcsFlowRepository = class {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
nodes;
|
|
51
|
+
constructor() {
|
|
52
|
+
this.nodes = new Map();
|
|
53
|
+
}
|
|
54
|
+
get sizeNodes() {
|
|
55
|
+
return this.nodes.size;
|
|
56
|
+
}
|
|
57
|
+
addSystemModuleNode(node) {
|
|
58
|
+
this.nodes.set(node.data.entityType.toString(), node);
|
|
59
|
+
}
|
|
60
|
+
getSystemModuleNode(entityType) {
|
|
61
|
+
return this.nodes.get(entityType.toString());
|
|
62
|
+
}
|
|
63
|
+
addEntityNode(node) {
|
|
64
|
+
this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);
|
|
65
|
+
}
|
|
66
|
+
getEntityNode(entity) {
|
|
67
|
+
return this.nodes.get(EcsIdGenerator.entityProxy(entity));
|
|
68
|
+
}
|
|
69
|
+
listAllNodes() {
|
|
70
|
+
return Array.from(this.nodes.values());
|
|
71
|
+
}
|
|
36
72
|
};
|
|
37
73
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// src/nodes/node-entity.tsx
|
|
46
|
-
var _compilerruntime = require('react/compiler-runtime');
|
|
47
|
-
var _layout = require('@awesome-flow/core/layout');
|
|
48
|
-
var _core = require('@mantine/core');
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// src/components/formatter-camel-case.tsx
|
|
52
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/abstract/handle-types.ts
|
|
76
|
+
let EcsHandleDataType = /* @__PURE__ */ function(EcsHandleDataType$1) {
|
|
77
|
+
EcsHandleDataType$1["proxy"] = "proxy";
|
|
78
|
+
EcsHandleDataType$1["module"] = "module";
|
|
79
|
+
return EcsHandleDataType$1;
|
|
80
|
+
}({});
|
|
53
81
|
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/formatter-camel-case.tsx
|
|
54
84
|
function CamelCaseFormatter(props) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
let t1;
|
|
58
|
-
if ($[0] !== props.value) {
|
|
59
|
-
t1 = _optionalChain([props, 'access', _ => _.value, 'optionalAccess', _2 => _2.toString, 'call', _3 => _3(), 'access', _4 => _4.replace, 'call', _5 => _5(/([a-z])([A-Z])/g, "$1 $2")]);
|
|
60
|
-
$[0] = props.value;
|
|
61
|
-
$[1] = t1;
|
|
62
|
-
} else {
|
|
63
|
-
t1 = $[1];
|
|
64
|
-
}
|
|
65
|
-
t0 = t1;
|
|
66
|
-
const value = t0;
|
|
67
|
-
return value;
|
|
85
|
+
const value = (0, react.useMemo)(() => props.value?.toString().replace(/([a-z])([A-Z])/g, "$1 $2"), [props.value]);
|
|
86
|
+
return value;
|
|
68
87
|
}
|
|
69
|
-
var formatter_camel_case_default =
|
|
70
|
-
|
|
71
|
-
// src/layout/entity-layout.tsx
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// src/components/entity-component-list.tsx
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// src/components/entity-component-inspector.tsx
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var _hooks = require('@mantine/hooks');
|
|
88
|
+
var formatter_camel_case_default = (0, react.memo)(CamelCaseFormatter);
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var _reactinspector = require('react-inspector');
|
|
91
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/components/object-inspector.tsx
|
|
92
92
|
function ObjectInspector(props) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
t1 = $[2];
|
|
106
|
-
}
|
|
107
|
-
return t1;
|
|
108
|
-
}
|
|
109
|
-
var object_inspector_default = _react.memo.call(void 0, ObjectInspector);
|
|
110
|
-
|
|
111
|
-
// src/components/entity-component-inspector.tsx
|
|
112
|
-
|
|
93
|
+
const colorScheme = (0, __mantine_core.useComputedColorScheme)();
|
|
94
|
+
const theme = (0, react.useMemo)(() => colorScheme === "dark" ? "chromeDark" : "chromeLight", [colorScheme]);
|
|
95
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_inspector.Inspector, {
|
|
96
|
+
table: false,
|
|
97
|
+
theme,
|
|
98
|
+
data: props.data
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
var object_inspector_default = (0, react.memo)(ObjectInspector);
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/entity-component-inspector.tsx
|
|
113
105
|
function EntityComponentInspector(props) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
let t3;
|
|
133
|
-
if ($[4] !== opened || $[5] !== props.component) {
|
|
134
|
-
t3 = opened && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, object_inspector_default, { data: props.component });
|
|
135
|
-
$[4] = opened;
|
|
136
|
-
$[5] = props.component;
|
|
137
|
-
$[6] = t3;
|
|
138
|
-
} else {
|
|
139
|
-
t3 = $[6];
|
|
140
|
-
}
|
|
141
|
-
let t4;
|
|
142
|
-
if ($[7] !== opened || $[8] !== t3) {
|
|
143
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Collapse, { in: opened, children: t3 });
|
|
144
|
-
$[7] = opened;
|
|
145
|
-
$[8] = t3;
|
|
146
|
-
$[9] = t4;
|
|
147
|
-
} else {
|
|
148
|
-
t4 = $[9];
|
|
149
|
-
}
|
|
150
|
-
let t5;
|
|
151
|
-
if ($[10] !== t2 || $[11] !== t4) {
|
|
152
|
-
t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Box, { children: [
|
|
153
|
-
t2,
|
|
154
|
-
t4
|
|
155
|
-
] });
|
|
156
|
-
$[10] = t2;
|
|
157
|
-
$[11] = t4;
|
|
158
|
-
$[12] = t5;
|
|
159
|
-
} else {
|
|
160
|
-
t5 = $[12];
|
|
161
|
-
}
|
|
162
|
-
return t5;
|
|
163
|
-
}
|
|
164
|
-
var entity_component_inspector_default = _react.memo.call(void 0, EntityComponentInspector);
|
|
165
|
-
|
|
166
|
-
// src/components/entity-component-list.tsx
|
|
167
|
-
|
|
106
|
+
const [opened, { toggle }] = (0, __mantine_hooks.useDisclosure)(false);
|
|
107
|
+
const buttonColor = (0, react.useMemo)(() => opened ? "light" : "indigo", [opened]);
|
|
108
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Box, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Button, {
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "xs",
|
|
111
|
+
onClick: toggle,
|
|
112
|
+
color: buttonColor,
|
|
113
|
+
fullWidth: true,
|
|
114
|
+
children: props.component.componentType
|
|
115
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Collapse, {
|
|
116
|
+
in: opened,
|
|
117
|
+
children: opened && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(object_inspector_default, { data: props.component })
|
|
118
|
+
})] });
|
|
119
|
+
}
|
|
120
|
+
var entity_component_inspector_default = (0, react.memo)(EntityComponentInspector);
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/entity-component-list.tsx
|
|
168
124
|
function EntityComponentList(props) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
} else {
|
|
185
|
-
t1 = $[3];
|
|
186
|
-
}
|
|
187
|
-
let t2;
|
|
188
|
-
if ($[4] !== components) {
|
|
189
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Panel, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: components.map(_temp) }) });
|
|
190
|
-
$[4] = components;
|
|
191
|
-
$[5] = t2;
|
|
192
|
-
} else {
|
|
193
|
-
t2 = $[5];
|
|
194
|
-
}
|
|
195
|
-
let t3;
|
|
196
|
-
if ($[6] !== t1 || $[7] !== t2) {
|
|
197
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion.Item, { value: "components", children: [
|
|
198
|
-
t1,
|
|
199
|
-
t2
|
|
200
|
-
] }, "components");
|
|
201
|
-
$[6] = t1;
|
|
202
|
-
$[7] = t2;
|
|
203
|
-
$[8] = t3;
|
|
204
|
-
} else {
|
|
205
|
-
t3 = $[8];
|
|
206
|
-
}
|
|
207
|
-
return t3;
|
|
208
|
-
}
|
|
209
|
-
function _temp(c, i) {
|
|
210
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_component_inspector_default, { component: c }, i);
|
|
211
|
-
}
|
|
212
|
-
var entity_component_list_default = _react.memo.call(void 0, EntityComponentList);
|
|
213
|
-
|
|
214
|
-
// src/components/entity-proxy-list.tsx
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// src/components/badge-list.tsx
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
125
|
+
const components = Array.from(props.entity.components.values());
|
|
126
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion.Item, {
|
|
127
|
+
value: "components",
|
|
128
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Control, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
129
|
+
fullWidth: true,
|
|
130
|
+
variant: "light",
|
|
131
|
+
rightSection: components.length,
|
|
132
|
+
children: "Components"
|
|
133
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Panel, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Stack, { children: components.map((c, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_component_inspector_default, { component: c }, i)) }) })]
|
|
134
|
+
}, "components");
|
|
135
|
+
}
|
|
136
|
+
var entity_component_list_default = (0, react.memo)(EntityComponentList);
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/components/badge-list.tsx
|
|
223
140
|
function BadgeList(props) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
141
|
+
return props.items.map((value, i) => {
|
|
142
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
143
|
+
...props.badge || [],
|
|
144
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(formatter_camel_case_default, { value })
|
|
145
|
+
}, i);
|
|
146
|
+
});
|
|
227
147
|
}
|
|
228
|
-
var badge_list_default =
|
|
229
|
-
|
|
230
|
-
// src/components/entity-proxy-list.tsx
|
|
148
|
+
var badge_list_default = (0, react.memo)(BadgeList);
|
|
231
149
|
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/components/entity-proxy-list.tsx
|
|
232
152
|
function EntityProxyList(props) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
254
|
-
t2 = {
|
|
255
|
-
variant: "outline"
|
|
256
|
-
};
|
|
257
|
-
$[4] = t2;
|
|
258
|
-
} else {
|
|
259
|
-
t2 = $[4];
|
|
260
|
-
}
|
|
261
|
-
let t3;
|
|
262
|
-
if ($[5] !== items) {
|
|
263
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Panel, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, badge_list_default, { items, badge: t2 }) }) });
|
|
264
|
-
$[5] = items;
|
|
265
|
-
$[6] = t3;
|
|
266
|
-
} else {
|
|
267
|
-
t3 = $[6];
|
|
268
|
-
}
|
|
269
|
-
let t4;
|
|
270
|
-
if ($[7] !== t1 || $[8] !== t3) {
|
|
271
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion.Item, { value: "proxies", children: [
|
|
272
|
-
t1,
|
|
273
|
-
t3
|
|
274
|
-
] }, "proxies");
|
|
275
|
-
$[7] = t1;
|
|
276
|
-
$[8] = t3;
|
|
277
|
-
$[9] = t4;
|
|
278
|
-
} else {
|
|
279
|
-
t4 = $[9];
|
|
280
|
-
}
|
|
281
|
-
return t4;
|
|
282
|
-
}
|
|
283
|
-
function _temp3(p) {
|
|
284
|
-
return Array.from(p).map(_temp2);
|
|
285
|
-
}
|
|
286
|
-
function _temp2(k) {
|
|
287
|
-
return EcsIdGenerator.entityProxy(k);
|
|
288
|
-
}
|
|
289
|
-
function _temp4(c) {
|
|
290
|
-
return c.values();
|
|
291
|
-
}
|
|
292
|
-
var entity_proxy_list_default = _react.memo.call(void 0, EntityProxyList);
|
|
293
|
-
|
|
294
|
-
// src/components/entity-subscription-list.tsx
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
153
|
+
const { entityProxyRepository } = (0, react.useContext)(EcsFlowContext);
|
|
154
|
+
const proxies = Array.from(entityProxyRepository.getAll(props.entity.myProxy).values()).flat();
|
|
155
|
+
const items = proxies.map((p) => EcsIdGenerator.entityProxy(p));
|
|
156
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion.Item, {
|
|
157
|
+
value: "proxies",
|
|
158
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Control, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
159
|
+
fullWidth: true,
|
|
160
|
+
variant: "light",
|
|
161
|
+
rightSection: items.length,
|
|
162
|
+
children: "Proxies"
|
|
163
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Panel, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Stack, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(badge_list_default, {
|
|
164
|
+
items,
|
|
165
|
+
badge: { variant: "outline" }
|
|
166
|
+
}) }) })]
|
|
167
|
+
}, "proxies");
|
|
168
|
+
}
|
|
169
|
+
var entity_proxy_list_default = (0, react.memo)(EntityProxyList);
|
|
170
|
+
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/components/entity-subscription-list.tsx
|
|
299
173
|
function EntitySubscriptionList(props) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
} else {
|
|
320
|
-
t1 = $[4];
|
|
321
|
-
}
|
|
322
|
-
let t2;
|
|
323
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
324
|
-
t2 = {
|
|
325
|
-
variant: "outline"
|
|
326
|
-
};
|
|
327
|
-
$[5] = t2;
|
|
328
|
-
} else {
|
|
329
|
-
t2 = $[5];
|
|
330
|
-
}
|
|
331
|
-
let t3;
|
|
332
|
-
if ($[6] !== subscriptions) {
|
|
333
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Panel, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, badge_list_default, { items: subscriptions, badge: t2 }) }) });
|
|
334
|
-
$[6] = subscriptions;
|
|
335
|
-
$[7] = t3;
|
|
336
|
-
} else {
|
|
337
|
-
t3 = $[7];
|
|
338
|
-
}
|
|
339
|
-
let t4;
|
|
340
|
-
if ($[8] !== t1 || $[9] !== t3) {
|
|
341
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion.Item, { value: "subscriptions", children: [
|
|
342
|
-
t1,
|
|
343
|
-
t3
|
|
344
|
-
] }, "subscriptions");
|
|
345
|
-
$[8] = t1;
|
|
346
|
-
$[9] = t3;
|
|
347
|
-
$[10] = t4;
|
|
348
|
-
} else {
|
|
349
|
-
t4 = $[10];
|
|
350
|
-
}
|
|
351
|
-
return t4;
|
|
352
|
-
}
|
|
353
|
-
var entity_subscription_list_default = _react.memo.call(void 0, EntitySubscriptionList);
|
|
354
|
-
|
|
355
|
-
// src/components/entity-update-counter.tsx
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
174
|
+
const { entityEventsManager } = (0, react.useContext)(EcsFlowContext);
|
|
175
|
+
const subscriptions = entityEventsManager.getSubscriptionsForEntity(props.entity.myProxy);
|
|
176
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion.Item, {
|
|
177
|
+
value: "subscriptions",
|
|
178
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Control, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
179
|
+
fullWidth: true,
|
|
180
|
+
variant: "light",
|
|
181
|
+
rightSection: subscriptions.length,
|
|
182
|
+
children: "Events"
|
|
183
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Panel, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Stack, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(badge_list_default, {
|
|
184
|
+
items: subscriptions,
|
|
185
|
+
badge: { variant: "outline" }
|
|
186
|
+
}) }) })]
|
|
187
|
+
}, "subscriptions");
|
|
188
|
+
}
|
|
189
|
+
var entity_subscription_list_default = (0, react.memo)(EntitySubscriptionList);
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/components/entity-update-counter.tsx
|
|
360
193
|
function EntityUpdateCounter(props) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
let t3;
|
|
403
|
-
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
404
|
-
t3 = [];
|
|
405
|
-
$[8] = t3;
|
|
406
|
-
} else {
|
|
407
|
-
t3 = $[8];
|
|
408
|
-
}
|
|
409
|
-
_react.useEffect.call(void 0, t2, t3);
|
|
410
|
-
let t4;
|
|
411
|
-
if ($[9] !== updates) {
|
|
412
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { variant: "light", children: updates });
|
|
413
|
-
$[9] = updates;
|
|
414
|
-
$[10] = t4;
|
|
415
|
-
} else {
|
|
416
|
-
t4 = $[10];
|
|
417
|
-
}
|
|
418
|
-
let t5;
|
|
419
|
-
if ($[11] !== removes) {
|
|
420
|
-
t5 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { variant: "light", color: "orange", children: removes });
|
|
421
|
-
$[11] = removes;
|
|
422
|
-
$[12] = t5;
|
|
423
|
-
} else {
|
|
424
|
-
t5 = $[12];
|
|
425
|
-
}
|
|
426
|
-
let t6;
|
|
427
|
-
if ($[13] !== t4 || $[14] !== t5) {
|
|
428
|
-
t6 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
429
|
-
t4,
|
|
430
|
-
t5
|
|
431
|
-
] });
|
|
432
|
-
$[13] = t4;
|
|
433
|
-
$[14] = t5;
|
|
434
|
-
$[15] = t6;
|
|
435
|
-
} else {
|
|
436
|
-
t6 = $[15];
|
|
437
|
-
}
|
|
438
|
-
return t6;
|
|
439
|
-
}
|
|
440
|
-
function _temp5(refresh) {
|
|
441
|
-
return refresh + 1;
|
|
442
|
-
}
|
|
443
|
-
var entity_update_counter_default = _react.memo.call(void 0, EntityUpdateCounter);
|
|
444
|
-
|
|
445
|
-
// src/layout/entity-layout.tsx
|
|
446
|
-
|
|
447
|
-
function EntityLayout(t0) {
|
|
448
|
-
const $ = _compilerruntime.c.call(void 0, 8);
|
|
449
|
-
const {
|
|
450
|
-
entity
|
|
451
|
-
} = t0;
|
|
452
|
-
let t1;
|
|
453
|
-
if ($[0] !== entity.myProxy.entityUid) {
|
|
454
|
-
t1 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
|
|
455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { variant: "outline", color: "orange", children: entity.myProxy.entityUid }),
|
|
456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_update_counter_default, { entityUid: entity.myProxy.entityUid })
|
|
457
|
-
] });
|
|
458
|
-
$[0] = entity.myProxy.entityUid;
|
|
459
|
-
$[1] = t1;
|
|
460
|
-
} else {
|
|
461
|
-
t1 = $[1];
|
|
462
|
-
}
|
|
463
|
-
let t2;
|
|
464
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
465
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Divider, { my: 5 });
|
|
466
|
-
$[2] = t2;
|
|
467
|
-
} else {
|
|
468
|
-
t2 = $[2];
|
|
469
|
-
}
|
|
470
|
-
let t3;
|
|
471
|
-
if ($[3] !== entity) {
|
|
472
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion, { children: [
|
|
473
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_component_list_default, { entity }),
|
|
474
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_proxy_list_default, { entity }),
|
|
475
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_subscription_list_default, { entity })
|
|
476
|
-
] });
|
|
477
|
-
$[3] = entity;
|
|
478
|
-
$[4] = t3;
|
|
479
|
-
} else {
|
|
480
|
-
t3 = $[4];
|
|
481
|
-
}
|
|
482
|
-
let t4;
|
|
483
|
-
if ($[5] !== t1 || $[6] !== t3) {
|
|
484
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
485
|
-
t1,
|
|
486
|
-
t2,
|
|
487
|
-
t3
|
|
488
|
-
] });
|
|
489
|
-
$[5] = t1;
|
|
490
|
-
$[6] = t3;
|
|
491
|
-
$[7] = t4;
|
|
492
|
-
} else {
|
|
493
|
-
t4 = $[7];
|
|
494
|
-
}
|
|
495
|
-
return t4;
|
|
194
|
+
const [, setRefresh] = (0, react.useState)(0);
|
|
195
|
+
const { entityUpdateCounter } = (0, react.useContext)(EcsFlowContext);
|
|
196
|
+
const updates = entityUpdateCounter.getUpdateCount(props.entityUid) || 0;
|
|
197
|
+
const removes = entityUpdateCounter.getRemoveCount(props.entityUid) || 0;
|
|
198
|
+
(0, react.useEffect)(() => {
|
|
199
|
+
const interval = setInterval(() => {
|
|
200
|
+
setRefresh((refresh) => refresh + 1);
|
|
201
|
+
}, 1e3);
|
|
202
|
+
return () => {
|
|
203
|
+
console.log("CLEAR INTERVAL");
|
|
204
|
+
clearInterval(interval);
|
|
205
|
+
};
|
|
206
|
+
}, []);
|
|
207
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
208
|
+
variant: "light",
|
|
209
|
+
children: updates
|
|
210
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
211
|
+
variant: "light",
|
|
212
|
+
color: "orange",
|
|
213
|
+
children: removes
|
|
214
|
+
})] });
|
|
215
|
+
}
|
|
216
|
+
var entity_update_counter_default = (0, react.memo)(EntityUpdateCounter);
|
|
217
|
+
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/layout/entity-layout.tsx
|
|
220
|
+
function EntityLayout({ entity }) {
|
|
221
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
222
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Group, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
223
|
+
variant: "outline",
|
|
224
|
+
color: "orange",
|
|
225
|
+
children: entity.myProxy.entityUid
|
|
226
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_update_counter_default, { entityUid: entity.myProxy.entityUid })] }),
|
|
227
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Divider, { my: 5 }),
|
|
228
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion, { children: [
|
|
229
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_component_list_default, { entity }),
|
|
230
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_proxy_list_default, { entity }),
|
|
231
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_subscription_list_default, { entity })
|
|
232
|
+
] })
|
|
233
|
+
] });
|
|
496
234
|
}
|
|
497
235
|
var entity_layout_default = EntityLayout;
|
|
498
236
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
function EntityNode(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
$[0] = data.entity;
|
|
517
|
-
$[1] = entityRepository;
|
|
518
|
-
$[2] = t2;
|
|
519
|
-
} else {
|
|
520
|
-
t2 = $[2];
|
|
521
|
-
}
|
|
522
|
-
t1 = t2;
|
|
523
|
-
const entity = t1;
|
|
524
|
-
let t3;
|
|
525
|
-
if ($[3] !== entity.myProxy.entityType) {
|
|
526
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { fullWidth: true, variant: "transparent", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, formatter_camel_case_default, { value: entity.myProxy.entityType }) });
|
|
527
|
-
$[3] = entity.myProxy.entityType;
|
|
528
|
-
$[4] = t3;
|
|
529
|
-
} else {
|
|
530
|
-
t3 = $[4];
|
|
531
|
-
}
|
|
532
|
-
let t4;
|
|
533
|
-
if ($[5] !== entity) {
|
|
534
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, entity_layout_default, { entity });
|
|
535
|
-
$[5] = entity;
|
|
536
|
-
$[6] = t4;
|
|
537
|
-
} else {
|
|
538
|
-
t4 = $[6];
|
|
539
|
-
}
|
|
540
|
-
let t5;
|
|
541
|
-
if ($[7] !== data || $[8] !== id || $[9] !== selected || $[10] !== t3 || $[11] !== t4 || $[12] !== type) {
|
|
542
|
-
t5 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, title: t3, type, children: t4 });
|
|
543
|
-
$[7] = data;
|
|
544
|
-
$[8] = id;
|
|
545
|
-
$[9] = selected;
|
|
546
|
-
$[10] = t3;
|
|
547
|
-
$[11] = t4;
|
|
548
|
-
$[12] = type;
|
|
549
|
-
$[13] = t5;
|
|
550
|
-
} else {
|
|
551
|
-
t5 = $[13];
|
|
552
|
-
}
|
|
553
|
-
return t5;
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/nodes/node-entity.tsx
|
|
239
|
+
function EntityNode({ id, data, selected, type }) {
|
|
240
|
+
const { entityRepository } = (0, react.useContext)(EcsFlowContext);
|
|
241
|
+
const entity = (0, react.useMemo)(() => entityRepository.get(data.entity), [data.entity, entityRepository]);
|
|
242
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__awesome_flow_core_layout.NodeContainer, {
|
|
243
|
+
id,
|
|
244
|
+
selected,
|
|
245
|
+
data,
|
|
246
|
+
title: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
247
|
+
fullWidth: true,
|
|
248
|
+
variant: "transparent",
|
|
249
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(formatter_camel_case_default, { value: entity.myProxy.entityType })
|
|
250
|
+
}),
|
|
251
|
+
type,
|
|
252
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(entity_layout_default, { entity })
|
|
253
|
+
});
|
|
554
254
|
}
|
|
555
255
|
var node_entity_default = EntityNode;
|
|
556
256
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
// src/layout/systems-module-layout.tsx
|
|
564
|
-
|
|
565
|
-
var _systems = require('@awesome-ecs/abstract/systems');
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
// src/components/pipeline-middleware-list.tsx
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/components/pipeline-middleware-list.tsx
|
|
572
259
|
function PipelineMiddlewareList(props) {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
} else {
|
|
591
|
-
t1 = $[2];
|
|
592
|
-
}
|
|
593
|
-
const components = t1;
|
|
594
|
-
let t2;
|
|
595
|
-
if ($[3] !== components.length || $[4] !== props.label) {
|
|
596
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Control, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { fullWidth: true, variant: "light", rightSection: components.length, children: props.label }) });
|
|
597
|
-
$[3] = components.length;
|
|
598
|
-
$[4] = props.label;
|
|
599
|
-
$[5] = t2;
|
|
600
|
-
} else {
|
|
601
|
-
t2 = $[5];
|
|
602
|
-
}
|
|
603
|
-
let t3;
|
|
604
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
605
|
-
t3 = {
|
|
606
|
-
variant: "outline"
|
|
607
|
-
};
|
|
608
|
-
$[6] = t3;
|
|
609
|
-
} else {
|
|
610
|
-
t3 = $[6];
|
|
611
|
-
}
|
|
612
|
-
let t4;
|
|
613
|
-
if ($[7] !== components) {
|
|
614
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Panel, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, badge_list_default, { items: components, badge: t3 }) }) });
|
|
615
|
-
$[7] = components;
|
|
616
|
-
$[8] = t4;
|
|
617
|
-
} else {
|
|
618
|
-
t4 = $[8];
|
|
619
|
-
}
|
|
620
|
-
let t5;
|
|
621
|
-
if ($[9] !== props.label || $[10] !== t2 || $[11] !== t4) {
|
|
622
|
-
t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion.Item, { value: props.label, children: [
|
|
623
|
-
t2,
|
|
624
|
-
t4
|
|
625
|
-
] }, props.label);
|
|
626
|
-
$[9] = props.label;
|
|
627
|
-
$[10] = t2;
|
|
628
|
-
$[11] = t4;
|
|
629
|
-
$[12] = t5;
|
|
630
|
-
} else {
|
|
631
|
-
t5 = $[12];
|
|
632
|
-
}
|
|
633
|
-
return t5;
|
|
634
|
-
}
|
|
635
|
-
function _temp6(m) {
|
|
636
|
-
return m.name || m.constructor.name;
|
|
260
|
+
let middleware = [];
|
|
261
|
+
if (props.pipeline) middleware = props.pipeline["middleware"];
|
|
262
|
+
const components = middleware.map((m) => {
|
|
263
|
+
return m.name || m.constructor.name;
|
|
264
|
+
});
|
|
265
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion.Item, {
|
|
266
|
+
value: props.label,
|
|
267
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Control, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
268
|
+
fullWidth: true,
|
|
269
|
+
variant: "light",
|
|
270
|
+
rightSection: components.length,
|
|
271
|
+
children: props.label
|
|
272
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Accordion.Panel, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Stack, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(badge_list_default, {
|
|
273
|
+
items: components,
|
|
274
|
+
badge: { variant: "outline" }
|
|
275
|
+
}) }) })]
|
|
276
|
+
}, props.label);
|
|
637
277
|
}
|
|
638
278
|
var pipeline_middleware_list_default = PipelineMiddlewareList;
|
|
639
279
|
|
|
640
|
-
|
|
641
|
-
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/layout/systems-module-layout.tsx
|
|
642
282
|
function SystemsModuleLayout(props) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
t2 = $[3];
|
|
672
|
-
}
|
|
673
|
-
const update = t2;
|
|
674
|
-
let t3;
|
|
675
|
-
if ($[4] !== runtimeContext.systemPipelines) {
|
|
676
|
-
t3 = runtimeContext.systemPipelines.get(_systems.SystemType.render);
|
|
677
|
-
$[4] = runtimeContext.systemPipelines;
|
|
678
|
-
$[5] = t3;
|
|
679
|
-
} else {
|
|
680
|
-
t3 = $[5];
|
|
681
|
-
}
|
|
682
|
-
const render = t3;
|
|
683
|
-
let t4;
|
|
684
|
-
if ($[6] !== runtimeContext.systemPipelines) {
|
|
685
|
-
t4 = runtimeContext.systemPipelines.get(_systems.SystemType.sync);
|
|
686
|
-
$[6] = runtimeContext.systemPipelines;
|
|
687
|
-
$[7] = t4;
|
|
688
|
-
} else {
|
|
689
|
-
t4 = $[7];
|
|
690
|
-
}
|
|
691
|
-
const sync = t4;
|
|
692
|
-
let t5;
|
|
693
|
-
if ($[8] !== status) {
|
|
694
|
-
t5 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { children: [
|
|
695
|
-
"Status: ",
|
|
696
|
-
status
|
|
697
|
-
] });
|
|
698
|
-
$[8] = status;
|
|
699
|
-
$[9] = t5;
|
|
700
|
-
} else {
|
|
701
|
-
t5 = $[9];
|
|
702
|
-
}
|
|
703
|
-
let t6;
|
|
704
|
-
if ($[10] !== init) {
|
|
705
|
-
t6 = init && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, pipeline_middleware_list_default, { pipeline: init, label: "Initialize" });
|
|
706
|
-
$[10] = init;
|
|
707
|
-
$[11] = t6;
|
|
708
|
-
} else {
|
|
709
|
-
t6 = $[11];
|
|
710
|
-
}
|
|
711
|
-
let t7;
|
|
712
|
-
if ($[12] !== update) {
|
|
713
|
-
t7 = update && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, pipeline_middleware_list_default, { pipeline: update, label: "Update" });
|
|
714
|
-
$[12] = update;
|
|
715
|
-
$[13] = t7;
|
|
716
|
-
} else {
|
|
717
|
-
t7 = $[13];
|
|
718
|
-
}
|
|
719
|
-
let t8;
|
|
720
|
-
if ($[14] !== render) {
|
|
721
|
-
t8 = render && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, pipeline_middleware_list_default, { pipeline: render, label: "Render" });
|
|
722
|
-
$[14] = render;
|
|
723
|
-
$[15] = t8;
|
|
724
|
-
} else {
|
|
725
|
-
t8 = $[15];
|
|
726
|
-
}
|
|
727
|
-
let t9;
|
|
728
|
-
if ($[16] !== sync) {
|
|
729
|
-
t9 = sync && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, pipeline_middleware_list_default, { pipeline: sync, label: "Sync" });
|
|
730
|
-
$[16] = sync;
|
|
731
|
-
$[17] = t9;
|
|
732
|
-
} else {
|
|
733
|
-
t9 = $[17];
|
|
734
|
-
}
|
|
735
|
-
let t10;
|
|
736
|
-
if ($[18] !== t6 || $[19] !== t7 || $[20] !== t8 || $[21] !== t9) {
|
|
737
|
-
t10 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Accordion, { children: [
|
|
738
|
-
t6,
|
|
739
|
-
t7,
|
|
740
|
-
t8,
|
|
741
|
-
t9
|
|
742
|
-
] });
|
|
743
|
-
$[18] = t6;
|
|
744
|
-
$[19] = t7;
|
|
745
|
-
$[20] = t8;
|
|
746
|
-
$[21] = t9;
|
|
747
|
-
$[22] = t10;
|
|
748
|
-
} else {
|
|
749
|
-
t10 = $[22];
|
|
750
|
-
}
|
|
751
|
-
let t11;
|
|
752
|
-
if ($[23] !== t10 || $[24] !== t5) {
|
|
753
|
-
t11 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
754
|
-
t5,
|
|
755
|
-
t10
|
|
756
|
-
] });
|
|
757
|
-
$[23] = t10;
|
|
758
|
-
$[24] = t5;
|
|
759
|
-
$[25] = t11;
|
|
760
|
-
} else {
|
|
761
|
-
t11 = $[25];
|
|
762
|
-
}
|
|
763
|
-
return t11;
|
|
283
|
+
const { module: module$1 } = props;
|
|
284
|
+
const runtimeContext = module$1["runtimeContext"];
|
|
285
|
+
const { systemContext } = runtimeContext;
|
|
286
|
+
const { status } = (0, react.useMemo)(() => {
|
|
287
|
+
return systemContext.runtime;
|
|
288
|
+
}, [systemContext.runtime]);
|
|
289
|
+
const init = runtimeContext.systemPipelines.get(__awesome_ecs_abstract_systems.SystemType.initialize);
|
|
290
|
+
const update = runtimeContext.systemPipelines.get(__awesome_ecs_abstract_systems.SystemType.update);
|
|
291
|
+
const render = runtimeContext.systemPipelines.get(__awesome_ecs_abstract_systems.SystemType.render);
|
|
292
|
+
const sync = runtimeContext.systemPipelines.get(__awesome_ecs_abstract_systems.SystemType.sync);
|
|
293
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Text, { children: ["Status: ", status] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__mantine_core.Accordion, { children: [
|
|
294
|
+
init && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(pipeline_middleware_list_default, {
|
|
295
|
+
pipeline: init,
|
|
296
|
+
label: "Initialize"
|
|
297
|
+
}),
|
|
298
|
+
update && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(pipeline_middleware_list_default, {
|
|
299
|
+
pipeline: update,
|
|
300
|
+
label: "Update"
|
|
301
|
+
}),
|
|
302
|
+
render && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(pipeline_middleware_list_default, {
|
|
303
|
+
pipeline: render,
|
|
304
|
+
label: "Render"
|
|
305
|
+
}),
|
|
306
|
+
sync && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(pipeline_middleware_list_default, {
|
|
307
|
+
pipeline: sync,
|
|
308
|
+
label: "Sync"
|
|
309
|
+
})
|
|
310
|
+
] })] });
|
|
764
311
|
}
|
|
765
312
|
var systems_module_layout_default = SystemsModuleLayout;
|
|
766
313
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
function SystemsModuleNode(
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
const module = t1;
|
|
790
|
-
let t2;
|
|
791
|
-
if ($[3] !== data.entityType) {
|
|
792
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { fullWidth: true, color: "indigo", variant: "transparent", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, formatter_camel_case_default, { value: data.entityType }) });
|
|
793
|
-
$[3] = data.entityType;
|
|
794
|
-
$[4] = t2;
|
|
795
|
-
} else {
|
|
796
|
-
t2 = $[4];
|
|
797
|
-
}
|
|
798
|
-
let t3;
|
|
799
|
-
if ($[5] !== data.entityType || $[6] !== module) {
|
|
800
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, systems_module_layout_default, { type: data.entityType, module });
|
|
801
|
-
$[5] = data.entityType;
|
|
802
|
-
$[6] = module;
|
|
803
|
-
$[7] = t3;
|
|
804
|
-
} else {
|
|
805
|
-
t3 = $[7];
|
|
806
|
-
}
|
|
807
|
-
let t4;
|
|
808
|
-
if ($[8] !== data || $[9] !== id || $[10] !== selected || $[11] !== t2 || $[12] !== t3 || $[13] !== type) {
|
|
809
|
-
t4 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeContainer, { id, selected, data, title: t2, type, children: t3 });
|
|
810
|
-
$[8] = data;
|
|
811
|
-
$[9] = id;
|
|
812
|
-
$[10] = selected;
|
|
813
|
-
$[11] = t2;
|
|
814
|
-
$[12] = t3;
|
|
815
|
-
$[13] = type;
|
|
816
|
-
$[14] = t4;
|
|
817
|
-
} else {
|
|
818
|
-
t4 = $[14];
|
|
819
|
-
}
|
|
820
|
-
return t4;
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/nodes/node-systems-module.tsx
|
|
316
|
+
function SystemsModuleNode({ id, data, selected, type }) {
|
|
317
|
+
const { systemsModuleRepository } = (0, react.useContext)(EcsFlowContext);
|
|
318
|
+
const module$1 = systemsModuleRepository.get(data.entityType);
|
|
319
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__awesome_flow_core_layout.NodeContainer, {
|
|
320
|
+
id,
|
|
321
|
+
selected,
|
|
322
|
+
data,
|
|
323
|
+
title: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__mantine_core.Badge, {
|
|
324
|
+
fullWidth: true,
|
|
325
|
+
color: "indigo",
|
|
326
|
+
variant: "transparent",
|
|
327
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(formatter_camel_case_default, { value: data.entityType })
|
|
328
|
+
}),
|
|
329
|
+
type,
|
|
330
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(systems_module_layout_default, {
|
|
331
|
+
type: data.entityType,
|
|
332
|
+
module: module$1
|
|
333
|
+
})
|
|
334
|
+
});
|
|
821
335
|
}
|
|
822
336
|
var node_systems_module_default = SystemsModuleNode;
|
|
823
337
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
]
|
|
856
|
-
}}
|
|
857
|
-
}, _class);
|
|
858
|
-
|
|
859
|
-
// src/templates/template-systems-module.ts
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/abstract/templates.ts
|
|
340
|
+
let EcsTemplateGroup = /* @__PURE__ */ function(EcsTemplateGroup$1) {
|
|
341
|
+
EcsTemplateGroup$1["ecs"] = "ECS";
|
|
342
|
+
return EcsTemplateGroup$1;
|
|
343
|
+
}({});
|
|
344
|
+
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/templates/template-entity-node.ts
|
|
347
|
+
var EntityNodeTemplate = class {
|
|
348
|
+
template = {
|
|
349
|
+
type: EcsNodeType.entity,
|
|
350
|
+
group: EcsTemplateGroup.ecs,
|
|
351
|
+
data: {
|
|
352
|
+
title: "Entity",
|
|
353
|
+
entity: null
|
|
354
|
+
},
|
|
355
|
+
handles: [{
|
|
356
|
+
dataType: EcsHandleDataType.proxy,
|
|
357
|
+
position: __xyflow_react.Position.Left,
|
|
358
|
+
connection: "target",
|
|
359
|
+
disabled: true
|
|
360
|
+
}, {
|
|
361
|
+
dataType: EcsHandleDataType.proxy,
|
|
362
|
+
position: __xyflow_react.Position.Right,
|
|
363
|
+
connection: "source",
|
|
364
|
+
disabled: true
|
|
365
|
+
}]
|
|
366
|
+
};
|
|
367
|
+
};
|
|
860
368
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/templates/template-systems-module.ts
|
|
371
|
+
var SystemsModuleNodeTemplate = class {
|
|
372
|
+
template = {
|
|
373
|
+
type: EcsNodeType.systemsModule,
|
|
374
|
+
group: EcsTemplateGroup.ecs,
|
|
375
|
+
data: {
|
|
376
|
+
title: "Systems Module",
|
|
377
|
+
entityType: null
|
|
378
|
+
},
|
|
379
|
+
handles: [{
|
|
380
|
+
dataType: EcsHandleDataType.module,
|
|
381
|
+
position: __xyflow_react.Position.Left,
|
|
382
|
+
connection: "target",
|
|
383
|
+
disabled: true
|
|
384
|
+
}]
|
|
385
|
+
};
|
|
386
|
+
};
|
|
879
387
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/abstract/node-types.ts
|
|
390
|
+
let EcsNodeType = /* @__PURE__ */ function(EcsNodeType$1) {
|
|
391
|
+
EcsNodeType$1["systemsModule"] = "systems-module-node";
|
|
392
|
+
EcsNodeType$1["entity"] = "entity-node";
|
|
393
|
+
return EcsNodeType$1;
|
|
394
|
+
}({});
|
|
395
|
+
const ecsNodeTypes = {
|
|
396
|
+
[EcsNodeType.systemsModule]: node_systems_module_default,
|
|
397
|
+
[EcsNodeType.entity]: node_entity_default
|
|
889
398
|
};
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
399
|
+
const ecsNodeTemplates = {
|
|
400
|
+
[EcsNodeType.entity]: new EntityNodeTemplate(),
|
|
401
|
+
[EcsNodeType.systemsModule]: new SystemsModuleNodeTemplate()
|
|
893
402
|
};
|
|
894
403
|
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
var _canvas = require('@awesome-flow/core/canvas');
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
// src/flow/flow-ecs-entities.tsx
|
|
901
|
-
|
|
902
|
-
var _abstract = require('@awesome-flow/core/abstract');
|
|
903
|
-
var _hooks3 = require('@awesome-flow/core/hooks');
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
// src/flow/flow-ecs-edge-modules.tsx
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/flow/flow-ecs-edge-modules.tsx
|
|
911
406
|
function FlowEcsEdgeModules(props) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
targetHandle: targetHandle.handleId
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
t1 = [nodesToConnect, ecsFlowRepository, entityRepository, onConnect];
|
|
941
|
-
$[0] = ecsFlowRepository;
|
|
942
|
-
$[1] = entityRepository;
|
|
943
|
-
$[2] = nodesToConnect;
|
|
944
|
-
$[3] = onConnect;
|
|
945
|
-
$[4] = t0;
|
|
946
|
-
$[5] = t1;
|
|
947
|
-
} else {
|
|
948
|
-
t0 = $[4];
|
|
949
|
-
t1 = $[5];
|
|
950
|
-
}
|
|
951
|
-
_react.useEffect.call(void 0, t0, t1);
|
|
952
|
-
let t2;
|
|
953
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
954
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
955
|
-
$[6] = t2;
|
|
956
|
-
} else {
|
|
957
|
-
t2 = $[6];
|
|
958
|
-
}
|
|
959
|
-
return t2;
|
|
960
|
-
}
|
|
961
|
-
function _temp32(h_0) {
|
|
962
|
-
return h_0.connection === "target";
|
|
963
|
-
}
|
|
964
|
-
function _temp22(h) {
|
|
965
|
-
return h.connection === "source";
|
|
966
|
-
}
|
|
967
|
-
function _temp7(state) {
|
|
968
|
-
return state.onConnect;
|
|
407
|
+
const { nodesToConnect } = props;
|
|
408
|
+
const onConnect = (0, __awesome_flow_core_hooks.useFlowStore)((state) => state.onConnect);
|
|
409
|
+
const { ecsFlowRepository, entityRepository } = (0, react.useContext)(EcsFlowContext);
|
|
410
|
+
(0, react.useEffect)(() => {
|
|
411
|
+
for (const node of nodesToConnect) {
|
|
412
|
+
const sourceHandle = node.data.handles.find((h) => h.connection === "source");
|
|
413
|
+
const entity = entityRepository.get(node.data.entity);
|
|
414
|
+
const systemModule = ecsFlowRepository.getSystemModuleNode(entity.myProxy.entityType);
|
|
415
|
+
const targetHandle = systemModule?.data.handles.find((h) => h.connection === "target");
|
|
416
|
+
if (targetHandle) onConnect({
|
|
417
|
+
source: node.id,
|
|
418
|
+
target: systemModule.id,
|
|
419
|
+
sourceHandle: sourceHandle.handleId,
|
|
420
|
+
targetHandle: targetHandle.handleId
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
}, [
|
|
424
|
+
nodesToConnect,
|
|
425
|
+
ecsFlowRepository,
|
|
426
|
+
entityRepository,
|
|
427
|
+
onConnect
|
|
428
|
+
]);
|
|
429
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
|
|
969
430
|
}
|
|
970
431
|
var flow_ecs_edge_modules_default = FlowEcsEdgeModules;
|
|
971
432
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/flow/flow-ecs-edge-proxies.tsx
|
|
977
435
|
function FlowEcsEdgeProxies(props) {
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
};
|
|
1010
|
-
t1 = [nodesToConnect, ecsFlowRepository, entityRepository, onConnect];
|
|
1011
|
-
$[0] = ecsFlowRepository;
|
|
1012
|
-
$[1] = entityRepository;
|
|
1013
|
-
$[2] = nodesToConnect;
|
|
1014
|
-
$[3] = onConnect;
|
|
1015
|
-
$[4] = t0;
|
|
1016
|
-
$[5] = t1;
|
|
1017
|
-
} else {
|
|
1018
|
-
t0 = $[4];
|
|
1019
|
-
t1 = $[5];
|
|
1020
|
-
}
|
|
1021
|
-
_react.useEffect.call(void 0, t0, t1);
|
|
1022
|
-
let t2;
|
|
1023
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1024
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
1025
|
-
$[6] = t2;
|
|
1026
|
-
} else {
|
|
1027
|
-
t2 = $[6];
|
|
1028
|
-
}
|
|
1029
|
-
return t2;
|
|
1030
|
-
}
|
|
1031
|
-
function _temp33(h_0) {
|
|
1032
|
-
return h_0.connection === "target";
|
|
1033
|
-
}
|
|
1034
|
-
function _temp23(h) {
|
|
1035
|
-
return h.connection === "source";
|
|
1036
|
-
}
|
|
1037
|
-
function _temp8(state) {
|
|
1038
|
-
return state.onConnect;
|
|
436
|
+
const { nodesToConnect } = props;
|
|
437
|
+
const onConnect = (0, __awesome_flow_core_hooks.useFlowStore)((state) => state.onConnect);
|
|
438
|
+
const { ecsFlowRepository, entityProxyRepository, entityRepository } = (0, react.useContext)(EcsFlowContext);
|
|
439
|
+
(0, react.useEffect)(() => {
|
|
440
|
+
for (const node of nodesToConnect) {
|
|
441
|
+
const sourceHandle = node.data.handles.find((h) => h.connection === "source");
|
|
442
|
+
const entity = entityRepository.get(node.data.entity);
|
|
443
|
+
const proxies = Array.from(entityProxyRepository.getAll(entity.myProxy).values()).flat();
|
|
444
|
+
for (const proxy of proxies) {
|
|
445
|
+
const proxyNode = ecsFlowRepository.getEntityNode(proxy);
|
|
446
|
+
if (proxyNode) {
|
|
447
|
+
const targetHandle = proxyNode.data.handles.find((h) => h.connection === "target");
|
|
448
|
+
onConnect({
|
|
449
|
+
source: node.id,
|
|
450
|
+
target: proxyNode.id,
|
|
451
|
+
sourceHandle: sourceHandle.handleId,
|
|
452
|
+
targetHandle: targetHandle.handleId
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}, [
|
|
458
|
+
nodesToConnect,
|
|
459
|
+
ecsFlowRepository,
|
|
460
|
+
entityRepository,
|
|
461
|
+
entityProxyRepository,
|
|
462
|
+
onConnect
|
|
463
|
+
]);
|
|
464
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
|
|
1039
465
|
}
|
|
1040
466
|
var flow_ecs_edge_proxies_default = FlowEcsEdgeProxies;
|
|
1041
467
|
|
|
1042
|
-
|
|
1043
|
-
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/flow/flow-ecs-entities.tsx
|
|
1044
470
|
function FlowEcsEntities() {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
node.data.entity = entity.myProxy;
|
|
1074
|
-
node.position = {
|
|
1075
|
-
x: 0,
|
|
1076
|
-
y: 0
|
|
1077
|
-
};
|
|
1078
|
-
ecsFlowRepository.addEntityNode(node);
|
|
1079
|
-
nodes.push(node);
|
|
1080
|
-
}
|
|
1081
|
-
setEntityNodes(nodes);
|
|
1082
|
-
addNodes(nodes);
|
|
1083
|
-
};
|
|
1084
|
-
t2 = [entityRepository, entityRepository.size, ecsFlowRepository, nodeFactory, addNodes];
|
|
1085
|
-
$[1] = addNodes;
|
|
1086
|
-
$[2] = ecsFlowRepository;
|
|
1087
|
-
$[3] = entityRepository;
|
|
1088
|
-
$[4] = nodeFactory;
|
|
1089
|
-
$[5] = t1;
|
|
1090
|
-
$[6] = t2;
|
|
1091
|
-
} else {
|
|
1092
|
-
t1 = $[5];
|
|
1093
|
-
t2 = $[6];
|
|
1094
|
-
}
|
|
1095
|
-
_react.useEffect.call(void 0, t1, t2);
|
|
1096
|
-
let t3;
|
|
1097
|
-
if ($[7] !== entityNodes) {
|
|
1098
|
-
t3 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1099
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, flow_ecs_edge_proxies_default, { nodesToConnect: entityNodes }),
|
|
1100
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, flow_ecs_edge_modules_default, { nodesToConnect: entityNodes })
|
|
1101
|
-
] });
|
|
1102
|
-
$[7] = entityNodes;
|
|
1103
|
-
$[8] = t3;
|
|
1104
|
-
} else {
|
|
1105
|
-
t3 = $[8];
|
|
1106
|
-
}
|
|
1107
|
-
return t3;
|
|
1108
|
-
}
|
|
1109
|
-
function _temp9(state) {
|
|
1110
|
-
return state.addNodes;
|
|
471
|
+
const { nodeFactory } = (0, react.useContext)(__awesome_flow_core_abstract.FlowContext);
|
|
472
|
+
const addNodes = (0, __awesome_flow_core_hooks.useFlowStore)((state) => state.addNodes);
|
|
473
|
+
const { ecsFlowRepository, entityRepository } = (0, react.useContext)(EcsFlowContext);
|
|
474
|
+
const [entityNodes, setEntityNodes] = (0, react.useState)([]);
|
|
475
|
+
(0, react.useEffect)(() => {
|
|
476
|
+
const entities = entityRepository.listAll();
|
|
477
|
+
const nodes = [];
|
|
478
|
+
for (const entity of entities) {
|
|
479
|
+
if (ecsFlowRepository.getEntityNode(entity.myProxy)) continue;
|
|
480
|
+
const node = nodeFactory.createNodeFromType(EcsNodeType.entity);
|
|
481
|
+
node.data.entity = entity.myProxy;
|
|
482
|
+
node.position = {
|
|
483
|
+
x: 0,
|
|
484
|
+
y: 0
|
|
485
|
+
};
|
|
486
|
+
ecsFlowRepository.addEntityNode(node);
|
|
487
|
+
nodes.push(node);
|
|
488
|
+
}
|
|
489
|
+
setEntityNodes(nodes);
|
|
490
|
+
addNodes(nodes);
|
|
491
|
+
}, [
|
|
492
|
+
entityRepository,
|
|
493
|
+
entityRepository.size,
|
|
494
|
+
ecsFlowRepository,
|
|
495
|
+
nodeFactory,
|
|
496
|
+
addNodes
|
|
497
|
+
]);
|
|
498
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(flow_ecs_edge_proxies_default, { nodesToConnect: entityNodes }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(flow_ecs_edge_modules_default, { nodesToConnect: entityNodes })] });
|
|
1111
499
|
}
|
|
1112
500
|
var flow_ecs_entities_default = FlowEcsEntities;
|
|
1113
501
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/flow/flow-ecs-modules.tsx
|
|
1120
504
|
function FlowEcsModules() {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
if (nodesToAdd.length) {
|
|
1151
|
-
addNodes(nodesToAdd);
|
|
1152
|
-
}
|
|
1153
|
-
};
|
|
1154
|
-
t1 = [nodeFactory, addNodes, ecsFlowRepository, ecsFlowRepository.sizeNodes, systemsModuleRepository, systemsModuleRepository.size];
|
|
1155
|
-
$[0] = addNodes;
|
|
1156
|
-
$[1] = ecsFlowRepository;
|
|
1157
|
-
$[2] = nodeFactory;
|
|
1158
|
-
$[3] = systemsModuleRepository;
|
|
1159
|
-
$[4] = t0;
|
|
1160
|
-
$[5] = t1;
|
|
1161
|
-
} else {
|
|
1162
|
-
t0 = $[4];
|
|
1163
|
-
t1 = $[5];
|
|
1164
|
-
}
|
|
1165
|
-
_react.useEffect.call(void 0, t0, t1);
|
|
1166
|
-
let t2;
|
|
1167
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1168
|
-
t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
1169
|
-
$[6] = t2;
|
|
1170
|
-
} else {
|
|
1171
|
-
t2 = $[6];
|
|
1172
|
-
}
|
|
1173
|
-
return t2;
|
|
1174
|
-
}
|
|
1175
|
-
function _temp34(v) {
|
|
1176
|
-
return v[0];
|
|
1177
|
-
}
|
|
1178
|
-
function _temp24(m) {
|
|
1179
|
-
return !!m;
|
|
1180
|
-
}
|
|
1181
|
-
function _temp10(state) {
|
|
1182
|
-
return state.addNodes;
|
|
505
|
+
const { nodeFactory } = (0, react.useContext)(__awesome_flow_core_abstract.FlowContext);
|
|
506
|
+
const addNodes = (0, __awesome_flow_core_hooks.useFlowStore)((state) => state.addNodes);
|
|
507
|
+
const { ecsFlowRepository, systemsModuleRepository } = (0, react.useContext)(EcsFlowContext);
|
|
508
|
+
(0, react.useEffect)(() => {
|
|
509
|
+
const modules = Array.from(systemsModuleRepository.list()).filter((m) => !!m);
|
|
510
|
+
const keys = Array.from(modules.values()).map((v) => v[0]);
|
|
511
|
+
const nodesToAdd = [];
|
|
512
|
+
for (const element of keys) {
|
|
513
|
+
if (ecsFlowRepository.getSystemModuleNode(element)) continue;
|
|
514
|
+
const node = nodeFactory.createNodeFromType(EcsNodeType.systemsModule);
|
|
515
|
+
node.data.entityType = element;
|
|
516
|
+
node.position = {
|
|
517
|
+
x: 0,
|
|
518
|
+
y: 0
|
|
519
|
+
};
|
|
520
|
+
ecsFlowRepository.addSystemModuleNode(node);
|
|
521
|
+
nodesToAdd.push(node);
|
|
522
|
+
}
|
|
523
|
+
if (nodesToAdd.length) addNodes(nodesToAdd);
|
|
524
|
+
}, [
|
|
525
|
+
nodeFactory,
|
|
526
|
+
addNodes,
|
|
527
|
+
ecsFlowRepository,
|
|
528
|
+
ecsFlowRepository.sizeNodes,
|
|
529
|
+
systemsModuleRepository,
|
|
530
|
+
systemsModuleRepository.size
|
|
531
|
+
]);
|
|
532
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
|
|
1183
533
|
}
|
|
1184
534
|
var flow_ecs_modules_default = FlowEcsModules;
|
|
1185
535
|
|
|
1186
|
-
|
|
1187
|
-
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/flow/flow-ecs-state.tsx
|
|
1188
538
|
function FlowEcsState(props) {
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
} else {
|
|
1223
|
-
t2 = $[4];
|
|
1224
|
-
}
|
|
1225
|
-
let t3;
|
|
1226
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1227
|
-
t3 = [];
|
|
1228
|
-
$[5] = t3;
|
|
1229
|
-
} else {
|
|
1230
|
-
t3 = $[5];
|
|
1231
|
-
}
|
|
1232
|
-
_react.useEffect.call(void 0, t2, t3);
|
|
1233
|
-
let t4;
|
|
1234
|
-
if ($[6] !== props.showSystemModules) {
|
|
1235
|
-
t4 = props.showSystemModules && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, flow_ecs_modules_default, {});
|
|
1236
|
-
$[6] = props.showSystemModules;
|
|
1237
|
-
$[7] = t4;
|
|
1238
|
-
} else {
|
|
1239
|
-
t4 = $[7];
|
|
1240
|
-
}
|
|
1241
|
-
let t5;
|
|
1242
|
-
if ($[8] !== props.showEntities) {
|
|
1243
|
-
t5 = props.showEntities && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, flow_ecs_entities_default, {});
|
|
1244
|
-
$[8] = props.showEntities;
|
|
1245
|
-
$[9] = t5;
|
|
1246
|
-
} else {
|
|
1247
|
-
t5 = $[9];
|
|
1248
|
-
}
|
|
1249
|
-
let t6;
|
|
1250
|
-
if ($[10] !== props.autoLayout || $[11] !== refreshLayout) {
|
|
1251
|
-
t6 = props.autoLayout && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _canvas.FlowAutoLayout, { refreshLayout });
|
|
1252
|
-
$[10] = props.autoLayout;
|
|
1253
|
-
$[11] = refreshLayout;
|
|
1254
|
-
$[12] = t6;
|
|
1255
|
-
} else {
|
|
1256
|
-
t6 = $[12];
|
|
1257
|
-
}
|
|
1258
|
-
let t7;
|
|
1259
|
-
if ($[13] !== t4 || $[14] !== t5 || $[15] !== t6) {
|
|
1260
|
-
t7 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1261
|
-
t4,
|
|
1262
|
-
t5,
|
|
1263
|
-
t6
|
|
1264
|
-
] });
|
|
1265
|
-
$[13] = t4;
|
|
1266
|
-
$[14] = t5;
|
|
1267
|
-
$[15] = t6;
|
|
1268
|
-
$[16] = t7;
|
|
1269
|
-
} else {
|
|
1270
|
-
t7 = $[16];
|
|
1271
|
-
}
|
|
1272
|
-
return t7;
|
|
1273
|
-
}
|
|
1274
|
-
function _temp11(updates) {
|
|
1275
|
-
return updates + 1;
|
|
1276
|
-
}
|
|
1277
|
-
var flow_ecs_state_default = _react.memo.call(void 0, FlowEcsState);
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
exports.EcsFlowContext = EcsFlowContext; exports.EcsFlowRepository = EcsFlowRepository; exports.EcsHandleDataType = EcsHandleDataType; exports.EcsNodeType = EcsNodeType; exports.EcsTemplateGroup = EcsTemplateGroup; exports.EntityNode = node_entity_default; exports.EntityNodeTemplate = EntityNodeTemplate; exports.FlowEcsState = flow_ecs_state_default; exports.SystemsModuleNode = node_systems_module_default; exports.SystemsModuleNodeTemplate = SystemsModuleNodeTemplate; exports.ecsNodeTemplates = ecsNodeTemplates; exports.ecsNodeTypes = ecsNodeTypes;
|
|
539
|
+
const [, setUpdates] = (0, react.useState)(0);
|
|
540
|
+
const [refreshLayout, setRefreshLayout] = (0, react.useState)(false);
|
|
541
|
+
const { ecsFlowRepository } = (0, react.useContext)(EcsFlowContext);
|
|
542
|
+
(0, react.useEffect)(() => {
|
|
543
|
+
setRefreshLayout(true);
|
|
544
|
+
}, [ecsFlowRepository.sizeNodes]);
|
|
545
|
+
(0, react.useEffect)(() => {
|
|
546
|
+
setInterval(() => {
|
|
547
|
+
setUpdates((updates) => updates + 1);
|
|
548
|
+
}, 1e3);
|
|
549
|
+
}, []);
|
|
550
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
551
|
+
props.showSystemModules && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(flow_ecs_modules_default, {}),
|
|
552
|
+
props.showEntities && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(flow_ecs_entities_default, {}),
|
|
553
|
+
props.autoLayout && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__awesome_flow_core_canvas.FlowAutoLayout, { refreshLayout })
|
|
554
|
+
] });
|
|
555
|
+
}
|
|
556
|
+
var flow_ecs_state_default = (0, react.memo)(FlowEcsState);
|
|
557
|
+
|
|
558
|
+
//#endregion
|
|
559
|
+
exports.EcsFlowContext = EcsFlowContext;
|
|
560
|
+
exports.EcsFlowRepository = EcsFlowRepository;
|
|
561
|
+
exports.EcsHandleDataType = EcsHandleDataType;
|
|
562
|
+
exports.EcsNodeType = EcsNodeType;
|
|
563
|
+
exports.EcsTemplateGroup = EcsTemplateGroup;
|
|
564
|
+
exports.EntityNode = node_entity_default;
|
|
565
|
+
exports.EntityNodeTemplate = EntityNodeTemplate;
|
|
566
|
+
exports.FlowEcsState = flow_ecs_state_default;
|
|
567
|
+
exports.SystemsModuleNode = node_systems_module_default;
|
|
568
|
+
exports.SystemsModuleNodeTemplate = SystemsModuleNodeTemplate;
|
|
569
|
+
exports.ecsNodeTemplates = ecsNodeTemplates;
|
|
570
|
+
exports.ecsNodeTypes = ecsNodeTypes;
|
|
571
|
+
//# sourceMappingURL=index.cjs.map
|