@awesome-flow/ecs 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +260 -276
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -22
- package/dist/index.d.ts +26 -22
- package/dist/index.js +216 -234
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.cjs
CHANGED
|
@@ -33,33 +33,29 @@ __export(src_exports, {
|
|
|
33
33
|
EcsFlowRepository: () => EcsFlowRepository,
|
|
34
34
|
EcsHandleDataType: () => EcsHandleDataType,
|
|
35
35
|
EcsNodeType: () => EcsNodeType,
|
|
36
|
+
EcsTemplateGroup: () => EcsTemplateGroup,
|
|
36
37
|
EntityNode: () => node_entity_default,
|
|
37
38
|
EntityNodeTemplate: () => EntityNodeTemplate,
|
|
38
39
|
FlowEcsState: () => flow_ecs_state_default,
|
|
39
40
|
SystemsModuleNode: () => node_systems_module_default,
|
|
40
41
|
SystemsModuleNodeTemplate: () => SystemsModuleNodeTemplate,
|
|
42
|
+
ecsNodeTemplates: () => ecsNodeTemplates,
|
|
41
43
|
ecsNodeTypes: () => ecsNodeTypes
|
|
42
44
|
});
|
|
43
45
|
module.exports = __toCommonJS(src_exports);
|
|
44
46
|
|
|
45
|
-
// src/
|
|
47
|
+
// src/abstract/ecs-flow-context.ts
|
|
46
48
|
var import_react = require("react");
|
|
47
|
-
var EcsFlowContext = (0, import_react.createContext)(
|
|
48
|
-
ecsFlowRepository: null,
|
|
49
|
-
entityRepository: null,
|
|
50
|
-
entityEventsManager: null,
|
|
51
|
-
entityUpdateCounter: null,
|
|
52
|
-
systemsModuleRepository: null
|
|
53
|
-
});
|
|
49
|
+
var EcsFlowContext = (0, import_react.createContext)(null);
|
|
54
50
|
|
|
55
51
|
// src/utils/id-generator.ts
|
|
56
|
-
var
|
|
52
|
+
var EcsIdGenerator = class {
|
|
57
53
|
static entityProxy(proxy) {
|
|
58
54
|
return `${proxy.entityType}:${proxy.entityUid}`;
|
|
59
55
|
}
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
// src/
|
|
58
|
+
// src/abstract/ecs-flow-repository.ts
|
|
63
59
|
var EcsFlowRepository = class {
|
|
64
60
|
nodes;
|
|
65
61
|
constructor() {
|
|
@@ -75,117 +71,62 @@ var EcsFlowRepository = class {
|
|
|
75
71
|
return this.nodes.get(entityType.toString());
|
|
76
72
|
}
|
|
77
73
|
addEntityNode(node) {
|
|
78
|
-
this.nodes.set(
|
|
74
|
+
this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);
|
|
79
75
|
}
|
|
80
76
|
getEntityNode(entity) {
|
|
81
|
-
return this.nodes.get(
|
|
77
|
+
return this.nodes.get(EcsIdGenerator.entityProxy(entity));
|
|
82
78
|
}
|
|
83
79
|
listAllNodes() {
|
|
84
80
|
return Array.from(this.nodes.values());
|
|
85
81
|
}
|
|
86
82
|
};
|
|
87
83
|
|
|
88
|
-
// src/
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var import_react2 = require("@xyflow/react");
|
|
95
|
-
var import_react3 = require("react");
|
|
96
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
97
|
-
function FlowEcsAutoLayout(props) {
|
|
98
|
-
const { getNodes, getEdges } = (0, import_react2.useReactFlow)();
|
|
99
|
-
const context = (0, import_react3.useContext)(import_abstract.FlowContext);
|
|
100
|
-
const setNodes = context.useFlowStore((state) => state.setNodes);
|
|
101
|
-
const graph = (0, import_react3.useMemo)(() => new import_dagre.default.graphlib.Graph().setDefaultEdgeLabel(() => ({})), []);
|
|
102
|
-
const getLayoutElements = (0, import_react3.useCallback)(
|
|
103
|
-
(nodes, edges, options) => {
|
|
104
|
-
graph.setGraph(options);
|
|
105
|
-
edges.forEach((edge) => graph.setEdge(edge.source, edge.target));
|
|
106
|
-
nodes.forEach((node) => {
|
|
107
|
-
if (node.measured) {
|
|
108
|
-
graph.setNode(node.id, {
|
|
109
|
-
width: node.measured.width,
|
|
110
|
-
height: node.measured.height
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
import_dagre.default.layout(graph);
|
|
115
|
-
return {
|
|
116
|
-
nodes: nodes.map((node) => {
|
|
117
|
-
const graphNode = graph.node(node.id);
|
|
118
|
-
if (graphNode) {
|
|
119
|
-
return { ...node, position: { x: graphNode.x, y: graphNode.y } };
|
|
120
|
-
}
|
|
121
|
-
return node;
|
|
122
|
-
}),
|
|
123
|
-
edges
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
[graph]
|
|
127
|
-
);
|
|
128
|
-
(0, import_react3.useEffect)(() => {
|
|
129
|
-
if (props.needsLayout) {
|
|
130
|
-
const storeNodes = getNodes();
|
|
131
|
-
if (storeNodes?.length) {
|
|
132
|
-
const edges = getEdges();
|
|
133
|
-
const layout = getLayoutElements(storeNodes, edges, {
|
|
134
|
-
rankdir: "LR"
|
|
135
|
-
});
|
|
136
|
-
setNodes(layout.nodes);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}, [props.needsLayout]);
|
|
140
|
-
(0, import_react3.useEffect)(() => {
|
|
141
|
-
if (props.needsLayout) {
|
|
142
|
-
props.setNeedsLayout(false);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
146
|
-
}
|
|
147
|
-
var flow_ecs_auto_layout_default = FlowEcsAutoLayout;
|
|
148
|
-
|
|
149
|
-
// src/ecs/flow-ecs-entities.tsx
|
|
150
|
-
var import_abstract4 = require("@awesome-flow/core/abstract");
|
|
151
|
-
var import_react17 = require("react");
|
|
84
|
+
// src/abstract/handle-types.ts
|
|
85
|
+
var EcsHandleDataType = /* @__PURE__ */ ((EcsHandleDataType2) => {
|
|
86
|
+
EcsHandleDataType2["proxy"] = "proxy";
|
|
87
|
+
EcsHandleDataType2["module"] = "module";
|
|
88
|
+
return EcsHandleDataType2;
|
|
89
|
+
})(EcsHandleDataType || {});
|
|
152
90
|
|
|
153
91
|
// src/nodes/node-systems-module.tsx
|
|
154
92
|
var import_layout = require("@awesome-flow/core/layout");
|
|
155
|
-
var
|
|
93
|
+
var import_react5 = require("react");
|
|
94
|
+
var import_core4 = require("@mantine/core");
|
|
156
95
|
|
|
157
96
|
// src/layout/systems-module-layout.tsx
|
|
158
97
|
var import_systems = require("@awesome-ecs/abstract/systems");
|
|
159
98
|
var import_core3 = require("@mantine/core");
|
|
160
|
-
var
|
|
99
|
+
var import_react4 = require("react");
|
|
100
|
+
|
|
101
|
+
// src/components/pipeline-middleware-list.tsx
|
|
102
|
+
var import_core2 = require("@mantine/core");
|
|
161
103
|
|
|
162
104
|
// src/components/badge-list.tsx
|
|
163
105
|
var import_core = require("@mantine/core");
|
|
164
|
-
var
|
|
106
|
+
var import_react3 = require("react");
|
|
165
107
|
|
|
166
108
|
// src/components/formatter-camel-case.tsx
|
|
167
|
-
var
|
|
109
|
+
var import_react2 = require("react");
|
|
168
110
|
function CamelCaseFormatter(props) {
|
|
169
|
-
const value = (0,
|
|
111
|
+
const value = (0, import_react2.useMemo)(
|
|
170
112
|
() => props.value?.toString().replace(/([a-z])([A-Z])/g, "$1 $2"),
|
|
171
113
|
[props.value]
|
|
172
114
|
);
|
|
173
115
|
return value;
|
|
174
116
|
}
|
|
175
|
-
var formatter_camel_case_default = (0,
|
|
117
|
+
var formatter_camel_case_default = (0, import_react2.memo)(CamelCaseFormatter);
|
|
176
118
|
|
|
177
119
|
// src/components/badge-list.tsx
|
|
178
|
-
var
|
|
120
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
179
121
|
function BadgeList(props) {
|
|
180
122
|
return props.items.map((value, i) => {
|
|
181
|
-
return /* @__PURE__ */ (0,
|
|
123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Badge, { ...props.badge || [], children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(formatter_camel_case_default, { value }) }, i);
|
|
182
124
|
});
|
|
183
125
|
}
|
|
184
|
-
var badge_list_default = (0,
|
|
126
|
+
var badge_list_default = (0, import_react3.memo)(BadgeList);
|
|
185
127
|
|
|
186
128
|
// src/components/pipeline-middleware-list.tsx
|
|
187
|
-
var
|
|
188
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
129
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
189
130
|
function PipelineMiddlewareList(props) {
|
|
190
131
|
let middleware = [];
|
|
191
132
|
if (props.pipeline) {
|
|
@@ -194,57 +135,55 @@ function PipelineMiddlewareList(props) {
|
|
|
194
135
|
const components = middleware.map((m) => {
|
|
195
136
|
return m.name || m.constructor.name;
|
|
196
137
|
});
|
|
197
|
-
return /* @__PURE__ */ (0,
|
|
198
|
-
/* @__PURE__ */ (0,
|
|
199
|
-
/* @__PURE__ */ (0,
|
|
138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Accordion.Item, { value: props.label, children: [
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Accordion.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Badge, { fullWidth: true, variant: "light", rightSection: components.length, children: props.label }) }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Accordion.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(badge_list_default, { items: components, badge: { variant: "outline" } }) }) })
|
|
200
141
|
] }, props.label);
|
|
201
142
|
}
|
|
202
143
|
var pipeline_middleware_list_default = PipelineMiddlewareList;
|
|
203
144
|
|
|
204
145
|
// src/layout/systems-module-layout.tsx
|
|
205
|
-
var
|
|
146
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
206
147
|
function SystemsModuleLayout(props) {
|
|
207
148
|
const { module: module2 } = props;
|
|
208
149
|
const runtimeContext = module2["runtimeContext"];
|
|
209
|
-
const systemContext = runtimeContext
|
|
210
|
-
const { status } = (0,
|
|
150
|
+
const { systemContext } = runtimeContext;
|
|
151
|
+
const { status } = (0, import_react4.useMemo)(() => {
|
|
211
152
|
return systemContext.runtime;
|
|
212
153
|
}, [systemContext.runtime.status]);
|
|
213
154
|
const init = runtimeContext.systemPipelines.get(import_systems.SystemType.initialize);
|
|
214
155
|
const update = runtimeContext.systemPipelines.get(import_systems.SystemType.update);
|
|
215
156
|
const render = runtimeContext.systemPipelines.get(import_systems.SystemType.render);
|
|
216
157
|
const sync = runtimeContext.systemPipelines.get(import_systems.SystemType.sync);
|
|
217
|
-
return /* @__PURE__ */ (0,
|
|
218
|
-
/* @__PURE__ */ (0,
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Text, { children: [
|
|
219
160
|
"Status: ",
|
|
220
161
|
status
|
|
221
162
|
] }),
|
|
222
|
-
/* @__PURE__ */ (0,
|
|
223
|
-
init && /* @__PURE__ */ (0,
|
|
224
|
-
update && /* @__PURE__ */ (0,
|
|
225
|
-
render && /* @__PURE__ */ (0,
|
|
226
|
-
sync && /* @__PURE__ */ (0,
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Accordion, { children: [
|
|
164
|
+
init && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(pipeline_middleware_list_default, { pipeline: init, label: "Initialize" }),
|
|
165
|
+
update && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(pipeline_middleware_list_default, { pipeline: update, label: "Update" }),
|
|
166
|
+
render && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(pipeline_middleware_list_default, { pipeline: render, label: "Render" }),
|
|
167
|
+
sync && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(pipeline_middleware_list_default, { pipeline: sync, label: "Sync" })
|
|
227
168
|
] })
|
|
228
169
|
] });
|
|
229
170
|
}
|
|
230
171
|
var systems_module_layout_default = SystemsModuleLayout;
|
|
231
172
|
|
|
232
173
|
// src/nodes/node-systems-module.tsx
|
|
233
|
-
var
|
|
234
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
174
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
235
175
|
function SystemsModuleNode({ id, data, selected, type }) {
|
|
236
|
-
const { systemsModuleRepository } = (0,
|
|
176
|
+
const { systemsModuleRepository } = (0, import_react5.useContext)(EcsFlowContext);
|
|
237
177
|
const module2 = systemsModuleRepository.get(data.entityType);
|
|
238
|
-
return /* @__PURE__ */ (0,
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
239
179
|
import_layout.NodeContainer,
|
|
240
180
|
{
|
|
241
181
|
id,
|
|
242
182
|
selected,
|
|
243
|
-
|
|
244
|
-
title: /* @__PURE__ */ (0,
|
|
245
|
-
templateId: data.templateId,
|
|
183
|
+
data,
|
|
184
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Badge, { fullWidth: true, color: "indigo", variant: "transparent", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(formatter_camel_case_default, { value: data.entityType }) }),
|
|
246
185
|
type,
|
|
247
|
-
children: /* @__PURE__ */ (0,
|
|
186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(systems_module_layout_default, { type: data.entityType, module: module2 })
|
|
248
187
|
}
|
|
249
188
|
);
|
|
250
189
|
}
|
|
@@ -253,96 +192,96 @@ var node_systems_module_default = SystemsModuleNode;
|
|
|
253
192
|
// src/nodes/node-entity.tsx
|
|
254
193
|
var import_layout2 = require("@awesome-flow/core/layout");
|
|
255
194
|
var import_core12 = require("@mantine/core");
|
|
256
|
-
var
|
|
195
|
+
var import_react12 = require("react");
|
|
257
196
|
|
|
258
197
|
// src/layout/entity-layout.tsx
|
|
259
198
|
var import_core11 = require("@mantine/core");
|
|
260
199
|
|
|
261
200
|
// src/components/entity-component-list.tsx
|
|
262
201
|
var import_core7 = require("@mantine/core");
|
|
263
|
-
var
|
|
202
|
+
var import_react8 = require("react");
|
|
264
203
|
|
|
265
204
|
// src/components/entity-component-inspector.tsx
|
|
266
205
|
var import_core6 = require("@mantine/core");
|
|
267
|
-
var
|
|
206
|
+
var import_react7 = require("react");
|
|
268
207
|
var import_hooks = require("@mantine/hooks");
|
|
269
208
|
|
|
270
209
|
// src/components/object-inspector.tsx
|
|
271
210
|
var import_core5 = require("@mantine/core");
|
|
272
|
-
var
|
|
211
|
+
var import_react6 = require("react");
|
|
273
212
|
var import_react_inspector = require("react-inspector");
|
|
274
|
-
var
|
|
213
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
275
214
|
function ObjectInspector(props) {
|
|
276
215
|
const colorScheme = (0, import_core5.useComputedColorScheme)();
|
|
277
|
-
const theme = (0,
|
|
216
|
+
const theme = (0, import_react6.useMemo)(
|
|
278
217
|
() => colorScheme === "dark" ? "chromeDark" : "chromeLight",
|
|
279
218
|
[colorScheme]
|
|
280
219
|
);
|
|
281
|
-
return /* @__PURE__ */ (0,
|
|
220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_inspector.Inspector, { table: false, theme, data: props.data });
|
|
282
221
|
}
|
|
283
|
-
var object_inspector_default = (0,
|
|
222
|
+
var object_inspector_default = (0, import_react6.memo)(ObjectInspector);
|
|
284
223
|
|
|
285
224
|
// src/components/entity-component-inspector.tsx
|
|
286
|
-
var
|
|
225
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
287
226
|
function EntityComponentInspector(props) {
|
|
288
227
|
const [opened, { toggle }] = (0, import_hooks.useDisclosure)(false);
|
|
289
|
-
const buttonColor = (0,
|
|
290
|
-
return /* @__PURE__ */ (0,
|
|
291
|
-
/* @__PURE__ */ (0,
|
|
292
|
-
/* @__PURE__ */ (0,
|
|
228
|
+
const buttonColor = (0, import_react7.useMemo)(() => opened ? "light" : "indigo", [opened]);
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core6.Box, { children: [
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core6.Button, { variant: "outline", size: "xs", onClick: toggle, color: buttonColor, fullWidth: true, children: props.component.componentType }),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core6.Collapse, { in: opened, children: opened && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(object_inspector_default, { data: props.component }) })
|
|
293
232
|
] });
|
|
294
233
|
}
|
|
295
|
-
var entity_component_inspector_default = (0,
|
|
234
|
+
var entity_component_inspector_default = (0, import_react7.memo)(EntityComponentInspector);
|
|
296
235
|
|
|
297
236
|
// src/components/entity-component-list.tsx
|
|
298
|
-
var
|
|
237
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
299
238
|
function EntityComponentList(props) {
|
|
300
239
|
const components = Array.from(props.entity.components.values());
|
|
301
|
-
return /* @__PURE__ */ (0,
|
|
302
|
-
/* @__PURE__ */ (0,
|
|
303
|
-
/* @__PURE__ */ (0,
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core7.Accordion.Item, { value: "components", children: [
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core7.Accordion.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core7.Badge, { fullWidth: true, variant: "light", rightSection: components.length, children: "Components" }) }),
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core7.Accordion.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core7.Stack, { children: components.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(entity_component_inspector_default, { component: c }, i)) }) })
|
|
304
243
|
] }, "components");
|
|
305
244
|
}
|
|
306
|
-
var entity_component_list_default = (0,
|
|
245
|
+
var entity_component_list_default = (0, import_react8.memo)(EntityComponentList);
|
|
307
246
|
|
|
308
247
|
// src/components/entity-proxy-list.tsx
|
|
309
248
|
var import_core8 = require("@mantine/core");
|
|
310
|
-
var
|
|
311
|
-
var
|
|
249
|
+
var import_react9 = require("react");
|
|
250
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
312
251
|
function EntityProxyList(props) {
|
|
313
252
|
const proxies = Array.from(props.entity.proxies.values()).map((c) => c.values());
|
|
314
|
-
const items = proxies.map((p) => Array.from(p).map((k) =>
|
|
315
|
-
return /* @__PURE__ */ (0,
|
|
316
|
-
/* @__PURE__ */ (0,
|
|
317
|
-
/* @__PURE__ */ (0,
|
|
253
|
+
const items = proxies.map((p) => Array.from(p).map((k) => EcsIdGenerator.entityProxy(k))).flat();
|
|
254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core8.Accordion.Item, { value: "proxies", children: [
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Accordion.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Badge, { fullWidth: true, variant: "light", rightSection: items.length, children: "Proxies" }) }),
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Accordion.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(badge_list_default, { items, badge: { variant: "outline" } }) }) })
|
|
318
257
|
] }, "proxies");
|
|
319
258
|
}
|
|
320
|
-
var entity_proxy_list_default = (0,
|
|
259
|
+
var entity_proxy_list_default = (0, import_react9.memo)(EntityProxyList);
|
|
321
260
|
|
|
322
261
|
// src/components/entity-subscription-list.tsx
|
|
323
262
|
var import_core9 = require("@mantine/core");
|
|
324
|
-
var
|
|
325
|
-
var
|
|
263
|
+
var import_react10 = require("react");
|
|
264
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
326
265
|
function EntitySubscriptionList(props) {
|
|
327
|
-
const { entityEventsManager } = (0,
|
|
266
|
+
const { entityEventsManager } = (0, import_react10.useContext)(EcsFlowContext);
|
|
328
267
|
const subscriptions = entityEventsManager.getSubscriptionsForEntity(props.entity.myProxy);
|
|
329
|
-
return /* @__PURE__ */ (0,
|
|
330
|
-
/* @__PURE__ */ (0,
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Accordion.Item, { value: "subscriptions", children: [
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Accordion.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Badge, { fullWidth: true, variant: "light", rightSection: subscriptions.length, children: "Events" }) }),
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Accordion.Panel, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Stack, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(badge_list_default, { items: subscriptions, badge: { variant: "outline" } }) }) })
|
|
332
271
|
] }, "subscriptions");
|
|
333
272
|
}
|
|
334
|
-
var entity_subscription_list_default = (0,
|
|
273
|
+
var entity_subscription_list_default = (0, import_react10.memo)(EntitySubscriptionList);
|
|
335
274
|
|
|
336
275
|
// src/components/entity-update-counter.tsx
|
|
337
276
|
var import_core10 = require("@mantine/core");
|
|
338
|
-
var
|
|
339
|
-
var
|
|
277
|
+
var import_react11 = require("react");
|
|
278
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
340
279
|
function EntityUpdateCounter(props) {
|
|
341
|
-
const [, setRefresh] = (0,
|
|
342
|
-
const { entityUpdateCounter } = (0,
|
|
280
|
+
const [, setRefresh] = (0, import_react11.useState)(0);
|
|
281
|
+
const { entityUpdateCounter } = (0, import_react11.useContext)(EcsFlowContext);
|
|
343
282
|
const updates = entityUpdateCounter.getUpdateCount(props.entityUid) || 0;
|
|
344
283
|
const removes = entityUpdateCounter.getRemoveCount(props.entityUid) || 0;
|
|
345
|
-
(0,
|
|
284
|
+
(0, import_react11.useEffect)(() => {
|
|
346
285
|
const interval = setInterval(() => {
|
|
347
286
|
setRefresh((refresh) => refresh + 1);
|
|
348
287
|
}, 1e3);
|
|
@@ -351,52 +290,107 @@ function EntityUpdateCounter(props) {
|
|
|
351
290
|
clearInterval(interval);
|
|
352
291
|
};
|
|
353
292
|
}, []);
|
|
354
|
-
return /* @__PURE__ */ (0,
|
|
355
|
-
/* @__PURE__ */ (0,
|
|
356
|
-
/* @__PURE__ */ (0,
|
|
293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
294
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Badge, { variant: "light", children: updates }),
|
|
295
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Badge, { variant: "light", color: "orange", children: removes })
|
|
357
296
|
] });
|
|
358
297
|
}
|
|
359
|
-
var entity_update_counter_default = (0,
|
|
298
|
+
var entity_update_counter_default = (0, import_react11.memo)(EntityUpdateCounter);
|
|
360
299
|
|
|
361
300
|
// src/layout/entity-layout.tsx
|
|
362
|
-
var
|
|
301
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
363
302
|
function EntityLayout({ entity }) {
|
|
364
|
-
return /* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
367
|
-
/* @__PURE__ */ (0,
|
|
303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core11.Group, { children: [
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.Badge, { variant: "outline", color: "orange", children: entity.myProxy.entityUid }),
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(entity_update_counter_default, { entityUid: entity.myProxy.entityUid })
|
|
368
307
|
] }),
|
|
369
|
-
/* @__PURE__ */ (0,
|
|
370
|
-
/* @__PURE__ */ (0,
|
|
371
|
-
/* @__PURE__ */ (0,
|
|
372
|
-
/* @__PURE__ */ (0,
|
|
373
|
-
/* @__PURE__ */ (0,
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.Divider, { my: 5 }),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_core11.Accordion, { children: [
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(entity_component_list_default, { entity }),
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(entity_proxy_list_default, { entity }),
|
|
312
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(entity_subscription_list_default, { entity })
|
|
374
313
|
] })
|
|
375
314
|
] });
|
|
376
315
|
}
|
|
377
316
|
var entity_layout_default = EntityLayout;
|
|
378
317
|
|
|
379
318
|
// src/nodes/node-entity.tsx
|
|
380
|
-
var
|
|
319
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
381
320
|
function EntityNode({ id, data, selected, type }) {
|
|
382
|
-
const { entityRepository } = (0,
|
|
383
|
-
const entity = (0,
|
|
384
|
-
return /* @__PURE__ */ (0,
|
|
321
|
+
const { entityRepository } = (0, import_react12.useContext)(EcsFlowContext);
|
|
322
|
+
const entity = (0, import_react12.useMemo)(() => entityRepository.get(data.entity), [data.entity]);
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
385
324
|
import_layout2.NodeContainer,
|
|
386
325
|
{
|
|
387
326
|
id,
|
|
388
327
|
selected,
|
|
389
|
-
|
|
390
|
-
title: /* @__PURE__ */ (0,
|
|
391
|
-
templateId: data.templateId,
|
|
328
|
+
data,
|
|
329
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core12.Badge, { fullWidth: true, variant: "transparent", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(formatter_camel_case_default, { value: entity.myProxy.entityType }) }),
|
|
392
330
|
type,
|
|
393
|
-
children: /* @__PURE__ */ (0,
|
|
331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(entity_layout_default, { entity })
|
|
394
332
|
}
|
|
395
333
|
);
|
|
396
334
|
}
|
|
397
335
|
var node_entity_default = EntityNode;
|
|
398
336
|
|
|
399
|
-
// src/node
|
|
337
|
+
// src/templates/template-entity-node.ts
|
|
338
|
+
var import_react13 = require("@xyflow/react");
|
|
339
|
+
|
|
340
|
+
// src/abstract/templates.ts
|
|
341
|
+
var EcsTemplateGroup = /* @__PURE__ */ ((EcsTemplateGroup2) => {
|
|
342
|
+
EcsTemplateGroup2["ecs"] = "ECS";
|
|
343
|
+
return EcsTemplateGroup2;
|
|
344
|
+
})(EcsTemplateGroup || {});
|
|
345
|
+
|
|
346
|
+
// src/templates/template-entity-node.ts
|
|
347
|
+
var EntityNodeTemplate = class {
|
|
348
|
+
template = {
|
|
349
|
+
type: "entity-node" /* entity */,
|
|
350
|
+
group: "ECS" /* ecs */,
|
|
351
|
+
data: {
|
|
352
|
+
title: "Entity",
|
|
353
|
+
entity: null
|
|
354
|
+
},
|
|
355
|
+
handles: [
|
|
356
|
+
{
|
|
357
|
+
dataType: "proxy" /* proxy */,
|
|
358
|
+
position: import_react13.Position.Left,
|
|
359
|
+
connection: "target",
|
|
360
|
+
disabled: true
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
dataType: "proxy" /* proxy */,
|
|
364
|
+
position: import_react13.Position.Right,
|
|
365
|
+
connection: "source",
|
|
366
|
+
disabled: true
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
// src/templates/template-systems-module.ts
|
|
373
|
+
var import_react14 = require("@xyflow/react");
|
|
374
|
+
var SystemsModuleNodeTemplate = class {
|
|
375
|
+
template = {
|
|
376
|
+
type: "systems-module-node" /* systemsModule */,
|
|
377
|
+
group: "ECS" /* ecs */,
|
|
378
|
+
data: {
|
|
379
|
+
title: "Systems Module",
|
|
380
|
+
entityType: null
|
|
381
|
+
},
|
|
382
|
+
handles: [
|
|
383
|
+
{
|
|
384
|
+
dataType: "module" /* module */,
|
|
385
|
+
position: import_react14.Position.Left,
|
|
386
|
+
connection: "target",
|
|
387
|
+
disabled: true
|
|
388
|
+
}
|
|
389
|
+
]
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// src/abstract/node-types.ts
|
|
400
394
|
var EcsNodeType = /* @__PURE__ */ ((EcsNodeType2) => {
|
|
401
395
|
EcsNodeType2["systemsModule"] = "systems-module-node";
|
|
402
396
|
EcsNodeType2["entity"] = "entity-node";
|
|
@@ -406,17 +400,86 @@ var ecsNodeTypes = {
|
|
|
406
400
|
["systems-module-node" /* systemsModule */]: node_systems_module_default,
|
|
407
401
|
["entity-node" /* entity */]: node_entity_default
|
|
408
402
|
};
|
|
403
|
+
var ecsNodeTemplates = {
|
|
404
|
+
["entity-node" /* entity */]: new EntityNodeTemplate(),
|
|
405
|
+
["systems-module-node" /* systemsModule */]: new SystemsModuleNodeTemplate()
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
// src/flow/flow-ecs-state.tsx
|
|
409
|
+
var import_react21 = require("react");
|
|
410
|
+
|
|
411
|
+
// src/flow/flow-ecs-auto-layout.tsx
|
|
412
|
+
var import_abstract = require("@awesome-flow/core/abstract");
|
|
413
|
+
var import_dagre = __toESM(require("@dagrejs/dagre"), 1);
|
|
414
|
+
var import_react15 = require("@xyflow/react");
|
|
415
|
+
var import_react16 = require("react");
|
|
416
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
417
|
+
function FlowEcsAutoLayout(props) {
|
|
418
|
+
const { getNodes, getEdges } = (0, import_react15.useReactFlow)();
|
|
419
|
+
const context = (0, import_react16.useContext)(import_abstract.FlowContext);
|
|
420
|
+
const setNodes = context.useFlowStore((state) => state.setNodes);
|
|
421
|
+
const graph = (0, import_react16.useMemo)(() => new import_dagre.default.graphlib.Graph().setDefaultEdgeLabel(() => ({})), []);
|
|
422
|
+
const getLayoutElements = (0, import_react16.useCallback)(
|
|
423
|
+
(nodes, edges, options) => {
|
|
424
|
+
graph.setGraph(options);
|
|
425
|
+
edges.forEach((edge) => graph.setEdge(edge.source, edge.target));
|
|
426
|
+
nodes.forEach((node) => {
|
|
427
|
+
if (node.measured) {
|
|
428
|
+
graph.setNode(node.id, {
|
|
429
|
+
width: node.measured.width,
|
|
430
|
+
height: node.measured.height
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
import_dagre.default.layout(graph);
|
|
435
|
+
return {
|
|
436
|
+
nodes: nodes.map((node) => {
|
|
437
|
+
const graphNode = graph.node(node.id);
|
|
438
|
+
if (graphNode) {
|
|
439
|
+
return { ...node, position: { x: graphNode.x, y: graphNode.y } };
|
|
440
|
+
}
|
|
441
|
+
return node;
|
|
442
|
+
}),
|
|
443
|
+
edges
|
|
444
|
+
};
|
|
445
|
+
},
|
|
446
|
+
[graph]
|
|
447
|
+
);
|
|
448
|
+
(0, import_react16.useEffect)(() => {
|
|
449
|
+
if (props.needsLayout) {
|
|
450
|
+
const storeNodes = getNodes();
|
|
451
|
+
if (storeNodes?.length) {
|
|
452
|
+
const edges = getEdges();
|
|
453
|
+
const layout = getLayoutElements(storeNodes, edges, {
|
|
454
|
+
rankdir: "LR"
|
|
455
|
+
});
|
|
456
|
+
setNodes(layout.nodes);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}, [props.needsLayout]);
|
|
460
|
+
(0, import_react16.useEffect)(() => {
|
|
461
|
+
if (props.needsLayout) {
|
|
462
|
+
props.setNeedsLayout(false);
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {});
|
|
466
|
+
}
|
|
467
|
+
var flow_ecs_auto_layout_default = FlowEcsAutoLayout;
|
|
468
|
+
|
|
469
|
+
// src/flow/flow-ecs-entities.tsx
|
|
470
|
+
var import_abstract4 = require("@awesome-flow/core/abstract");
|
|
471
|
+
var import_react19 = require("react");
|
|
409
472
|
|
|
410
|
-
// src/
|
|
411
|
-
var
|
|
473
|
+
// src/flow/flow-ecs-edge-proxies.tsx
|
|
474
|
+
var import_react17 = require("react");
|
|
412
475
|
var import_abstract2 = require("@awesome-flow/core/abstract");
|
|
413
476
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
414
477
|
function FlowEcsEdgeProxies(props) {
|
|
415
478
|
const { nodesToConnect } = props;
|
|
416
|
-
const context = (0,
|
|
479
|
+
const context = (0, import_react17.useContext)(import_abstract2.FlowContext);
|
|
417
480
|
const onConnect = context.useFlowStore((state) => state.onConnect);
|
|
418
|
-
const { ecsFlowRepository, entityRepository } = (0,
|
|
419
|
-
(0,
|
|
481
|
+
const { ecsFlowRepository, entityRepository } = (0, import_react17.useContext)(EcsFlowContext);
|
|
482
|
+
(0, import_react17.useEffect)(() => {
|
|
420
483
|
for (const node of nodesToConnect) {
|
|
421
484
|
const sourceHandle = node.data.handles.find((h) => h.connection === "source");
|
|
422
485
|
const entity = entityRepository.get(node.data.entity);
|
|
@@ -440,16 +503,16 @@ function FlowEcsEdgeProxies(props) {
|
|
|
440
503
|
}
|
|
441
504
|
var flow_ecs_edge_proxies_default = FlowEcsEdgeProxies;
|
|
442
505
|
|
|
443
|
-
// src/
|
|
444
|
-
var
|
|
506
|
+
// src/flow/flow-ecs-edge-modules.tsx
|
|
507
|
+
var import_react18 = require("react");
|
|
445
508
|
var import_abstract3 = require("@awesome-flow/core/abstract");
|
|
446
509
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
447
510
|
function FlowEcsEdgeModules(props) {
|
|
448
511
|
const { nodesToConnect } = props;
|
|
449
|
-
const context = (0,
|
|
512
|
+
const context = (0, import_react18.useContext)(import_abstract3.FlowContext);
|
|
450
513
|
const onConnect = context.useFlowStore((state) => state.onConnect);
|
|
451
|
-
const { ecsFlowRepository, entityRepository } = (0,
|
|
452
|
-
(0,
|
|
514
|
+
const { ecsFlowRepository, entityRepository } = (0, import_react18.useContext)(EcsFlowContext);
|
|
515
|
+
(0, import_react18.useEffect)(() => {
|
|
453
516
|
for (const node of nodesToConnect) {
|
|
454
517
|
const sourceHandle = node.data.handles.find((h) => h.connection === "source");
|
|
455
518
|
const entity = entityRepository.get(node.data.entity);
|
|
@@ -469,14 +532,14 @@ function FlowEcsEdgeModules(props) {
|
|
|
469
532
|
}
|
|
470
533
|
var flow_ecs_edge_modules_default = FlowEcsEdgeModules;
|
|
471
534
|
|
|
472
|
-
// src/
|
|
535
|
+
// src/flow/flow-ecs-entities.tsx
|
|
473
536
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
474
537
|
function FlowEcsEntities() {
|
|
475
|
-
const context = (0,
|
|
538
|
+
const context = (0, import_react19.useContext)(import_abstract4.FlowContext);
|
|
476
539
|
const addNodes = context.useFlowStore((state) => state.addNodes);
|
|
477
|
-
const { ecsFlowRepository, entityRepository } = (0,
|
|
478
|
-
const [entityNodes, setEntityNodes] = (0,
|
|
479
|
-
(0,
|
|
540
|
+
const { ecsFlowRepository, entityRepository } = (0, import_react19.useContext)(EcsFlowContext);
|
|
541
|
+
const [entityNodes, setEntityNodes] = (0, import_react19.useState)([]);
|
|
542
|
+
(0, import_react19.useEffect)(() => {
|
|
480
543
|
const entities = entityRepository.listAll();
|
|
481
544
|
const nodes = [];
|
|
482
545
|
for (const entity of entities) {
|
|
@@ -499,15 +562,15 @@ function FlowEcsEntities() {
|
|
|
499
562
|
}
|
|
500
563
|
var flow_ecs_entities_default = FlowEcsEntities;
|
|
501
564
|
|
|
502
|
-
// src/
|
|
503
|
-
var
|
|
565
|
+
// src/flow/flow-ecs-modules.tsx
|
|
566
|
+
var import_react20 = require("react");
|
|
504
567
|
var import_abstract5 = require("@awesome-flow/core/abstract");
|
|
505
568
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
506
569
|
function FlowEcsModules() {
|
|
507
|
-
const context = (0,
|
|
570
|
+
const context = (0, import_react20.useContext)(import_abstract5.FlowContext);
|
|
508
571
|
const addNodes = context.useFlowStore((state) => state.addNodes);
|
|
509
|
-
const { ecsFlowRepository, systemsModuleRepository } = (0,
|
|
510
|
-
(0,
|
|
572
|
+
const { ecsFlowRepository, systemsModuleRepository } = (0, import_react20.useContext)(EcsFlowContext);
|
|
573
|
+
(0, import_react20.useEffect)(() => {
|
|
511
574
|
const modules = Array.from(systemsModuleRepository.list()).filter((m) => !!m);
|
|
512
575
|
const keys = Array.from(modules.values()).map((v) => v[0]);
|
|
513
576
|
const nodesToAdd = [];
|
|
@@ -531,16 +594,16 @@ function FlowEcsModules() {
|
|
|
531
594
|
}
|
|
532
595
|
var flow_ecs_modules_default = FlowEcsModules;
|
|
533
596
|
|
|
534
|
-
// src/
|
|
597
|
+
// src/flow/flow-ecs-state.tsx
|
|
535
598
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
536
599
|
function FlowEcsState(props) {
|
|
537
|
-
const [, setUpdates] = (0,
|
|
538
|
-
const [needsLayout, setNeedsLayout] = (0,
|
|
539
|
-
const { ecsFlowRepository } = (0,
|
|
540
|
-
(0,
|
|
600
|
+
const [, setUpdates] = (0, import_react21.useState)(0);
|
|
601
|
+
const [needsLayout, setNeedsLayout] = (0, import_react21.useState)(false);
|
|
602
|
+
const { ecsFlowRepository } = (0, import_react21.useContext)(EcsFlowContext);
|
|
603
|
+
(0, import_react21.useEffect)(() => {
|
|
541
604
|
setNeedsLayout(true);
|
|
542
605
|
}, [ecsFlowRepository.sizeNodes]);
|
|
543
|
-
(0,
|
|
606
|
+
(0, import_react21.useEffect)(() => {
|
|
544
607
|
setInterval(() => {
|
|
545
608
|
setUpdates((updates) => updates + 1);
|
|
546
609
|
}, 1e3);
|
|
@@ -552,98 +615,19 @@ function FlowEcsState(props) {
|
|
|
552
615
|
] });
|
|
553
616
|
}
|
|
554
617
|
var flow_ecs_state_default = FlowEcsState;
|
|
555
|
-
|
|
556
|
-
// src/templates/template-entity-node.ts
|
|
557
|
-
var import_utils = require("@awesome-flow/core/utils");
|
|
558
|
-
|
|
559
|
-
// src/handle-types.ts
|
|
560
|
-
var EcsHandleDataType = /* @__PURE__ */ ((EcsHandleDataType2) => {
|
|
561
|
-
EcsHandleDataType2[EcsHandleDataType2["proxy"] = 1] = "proxy";
|
|
562
|
-
EcsHandleDataType2[EcsHandleDataType2["module"] = 2] = "module";
|
|
563
|
-
return EcsHandleDataType2;
|
|
564
|
-
})(EcsHandleDataType || {});
|
|
565
|
-
|
|
566
|
-
// src/templates/template-entity-node.ts
|
|
567
|
-
var import_react20 = require("@xyflow/react");
|
|
568
|
-
var EntityNodeTemplate = class {
|
|
569
|
-
create() {
|
|
570
|
-
const data = {
|
|
571
|
-
title: "Entity",
|
|
572
|
-
entity: null
|
|
573
|
-
};
|
|
574
|
-
return {
|
|
575
|
-
id: import_utils.IDGenerator.template(),
|
|
576
|
-
removable: false,
|
|
577
|
-
type: "entity-node" /* entity */,
|
|
578
|
-
data,
|
|
579
|
-
handles: [
|
|
580
|
-
{
|
|
581
|
-
dataType: 1 /* proxy */,
|
|
582
|
-
position: import_react20.Position.Left,
|
|
583
|
-
connection: "target",
|
|
584
|
-
disabled: true
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
dataType: 1 /* proxy */,
|
|
588
|
-
position: import_react20.Position.Right,
|
|
589
|
-
connection: "source",
|
|
590
|
-
disabled: true
|
|
591
|
-
}
|
|
592
|
-
]
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
isHandleAllowed() {
|
|
596
|
-
return false;
|
|
597
|
-
}
|
|
598
|
-
getHandleAllowedDataType() {
|
|
599
|
-
return 1 /* proxy */;
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
// src/templates/template-systems-module.ts
|
|
604
|
-
var import_utils2 = require("@awesome-flow/core/utils");
|
|
605
|
-
var import_react21 = require("@xyflow/react");
|
|
606
|
-
var SystemsModuleNodeTemplate = class {
|
|
607
|
-
create() {
|
|
608
|
-
const data = {
|
|
609
|
-
title: "Systems Module",
|
|
610
|
-
entityType: null,
|
|
611
|
-
handles: null,
|
|
612
|
-
templateId: null
|
|
613
|
-
};
|
|
614
|
-
return {
|
|
615
|
-
id: import_utils2.IDGenerator.template(),
|
|
616
|
-
removable: false,
|
|
617
|
-
type: "systems-module-node" /* systemsModule */,
|
|
618
|
-
data,
|
|
619
|
-
handles: [
|
|
620
|
-
{
|
|
621
|
-
dataType: 2 /* module */,
|
|
622
|
-
position: import_react21.Position.Left,
|
|
623
|
-
connection: "target",
|
|
624
|
-
disabled: true
|
|
625
|
-
}
|
|
626
|
-
]
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
isHandleAllowed() {
|
|
630
|
-
return false;
|
|
631
|
-
}
|
|
632
|
-
getHandleAllowedDataType() {
|
|
633
|
-
return 2 /* module */;
|
|
634
|
-
}
|
|
635
|
-
};
|
|
636
618
|
// Annotate the CommonJS export names for ESM import in node:
|
|
637
619
|
0 && (module.exports = {
|
|
638
620
|
EcsFlowContext,
|
|
639
621
|
EcsFlowRepository,
|
|
640
622
|
EcsHandleDataType,
|
|
641
623
|
EcsNodeType,
|
|
624
|
+
EcsTemplateGroup,
|
|
642
625
|
EntityNode,
|
|
643
626
|
EntityNodeTemplate,
|
|
644
627
|
FlowEcsState,
|
|
645
628
|
SystemsModuleNode,
|
|
646
629
|
SystemsModuleNodeTemplate,
|
|
630
|
+
ecsNodeTemplates,
|
|
647
631
|
ecsNodeTypes
|
|
648
632
|
});
|
|
649
633
|
//# sourceMappingURL=index.cjs.map
|