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