@awesome-flow/ecs 0.9.5 → 0.11.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 +87 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -24
- package/dist/index.d.cts.map +1 -1
- package/dist/{index.d.ts → index.d.mts} +12 -25
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +36 -53
- package/dist/index.mjs.map +1 -0
- package/package.json +20 -17
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -26,7 +26,7 @@ var EcsIdGenerator = class {
|
|
|
26
26
|
var EcsFlowRepository = class {
|
|
27
27
|
nodes;
|
|
28
28
|
constructor() {
|
|
29
|
-
this.nodes = new Map();
|
|
29
|
+
this.nodes = /* @__PURE__ */ new Map();
|
|
30
30
|
}
|
|
31
31
|
get sizeNodes() {
|
|
32
32
|
return this.nodes.size;
|
|
@@ -50,17 +50,16 @@ var EcsFlowRepository = class {
|
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/abstract/handle-types.ts
|
|
53
|
-
let EcsHandleDataType = /* @__PURE__ */ function(EcsHandleDataType
|
|
54
|
-
EcsHandleDataType
|
|
55
|
-
EcsHandleDataType
|
|
56
|
-
return EcsHandleDataType
|
|
53
|
+
let EcsHandleDataType = /* @__PURE__ */ function(EcsHandleDataType) {
|
|
54
|
+
EcsHandleDataType["proxy"] = "proxy";
|
|
55
|
+
EcsHandleDataType["module"] = "module";
|
|
56
|
+
return EcsHandleDataType;
|
|
57
57
|
}({});
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/formatter-camel-case.tsx
|
|
61
61
|
function CamelCaseFormatter(props) {
|
|
62
|
-
|
|
63
|
-
return value;
|
|
62
|
+
return useMemo(() => props.value?.toString().replace(/([a-z])([A-Z])/g, "$1 $2"), [props.value]);
|
|
64
63
|
}
|
|
65
64
|
var formatter_camel_case_default = memo(CamelCaseFormatter);
|
|
66
65
|
|
|
@@ -68,10 +67,9 @@ var formatter_camel_case_default = memo(CamelCaseFormatter);
|
|
|
68
67
|
//#region src/components/object-inspector.tsx
|
|
69
68
|
function ObjectInspector(props) {
|
|
70
69
|
const colorScheme = useComputedColorScheme();
|
|
71
|
-
const theme = useMemo(() => colorScheme === "dark" ? "chromeDark" : "chromeLight", [colorScheme]);
|
|
72
70
|
return /* @__PURE__ */ jsx(Inspector, {
|
|
73
71
|
table: false,
|
|
74
|
-
theme,
|
|
72
|
+
theme: useMemo(() => colorScheme === "dark" ? "chromeDark" : "chromeLight", [colorScheme]),
|
|
75
73
|
data: props.data
|
|
76
74
|
});
|
|
77
75
|
}
|
|
@@ -81,12 +79,11 @@ var object_inspector_default = memo(ObjectInspector);
|
|
|
81
79
|
//#region src/components/entity-component-inspector.tsx
|
|
82
80
|
function EntityComponentInspector(props) {
|
|
83
81
|
const [opened, { toggle }] = useDisclosure(false);
|
|
84
|
-
const buttonColor = useMemo(() => opened ? "light" : "indigo", [opened]);
|
|
85
82
|
return /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsx(Button, {
|
|
86
83
|
variant: "outline",
|
|
87
84
|
size: "xs",
|
|
88
85
|
onClick: toggle,
|
|
89
|
-
color:
|
|
86
|
+
color: useMemo(() => opened ? "light" : "indigo", [opened]),
|
|
90
87
|
fullWidth: true,
|
|
91
88
|
children: props.component.componentType
|
|
92
89
|
}), /* @__PURE__ */ jsx(Collapse, {
|
|
@@ -128,8 +125,7 @@ var badge_list_default = memo(BadgeList);
|
|
|
128
125
|
//#region src/components/entity-proxy-list.tsx
|
|
129
126
|
function EntityProxyList(props) {
|
|
130
127
|
const { entityProxyRepository } = useContext(EcsFlowContext);
|
|
131
|
-
const
|
|
132
|
-
const items = proxies.map((p) => EcsIdGenerator.entityProxy(p));
|
|
128
|
+
const items = Array.from(entityProxyRepository.getAll(props.entity.myProxy).values()).flat().map((p) => EcsIdGenerator.entityProxy(p));
|
|
133
129
|
return /* @__PURE__ */ jsxs(Accordion.Item, {
|
|
134
130
|
value: "proxies",
|
|
135
131
|
children: [/* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsx(Badge, {
|
|
@@ -177,7 +173,6 @@ function EntityUpdateCounter(props) {
|
|
|
177
173
|
setRefresh((refresh) => refresh + 1);
|
|
178
174
|
}, 1e3);
|
|
179
175
|
return () => {
|
|
180
|
-
console.log("CLEAR INTERVAL");
|
|
181
176
|
clearInterval(interval);
|
|
182
177
|
};
|
|
183
178
|
}, []);
|
|
@@ -209,7 +204,6 @@ function EntityLayout({ entity }) {
|
|
|
209
204
|
] })
|
|
210
205
|
] });
|
|
211
206
|
}
|
|
212
|
-
var entity_layout_default = EntityLayout;
|
|
213
207
|
|
|
214
208
|
//#endregion
|
|
215
209
|
//#region src/nodes/node-entity.tsx
|
|
@@ -226,10 +220,9 @@ function EntityNode({ id, data, selected, type }) {
|
|
|
226
220
|
children: /* @__PURE__ */ jsx(formatter_camel_case_default, { value: entity.myProxy.entityType })
|
|
227
221
|
}),
|
|
228
222
|
type,
|
|
229
|
-
children: /* @__PURE__ */ jsx(
|
|
223
|
+
children: /* @__PURE__ */ jsx(EntityLayout, { entity })
|
|
230
224
|
});
|
|
231
225
|
}
|
|
232
|
-
var node_entity_default = EntityNode;
|
|
233
226
|
|
|
234
227
|
//#endregion
|
|
235
228
|
//#region src/components/pipeline-middleware-list.tsx
|
|
@@ -252,41 +245,36 @@ function PipelineMiddlewareList(props) {
|
|
|
252
245
|
}) }) })]
|
|
253
246
|
}, props.label);
|
|
254
247
|
}
|
|
255
|
-
var pipeline_middleware_list_default = PipelineMiddlewareList;
|
|
256
248
|
|
|
257
249
|
//#endregion
|
|
258
250
|
//#region src/layout/systems-module-layout.tsx
|
|
259
251
|
function SystemsModuleLayout(props) {
|
|
260
252
|
const { module } = props;
|
|
261
|
-
const
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const sync = runtimeContext.systemPipelines.get(SystemType.sync);
|
|
270
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Text, { children: ["Status: ", status] }), /* @__PURE__ */ jsxs(Accordion, { children: [
|
|
271
|
-
init && /* @__PURE__ */ jsx(pipeline_middleware_list_default, {
|
|
253
|
+
const { systemContext, systemsModule } = module["runtimeContext"];
|
|
254
|
+
const error = systemContext.runtime.error;
|
|
255
|
+
const init = systemsModule.pipelines.get(SystemType.initialize);
|
|
256
|
+
const update = systemsModule.pipelines.get(SystemType.update);
|
|
257
|
+
const render = systemsModule.pipelines.get(SystemType.render);
|
|
258
|
+
const sync = systemsModule.pipelines.get(SystemType.sync);
|
|
259
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Text, { children: ["Error?: ", error] }), /* @__PURE__ */ jsxs(Accordion, { children: [
|
|
260
|
+
init && /* @__PURE__ */ jsx(PipelineMiddlewareList, {
|
|
272
261
|
pipeline: init,
|
|
273
262
|
label: "Initialize"
|
|
274
263
|
}),
|
|
275
|
-
update && /* @__PURE__ */ jsx(
|
|
264
|
+
update && /* @__PURE__ */ jsx(PipelineMiddlewareList, {
|
|
276
265
|
pipeline: update,
|
|
277
266
|
label: "Update"
|
|
278
267
|
}),
|
|
279
|
-
render && /* @__PURE__ */ jsx(
|
|
268
|
+
render && /* @__PURE__ */ jsx(PipelineMiddlewareList, {
|
|
280
269
|
pipeline: render,
|
|
281
270
|
label: "Render"
|
|
282
271
|
}),
|
|
283
|
-
sync && /* @__PURE__ */ jsx(
|
|
272
|
+
sync && /* @__PURE__ */ jsx(PipelineMiddlewareList, {
|
|
284
273
|
pipeline: sync,
|
|
285
274
|
label: "Sync"
|
|
286
275
|
})
|
|
287
276
|
] })] });
|
|
288
277
|
}
|
|
289
|
-
var systems_module_layout_default = SystemsModuleLayout;
|
|
290
278
|
|
|
291
279
|
//#endregion
|
|
292
280
|
//#region src/nodes/node-systems-module.tsx
|
|
@@ -304,19 +292,18 @@ function SystemsModuleNode({ id, data, selected, type }) {
|
|
|
304
292
|
children: /* @__PURE__ */ jsx(formatter_camel_case_default, { value: data.entityType })
|
|
305
293
|
}),
|
|
306
294
|
type,
|
|
307
|
-
children: /* @__PURE__ */ jsx(
|
|
295
|
+
children: /* @__PURE__ */ jsx(SystemsModuleLayout, {
|
|
308
296
|
type: data.entityType,
|
|
309
297
|
module
|
|
310
298
|
})
|
|
311
299
|
});
|
|
312
300
|
}
|
|
313
|
-
var node_systems_module_default = SystemsModuleNode;
|
|
314
301
|
|
|
315
302
|
//#endregion
|
|
316
303
|
//#region src/abstract/templates.ts
|
|
317
|
-
let EcsTemplateGroup = /* @__PURE__ */ function(EcsTemplateGroup
|
|
318
|
-
EcsTemplateGroup
|
|
319
|
-
return EcsTemplateGroup
|
|
304
|
+
let EcsTemplateGroup = /* @__PURE__ */ function(EcsTemplateGroup) {
|
|
305
|
+
EcsTemplateGroup["ecs"] = "ECS";
|
|
306
|
+
return EcsTemplateGroup;
|
|
320
307
|
}({});
|
|
321
308
|
|
|
322
309
|
//#endregion
|
|
@@ -364,14 +351,14 @@ var SystemsModuleNodeTemplate = class {
|
|
|
364
351
|
|
|
365
352
|
//#endregion
|
|
366
353
|
//#region src/abstract/node-types.ts
|
|
367
|
-
let EcsNodeType = /* @__PURE__ */ function(EcsNodeType
|
|
368
|
-
EcsNodeType
|
|
369
|
-
EcsNodeType
|
|
370
|
-
return EcsNodeType
|
|
354
|
+
let EcsNodeType = /* @__PURE__ */ function(EcsNodeType) {
|
|
355
|
+
EcsNodeType["systemsModule"] = "systems-module-node";
|
|
356
|
+
EcsNodeType["entity"] = "entity-node";
|
|
357
|
+
return EcsNodeType;
|
|
371
358
|
}({});
|
|
372
359
|
const ecsNodeTypes = {
|
|
373
|
-
[EcsNodeType.systemsModule]:
|
|
374
|
-
[EcsNodeType.entity]:
|
|
360
|
+
[EcsNodeType.systemsModule]: SystemsModuleNode,
|
|
361
|
+
[EcsNodeType.entity]: EntityNode
|
|
375
362
|
};
|
|
376
363
|
const ecsNodeTemplates = {
|
|
377
364
|
[EcsNodeType.entity]: new EntityNodeTemplate(),
|
|
@@ -405,7 +392,6 @@ function FlowEcsEdgeModules(props) {
|
|
|
405
392
|
]);
|
|
406
393
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
407
394
|
}
|
|
408
|
-
var flow_ecs_edge_modules_default = FlowEcsEdgeModules;
|
|
409
395
|
|
|
410
396
|
//#endregion
|
|
411
397
|
//#region src/flow/flow-ecs-edge-proxies.tsx
|
|
@@ -440,7 +426,6 @@ function FlowEcsEdgeProxies(props) {
|
|
|
440
426
|
]);
|
|
441
427
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
442
428
|
}
|
|
443
|
-
var flow_ecs_edge_proxies_default = FlowEcsEdgeProxies;
|
|
444
429
|
|
|
445
430
|
//#endregion
|
|
446
431
|
//#region src/flow/flow-ecs-entities.tsx
|
|
@@ -472,9 +457,8 @@ function FlowEcsEntities() {
|
|
|
472
457
|
nodeFactory,
|
|
473
458
|
addNodes
|
|
474
459
|
]);
|
|
475
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
460
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FlowEcsEdgeProxies, { nodesToConnect: entityNodes }), /* @__PURE__ */ jsx(FlowEcsEdgeModules, { nodesToConnect: entityNodes })] });
|
|
476
461
|
}
|
|
477
|
-
var flow_ecs_entities_default = FlowEcsEntities;
|
|
478
462
|
|
|
479
463
|
//#endregion
|
|
480
464
|
//#region src/flow/flow-ecs-modules.tsx
|
|
@@ -508,7 +492,6 @@ function FlowEcsModules() {
|
|
|
508
492
|
]);
|
|
509
493
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
510
494
|
}
|
|
511
|
-
var flow_ecs_modules_default = FlowEcsModules;
|
|
512
495
|
|
|
513
496
|
//#endregion
|
|
514
497
|
//#region src/flow/flow-ecs-state.tsx
|
|
@@ -525,13 +508,13 @@ function FlowEcsState(props) {
|
|
|
525
508
|
}, 1e3);
|
|
526
509
|
}, []);
|
|
527
510
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
528
|
-
props.showSystemModules && /* @__PURE__ */ jsx(
|
|
529
|
-
props.showEntities && /* @__PURE__ */ jsx(
|
|
511
|
+
props.showSystemModules && /* @__PURE__ */ jsx(FlowEcsModules, {}),
|
|
512
|
+
props.showEntities && /* @__PURE__ */ jsx(FlowEcsEntities, {}),
|
|
530
513
|
props.autoLayout && /* @__PURE__ */ jsx(FlowAutoLayout, { refreshLayout })
|
|
531
514
|
] });
|
|
532
515
|
}
|
|
533
516
|
var flow_ecs_state_default = memo(FlowEcsState);
|
|
534
517
|
|
|
535
518
|
//#endregion
|
|
536
|
-
export { EcsFlowContext, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EcsTemplateGroup,
|
|
537
|
-
//# sourceMappingURL=index.
|
|
519
|
+
export { EcsFlowContext, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EcsTemplateGroup, EntityNode, EntityNodeTemplate, flow_ecs_state_default as FlowEcsState, SystemsModuleNode, SystemsModuleNodeTemplate, ecsNodeTemplates, ecsNodeTypes };
|
|
520
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ObjectInspector","EntityComponentInspector","FormatterCamelCase","BadgeList","BadgeList","EntityUpdateCounter","EntityComponentList","EntityProxyList","EntitySubscriptionList","CamelCaseFormatter","BadgeList","CamelCaseFormatter"],"sources":["../src/abstract/ecs-flow-context.ts","../src/utils/id-generator.ts","../src/abstract/ecs-flow-repository.ts","../src/abstract/handle-types.ts","../src/components/formatter-camel-case.tsx","../src/components/object-inspector.tsx","../src/components/entity-component-inspector.tsx","../src/components/entity-component-list.tsx","../src/components/badge-list.tsx","../src/components/entity-proxy-list.tsx","../src/components/entity-subscription-list.tsx","../src/components/entity-update-counter.tsx","../src/layout/entity-layout.tsx","../src/nodes/node-entity.tsx","../src/components/pipeline-middleware-list.tsx","../src/layout/systems-module-layout.tsx","../src/nodes/node-systems-module.tsx","../src/abstract/templates.ts","../src/templates/template-entity-node.ts","../src/templates/template-systems-module.ts","../src/abstract/node-types.ts","../src/flow/flow-ecs-edge-modules.tsx","../src/flow/flow-ecs-edge-proxies.tsx","../src/flow/flow-ecs-entities.tsx","../src/flow/flow-ecs-modules.tsx","../src/flow/flow-ecs-state.tsx"],"sourcesContent":["import { IEntityEventsManager, IEntityProxyRepository, IEntityRepository } from '@awesome-ecs/abstract/entities';\r\nimport { ISystemsModuleRepository } from '@awesome-ecs/abstract/systems';\r\nimport { createContext } from 'react';\r\nimport { IEntityUpdateCounter } from '../utils/entity-update-counter';\r\nimport { EcsFlowRepository } from './ecs-flow-repository';\r\n\r\nexport type EcsFlowContextProps = {\r\n ecsFlowRepository: EcsFlowRepository;\r\n entityRepository: IEntityRepository;\r\n entityEventsManager: IEntityEventsManager;\r\n entityUpdateCounter: IEntityUpdateCounter;\r\n entityProxyRepository: IEntityProxyRepository;\r\n systemsModuleRepository: ISystemsModuleRepository;\r\n};\r\n\r\nexport const EcsFlowContext = createContext<EcsFlowContextProps>(null);\r\n","import { IEntityProxy } from '@awesome-ecs/abstract/entities';\n\nexport class EcsIdGenerator {\n static entityProxy(proxy: IEntityProxy): string {\n return `${proxy.entityType}:${proxy.entityUid}`;\n }\n}\n","import { EntityTypeUid, IEntityProxy } from '@awesome-ecs/abstract/entities';\r\nimport { Node } from '@xyflow/react';\r\nimport { EcsIdGenerator } from '../utils/id-generator';\r\nimport { EntityNodeData, SystemsModuleNodeData } from './node-props';\r\n\r\nexport class EcsFlowRepository {\r\n private readonly nodes: Map<string, Node>;\r\n\r\n constructor() {\r\n this.nodes = new Map();\r\n }\r\n\r\n get sizeNodes(): number {\r\n return this.nodes.size;\r\n }\r\n\r\n addSystemModuleNode(node: Node<SystemsModuleNodeData>) {\r\n this.nodes.set(node.data.entityType.toString(), node);\r\n }\r\n\r\n getSystemModuleNode(entityType: EntityTypeUid): Node<SystemsModuleNodeData> {\r\n return this.nodes.get(entityType.toString()) as Node<SystemsModuleNodeData>;\r\n }\r\n\r\n addEntityNode(node: Node<EntityNodeData>) {\r\n this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);\r\n }\r\n\r\n getEntityNode(entity: IEntityProxy): Node<EntityNodeData> {\r\n return this.nodes.get(EcsIdGenerator.entityProxy(entity)) as Node<EntityNodeData>;\r\n }\r\n\r\n listAllNodes(): Node[] {\r\n return Array.from(this.nodes.values());\r\n }\r\n}\r\n","export enum EcsHandleDataType {\n proxy = 'proxy',\n module = 'module'\n}\n","import { memo, useMemo } from 'react';\n\nexport type CamelCaseFormatterProps = {\n value: string | number;\n};\n\nfunction CamelCaseFormatter(props: Readonly<CamelCaseFormatterProps>) {\n const value = useMemo(\n () => props.value?.toString().replace(/([a-z])([A-Z])/g, '$1 $2'),\n [props.value]\n );\n return value;\n}\n\nexport default memo(CamelCaseFormatter);\n","import { useComputedColorScheme } from '@mantine/core';\nimport { memo, useMemo } from 'react';\nimport { Inspector } from 'react-inspector';\n\nexport type ObjectInspectorProps = {\n data: any;\n};\n\nfunction ObjectInspector(props: Readonly<ObjectInspectorProps>) {\n const colorScheme = useComputedColorScheme();\n\n const theme = useMemo(\n () => (colorScheme === 'dark' ? 'chromeDark' : 'chromeLight'),\n [colorScheme]\n );\n\n return <Inspector table={false} theme={theme} data={props.data} />;\n}\n\nexport default memo(ObjectInspector);\n","import { IComponent } from '@awesome-ecs/abstract/components';\nimport { Box, Button, Collapse } from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { memo, useMemo } from 'react';\nimport ObjectInspector from './object-inspector';\n\nexport type EntityComponentInspectorProps = {\n component: IComponent;\n};\n\nfunction EntityComponentInspector(props: Readonly<EntityComponentInspectorProps>) {\n const [opened, { toggle }] = useDisclosure(false);\n\n const buttonColor = useMemo(() => (opened ? 'light' : 'indigo'), [opened]);\n\n return (\n <Box>\n <Button variant=\"outline\" size=\"xs\" onClick={toggle} color={buttonColor} fullWidth>\n {props.component.componentType}\n </Button>\n\n <Collapse in={opened}>{opened && <ObjectInspector data={props.component} />}</Collapse>\n </Box>\n );\n}\n\nexport default memo(EntityComponentInspector);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport { memo } from 'react';\nimport EntityComponentInspector from './entity-component-inspector';\n\nexport type EntityComponentListProps = {\n entity: IEntity;\n};\n\nfunction EntityComponentList(props: Readonly<EntityComponentListProps>) {\n const components = Array.from(props.entity.components.values());\n\n return (\n <Accordion.Item key=\"components\" value=\"components\">\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={components.length}>\n Components\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n {components.map((c, i) => (\n <EntityComponentInspector component={c} key={i} />\n ))}\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default memo(EntityComponentList);\n","import { Badge, BadgeProps } from '@mantine/core';\nimport { memo } from 'react';\nimport FormatterCamelCase from './formatter-camel-case';\n\nexport type BadgeListProps = {\n items: (string | number)[];\n badge?: BadgeProps;\n};\n\nfunction BadgeList(props: Readonly<BadgeListProps>) {\n return props.items.map((value, i) => {\n return (\n <Badge key={i} {...(props.badge || [])}>\n <FormatterCamelCase value={value} />\n </Badge>\n );\n });\n}\n\nexport default memo(BadgeList);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\r\nimport { Accordion, Badge, Stack } from '@mantine/core';\r\nimport { memo, useContext } from 'react';\r\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\r\nimport { EcsIdGenerator } from '../utils/id-generator';\r\nimport BadgeList from './badge-list';\r\n\r\nexport type EntityProxyListProps = {\r\n entity: IEntity;\r\n};\r\n\r\nfunction EntityProxyList(props: Readonly<EntityProxyListProps>) {\r\n const { entityProxyRepository } = useContext(EcsFlowContext);\r\n\r\n const proxies = Array.from(entityProxyRepository.getAll(props.entity.myProxy).values()).flat();\r\n const items = proxies.map((p) => EcsIdGenerator.entityProxy(p));\r\n\r\n return (\r\n <Accordion.Item key=\"proxies\" value=\"proxies\">\r\n <Accordion.Control>\r\n <Badge fullWidth variant=\"light\" rightSection={items.length}>\r\n Proxies\r\n </Badge>\r\n </Accordion.Control>\r\n <Accordion.Panel>\r\n <Stack>\r\n <BadgeList items={items} badge={{ variant: 'outline' }} />\r\n </Stack>\r\n </Accordion.Panel>\r\n </Accordion.Item>\r\n );\r\n}\r\n\r\nexport default memo(EntityProxyList);\r\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport { memo, useContext } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport BadgeList from './badge-list';\n\nexport type EntitySubscriptionListProps = {\n entity: IEntity;\n};\n\nfunction EntitySubscriptionList(props: Readonly<EntitySubscriptionListProps>) {\n const { entityEventsManager } = useContext(EcsFlowContext);\n const subscriptions = entityEventsManager.getSubscriptionsForEntity(props.entity.myProxy);\n\n return (\n <Accordion.Item key=\"subscriptions\" value=\"subscriptions\">\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={subscriptions.length}>\n Events\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n <BadgeList items={subscriptions} badge={{ variant: 'outline' }} />\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default memo(EntitySubscriptionList);\n","import { EntityUid } from '@awesome-ecs/abstract/entities';\nimport { Badge } from '@mantine/core';\nimport { memo, useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\n\nexport type EntityUpdateCounterProps = {\n entityUid: EntityUid;\n};\n\nfunction EntityUpdateCounter(props: Readonly<EntityUpdateCounterProps>) {\n const [, setRefresh] = useState(0);\n\n const { entityUpdateCounter } = useContext(EcsFlowContext);\n\n const updates = entityUpdateCounter.getUpdateCount(props.entityUid) || 0;\n const removes = entityUpdateCounter.getRemoveCount(props.entityUid) || 0;\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRefresh((refresh) => refresh + 1);\n }, 1000);\n\n return () => {\n clearInterval(interval);\n };\n }, []);\n\n return (\n <>\n <Badge variant=\"light\">{updates}</Badge>\n <Badge variant=\"light\" color=\"orange\">\n {removes}\n </Badge>\n </>\n );\n}\n\nexport default memo(EntityUpdateCounter);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Divider, Group } from '@mantine/core';\nimport EntityComponentList from '../components/entity-component-list';\nimport EntityProxyList from '../components/entity-proxy-list';\nimport EntitySubscriptionList from '../components/entity-subscription-list';\nimport EntityUpdateCounter from '../components/entity-update-counter';\n\nexport type NodeEntityProps = {\n entity: IEntity;\n};\n\nfunction EntityLayout({ entity }: Readonly<NodeEntityProps>) {\n return (\n <>\n <Group>\n <Badge variant=\"outline\" color=\"orange\">\n {entity.myProxy.entityUid}\n </Badge>\n <EntityUpdateCounter entityUid={entity.myProxy.entityUid} />\n </Group>\n <Divider my={5} />\n <Accordion>\n <EntityComponentList entity={entity} />\n <EntityProxyList entity={entity} />\n <EntitySubscriptionList entity={entity} />\n </Accordion>\n </>\n );\n}\n\nexport default EntityLayout;\n","import { NodeContainer } from '@awesome-flow/core/layout';\r\nimport { Badge } from '@mantine/core';\r\nimport { Node, NodeProps } from '@xyflow/react';\r\nimport { useContext, useMemo } from 'react';\r\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\r\nimport { EntityNodeData } from '../abstract/node-props';\r\nimport CamelCaseFormatter from '../components/formatter-camel-case';\r\nimport EntityLayout from '../layout/entity-layout';\r\n\r\nfunction EntityNode({ id, data, selected, type }: NodeProps<Node<EntityNodeData>>) {\r\n const { entityRepository } = useContext(EcsFlowContext);\r\n const entity = useMemo(() => entityRepository.get(data.entity), [data.entity, entityRepository]);\r\n\r\n return (\r\n <NodeContainer\r\n id={id}\r\n selected={selected}\r\n data={data}\r\n title={\r\n <Badge fullWidth variant=\"transparent\">\r\n <CamelCaseFormatter value={entity.myProxy.entityType} />\r\n </Badge>\r\n }\r\n type={type}\r\n >\r\n <EntityLayout entity={entity} />\r\n </NodeContainer>\r\n );\r\n}\r\n\r\nexport default EntityNode;\r\n","import { IMiddleware, IPipeline, IPipelineContext } from '@awesome-ecs/abstract/pipelines';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport BadgeList from './badge-list';\n\nexport type PipelineMiddlewareListProps = {\n pipeline: IPipeline<IPipelineContext>;\n label: string;\n};\n\nfunction PipelineMiddlewareList(props: Readonly<PipelineMiddlewareListProps>) {\n let middleware: IMiddleware<IPipelineContext>[] = [];\n\n if (props.pipeline) {\n middleware = props.pipeline['middleware'] as IMiddleware<IPipelineContext>[];\n }\n\n const components = middleware.map((m) => {\n return m.name || m.constructor.name;\n });\n\n return (\n <Accordion.Item key={props.label} value={props.label}>\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={components.length}>\n {props.label}\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n <BadgeList items={components} badge={{ variant: 'outline' }} />\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default PipelineMiddlewareList;\n","import { EntityTypeUid, IEntity } from '@awesome-ecs/abstract/entities';\nimport { ISystemsModule, ISystemsRuntimeContext, SystemType } from '@awesome-ecs/abstract/systems';\nimport { Accordion, Text } from '@mantine/core';\nimport { useMemo } from 'react';\nimport PipelineMiddlewareList from '../components/pipeline-middleware-list';\n\nexport type NodeSystemModuleProps = {\n type: EntityTypeUid;\n module: ISystemsModule<IEntity>;\n};\n\nfunction SystemsModuleLayout(props: Readonly<NodeSystemModuleProps>) {\n const { module } = props;\n\n const runtimeContext = module['runtimeContext'] as ISystemsRuntimeContext<IEntity>;\n const { systemContext, systemsModule } = runtimeContext;\n\n const error = systemContext.runtime.error;\n\n const init = systemsModule.pipelines.get(SystemType.initialize);\n const update = systemsModule.pipelines.get(SystemType.update);\n const render = systemsModule.pipelines.get(SystemType.render);\n const sync = systemsModule.pipelines.get(SystemType.sync);\n\n return (\n <>\n <Text>Error?: {error}</Text>\n <Accordion>\n {init && <PipelineMiddlewareList pipeline={init} label=\"Initialize\" />}\n {update && <PipelineMiddlewareList pipeline={update} label=\"Update\" />}\n {render && <PipelineMiddlewareList pipeline={render} label=\"Render\" />}\n {sync && <PipelineMiddlewareList pipeline={sync} label=\"Sync\" />}\n </Accordion>\n </>\n );\n}\n\nexport default SystemsModuleLayout;\n","import { NodeContainer } from '@awesome-flow/core/layout';\r\nimport { Badge } from '@mantine/core';\r\nimport { Node, NodeProps } from '@xyflow/react';\r\nimport { useContext } from 'react';\r\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\r\nimport { SystemsModuleNodeData } from '../abstract/node-props';\r\nimport CamelCaseFormatter from '../components/formatter-camel-case';\r\nimport SystemsModuleLayout from '../layout/systems-module-layout';\r\n\r\nfunction SystemsModuleNode({ id, data, selected, type }: NodeProps<Node<SystemsModuleNodeData>>) {\r\n const { systemsModuleRepository } = useContext(EcsFlowContext);\r\n const module = systemsModuleRepository.get(data.entityType);\r\n\r\n return (\r\n <NodeContainer\r\n id={id}\r\n selected={selected}\r\n data={data}\r\n title={\r\n <Badge fullWidth color=\"indigo\" variant=\"transparent\">\r\n <CamelCaseFormatter value={data.entityType} />\r\n </Badge>\r\n }\r\n type={type}\r\n >\r\n <SystemsModuleLayout type={data.entityType} module={module} />\r\n </NodeContainer>\r\n );\r\n}\r\n\r\nexport default SystemsModuleNode;\r\n","export enum EcsTemplateGroup {\n ecs = 'ECS'\n}\n","import { ITemplateFactory, NodeTemplate } from '@awesome-flow/core/abstract';\nimport { Position } from '@xyflow/react';\nimport { EcsHandleDataType } from '../abstract/handle-types';\nimport { EntityNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport { EcsTemplateGroup } from '../abstract/templates';\n\nexport class EntityNodeTemplate implements ITemplateFactory {\n readonly template: NodeTemplate<EntityNodeData> = {\n type: EcsNodeType.entity,\n group: EcsTemplateGroup.ecs,\n data: {\n title: 'Entity',\n entity: null\n },\n handles: [\n {\n dataType: EcsHandleDataType.proxy,\n position: Position.Left,\n connection: 'target',\n disabled: true\n },\n {\n dataType: EcsHandleDataType.proxy,\n position: Position.Right,\n connection: 'source',\n disabled: true\n }\n ]\n };\n}\n","import { ITemplateFactory, NodeTemplate } from '@awesome-flow/core/abstract';\nimport { Position } from '@xyflow/react';\nimport { EcsHandleDataType } from '../abstract/handle-types';\nimport { SystemsModuleNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport { EcsTemplateGroup } from '../abstract/templates';\n\nexport class SystemsModuleNodeTemplate implements ITemplateFactory {\n readonly template: NodeTemplate<SystemsModuleNodeData> = {\n type: EcsNodeType.systemsModule,\n group: EcsTemplateGroup.ecs,\n data: {\n title: 'Systems Module',\n entityType: null\n },\n handles: [\n {\n dataType: EcsHandleDataType.module,\n position: Position.Left,\n connection: 'target',\n disabled: true\n }\n ]\n };\n}\n","import { NodeTypes } from '@xyflow/react';\nimport EntityNode from '../nodes/node-entity';\nimport SystemsModuleNode from '../nodes/node-systems-module';\nimport { EntityNodeTemplate } from '../templates/template-entity-node';\nimport { SystemsModuleNodeTemplate } from '../templates/template-systems-module';\n\nexport enum EcsNodeType {\n systemsModule = 'systems-module-node',\n entity = 'entity-node'\n}\n\nexport const ecsNodeTypes = {\n [EcsNodeType.systemsModule]: SystemsModuleNode,\n [EcsNodeType.entity]: EntityNode\n} satisfies NodeTypes;\n\nexport const ecsNodeTemplates = {\n [EcsNodeType.entity]: new EntityNodeTemplate(),\n [EcsNodeType.systemsModule]: new SystemsModuleNodeTemplate()\n};\n","import { useFlowStore } from '@awesome-flow/core/hooks';\nimport { Node } from '@xyflow/react';\nimport { useContext, useEffect } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\n\nexport type FlowEcsEdgeProxiesProps = {\n nodesToConnect: Node<EntityNodeData>[];\n};\n\nfunction FlowEcsEdgeModules(props: Readonly<FlowEcsEdgeProxiesProps>) {\n const { nodesToConnect } = props;\n\n const onConnect = useFlowStore((state: { onConnect: any }) => state.onConnect);\n\n const { ecsFlowRepository, entityRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n for (const node of nodesToConnect) {\n const sourceHandle = node.data.handles.find((h) => h.connection === 'source');\n const entity = entityRepository.get(node.data.entity);\n\n const systemModule = ecsFlowRepository.getSystemModuleNode(entity.myProxy.entityType);\n const targetHandle = systemModule?.data.handles.find((h) => h.connection === 'target');\n\n if (targetHandle) {\n onConnect({\n source: node.id,\n target: systemModule.id,\n sourceHandle: sourceHandle.handleId,\n targetHandle: targetHandle.handleId\n });\n }\n }\n }, [nodesToConnect, ecsFlowRepository, entityRepository, onConnect]);\n\n return <></>;\n}\n\nexport default FlowEcsEdgeModules;\n","import { useFlowStore } from '@awesome-flow/core/hooks';\r\nimport { Node } from '@xyflow/react';\r\nimport { useContext, useEffect } from 'react';\r\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\r\nimport { EntityNodeData } from '../abstract/node-props';\r\n\r\nexport type FlowEcsEdgeProxiesProps = {\r\n nodesToConnect: Node<EntityNodeData>[];\r\n};\r\n\r\nfunction FlowEcsEdgeProxies(props: Readonly<FlowEcsEdgeProxiesProps>) {\r\n const { nodesToConnect } = props;\r\n\r\n const onConnect = useFlowStore((state: { onConnect: any }) => state.onConnect);\r\n\r\n const { ecsFlowRepository, entityProxyRepository, entityRepository } = useContext(EcsFlowContext);\r\n\r\n useEffect(() => {\r\n for (const node of nodesToConnect) {\r\n const sourceHandle = node.data.handles.find((h) => h.connection === 'source');\r\n const entity = entityRepository.get(node.data.entity);\r\n const proxies = Array.from(entityProxyRepository.getAll(entity.myProxy).values()).flat();\r\n\r\n for (const proxy of proxies) {\r\n const proxyNode = ecsFlowRepository.getEntityNode(proxy);\r\n\r\n if (proxyNode) {\r\n const targetHandle = proxyNode.data.handles.find((h) => h.connection === 'target');\r\n\r\n onConnect({\r\n source: node.id,\r\n target: proxyNode.id,\r\n sourceHandle: sourceHandle.handleId,\r\n targetHandle: targetHandle.handleId\r\n });\r\n }\r\n }\r\n }\r\n }, [nodesToConnect, ecsFlowRepository, entityRepository, entityProxyRepository, onConnect]);\r\n\r\n return <></>;\r\n}\r\n\r\nexport default FlowEcsEdgeProxies;\r\n","import { FlowContext } from '@awesome-flow/core/abstract';\nimport { useFlowStore } from '@awesome-flow/core/hooks';\nimport { Node } from '@xyflow/react';\nimport { useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport FlowEcsEdgeModules from './flow-ecs-edge-modules';\nimport FlowEcsEdgeProxies from './flow-ecs-edge-proxies';\n\nfunction FlowEcsEntities() {\n const { nodeFactory } = useContext(FlowContext);\n const addNodes = useFlowStore((state) => state.addNodes);\n\n const { ecsFlowRepository, entityRepository } = useContext(EcsFlowContext);\n const [entityNodes, setEntityNodes] = useState<Node<EntityNodeData>[]>([]);\n\n useEffect(() => {\n const entities = entityRepository.listAll();\n const nodes = [];\n\n for (const entity of entities) {\n if (ecsFlowRepository.getEntityNode(entity.myProxy)) {\n continue;\n }\n\n const node = nodeFactory.createNodeFromType<EntityNodeData>(EcsNodeType.entity);\n\n node.data.entity = entity.myProxy;\n node.position = { x: 0, y: 0 };\n\n ecsFlowRepository.addEntityNode(node);\n nodes.push(node);\n }\n\n setEntityNodes(nodes);\n addNodes(nodes);\n }, [entityRepository, entityRepository.size, ecsFlowRepository, nodeFactory, addNodes]);\n\n return (\n <>\n <FlowEcsEdgeProxies nodesToConnect={entityNodes} />\n <FlowEcsEdgeModules nodesToConnect={entityNodes} />\n </>\n );\n}\n\nexport default FlowEcsEntities;\n","import { FlowContext } from '@awesome-flow/core/abstract';\r\nimport { useFlowStore } from '@awesome-flow/core/hooks';\r\nimport { useContext, useEffect } from 'react';\r\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\r\nimport { SystemsModuleNodeData } from '../abstract/node-props';\r\nimport { EcsNodeType } from '../abstract/node-types';\r\n\r\nfunction FlowEcsModules() {\r\n const { nodeFactory } = useContext(FlowContext);\r\n const addNodes = useFlowStore((state) => state.addNodes);\r\n\r\n const { ecsFlowRepository, systemsModuleRepository } = useContext(EcsFlowContext);\r\n\r\n useEffect(() => {\r\n const modules = Array.from(systemsModuleRepository.list()).filter((m) => !!m);\r\n const keys = Array.from(modules.values()).map((v) => v[0]);\r\n\r\n const nodesToAdd = [];\r\n\r\n for (const element of keys) {\r\n if (ecsFlowRepository.getSystemModuleNode(element)) {\r\n continue;\r\n }\r\n\r\n const node = nodeFactory.createNodeFromType<SystemsModuleNodeData>(EcsNodeType.systemsModule);\r\n\r\n node.data.entityType = element;\r\n node.position = { x: 0, y: 0 };\r\n\r\n ecsFlowRepository.addSystemModuleNode(node);\r\n nodesToAdd.push(node);\r\n }\r\n\r\n if (nodesToAdd.length) {\r\n addNodes(nodesToAdd);\r\n }\r\n }, [\r\n nodeFactory,\r\n addNodes,\r\n ecsFlowRepository,\r\n ecsFlowRepository.sizeNodes,\r\n systemsModuleRepository,\r\n systemsModuleRepository.size\r\n ]);\r\n\r\n return <></>;\r\n}\r\n\r\nexport default FlowEcsModules;\r\n","import { FlowAutoLayout } from '@awesome-flow/core/canvas';\nimport { memo, useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport FlowEcsEntities from './flow-ecs-entities';\nimport FlowEcsModules from './flow-ecs-modules';\n\nexport type FlowEcsStateProps = {\n showSystemModules: boolean;\n showEntities: boolean;\n autoLayout: boolean;\n};\n\nfunction FlowEcsState(props: Readonly<FlowEcsStateProps>) {\n const [, setUpdates] = useState(0);\n const [refreshLayout, setRefreshLayout] = useState(false);\n\n const { ecsFlowRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n setRefreshLayout(true);\n }, [ecsFlowRepository.sizeNodes]);\n\n useEffect(() => {\n setInterval(() => {\n setUpdates((updates) => updates + 1);\n }, 1000);\n }, []);\n\n return (\n <>\n {props.showSystemModules && <FlowEcsModules />}\n {props.showEntities && <FlowEcsEntities />}\n {props.autoLayout && <FlowAutoLayout refreshLayout={refreshLayout} />}\n </>\n );\n}\n\nexport default memo(FlowEcsState);\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,iBAAiB,cAAmC,KAAK;;;;ACbtE,IAAa,iBAAb,MAA4B;CAC1B,OAAO,YAAY,OAA6B;AAC9C,SAAO,GAAG,MAAM,WAAW,GAAG,MAAM;;;;;;ACCxC,IAAa,oBAAb,MAA+B;CAC7B,AAAiB;CAEjB,cAAc;AACZ,OAAK,wBAAQ,IAAI,KAAK;;CAGxB,IAAI,YAAoB;AACtB,SAAO,KAAK,MAAM;;CAGpB,oBAAoB,MAAmC;AACrD,OAAK,MAAM,IAAI,KAAK,KAAK,WAAW,UAAU,EAAE,KAAK;;CAGvD,oBAAoB,YAAwD;AAC1E,SAAO,KAAK,MAAM,IAAI,WAAW,UAAU,CAAC;;CAG9C,cAAc,MAA4B;AACxC,OAAK,MAAM,IAAI,eAAe,YAAY,KAAK,KAAK,OAAO,EAAE,KAAK;;CAGpE,cAAc,QAA4C;AACxD,SAAO,KAAK,MAAM,IAAI,eAAe,YAAY,OAAO,CAAC;;CAG3D,eAAuB;AACrB,SAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,CAAC;;;;;;ACjC1C,IAAY,oBAAL;AACL;AACA;;KACD;;;;ACGD,SAAS,mBAAmB,OAA0C;AAKpE,QAJc,cACN,MAAM,OAAO,UAAU,CAAC,QAAQ,mBAAmB,QAAQ,EACjE,CAAC,MAAM,MAAM,CACd;;AAIH,mCAAe,KAAK,mBAAmB;;;;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MAAM,EAAE,sBAAsB,WAAW,eAAe;AAExD,iBAAgB;AACd,mBAAiB,KAAK;IACrB,CAAC,kBAAkB,UAAU,CAAC;AAEjC,iBAAgB;AACd,oBAAkB;AAChB,eAAY,YAAY,UAAU,EAAE;KACnC,IAAK;IACP,EAAE,CAAC;AAEN,QACE;EACG,MAAM,qBAAqB,oBAAC,gBAAD,EAAkB;EAC7C,MAAM,gBAAgB,oBAAC,iBAAD,EAAmB;EACzC,MAAM,cAAc,oBAAC,gBAAD,EAA+B,eAAiB;EACpE;;AAIP,6BAAe,KAAK,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesome-flow/ecs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "The ECS package for Awesome Flow. Provides basic components to map Awesome ECS objects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"ts:watch": "npx tsc --noEmit --incremental --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"@awesome-ecs/core": "^0.22.0",
|
|
17
|
-
"@awesome-flow/core": "^0.9.5",
|
|
18
|
-
"react-inspector": "^6.0.2"
|
|
15
|
+
"react-inspector": "^9.0.0"
|
|
19
16
|
},
|
|
20
17
|
"peerDependencies": {
|
|
18
|
+
"@awesome-ecs/abstract": ">=0.22.0",
|
|
19
|
+
"@awesome-ecs/core": ">=0.22.0",
|
|
20
|
+
"@awesome-flow/core": ">=0.9.0",
|
|
21
21
|
"@mantine/core": ">=7.13.2",
|
|
22
22
|
"@mantine/hooks": ">=7.13.2",
|
|
23
23
|
"@tabler/icons-react": ">=3.19.0",
|
|
@@ -28,20 +28,23 @@
|
|
|
28
28
|
"zustand": ">=4.5.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"react": "^
|
|
37
|
-
"react
|
|
38
|
-
"
|
|
31
|
+
"@awesome-ecs/abstract": "^0.23.0",
|
|
32
|
+
"@awesome-ecs/core": "^0.23.0",
|
|
33
|
+
"@awesome-flow/core": "0.11.0",
|
|
34
|
+
"@mantine/core": "^8.3.16",
|
|
35
|
+
"@mantine/hooks": "^8.3.16",
|
|
36
|
+
"@tabler/icons-react": "^3.40.0",
|
|
37
|
+
"@xyflow/react": "^12.10.1",
|
|
38
|
+
"@xyflow/system": "^0.0.75",
|
|
39
|
+
"react": "^19.2.4",
|
|
40
|
+
"react-dom": "^19.2.4",
|
|
41
|
+
"zustand": "^5.0.11"
|
|
39
42
|
},
|
|
40
43
|
"exports": {
|
|
41
44
|
".": {
|
|
42
45
|
"import": {
|
|
43
|
-
"types": "./dist/index.d.
|
|
44
|
-
"default": "./dist/index.
|
|
46
|
+
"types": "./dist/index.d.mts",
|
|
47
|
+
"default": "./dist/index.mjs"
|
|
45
48
|
},
|
|
46
49
|
"require": {
|
|
47
50
|
"types": "./dist/index.d.cts",
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
},
|
|
52
55
|
"files": [
|
|
53
56
|
"dist",
|
|
54
|
-
"*.d.
|
|
57
|
+
"*.d.mts",
|
|
55
58
|
"*.d.cts"
|
|
56
59
|
],
|
|
57
60
|
"repository": {
|
|
@@ -76,5 +79,5 @@
|
|
|
76
79
|
"url": "https://github.com/privatebytes/awesome-flow/issues"
|
|
77
80
|
},
|
|
78
81
|
"homepage": "https://github.com/privatebytes/awesome-flow#readme",
|
|
79
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "c5dcf8e9f1131e63352ed0f9eb5cef64986ef139"
|
|
80
83
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/utils/entity-update-counter.ts","../src/abstract/node-props.ts","../src/abstract/ecs-flow-repository.ts","../src/abstract/ecs-flow-context.ts","../src/abstract/handle-types.ts","../src/nodes/node-entity.tsx","../src/nodes/node-systems-module.tsx","../src/templates/template-entity-node.ts","../src/templates/template-systems-module.ts","../src/abstract/node-types.ts","../src/abstract/templates.ts","../src/flow/flow-ecs-state.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAEiB,oBAAA;4BACW;4BACA;;;;;KCDhB,qBAAA,GAAwB;cACtB;;KAGF,cAAA,GAAiB;UACnB;;;;;cCHG,iBAAA;;;;4BAWe,KAAK;kCAIC,gBAAgB,KAAK;sBAIjC,KAAK;wBAIH,eAAe,KAAK;kBAI1B;AF9BlB;;;;KGKY,mBAAA;qBACS;oBACD;uBACG;uBACA;yBACE;2BACE;AHX3B,CAAA;AAAqC,cGcxB,cHdwB,EGcV,QAAA,CAAA,OHdU,CGcV,mBHdU,CAAA;;;;aIFzB,iBAAA;;;;;;;iBCSH,UAAA;;;;;GAAyC,UAAU,KAAK,mBAAgB,oBAAA,CAAA,GAAA,CAAA;;;iBCAxE,iBAAA;;;;;GAAgD,UAAU,KAAK,0BAAuB,kBAAA,CAAA,GAAA,CAAA;;;cCFlF,kBAAA,YAA8B;qBACtB,aAAa;;;;;cCDrB,yBAAA,YAAqC;qBAC7B,aAAa;;;;;aCFtB,WAAA;;;;cAKC;gCAGQ;;;ATZJ,cScJ,gBTdwB,EAAA;EAAA,aAAA,ESiBpC,kBTjBoC;EAAA,qBACT,2BAAA;CAAS;AACA;;;aUJzB,gBAAA;;;;;;KCMA,iBAAA;;;;;iBAMH,YAAA,QAAoB,SAAS,qBAAkB,kBAAA,CAAA,GAAA,CAAA;cAAA"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["proxy: IEntityProxy","node: Node<SystemsModuleNodeData>","entityType: EntityTypeUid","node: Node<EntityNodeData>","entity: IEntityProxy","props: Readonly<CamelCaseFormatterProps>","props: Readonly<ObjectInspectorProps>","props: Readonly<EntityComponentInspectorProps>","ObjectInspector","props: Readonly<EntityComponentListProps>","EntityComponentInspector","props: Readonly<BadgeListProps>","FormatterCamelCase","props: Readonly<EntityProxyListProps>","BadgeList","props: Readonly<EntitySubscriptionListProps>","BadgeList","props: Readonly<EntityUpdateCounterProps>","EntityUpdateCounter","EntityComponentList","EntityProxyList","EntitySubscriptionList","CamelCaseFormatter","EntityLayout","props: Readonly<PipelineMiddlewareListProps>","middleware: IMiddleware<IPipelineContext>[]","BadgeList","props: Readonly<NodeSystemModuleProps>","PipelineMiddlewareList","CamelCaseFormatter","SystemsModuleLayout","SystemsModuleNode","EntityNode","props: Readonly<FlowEcsEdgeProxiesProps>","state: { onConnect: any }","props: Readonly<FlowEcsEdgeProxiesProps>","state: { onConnect: any }","FlowEcsEdgeProxies","FlowEcsEdgeModules","props: Readonly<FlowEcsStateProps>","FlowEcsModules","FlowEcsEntities"],"sources":["../src/abstract/ecs-flow-context.ts","../src/utils/id-generator.ts","../src/abstract/ecs-flow-repository.ts","../src/abstract/handle-types.ts","../src/components/formatter-camel-case.tsx","../src/components/object-inspector.tsx","../src/components/entity-component-inspector.tsx","../src/components/entity-component-list.tsx","../src/components/badge-list.tsx","../src/components/entity-proxy-list.tsx","../src/components/entity-subscription-list.tsx","../src/components/entity-update-counter.tsx","../src/layout/entity-layout.tsx","../src/nodes/node-entity.tsx","../src/components/pipeline-middleware-list.tsx","../src/layout/systems-module-layout.tsx","../src/nodes/node-systems-module.tsx","../src/abstract/templates.ts","../src/templates/template-entity-node.ts","../src/templates/template-systems-module.ts","../src/abstract/node-types.ts","../src/flow/flow-ecs-edge-modules.tsx","../src/flow/flow-ecs-edge-proxies.tsx","../src/flow/flow-ecs-entities.tsx","../src/flow/flow-ecs-modules.tsx","../src/flow/flow-ecs-state.tsx"],"sourcesContent":["import { IEntityProxyRepository, IEntityRepository } from '@awesome-ecs/abstract/entities';\nimport { ISystemsModuleRepository } from '@awesome-ecs/abstract/systems';\nimport { EntityEventsManager } from '@awesome-ecs/core/entities';\nimport { createContext } from 'react';\nimport { IEntityUpdateCounter } from '../utils/entity-update-counter';\nimport { EcsFlowRepository } from './ecs-flow-repository';\n\nexport type EcsFlowContextProps = {\n ecsFlowRepository: EcsFlowRepository;\n entityRepository: IEntityRepository;\n entityEventsManager: EntityEventsManager;\n entityUpdateCounter: IEntityUpdateCounter;\n entityProxyRepository: IEntityProxyRepository;\n systemsModuleRepository: ISystemsModuleRepository;\n};\n\nexport const EcsFlowContext = createContext<EcsFlowContextProps>(null);\n","import { IEntityProxy } from '@awesome-ecs/abstract/entities';\n\nexport class EcsIdGenerator {\n static entityProxy(proxy: IEntityProxy): string {\n return `${proxy.entityType}:${proxy.entityUid}`;\n }\n}\n","import { EntityTypeUid, IEntityProxy } from '@awesome-ecs/abstract/entities';\nimport { Node } from '@xyflow/react';\nimport { EcsIdGenerator } from '../utils/id-generator';\nimport { EntityNodeData, SystemsModuleNodeData } from './node-props';\n\nexport class EcsFlowRepository {\n private nodes: Map<string, Node>;\n\n constructor() {\n this.nodes = new Map();\n }\n\n get sizeNodes(): number {\n return this.nodes.size;\n }\n\n addSystemModuleNode(node: Node<SystemsModuleNodeData>) {\n this.nodes.set(node.data.entityType.toString(), node);\n }\n\n getSystemModuleNode(entityType: EntityTypeUid): Node<SystemsModuleNodeData> {\n return this.nodes.get(entityType.toString()) as Node<SystemsModuleNodeData>;\n }\n\n addEntityNode(node: Node<EntityNodeData>) {\n this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);\n }\n\n getEntityNode(entity: IEntityProxy): Node<EntityNodeData> {\n return this.nodes.get(EcsIdGenerator.entityProxy(entity)) as Node<EntityNodeData>;\n }\n\n listAllNodes(): Node[] {\n return Array.from(this.nodes.values());\n }\n}\n","export enum EcsHandleDataType {\n proxy = 'proxy',\n module = 'module'\n}\n","import { memo, useMemo } from 'react';\n\nexport type CamelCaseFormatterProps = {\n value: string | number;\n};\n\nfunction CamelCaseFormatter(props: Readonly<CamelCaseFormatterProps>) {\n const value = useMemo(\n () => props.value?.toString().replace(/([a-z])([A-Z])/g, '$1 $2'),\n [props.value]\n );\n return value;\n}\n\nexport default memo(CamelCaseFormatter);\n","import { useComputedColorScheme } from '@mantine/core';\nimport { memo, useMemo } from 'react';\nimport { Inspector } from 'react-inspector';\n\nexport type ObjectInspectorProps = {\n data: any;\n};\n\nfunction ObjectInspector(props: Readonly<ObjectInspectorProps>) {\n const colorScheme = useComputedColorScheme();\n\n const theme = useMemo(\n () => (colorScheme === 'dark' ? 'chromeDark' : 'chromeLight'),\n [colorScheme]\n );\n\n return <Inspector table={false} theme={theme} data={props.data} />;\n}\n\nexport default memo(ObjectInspector);\n","import { IComponent } from '@awesome-ecs/abstract/components';\nimport { Box, Button, Collapse } from '@mantine/core';\nimport { useDisclosure } from '@mantine/hooks';\nimport { memo, useMemo } from 'react';\nimport ObjectInspector from './object-inspector';\n\nexport type EntityComponentInspectorProps = {\n component: IComponent;\n};\n\nfunction EntityComponentInspector(props: Readonly<EntityComponentInspectorProps>) {\n const [opened, { toggle }] = useDisclosure(false);\n\n const buttonColor = useMemo(() => (opened ? 'light' : 'indigo'), [opened]);\n\n return (\n <Box>\n <Button variant=\"outline\" size=\"xs\" onClick={toggle} color={buttonColor} fullWidth>\n {props.component.componentType}\n </Button>\n\n <Collapse in={opened}>{opened && <ObjectInspector data={props.component} />}</Collapse>\n </Box>\n );\n}\n\nexport default memo(EntityComponentInspector);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport { memo } from 'react';\nimport EntityComponentInspector from './entity-component-inspector';\n\nexport type EntityComponentListProps = {\n entity: IEntity;\n};\n\nfunction EntityComponentList(props: Readonly<EntityComponentListProps>) {\n const components = Array.from(props.entity.components.values());\n\n return (\n <Accordion.Item key=\"components\" value=\"components\">\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={components.length}>\n Components\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n {components.map((c, i) => (\n <EntityComponentInspector component={c} key={i} />\n ))}\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default memo(EntityComponentList);\n","import { Badge, BadgeProps } from '@mantine/core';\nimport { memo } from 'react';\nimport FormatterCamelCase from './formatter-camel-case';\n\nexport type BadgeListProps = {\n items: (string | number)[];\n badge?: BadgeProps;\n};\n\nfunction BadgeList(props: Readonly<BadgeListProps>) {\n return props.items.map((value, i) => {\n return (\n <Badge key={i} {...(props.badge || [])}>\n <FormatterCamelCase value={value} />\n </Badge>\n );\n });\n}\n\nexport default memo(BadgeList);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport { memo, useContext } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EcsIdGenerator } from '../utils/id-generator';\nimport BadgeList from './badge-list';\n\nexport type EntityProxyListProps = {\n entity: IEntity;\n};\n\nfunction EntityProxyList(props: Readonly<EntityProxyListProps>) {\n const { entityProxyRepository } = useContext(EcsFlowContext);\n\n const proxies = Array.from(entityProxyRepository.getAll(props.entity.myProxy).values()).flat();\n const items = proxies.map((p) => EcsIdGenerator.entityProxy(p));\n\n return (\n <Accordion.Item key=\"proxies\" value=\"proxies\">\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={items.length}>\n Proxies\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n <BadgeList items={items} badge={{ variant: 'outline' }} />\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default memo(EntityProxyList);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport { memo, useContext } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport BadgeList from './badge-list';\n\nexport type EntitySubscriptionListProps = {\n entity: IEntity;\n};\n\nfunction EntitySubscriptionList(props: Readonly<EntitySubscriptionListProps>) {\n const { entityEventsManager } = useContext(EcsFlowContext);\n const subscriptions = entityEventsManager.getSubscriptionsForEntity(props.entity.myProxy);\n\n return (\n <Accordion.Item key=\"subscriptions\" value=\"subscriptions\">\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={subscriptions.length}>\n Events\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n <BadgeList items={subscriptions} badge={{ variant: 'outline' }} />\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default memo(EntitySubscriptionList);\n","import { EntityUid } from '@awesome-ecs/abstract/entities';\nimport { Badge } from '@mantine/core';\nimport { memo, useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\n\nexport type EntityUpdateCounterProps = {\n entityUid: EntityUid;\n};\n\nfunction EntityUpdateCounter(props: Readonly<EntityUpdateCounterProps>) {\n const [, setRefresh] = useState(0);\n\n const { entityUpdateCounter } = useContext(EcsFlowContext);\n\n const updates = entityUpdateCounter.getUpdateCount(props.entityUid) || 0;\n const removes = entityUpdateCounter.getRemoveCount(props.entityUid) || 0;\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRefresh((refresh) => refresh + 1);\n }, 1000);\n\n return () => {\n console.log('CLEAR INTERVAL');\n clearInterval(interval);\n };\n }, []);\n\n return (\n <>\n <Badge variant=\"light\">{updates}</Badge>\n <Badge variant=\"light\" color=\"orange\">\n {removes}\n </Badge>\n </>\n );\n}\n\nexport default memo(EntityUpdateCounter);\n","import { IEntity } from '@awesome-ecs/abstract/entities';\nimport { Accordion, Badge, Divider, Group } from '@mantine/core';\nimport EntityComponentList from '../components/entity-component-list';\nimport EntityProxyList from '../components/entity-proxy-list';\nimport EntitySubscriptionList from '../components/entity-subscription-list';\nimport EntityUpdateCounter from '../components/entity-update-counter';\n\nexport type NodeEntityProps = {\n entity: IEntity;\n};\n\nfunction EntityLayout({ entity }: Readonly<NodeEntityProps>) {\n return (\n <>\n <Group>\n <Badge variant=\"outline\" color=\"orange\">\n {entity.myProxy.entityUid}\n </Badge>\n <EntityUpdateCounter entityUid={entity.myProxy.entityUid} />\n </Group>\n <Divider my={5} />\n <Accordion>\n <EntityComponentList entity={entity} />\n <EntityProxyList entity={entity} />\n <EntitySubscriptionList entity={entity} />\n </Accordion>\n </>\n );\n}\n\nexport default EntityLayout;\n","import { NodeContainer } from '@awesome-flow/core/layout';\nimport { Badge } from '@mantine/core';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useContext, useMemo } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\nimport CamelCaseFormatter from '../components/formatter-camel-case';\nimport EntityLayout from '../layout/entity-layout';\n\nfunction EntityNode({ id, data, selected, type }: NodeProps<Node<EntityNodeData>>) {\n const { entityRepository } = useContext(EcsFlowContext);\n const entity = useMemo(() => entityRepository.get(data.entity), [data.entity, entityRepository]);\n\n return (\n <NodeContainer\n id={id}\n selected={selected}\n data={data}\n title={\n <Badge fullWidth variant=\"transparent\">\n <CamelCaseFormatter value={entity.myProxy.entityType} />\n </Badge>\n }\n type={type}\n >\n <EntityLayout entity={entity} />\n </NodeContainer>\n );\n}\n\nexport default EntityNode;\n","import { IMiddleware, IPipeline, IPipelineContext } from '@awesome-ecs/abstract/pipelines';\nimport { Accordion, Badge, Stack } from '@mantine/core';\nimport BadgeList from './badge-list';\n\nexport type PipelineMiddlewareListProps = {\n pipeline: IPipeline<IPipelineContext>;\n label: string;\n};\n\nfunction PipelineMiddlewareList(props: Readonly<PipelineMiddlewareListProps>) {\n let middleware: IMiddleware<IPipelineContext>[] = [];\n\n if (props.pipeline) {\n middleware = props.pipeline['middleware'] as IMiddleware<IPipelineContext>[];\n }\n\n const components = middleware.map((m) => {\n return m.name || m.constructor.name;\n });\n\n return (\n <Accordion.Item key={props.label} value={props.label}>\n <Accordion.Control>\n <Badge fullWidth variant=\"light\" rightSection={components.length}>\n {props.label}\n </Badge>\n </Accordion.Control>\n <Accordion.Panel>\n <Stack>\n <BadgeList items={components} badge={{ variant: 'outline' }} />\n </Stack>\n </Accordion.Panel>\n </Accordion.Item>\n );\n}\n\nexport default PipelineMiddlewareList;\n","import { EntityTypeUid, IEntity } from '@awesome-ecs/abstract/entities';\nimport { ISystemsModule, ISystemsRuntimeContext, SystemType } from '@awesome-ecs/abstract/systems';\nimport { Accordion, Text } from '@mantine/core';\nimport { useMemo } from 'react';\nimport PipelineMiddlewareList from '../components/pipeline-middleware-list';\n\nexport type NodeSystemModuleProps = {\n type: EntityTypeUid;\n module: ISystemsModule<IEntity>;\n};\n\nfunction SystemsModuleLayout(props: Readonly<NodeSystemModuleProps>) {\n const { module } = props;\n\n const runtimeContext = module['runtimeContext'] as ISystemsRuntimeContext<IEntity>;\n const { systemContext } = runtimeContext;\n\n const { status } = useMemo(() => {\n return systemContext.runtime;\n }, [systemContext.runtime]);\n\n const init = runtimeContext.systemPipelines.get(SystemType.initialize);\n const update = runtimeContext.systemPipelines.get(SystemType.update);\n const render = runtimeContext.systemPipelines.get(SystemType.render);\n const sync = runtimeContext.systemPipelines.get(SystemType.sync);\n\n return (\n <>\n <Text>Status: {status}</Text>\n <Accordion>\n {init && <PipelineMiddlewareList pipeline={init} label=\"Initialize\" />}\n {update && <PipelineMiddlewareList pipeline={update} label=\"Update\" />}\n {render && <PipelineMiddlewareList pipeline={render} label=\"Render\" />}\n {sync && <PipelineMiddlewareList pipeline={sync} label=\"Sync\" />}\n </Accordion>\n </>\n );\n}\n\nexport default SystemsModuleLayout;\n","import { NodeContainer } from '@awesome-flow/core/layout';\nimport { Badge } from '@mantine/core';\nimport { Node, NodeProps } from '@xyflow/react';\nimport { useContext } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { SystemsModuleNodeData } from '../abstract/node-props';\nimport CamelCaseFormatter from '../components/formatter-camel-case';\nimport SystemsModuleLayout from '../layout/systems-module-layout';\n\nfunction SystemsModuleNode({ id, data, selected, type }: NodeProps<Node<SystemsModuleNodeData>>) {\n const { systemsModuleRepository } = useContext(EcsFlowContext);\n const module = systemsModuleRepository.get(data.entityType);\n\n return (\n <NodeContainer\n id={id}\n selected={selected}\n data={data}\n title={\n <Badge fullWidth color=\"indigo\" variant=\"transparent\">\n <CamelCaseFormatter value={data.entityType} />\n </Badge>\n }\n type={type}\n >\n <SystemsModuleLayout type={data.entityType} module={module} />\n </NodeContainer>\n );\n}\n\nexport default SystemsModuleNode;\n","export enum EcsTemplateGroup {\n ecs = 'ECS'\n}\n","import { ITemplateFactory, NodeTemplate } from '@awesome-flow/core/abstract';\nimport { Position } from '@xyflow/react';\nimport { EcsHandleDataType } from '../abstract/handle-types';\nimport { EntityNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport { EcsTemplateGroup } from '../abstract/templates';\n\nexport class EntityNodeTemplate implements ITemplateFactory {\n readonly template: NodeTemplate<EntityNodeData> = {\n type: EcsNodeType.entity,\n group: EcsTemplateGroup.ecs,\n data: {\n title: 'Entity',\n entity: null\n },\n handles: [\n {\n dataType: EcsHandleDataType.proxy,\n position: Position.Left,\n connection: 'target',\n disabled: true\n },\n {\n dataType: EcsHandleDataType.proxy,\n position: Position.Right,\n connection: 'source',\n disabled: true\n }\n ]\n };\n}\n","import { ITemplateFactory, NodeTemplate } from '@awesome-flow/core/abstract';\nimport { Position } from '@xyflow/react';\nimport { EcsHandleDataType } from '../abstract/handle-types';\nimport { SystemsModuleNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport { EcsTemplateGroup } from '../abstract/templates';\n\nexport class SystemsModuleNodeTemplate implements ITemplateFactory {\n readonly template: NodeTemplate<SystemsModuleNodeData> = {\n type: EcsNodeType.systemsModule,\n group: EcsTemplateGroup.ecs,\n data: {\n title: 'Systems Module',\n entityType: null\n },\n handles: [\n {\n dataType: EcsHandleDataType.module,\n position: Position.Left,\n connection: 'target',\n disabled: true\n }\n ]\n };\n}\n","import { NodeTypes } from '@xyflow/react';\nimport EntityNode from '../nodes/node-entity';\nimport SystemsModuleNode from '../nodes/node-systems-module';\nimport { EntityNodeTemplate } from '../templates/template-entity-node';\nimport { SystemsModuleNodeTemplate } from '../templates/template-systems-module';\n\nexport enum EcsNodeType {\n systemsModule = 'systems-module-node',\n entity = 'entity-node'\n}\n\nexport const ecsNodeTypes = {\n [EcsNodeType.systemsModule]: SystemsModuleNode,\n [EcsNodeType.entity]: EntityNode\n} satisfies NodeTypes;\n\nexport const ecsNodeTemplates = {\n [EcsNodeType.entity]: new EntityNodeTemplate(),\n [EcsNodeType.systemsModule]: new SystemsModuleNodeTemplate()\n};\n","import { useFlowStore } from '@awesome-flow/core/hooks';\nimport { Node } from '@xyflow/react';\nimport { useContext, useEffect } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\n\nexport type FlowEcsEdgeProxiesProps = {\n nodesToConnect: Node<EntityNodeData>[];\n};\n\nfunction FlowEcsEdgeModules(props: Readonly<FlowEcsEdgeProxiesProps>) {\n const { nodesToConnect } = props;\n\n const onConnect = useFlowStore((state: { onConnect: any }) => state.onConnect);\n\n const { ecsFlowRepository, entityRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n for (const node of nodesToConnect) {\n const sourceHandle = node.data.handles.find((h) => h.connection === 'source');\n const entity = entityRepository.get(node.data.entity);\n\n const systemModule = ecsFlowRepository.getSystemModuleNode(entity.myProxy.entityType);\n const targetHandle = systemModule?.data.handles.find((h) => h.connection === 'target');\n\n if (targetHandle) {\n onConnect({\n source: node.id,\n target: systemModule.id,\n sourceHandle: sourceHandle.handleId,\n targetHandle: targetHandle.handleId\n });\n }\n }\n }, [nodesToConnect, ecsFlowRepository, entityRepository, onConnect]);\n\n return <></>;\n}\n\nexport default FlowEcsEdgeModules;\n","import { useFlowStore } from '@awesome-flow/core/hooks';\nimport { Node } from '@xyflow/react';\nimport { useContext, useEffect } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\n\nexport type FlowEcsEdgeProxiesProps = {\n nodesToConnect: Node<EntityNodeData>[];\n};\n\nfunction FlowEcsEdgeProxies(props: Readonly<FlowEcsEdgeProxiesProps>) {\n const { nodesToConnect } = props;\n\n const onConnect = useFlowStore((state: { onConnect: any }) => state.onConnect);\n\n const { ecsFlowRepository, entityProxyRepository, entityRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n for (const node of nodesToConnect) {\n const sourceHandle = node.data.handles.find((h) => h.connection === 'source');\n const entity = entityRepository.get(node.data.entity);\n const proxies = Array.from(entityProxyRepository.getAll(entity.myProxy).values()).flat();\n\n for (const proxy of proxies) {\n const proxyNode = ecsFlowRepository.getEntityNode(proxy);\n\n if (proxyNode) {\n const targetHandle = proxyNode.data.handles.find((h) => h.connection === 'target');\n\n onConnect({\n source: node.id,\n target: proxyNode.id,\n sourceHandle: sourceHandle.handleId,\n targetHandle: targetHandle.handleId\n });\n }\n }\n }\n }, [nodesToConnect, ecsFlowRepository, entityRepository, entityProxyRepository, onConnect]);\n\n return <></>;\n}\n\nexport default FlowEcsEdgeProxies;\n","import { FlowContext } from '@awesome-flow/core/abstract';\nimport { useFlowStore } from '@awesome-flow/core/hooks';\nimport { Node } from '@xyflow/react';\nimport { useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { EntityNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\nimport FlowEcsEdgeModules from './flow-ecs-edge-modules';\nimport FlowEcsEdgeProxies from './flow-ecs-edge-proxies';\n\nfunction FlowEcsEntities() {\n const { nodeFactory } = useContext(FlowContext);\n const addNodes = useFlowStore((state) => state.addNodes);\n\n const { ecsFlowRepository, entityRepository } = useContext(EcsFlowContext);\n const [entityNodes, setEntityNodes] = useState<Node<EntityNodeData>[]>([]);\n\n useEffect(() => {\n const entities = entityRepository.listAll();\n const nodes = [];\n\n for (const entity of entities) {\n if (ecsFlowRepository.getEntityNode(entity.myProxy)) {\n continue;\n }\n\n const node = nodeFactory.createNodeFromType<EntityNodeData>(EcsNodeType.entity);\n\n node.data.entity = entity.myProxy;\n node.position = { x: 0, y: 0 };\n\n ecsFlowRepository.addEntityNode(node);\n nodes.push(node);\n }\n\n setEntityNodes(nodes);\n addNodes(nodes);\n }, [entityRepository, entityRepository.size, ecsFlowRepository, nodeFactory, addNodes]);\n\n return (\n <>\n <FlowEcsEdgeProxies nodesToConnect={entityNodes} />\n <FlowEcsEdgeModules nodesToConnect={entityNodes} />\n </>\n );\n}\n\nexport default FlowEcsEntities;\n","import { FlowContext } from '@awesome-flow/core/abstract';\nimport { useFlowStore } from '@awesome-flow/core/hooks';\nimport { useContext, useEffect } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport { SystemsModuleNodeData } from '../abstract/node-props';\nimport { EcsNodeType } from '../abstract/node-types';\n\nfunction FlowEcsModules() {\n const { nodeFactory } = useContext(FlowContext);\n const addNodes = useFlowStore((state) => state.addNodes);\n\n const { ecsFlowRepository, systemsModuleRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n const modules = Array.from(systemsModuleRepository.list()).filter((m) => !!m);\n const keys = Array.from(modules.values()).map((v) => v[0]);\n\n const nodesToAdd = [];\n\n for (const element of keys) {\n if (ecsFlowRepository.getSystemModuleNode(element)) {\n continue;\n }\n\n const node = nodeFactory.createNodeFromType<SystemsModuleNodeData>(EcsNodeType.systemsModule);\n\n node.data.entityType = element;\n node.position = { x: 0, y: 0 };\n\n ecsFlowRepository.addSystemModuleNode(node);\n nodesToAdd.push(node);\n }\n\n if (nodesToAdd.length) {\n addNodes(nodesToAdd);\n }\n }, [\n nodeFactory,\n addNodes,\n ecsFlowRepository,\n ecsFlowRepository.sizeNodes,\n systemsModuleRepository,\n systemsModuleRepository.size\n ]);\n\n return <></>;\n}\n\nexport default FlowEcsModules;\n","import { FlowAutoLayout } from '@awesome-flow/core/canvas';\nimport { memo, useContext, useEffect, useState } from 'react';\nimport { EcsFlowContext } from '../abstract/ecs-flow-context';\nimport FlowEcsEntities from './flow-ecs-entities';\nimport FlowEcsModules from './flow-ecs-modules';\n\nexport type FlowEcsStateProps = {\n showSystemModules: boolean;\n showEntities: boolean;\n autoLayout: boolean;\n};\n\nfunction FlowEcsState(props: Readonly<FlowEcsStateProps>) {\n const [, setUpdates] = useState(0);\n const [refreshLayout, setRefreshLayout] = useState(false);\n\n const { ecsFlowRepository } = useContext(EcsFlowContext);\n\n useEffect(() => {\n setRefreshLayout(true);\n }, [ecsFlowRepository.sizeNodes]);\n\n useEffect(() => {\n setInterval(() => {\n setUpdates((updates) => updates + 1);\n }, 1000);\n }, []);\n\n return (\n <>\n {props.showSystemModules && <FlowEcsModules />}\n {props.showEntities && <FlowEcsEntities />}\n {props.autoLayout && <FlowAutoLayout refreshLayout={refreshLayout} />}\n </>\n );\n}\n\nexport default memo(FlowEcsState);\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,iBAAiB,cAAmC,KAAK;;;;ACdtE,IAAa,iBAAb,MAA4B;CAC1B,OAAO,YAAYA,OAA6B;AAC9C,UAAQ,EAAE,MAAM,WAAW,GAAG,MAAM,UAAU;CAC/C;AACF;;;;ACDD,IAAa,oBAAb,MAA+B;CAC7B,AAAQ;CAER,cAAc;AACZ,OAAK,QAAQ,IAAI;CAClB;CAED,IAAI,YAAoB;AACtB,SAAO,KAAK,MAAM;CACnB;CAED,oBAAoBC,MAAmC;AACrD,OAAK,MAAM,IAAI,KAAK,KAAK,WAAW,UAAU,EAAE,KAAK;CACtD;CAED,oBAAoBC,YAAwD;AAC1E,SAAO,KAAK,MAAM,IAAI,WAAW,UAAU,CAAC;CAC7C;CAED,cAAcC,MAA4B;AACxC,OAAK,MAAM,IAAI,eAAe,YAAY,KAAK,KAAK,OAAO,EAAE,KAAK;CACnE;CAED,cAAcC,QAA4C;AACxD,SAAO,KAAK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