@awesome-flow/ecs 0.2.0 → 0.3.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 +133 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +115 -116
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { Node, NodeProps } from '@xyflow/react';
|
|
3
2
|
import { EntityTypeUid, IEntityProxy, EntityUid, IEntityRepository } from '@awesome-ecs/abstract/entities';
|
|
4
|
-
import { BasicNodeData, ITemplateFactory, NodeTemplate, HandleDataType } from '@awesome-flow/core/abstract';
|
|
5
3
|
import { ISystemsModuleRepository } from '@awesome-ecs/abstract/systems';
|
|
6
4
|
import { EntityEventsManager } from '@awesome-ecs/core/entities';
|
|
5
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
6
|
+
import { BasicNodeData, ITemplateFactory, NodeTemplate, HandleDataType } from '@awesome-flow/core/abstract';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
type SystemsModuleNodeData = BasicNodeData & {
|
|
@@ -74,5 +74,9 @@ declare const ecsNodeTypes: {
|
|
|
74
74
|
"systems-module-node": typeof SystemsModuleNode;
|
|
75
75
|
"entity-node": typeof EntityNode;
|
|
76
76
|
};
|
|
77
|
+
declare const ecsNodeTemplates: {
|
|
78
|
+
"entity-node": EntityNodeTemplate;
|
|
79
|
+
"systems-module-node": SystemsModuleNodeTemplate;
|
|
80
|
+
};
|
|
77
81
|
|
|
78
|
-
export { EcsFlowContext, type EcsFlowContextProps, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EntityNode, type EntityNodeData, EntityNodeTemplate, FlowEcsState, type IEntityUpdateCounter, SystemsModuleNode, type SystemsModuleNodeData, SystemsModuleNodeTemplate, ecsNodeTypes };
|
|
82
|
+
export { EcsFlowContext, type EcsFlowContextProps, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EntityNode, type EntityNodeData, EntityNodeTemplate, FlowEcsState, type IEntityUpdateCounter, SystemsModuleNode, type SystemsModuleNodeData, SystemsModuleNodeTemplate, ecsNodeTemplates, ecsNodeTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { Node, NodeProps } from '@xyflow/react';
|
|
3
2
|
import { EntityTypeUid, IEntityProxy, EntityUid, IEntityRepository } from '@awesome-ecs/abstract/entities';
|
|
4
|
-
import { BasicNodeData, ITemplateFactory, NodeTemplate, HandleDataType } from '@awesome-flow/core/abstract';
|
|
5
3
|
import { ISystemsModuleRepository } from '@awesome-ecs/abstract/systems';
|
|
6
4
|
import { EntityEventsManager } from '@awesome-ecs/core/entities';
|
|
5
|
+
import { Node, NodeProps } from '@xyflow/react';
|
|
6
|
+
import { BasicNodeData, ITemplateFactory, NodeTemplate, HandleDataType } from '@awesome-flow/core/abstract';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
type SystemsModuleNodeData = BasicNodeData & {
|
|
@@ -74,5 +74,9 @@ declare const ecsNodeTypes: {
|
|
|
74
74
|
"systems-module-node": typeof SystemsModuleNode;
|
|
75
75
|
"entity-node": typeof EntityNode;
|
|
76
76
|
};
|
|
77
|
+
declare const ecsNodeTemplates: {
|
|
78
|
+
"entity-node": EntityNodeTemplate;
|
|
79
|
+
"systems-module-node": SystemsModuleNodeTemplate;
|
|
80
|
+
};
|
|
77
81
|
|
|
78
|
-
export { EcsFlowContext, type EcsFlowContextProps, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EntityNode, type EntityNodeData, EntityNodeTemplate, FlowEcsState, type IEntityUpdateCounter, SystemsModuleNode, type SystemsModuleNodeData, SystemsModuleNodeTemplate, ecsNodeTypes };
|
|
82
|
+
export { EcsFlowContext, type EcsFlowContextProps, EcsFlowRepository, EcsHandleDataType, EcsNodeType, EntityNode, type EntityNodeData, EntityNodeTemplate, FlowEcsState, type IEntityUpdateCounter, SystemsModuleNode, type SystemsModuleNodeData, SystemsModuleNodeTemplate, ecsNodeTemplates, ecsNodeTypes };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/abstract/ecs-flow-context.ts
|
|
2
2
|
import { createContext } from "react";
|
|
3
|
-
var EcsFlowContext = createContext(
|
|
4
|
-
ecsFlowRepository: null,
|
|
5
|
-
entityRepository: null,
|
|
6
|
-
entityEventsManager: null,
|
|
7
|
-
entityUpdateCounter: null,
|
|
8
|
-
systemsModuleRepository: null
|
|
9
|
-
});
|
|
3
|
+
var EcsFlowContext = createContext(null);
|
|
10
4
|
|
|
11
5
|
// src/utils/id-generator.ts
|
|
12
|
-
var
|
|
6
|
+
var EcsIdGenerator = class {
|
|
13
7
|
static entityProxy(proxy) {
|
|
14
8
|
return `${proxy.entityType}:${proxy.entityUid}`;
|
|
15
9
|
}
|
|
16
10
|
};
|
|
17
11
|
|
|
18
|
-
// src/
|
|
12
|
+
// src/abstract/ecs-flow-repository.ts
|
|
19
13
|
var EcsFlowRepository = class {
|
|
20
14
|
nodes;
|
|
21
15
|
constructor() {
|
|
@@ -31,20 +25,20 @@ var EcsFlowRepository = class {
|
|
|
31
25
|
return this.nodes.get(entityType.toString());
|
|
32
26
|
}
|
|
33
27
|
addEntityNode(node) {
|
|
34
|
-
this.nodes.set(
|
|
28
|
+
this.nodes.set(EcsIdGenerator.entityProxy(node.data.entity), node);
|
|
35
29
|
}
|
|
36
30
|
getEntityNode(entity) {
|
|
37
|
-
return this.nodes.get(
|
|
31
|
+
return this.nodes.get(EcsIdGenerator.entityProxy(entity));
|
|
38
32
|
}
|
|
39
33
|
listAllNodes() {
|
|
40
34
|
return Array.from(this.nodes.values());
|
|
41
35
|
}
|
|
42
36
|
};
|
|
43
37
|
|
|
44
|
-
// src/
|
|
38
|
+
// src/flow/flow-ecs-state.tsx
|
|
45
39
|
import { useEffect as useEffect7, useContext as useContext10, useState as useState3 } from "react";
|
|
46
40
|
|
|
47
|
-
// src/
|
|
41
|
+
// src/flow/flow-ecs-auto-layout.tsx
|
|
48
42
|
import { FlowContext } from "@awesome-flow/core/abstract";
|
|
49
43
|
import Dagre from "@dagrejs/dagre";
|
|
50
44
|
import { useReactFlow } from "@xyflow/react";
|
|
@@ -102,19 +96,23 @@ function FlowEcsAutoLayout(props) {
|
|
|
102
96
|
}
|
|
103
97
|
var flow_ecs_auto_layout_default = FlowEcsAutoLayout;
|
|
104
98
|
|
|
105
|
-
// src/
|
|
99
|
+
// src/flow/flow-ecs-entities.tsx
|
|
106
100
|
import { FlowContext as FlowContext4 } from "@awesome-flow/core/abstract";
|
|
107
101
|
import { useContext as useContext8, useEffect as useEffect5, useState as useState2 } from "react";
|
|
108
102
|
|
|
109
103
|
// src/nodes/node-systems-module.tsx
|
|
110
104
|
import { NodeContainer } from "@awesome-flow/core/layout";
|
|
111
105
|
import { useContext as useContext2 } from "react";
|
|
106
|
+
import { Badge as Badge3 } from "@mantine/core";
|
|
112
107
|
|
|
113
108
|
// src/layout/systems-module-layout.tsx
|
|
114
109
|
import { SystemType } from "@awesome-ecs/abstract/systems";
|
|
115
110
|
import { Accordion as Accordion2, Text } from "@mantine/core";
|
|
116
111
|
import { useMemo as useMemo3 } from "react";
|
|
117
112
|
|
|
113
|
+
// src/components/pipeline-middleware-list.tsx
|
|
114
|
+
import { Accordion, Badge as Badge2, Stack } from "@mantine/core";
|
|
115
|
+
|
|
118
116
|
// src/components/badge-list.tsx
|
|
119
117
|
import { Badge } from "@mantine/core";
|
|
120
118
|
import { memo as memo2 } from "react";
|
|
@@ -140,7 +138,6 @@ function BadgeList(props) {
|
|
|
140
138
|
var badge_list_default = memo2(BadgeList);
|
|
141
139
|
|
|
142
140
|
// src/components/pipeline-middleware-list.tsx
|
|
143
|
-
import { Accordion, Badge as Badge2, Stack } from "@mantine/core";
|
|
144
141
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
145
142
|
function PipelineMiddlewareList(props) {
|
|
146
143
|
let middleware = [];
|
|
@@ -162,7 +159,7 @@ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-run
|
|
|
162
159
|
function SystemsModuleLayout(props) {
|
|
163
160
|
const { module } = props;
|
|
164
161
|
const runtimeContext = module["runtimeContext"];
|
|
165
|
-
const systemContext = runtimeContext
|
|
162
|
+
const { systemContext } = runtimeContext;
|
|
166
163
|
const { status } = useMemo3(() => {
|
|
167
164
|
return systemContext.runtime;
|
|
168
165
|
}, [systemContext.runtime.status]);
|
|
@@ -186,7 +183,6 @@ function SystemsModuleLayout(props) {
|
|
|
186
183
|
var systems_module_layout_default = SystemsModuleLayout;
|
|
187
184
|
|
|
188
185
|
// src/nodes/node-systems-module.tsx
|
|
189
|
-
import { Badge as Badge3 } from "@mantine/core";
|
|
190
186
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
191
187
|
function SystemsModuleNode({ id, data, selected, type }) {
|
|
192
188
|
const { systemsModuleRepository } = useContext2(EcsFlowContext);
|
|
@@ -196,9 +192,8 @@ function SystemsModuleNode({ id, data, selected, type }) {
|
|
|
196
192
|
{
|
|
197
193
|
id,
|
|
198
194
|
selected,
|
|
199
|
-
|
|
195
|
+
data,
|
|
200
196
|
title: /* @__PURE__ */ jsx5(Badge3, { fullWidth: true, color: "indigo", variant: "transparent", children: /* @__PURE__ */ jsx5(formatter_camel_case_default, { value: data.entityType }) }),
|
|
201
|
-
templateId: data.templateId,
|
|
202
197
|
type,
|
|
203
198
|
children: /* @__PURE__ */ jsx5(systems_module_layout_default, { type: data.entityType, module })
|
|
204
199
|
}
|
|
@@ -209,7 +204,7 @@ var node_systems_module_default = SystemsModuleNode;
|
|
|
209
204
|
// src/nodes/node-entity.tsx
|
|
210
205
|
import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
|
|
211
206
|
import { Badge as Badge9 } from "@mantine/core";
|
|
212
|
-
import { useContext as useContext5, useMemo as
|
|
207
|
+
import { useContext as useContext5, useMemo as useMemo6 } from "react";
|
|
213
208
|
|
|
214
209
|
// src/layout/entity-layout.tsx
|
|
215
210
|
import { Accordion as Accordion6, Badge as Badge8, Divider, Group } from "@mantine/core";
|
|
@@ -220,17 +215,17 @@ import { memo as memo5 } from "react";
|
|
|
220
215
|
|
|
221
216
|
// src/components/entity-component-inspector.tsx
|
|
222
217
|
import { Box, Button, Collapse } from "@mantine/core";
|
|
223
|
-
import { memo as memo4, useMemo as
|
|
218
|
+
import { memo as memo4, useMemo as useMemo5 } from "react";
|
|
224
219
|
import { useDisclosure } from "@mantine/hooks";
|
|
225
220
|
|
|
226
221
|
// src/components/object-inspector.tsx
|
|
227
222
|
import { useComputedColorScheme } from "@mantine/core";
|
|
228
|
-
import { memo as memo3, useMemo as
|
|
223
|
+
import { memo as memo3, useMemo as useMemo4 } from "react";
|
|
229
224
|
import { Inspector } from "react-inspector";
|
|
230
225
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
231
226
|
function ObjectInspector(props) {
|
|
232
227
|
const colorScheme = useComputedColorScheme();
|
|
233
|
-
const theme =
|
|
228
|
+
const theme = useMemo4(
|
|
234
229
|
() => colorScheme === "dark" ? "chromeDark" : "chromeLight",
|
|
235
230
|
[colorScheme]
|
|
236
231
|
);
|
|
@@ -242,7 +237,7 @@ var object_inspector_default = memo3(ObjectInspector);
|
|
|
242
237
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
243
238
|
function EntityComponentInspector(props) {
|
|
244
239
|
const [opened, { toggle }] = useDisclosure(false);
|
|
245
|
-
const buttonColor =
|
|
240
|
+
const buttonColor = useMemo5(() => opened ? "light" : "indigo", [opened]);
|
|
246
241
|
return /* @__PURE__ */ jsxs3(Box, { children: [
|
|
247
242
|
/* @__PURE__ */ jsx7(Button, { variant: "outline", size: "xs", onClick: toggle, color: buttonColor, fullWidth: true, children: props.component.componentType }),
|
|
248
243
|
/* @__PURE__ */ jsx7(Collapse, { in: opened, children: opened && /* @__PURE__ */ jsx7(object_inspector_default, { data: props.component }) })
|
|
@@ -267,7 +262,7 @@ import { memo as memo6 } from "react";
|
|
|
267
262
|
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
268
263
|
function EntityProxyList(props) {
|
|
269
264
|
const proxies = Array.from(props.entity.proxies.values()).map((c) => c.values());
|
|
270
|
-
const items = proxies.map((p) => Array.from(p).map((k) =>
|
|
265
|
+
const items = proxies.map((p) => Array.from(p).map((k) => EcsIdGenerator.entityProxy(k))).flat();
|
|
271
266
|
return /* @__PURE__ */ jsxs5(Accordion4.Item, { value: "proxies", children: [
|
|
272
267
|
/* @__PURE__ */ jsx9(Accordion4.Control, { children: /* @__PURE__ */ jsx9(Badge5, { fullWidth: true, variant: "light", rightSection: items.length, children: "Proxies" }) }),
|
|
273
268
|
/* @__PURE__ */ jsx9(Accordion4.Panel, { children: /* @__PURE__ */ jsx9(Stack3, { children: /* @__PURE__ */ jsx9(badge_list_default, { items, badge: { variant: "outline" } }) }) })
|
|
@@ -336,15 +331,14 @@ var entity_layout_default = EntityLayout;
|
|
|
336
331
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
337
332
|
function EntityNode({ id, data, selected, type }) {
|
|
338
333
|
const { entityRepository } = useContext5(EcsFlowContext);
|
|
339
|
-
const entity =
|
|
334
|
+
const entity = useMemo6(() => entityRepository.get(data.entity), [data.entity]);
|
|
340
335
|
return /* @__PURE__ */ jsx13(
|
|
341
336
|
NodeContainer2,
|
|
342
337
|
{
|
|
343
338
|
id,
|
|
344
339
|
selected,
|
|
345
|
-
|
|
340
|
+
data,
|
|
346
341
|
title: /* @__PURE__ */ jsx13(Badge9, { fullWidth: true, variant: "transparent", children: /* @__PURE__ */ jsx13(formatter_camel_case_default, { value: entity.myProxy.entityType }) }),
|
|
347
|
-
templateId: data.templateId,
|
|
348
342
|
type,
|
|
349
343
|
children: /* @__PURE__ */ jsx13(entity_layout_default, { entity })
|
|
350
344
|
}
|
|
@@ -352,7 +346,88 @@ function EntityNode({ id, data, selected, type }) {
|
|
|
352
346
|
}
|
|
353
347
|
var node_entity_default = EntityNode;
|
|
354
348
|
|
|
355
|
-
// src/node
|
|
349
|
+
// src/templates/template-entity-node.ts
|
|
350
|
+
import { IDGenerator } from "@awesome-flow/core/utils";
|
|
351
|
+
import { Position } from "@xyflow/react";
|
|
352
|
+
|
|
353
|
+
// src/abstract/handle-types.ts
|
|
354
|
+
var EcsHandleDataType = /* @__PURE__ */ ((EcsHandleDataType2) => {
|
|
355
|
+
EcsHandleDataType2[EcsHandleDataType2["proxy"] = 1] = "proxy";
|
|
356
|
+
EcsHandleDataType2[EcsHandleDataType2["module"] = 2] = "module";
|
|
357
|
+
return EcsHandleDataType2;
|
|
358
|
+
})(EcsHandleDataType || {});
|
|
359
|
+
|
|
360
|
+
// src/templates/template-entity-node.ts
|
|
361
|
+
var EntityNodeTemplate = class {
|
|
362
|
+
create() {
|
|
363
|
+
const data = {
|
|
364
|
+
title: "Entity",
|
|
365
|
+
entity: null
|
|
366
|
+
};
|
|
367
|
+
return {
|
|
368
|
+
id: IDGenerator.template(),
|
|
369
|
+
removable: false,
|
|
370
|
+
type: "entity-node" /* entity */,
|
|
371
|
+
data,
|
|
372
|
+
handles: [
|
|
373
|
+
{
|
|
374
|
+
dataType: 1 /* proxy */,
|
|
375
|
+
position: Position.Left,
|
|
376
|
+
connection: "target",
|
|
377
|
+
disabled: true
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
dataType: 1 /* proxy */,
|
|
381
|
+
position: Position.Right,
|
|
382
|
+
connection: "source",
|
|
383
|
+
disabled: true
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
isHandleAllowed() {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
getHandleAllowedDataType() {
|
|
392
|
+
return 1 /* proxy */;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
// src/templates/template-systems-module.ts
|
|
397
|
+
import { IDGenerator as IDGenerator2 } from "@awesome-flow/core/utils";
|
|
398
|
+
import { Position as Position2 } from "@xyflow/react";
|
|
399
|
+
var SystemsModuleNodeTemplate = class {
|
|
400
|
+
create() {
|
|
401
|
+
const data = {
|
|
402
|
+
title: "Systems Module",
|
|
403
|
+
entityType: null,
|
|
404
|
+
handles: null,
|
|
405
|
+
templateId: null
|
|
406
|
+
};
|
|
407
|
+
return {
|
|
408
|
+
id: IDGenerator2.template(),
|
|
409
|
+
removable: false,
|
|
410
|
+
type: "systems-module-node" /* systemsModule */,
|
|
411
|
+
data,
|
|
412
|
+
handles: [
|
|
413
|
+
{
|
|
414
|
+
dataType: 2 /* module */,
|
|
415
|
+
position: Position2.Left,
|
|
416
|
+
connection: "target",
|
|
417
|
+
disabled: true
|
|
418
|
+
}
|
|
419
|
+
]
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
isHandleAllowed() {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
getHandleAllowedDataType() {
|
|
426
|
+
return 2 /* module */;
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// src/abstract/node-types.ts
|
|
356
431
|
var EcsNodeType = /* @__PURE__ */ ((EcsNodeType2) => {
|
|
357
432
|
EcsNodeType2["systemsModule"] = "systems-module-node";
|
|
358
433
|
EcsNodeType2["entity"] = "entity-node";
|
|
@@ -362,8 +437,12 @@ var ecsNodeTypes = {
|
|
|
362
437
|
["systems-module-node" /* systemsModule */]: node_systems_module_default,
|
|
363
438
|
["entity-node" /* entity */]: node_entity_default
|
|
364
439
|
};
|
|
440
|
+
var ecsNodeTemplates = {
|
|
441
|
+
["entity-node" /* entity */]: new EntityNodeTemplate(),
|
|
442
|
+
["systems-module-node" /* systemsModule */]: new SystemsModuleNodeTemplate()
|
|
443
|
+
};
|
|
365
444
|
|
|
366
|
-
// src/
|
|
445
|
+
// src/flow/flow-ecs-edge-proxies.tsx
|
|
367
446
|
import { useContext as useContext6, useEffect as useEffect3 } from "react";
|
|
368
447
|
import { FlowContext as FlowContext2 } from "@awesome-flow/core/abstract";
|
|
369
448
|
import { Fragment as Fragment5, jsx as jsx14 } from "react/jsx-runtime";
|
|
@@ -396,7 +475,7 @@ function FlowEcsEdgeProxies(props) {
|
|
|
396
475
|
}
|
|
397
476
|
var flow_ecs_edge_proxies_default = FlowEcsEdgeProxies;
|
|
398
477
|
|
|
399
|
-
// src/
|
|
478
|
+
// src/flow/flow-ecs-edge-modules.tsx
|
|
400
479
|
import { useContext as useContext7, useEffect as useEffect4 } from "react";
|
|
401
480
|
import { FlowContext as FlowContext3 } from "@awesome-flow/core/abstract";
|
|
402
481
|
import { Fragment as Fragment6, jsx as jsx15 } from "react/jsx-runtime";
|
|
@@ -425,7 +504,7 @@ function FlowEcsEdgeModules(props) {
|
|
|
425
504
|
}
|
|
426
505
|
var flow_ecs_edge_modules_default = FlowEcsEdgeModules;
|
|
427
506
|
|
|
428
|
-
// src/
|
|
507
|
+
// src/flow/flow-ecs-entities.tsx
|
|
429
508
|
import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
430
509
|
function FlowEcsEntities() {
|
|
431
510
|
const context = useContext8(FlowContext4);
|
|
@@ -455,7 +534,7 @@ function FlowEcsEntities() {
|
|
|
455
534
|
}
|
|
456
535
|
var flow_ecs_entities_default = FlowEcsEntities;
|
|
457
536
|
|
|
458
|
-
// src/
|
|
537
|
+
// src/flow/flow-ecs-modules.tsx
|
|
459
538
|
import { useEffect as useEffect6, useContext as useContext9 } from "react";
|
|
460
539
|
import { FlowContext as FlowContext5 } from "@awesome-flow/core/abstract";
|
|
461
540
|
import { Fragment as Fragment8, jsx as jsx17 } from "react/jsx-runtime";
|
|
@@ -487,7 +566,7 @@ function FlowEcsModules() {
|
|
|
487
566
|
}
|
|
488
567
|
var flow_ecs_modules_default = FlowEcsModules;
|
|
489
568
|
|
|
490
|
-
// src/
|
|
569
|
+
// src/flow/flow-ecs-state.tsx
|
|
491
570
|
import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
492
571
|
function FlowEcsState(props) {
|
|
493
572
|
const [, setUpdates] = useState3(0);
|
|
@@ -508,87 +587,6 @@ function FlowEcsState(props) {
|
|
|
508
587
|
] });
|
|
509
588
|
}
|
|
510
589
|
var flow_ecs_state_default = FlowEcsState;
|
|
511
|
-
|
|
512
|
-
// src/templates/template-entity-node.ts
|
|
513
|
-
import { IDGenerator } from "@awesome-flow/core/utils";
|
|
514
|
-
|
|
515
|
-
// src/handle-types.ts
|
|
516
|
-
var EcsHandleDataType = /* @__PURE__ */ ((EcsHandleDataType2) => {
|
|
517
|
-
EcsHandleDataType2[EcsHandleDataType2["proxy"] = 1] = "proxy";
|
|
518
|
-
EcsHandleDataType2[EcsHandleDataType2["module"] = 2] = "module";
|
|
519
|
-
return EcsHandleDataType2;
|
|
520
|
-
})(EcsHandleDataType || {});
|
|
521
|
-
|
|
522
|
-
// src/templates/template-entity-node.ts
|
|
523
|
-
import { Position } from "@xyflow/react";
|
|
524
|
-
var EntityNodeTemplate = class {
|
|
525
|
-
create() {
|
|
526
|
-
const data = {
|
|
527
|
-
title: "Entity",
|
|
528
|
-
entity: null
|
|
529
|
-
};
|
|
530
|
-
return {
|
|
531
|
-
id: IDGenerator.template(),
|
|
532
|
-
removable: false,
|
|
533
|
-
type: "entity-node" /* entity */,
|
|
534
|
-
data,
|
|
535
|
-
handles: [
|
|
536
|
-
{
|
|
537
|
-
dataType: 1 /* proxy */,
|
|
538
|
-
position: Position.Left,
|
|
539
|
-
connection: "target",
|
|
540
|
-
disabled: true
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
dataType: 1 /* proxy */,
|
|
544
|
-
position: Position.Right,
|
|
545
|
-
connection: "source",
|
|
546
|
-
disabled: true
|
|
547
|
-
}
|
|
548
|
-
]
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
isHandleAllowed() {
|
|
552
|
-
return false;
|
|
553
|
-
}
|
|
554
|
-
getHandleAllowedDataType() {
|
|
555
|
-
return 1 /* proxy */;
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// src/templates/template-systems-module.ts
|
|
560
|
-
import { IDGenerator as IDGenerator2 } from "@awesome-flow/core/utils";
|
|
561
|
-
import { Position as Position2 } from "@xyflow/react";
|
|
562
|
-
var SystemsModuleNodeTemplate = class {
|
|
563
|
-
create() {
|
|
564
|
-
const data = {
|
|
565
|
-
title: "Systems Module",
|
|
566
|
-
entityType: null,
|
|
567
|
-
handles: null,
|
|
568
|
-
templateId: null
|
|
569
|
-
};
|
|
570
|
-
return {
|
|
571
|
-
id: IDGenerator2.template(),
|
|
572
|
-
removable: false,
|
|
573
|
-
type: "systems-module-node" /* systemsModule */,
|
|
574
|
-
data,
|
|
575
|
-
handles: [
|
|
576
|
-
{
|
|
577
|
-
dataType: 2 /* module */,
|
|
578
|
-
position: Position2.Left,
|
|
579
|
-
connection: "target",
|
|
580
|
-
disabled: true
|
|
581
|
-
}
|
|
582
|
-
]
|
|
583
|
-
};
|
|
584
|
-
}
|
|
585
|
-
isHandleAllowed() {
|
|
586
|
-
return false;
|
|
587
|
-
}
|
|
588
|
-
getHandleAllowedDataType() {
|
|
589
|
-
return 2 /* module */;
|
|
590
|
-
}
|
|
591
|
-
};
|
|
592
590
|
export {
|
|
593
591
|
EcsFlowContext,
|
|
594
592
|
EcsFlowRepository,
|
|
@@ -599,6 +597,7 @@ export {
|
|
|
599
597
|
flow_ecs_state_default as FlowEcsState,
|
|
600
598
|
node_systems_module_default as SystemsModuleNode,
|
|
601
599
|
SystemsModuleNodeTemplate,
|
|
600
|
+
ecsNodeTemplates,
|
|
602
601
|
ecsNodeTypes
|
|
603
602
|
};
|
|
604
603
|
//# sourceMappingURL=index.js.map
|