@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 CHANGED
@@ -1,1291 +1,571 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;// src/abstract/ecs-flow-context.ts
2
- var _react = require('react');
3
- var EcsFlowContext = _react.createContext.call(void 0, null);
4
-
5
- // src/utils/id-generator.ts
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
- static entityProxy(proxy) {
8
- return `${proxy.entityType}:${proxy.entityUid}`;
9
- }
42
+ static entityProxy(proxy) {
43
+ return `${proxy.entityType}:${proxy.entityUid}`;
44
+ }
10
45
  };
11
46
 
12
- // src/abstract/ecs-flow-repository.ts
47
+ //#endregion
48
+ //#region src/abstract/ecs-flow-repository.ts
13
49
  var EcsFlowRepository = class {
14
-
15
- constructor() {
16
- this.nodes = /* @__PURE__ */ new Map();
17
- }
18
- get sizeNodes() {
19
- return this.nodes.size;
20
- }
21
- addSystemModuleNode(node) {
22
- this.nodes.set(node.data.entityType.toString(), node);
23
- }
24
- getSystemModuleNode(entityType) {
25
- return this.nodes.get(entityType.toString());
26
- }
27
- addEntityNode(node) {
28
- this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);
29
- }
30
- getEntityNode(entity) {
31
- return this.nodes.get(EcsIdGenerator.entityProxy(entity));
32
- }
33
- listAllNodes() {
34
- return Array.from(this.nodes.values());
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
- // src/abstract/handle-types.ts
39
- var EcsHandleDataType = /* @__PURE__ */ ((EcsHandleDataType2) => {
40
- EcsHandleDataType2["proxy"] = "proxy";
41
- EcsHandleDataType2["module"] = "module";
42
- return EcsHandleDataType2;
43
- })(EcsHandleDataType || {});
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
- const $ = _compilerruntime.c.call(void 0, 2);
56
- let t0;
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 = _react.memo.call(void 0, CamelCaseFormatter);
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
- // src/components/object-inspector.tsx
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
- const $ = _compilerruntime.c.call(void 0, 3);
94
- const colorScheme = _core.useComputedColorScheme.call(void 0, );
95
- let t0;
96
- t0 = colorScheme === "dark" ? "chromeDark" : "chromeLight";
97
- const theme = t0;
98
- let t1;
99
- if ($[0] !== props.data || $[1] !== theme) {
100
- t1 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactinspector.Inspector, { table: false, theme, data: props.data });
101
- $[0] = props.data;
102
- $[1] = theme;
103
- $[2] = t1;
104
- } else {
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
- const $ = _compilerruntime.c.call(void 0, 13);
115
- const [opened, t0] = _hooks.useDisclosure.call(void 0, false);
116
- const {
117
- toggle
118
- } = t0;
119
- let t1;
120
- t1 = opened ? "light" : "indigo";
121
- const buttonColor = t1;
122
- let t2;
123
- if ($[0] !== buttonColor || $[1] !== props.component.componentType || $[2] !== toggle) {
124
- t2 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Button, { variant: "outline", size: "xs", onClick: toggle, color: buttonColor, fullWidth: true, children: props.component.componentType });
125
- $[0] = buttonColor;
126
- $[1] = props.component.componentType;
127
- $[2] = toggle;
128
- $[3] = t2;
129
- } else {
130
- t2 = $[3];
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
- const $ = _compilerruntime.c.call(void 0, 9);
170
- let t0;
171
- if ($[0] !== props.entity.components) {
172
- t0 = Array.from(props.entity.components.values());
173
- $[0] = props.entity.components;
174
- $[1] = t0;
175
- } else {
176
- t0 = $[1];
177
- }
178
- const components = t0;
179
- let t1;
180
- if ($[2] !== components.length) {
181
- t1 = /* @__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: "Components" }) });
182
- $[2] = components.length;
183
- $[3] = t1;
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
- return props.items.map((value, i) => {
225
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { ...props.badge || [], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, formatter_camel_case_default, { value }) }, i);
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 = _react.memo.call(void 0, BadgeList);
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
- const $ = _compilerruntime.c.call(void 0, 10);
234
- let t0;
235
- if ($[0] !== props.entity.proxies) {
236
- const proxies = Array.from(props.entity.proxies.values()).map(_temp4);
237
- t0 = proxies.map(_temp3).flat();
238
- $[0] = props.entity.proxies;
239
- $[1] = t0;
240
- } else {
241
- t0 = $[1];
242
- }
243
- const items = t0;
244
- let t1;
245
- if ($[2] !== items.length) {
246
- t1 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Control, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { fullWidth: true, variant: "light", rightSection: items.length, children: "Proxies" }) });
247
- $[2] = items.length;
248
- $[3] = t1;
249
- } else {
250
- t1 = $[3];
251
- }
252
- let t2;
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
- const $ = _compilerruntime.c.call(void 0, 11);
301
- const {
302
- entityEventsManager
303
- } = _react.useContext.call(void 0, EcsFlowContext);
304
- let t0;
305
- if ($[0] !== entityEventsManager || $[1] !== props.entity.myProxy) {
306
- t0 = entityEventsManager.getSubscriptionsForEntity(props.entity.myProxy);
307
- $[0] = entityEventsManager;
308
- $[1] = props.entity.myProxy;
309
- $[2] = t0;
310
- } else {
311
- t0 = $[2];
312
- }
313
- const subscriptions = t0;
314
- let t1;
315
- if ($[3] !== subscriptions.length) {
316
- t1 = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Accordion.Control, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Badge, { fullWidth: true, variant: "light", rightSection: subscriptions.length, children: "Events" }) });
317
- $[3] = subscriptions.length;
318
- $[4] = t1;
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
- const $ = _compilerruntime.c.call(void 0, 16);
362
- const [, setRefresh] = _react.useState.call(void 0, 0);
363
- const {
364
- entityUpdateCounter
365
- } = _react.useContext.call(void 0, EcsFlowContext);
366
- let t0;
367
- if ($[0] !== entityUpdateCounter || $[1] !== props.entityUid) {
368
- t0 = entityUpdateCounter.getUpdateCount(props.entityUid) || 0;
369
- $[0] = entityUpdateCounter;
370
- $[1] = props.entityUid;
371
- $[2] = t0;
372
- } else {
373
- t0 = $[2];
374
- }
375
- const updates = t0;
376
- let t1;
377
- if ($[3] !== entityUpdateCounter || $[4] !== props.entityUid) {
378
- t1 = entityUpdateCounter.getRemoveCount(props.entityUid) || 0;
379
- $[3] = entityUpdateCounter;
380
- $[4] = props.entityUid;
381
- $[5] = t1;
382
- } else {
383
- t1 = $[5];
384
- }
385
- const removes = t1;
386
- let t2;
387
- if ($[6] !== setRefresh) {
388
- t2 = () => {
389
- const interval = setInterval(() => {
390
- setRefresh(_temp5);
391
- }, 1e3);
392
- return () => {
393
- console.log("CLEAR INTERVAL");
394
- clearInterval(interval);
395
- };
396
- };
397
- $[6] = setRefresh;
398
- $[7] = t2;
399
- } else {
400
- t2 = $[7];
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
- // src/nodes/node-entity.tsx
500
-
501
- function EntityNode(t0) {
502
- const $ = _compilerruntime.c.call(void 0, 14);
503
- const {
504
- id,
505
- data,
506
- selected,
507
- type
508
- } = t0;
509
- const {
510
- entityRepository
511
- } = _react.useContext.call(void 0, EcsFlowContext);
512
- let t1;
513
- let t2;
514
- if ($[0] !== data.entity || $[1] !== entityRepository) {
515
- t2 = entityRepository.get(data.entity);
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
- // src/nodes/node-systems-module.tsx
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
- const $ = _compilerruntime.c.call(void 0, 13);
574
- let t0;
575
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
576
- t0 = [];
577
- $[0] = t0;
578
- } else {
579
- t0 = $[0];
580
- }
581
- let middleware = t0;
582
- if (props.pipeline) {
583
- middleware = props.pipeline.middleware;
584
- }
585
- let t1;
586
- if ($[1] !== middleware) {
587
- t1 = middleware.map(_temp6);
588
- $[1] = middleware;
589
- $[2] = t1;
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
- // src/layout/systems-module-layout.tsx
641
-
280
+ //#endregion
281
+ //#region src/layout/systems-module-layout.tsx
642
282
  function SystemsModuleLayout(props) {
643
- const $ = _compilerruntime.c.call(void 0, 26);
644
- const {
645
- module
646
- } = props;
647
- const runtimeContext = module.runtimeContext;
648
- const {
649
- systemContext
650
- } = runtimeContext;
651
- let t0;
652
- t0 = systemContext.runtime;
653
- const {
654
- status
655
- } = t0;
656
- let t1;
657
- if ($[0] !== runtimeContext.systemPipelines) {
658
- t1 = runtimeContext.systemPipelines.get(_systems.SystemType.initialize);
659
- $[0] = runtimeContext.systemPipelines;
660
- $[1] = t1;
661
- } else {
662
- t1 = $[1];
663
- }
664
- const init = t1;
665
- let t2;
666
- if ($[2] !== runtimeContext.systemPipelines) {
667
- t2 = runtimeContext.systemPipelines.get(_systems.SystemType.update);
668
- $[2] = runtimeContext.systemPipelines;
669
- $[3] = t2;
670
- } else {
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
- // src/nodes/node-systems-module.tsx
768
-
769
- function SystemsModuleNode(t0) {
770
- const $ = _compilerruntime.c.call(void 0, 15);
771
- const {
772
- id,
773
- data,
774
- selected,
775
- type
776
- } = t0;
777
- const {
778
- systemsModuleRepository
779
- } = _react.useContext.call(void 0, EcsFlowContext);
780
- let t1;
781
- if ($[0] !== data.entityType || $[1] !== systemsModuleRepository) {
782
- t1 = systemsModuleRepository.get(data.entityType);
783
- $[0] = data.entityType;
784
- $[1] = systemsModuleRepository;
785
- $[2] = t1;
786
- } else {
787
- t1 = $[2];
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
- // src/templates/template-entity-node.ts
825
- var _react3 = require('@xyflow/react');
826
-
827
- // src/abstract/templates.ts
828
- var EcsTemplateGroup = /* @__PURE__ */ ((EcsTemplateGroup2) => {
829
- EcsTemplateGroup2["ecs"] = "ECS";
830
- return EcsTemplateGroup2;
831
- })(EcsTemplateGroup || {});
832
-
833
- // src/templates/template-entity-node.ts
834
- var EntityNodeTemplate = (_class = class {constructor() { _class.prototype.__init.call(this); }
835
- __init() {this.template = {
836
- type: "entity-node" /* entity */,
837
- group: "ECS" /* ecs */,
838
- data: {
839
- title: "Entity",
840
- entity: null
841
- },
842
- handles: [
843
- {
844
- dataType: "proxy" /* proxy */,
845
- position: _react3.Position.Left,
846
- connection: "target",
847
- disabled: true
848
- },
849
- {
850
- dataType: "proxy" /* proxy */,
851
- position: _react3.Position.Right,
852
- connection: "source",
853
- disabled: true
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
- var SystemsModuleNodeTemplate = (_class2 = class {constructor() { _class2.prototype.__init2.call(this); }
862
- __init2() {this.template = {
863
- type: "systems-module-node" /* systemsModule */,
864
- group: "ECS" /* ecs */,
865
- data: {
866
- title: "Systems Module",
867
- entityType: null
868
- },
869
- handles: [
870
- {
871
- dataType: "module" /* module */,
872
- position: _react3.Position.Left,
873
- connection: "target",
874
- disabled: true
875
- }
876
- ]
877
- }}
878
- }, _class2);
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
- // src/abstract/node-types.ts
881
- var EcsNodeType = /* @__PURE__ */ ((EcsNodeType2) => {
882
- EcsNodeType2["systemsModule"] = "systems-module-node";
883
- EcsNodeType2["entity"] = "entity-node";
884
- return EcsNodeType2;
885
- })(EcsNodeType || {});
886
- var ecsNodeTypes = {
887
- ["systems-module-node" /* systemsModule */]: node_systems_module_default,
888
- ["entity-node" /* entity */]: node_entity_default
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
- var ecsNodeTemplates = {
891
- ["entity-node" /* entity */]: new EntityNodeTemplate(),
892
- ["systems-module-node" /* systemsModule */]: new SystemsModuleNodeTemplate()
399
+ const ecsNodeTemplates = {
400
+ [EcsNodeType.entity]: new EntityNodeTemplate(),
401
+ [EcsNodeType.systemsModule]: new SystemsModuleNodeTemplate()
893
402
  };
894
403
 
895
- // src/flow/flow-ecs-state.tsx
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
- const $ = _compilerruntime.c.call(void 0, 7);
913
- const {
914
- nodesToConnect
915
- } = props;
916
- const onConnect = _hooks3.useFlowStore.call(void 0, _temp7);
917
- const {
918
- ecsFlowRepository,
919
- entityRepository
920
- } = _react.useContext.call(void 0, EcsFlowContext);
921
- let t0;
922
- let t1;
923
- if ($[0] !== ecsFlowRepository || $[1] !== entityRepository || $[2] !== nodesToConnect || $[3] !== onConnect) {
924
- t0 = () => {
925
- for (const node of nodesToConnect) {
926
- const sourceHandle = node.data.handles.find(_temp22);
927
- const entity = entityRepository.get(node.data.entity);
928
- const systemModule = ecsFlowRepository.getSystemModuleNode(entity.myProxy.entityType);
929
- const targetHandle = _optionalChain([systemModule, 'optionalAccess', _6 => _6.data, 'access', _7 => _7.handles, 'access', _8 => _8.find, 'call', _9 => _9(_temp32)]);
930
- if (targetHandle) {
931
- onConnect({
932
- source: node.id,
933
- target: systemModule.id,
934
- sourceHandle: sourceHandle.handleId,
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
- // src/flow/flow-ecs-edge-proxies.tsx
973
-
974
-
975
-
976
-
433
+ //#endregion
434
+ //#region src/flow/flow-ecs-edge-proxies.tsx
977
435
  function FlowEcsEdgeProxies(props) {
978
- const $ = _compilerruntime.c.call(void 0, 7);
979
- const {
980
- nodesToConnect
981
- } = props;
982
- const onConnect = _hooks3.useFlowStore.call(void 0, _temp8);
983
- const {
984
- ecsFlowRepository,
985
- entityRepository
986
- } = _react.useContext.call(void 0, EcsFlowContext);
987
- let t0;
988
- let t1;
989
- if ($[0] !== ecsFlowRepository || $[1] !== entityRepository || $[2] !== nodesToConnect || $[3] !== onConnect) {
990
- t0 = () => {
991
- for (const node of nodesToConnect) {
992
- const sourceHandle = node.data.handles.find(_temp23);
993
- const entity = entityRepository.get(node.data.entity);
994
- for (const [, proxyMap] of entity.proxies) {
995
- for (const proxy of proxyMap.values()) {
996
- const proxyNode = ecsFlowRepository.getEntityNode(proxy);
997
- if (proxyNode) {
998
- const targetHandle = proxyNode.data.handles.find(_temp33);
999
- onConnect({
1000
- source: node.id,
1001
- target: proxyNode.id,
1002
- sourceHandle: sourceHandle.handleId,
1003
- targetHandle: targetHandle.handleId
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
- // src/flow/flow-ecs-entities.tsx
1043
-
468
+ //#endregion
469
+ //#region src/flow/flow-ecs-entities.tsx
1044
470
  function FlowEcsEntities() {
1045
- const $ = _compilerruntime.c.call(void 0, 9);
1046
- const {
1047
- nodeFactory
1048
- } = _react.useContext.call(void 0, _abstract.FlowContext);
1049
- const addNodes = _hooks3.useFlowStore.call(void 0, _temp9);
1050
- const {
1051
- ecsFlowRepository,
1052
- entityRepository
1053
- } = _react.useContext.call(void 0, EcsFlowContext);
1054
- let t0;
1055
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1056
- t0 = [];
1057
- $[0] = t0;
1058
- } else {
1059
- t0 = $[0];
1060
- }
1061
- const [entityNodes, setEntityNodes] = _react.useState.call(void 0, t0);
1062
- let t1;
1063
- let t2;
1064
- if ($[1] !== addNodes || $[2] !== ecsFlowRepository || $[3] !== entityRepository || $[4] !== nodeFactory) {
1065
- t1 = () => {
1066
- const entities = entityRepository.listAll();
1067
- const nodes = [];
1068
- for (const entity of entities) {
1069
- if (ecsFlowRepository.getEntityNode(entity.myProxy)) {
1070
- continue;
1071
- }
1072
- const node = nodeFactory.createNodeFromType("entity-node" /* entity */);
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
- // src/flow/flow-ecs-modules.tsx
1115
-
1116
-
1117
-
1118
-
1119
-
502
+ //#endregion
503
+ //#region src/flow/flow-ecs-modules.tsx
1120
504
  function FlowEcsModules() {
1121
- const $ = _compilerruntime.c.call(void 0, 7);
1122
- const {
1123
- nodeFactory
1124
- } = _react.useContext.call(void 0, _abstract.FlowContext);
1125
- const addNodes = _hooks3.useFlowStore.call(void 0, _temp10);
1126
- const {
1127
- ecsFlowRepository,
1128
- systemsModuleRepository
1129
- } = _react.useContext.call(void 0, EcsFlowContext);
1130
- let t0;
1131
- let t1;
1132
- if ($[0] !== addNodes || $[1] !== ecsFlowRepository || $[2] !== nodeFactory || $[3] !== systemsModuleRepository) {
1133
- t0 = () => {
1134
- const modules = Array.from(systemsModuleRepository.list()).filter(_temp24);
1135
- const keys = Array.from(modules.values()).map(_temp34);
1136
- const nodesToAdd = [];
1137
- for (const element of keys) {
1138
- if (ecsFlowRepository.getSystemModuleNode(element)) {
1139
- continue;
1140
- }
1141
- const node = nodeFactory.createNodeFromType("systems-module-node" /* systemsModule */);
1142
- node.data.entityType = element;
1143
- node.position = {
1144
- x: 0,
1145
- y: 0
1146
- };
1147
- ecsFlowRepository.addSystemModuleNode(node);
1148
- nodesToAdd.push(node);
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
- // src/flow/flow-ecs-state.tsx
1187
-
536
+ //#endregion
537
+ //#region src/flow/flow-ecs-state.tsx
1188
538
  function FlowEcsState(props) {
1189
- const $ = _compilerruntime.c.call(void 0, 17);
1190
- const [, setUpdates] = _react.useState.call(void 0, 0);
1191
- const [refreshLayout, setRefreshLayout] = _react.useState.call(void 0, false);
1192
- const {
1193
- ecsFlowRepository
1194
- } = _react.useContext.call(void 0, EcsFlowContext);
1195
- let t0;
1196
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1197
- t0 = () => {
1198
- setRefreshLayout(true);
1199
- };
1200
- $[0] = t0;
1201
- } else {
1202
- t0 = $[0];
1203
- }
1204
- let t1;
1205
- if ($[1] !== ecsFlowRepository.sizeNodes) {
1206
- t1 = [ecsFlowRepository.sizeNodes];
1207
- $[1] = ecsFlowRepository.sizeNodes;
1208
- $[2] = t1;
1209
- } else {
1210
- t1 = $[2];
1211
- }
1212
- _react.useEffect.call(void 0, t0, t1);
1213
- let t2;
1214
- if ($[3] !== setUpdates) {
1215
- t2 = () => {
1216
- setInterval(() => {
1217
- setUpdates(_temp11);
1218
- }, 1e3);
1219
- };
1220
- $[3] = setUpdates;
1221
- $[4] = t2;
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