@awesome-flow/ecs 0.12.0 → 0.14.1
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/canvas/index.cjs +5 -0
- package/dist/canvas/index.d.cts +2 -0
- package/dist/canvas/index.d.mts +2 -0
- package/dist/canvas/index.mjs +3 -0
- package/dist/canvas-WWAJ6C2l.cjs +688 -0
- package/dist/canvas-WWAJ6C2l.cjs.map +1 -0
- package/dist/canvas-cO2NAQyX.mjs +677 -0
- package/dist/canvas-cO2NAQyX.mjs.map +1 -0
- package/dist/context/index.cjs +501 -0
- package/dist/context/index.cjs.map +1 -0
- package/dist/context/index.d.cts +2 -0
- package/dist/context/index.d.mts +2 -0
- package/dist/context/index.mjs +496 -0
- package/dist/context/index.mjs.map +1 -0
- package/dist/entity-component-inspector-CNaN8Scf.mjs +79 -0
- package/dist/entity-component-inspector-CNaN8Scf.mjs.map +1 -0
- package/dist/entity-component-inspector-VlwcaUqy.cjs +90 -0
- package/dist/entity-component-inspector-VlwcaUqy.cjs.map +1 -0
- package/dist/hooks/index.cjs +19 -0
- package/dist/hooks/index.d.cts +2 -0
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.mjs +3 -0
- package/dist/id-generator-C2_8g29M.cjs +45 -0
- package/dist/id-generator-C2_8g29M.cjs.map +1 -0
- package/dist/id-generator-DDsv3NdX.mjs +34 -0
- package/dist/id-generator-DDsv3NdX.mjs.map +1 -0
- package/dist/index-2l9Vdh2S.d.mts +54 -0
- package/dist/index-2l9Vdh2S.d.mts.map +1 -0
- package/dist/index-BFqa6aqs.d.mts +99 -0
- package/dist/index-BFqa6aqs.d.mts.map +1 -0
- package/dist/index-BTs_8SY-.d.cts +20 -0
- package/dist/index-BTs_8SY-.d.cts.map +1 -0
- package/dist/index-C3QIukqX.d.cts +157 -0
- package/dist/index-C3QIukqX.d.cts.map +1 -0
- package/dist/index-CPTq4oOA.d.cts +67 -0
- package/dist/index-CPTq4oOA.d.cts.map +1 -0
- package/dist/index-CyeezgDI.d.mts +20 -0
- package/dist/index-CyeezgDI.d.mts.map +1 -0
- package/dist/index-D9zIjQH9.d.mts +1 -0
- package/dist/index-DLoAMD9J.d.cts +1 -0
- package/dist/index-Ht3fVcsn.d.cts +54 -0
- package/dist/index-Ht3fVcsn.d.cts.map +1 -0
- package/dist/index-edb-X9uc.d.mts +157 -0
- package/dist/index-edb-X9uc.d.mts.map +1 -0
- package/dist/index-pInK6VDK.d.cts +99 -0
- package/dist/index-pInK6VDK.d.cts.map +1 -0
- package/dist/index-vf1CSWta.d.mts +67 -0
- package/dist/index-vf1CSWta.d.mts.map +1 -0
- package/dist/index.cjs +55 -531
- package/dist/index.d.cts +9 -106
- package/dist/index.d.mts +9 -106
- package/dist/index.mjs +10 -520
- package/dist/inspectors/index.cjs +6 -0
- package/dist/inspectors/index.d.cts +2 -0
- package/dist/inspectors/index.d.mts +2 -0
- package/dist/inspectors/index.mjs +3 -0
- package/dist/node-props-Bryks8-5.d.cts +45 -0
- package/dist/node-props-Bryks8-5.d.cts.map +1 -0
- package/dist/node-props-Cusf_qtn.d.mts +45 -0
- package/dist/node-props-Cusf_qtn.d.mts.map +1 -0
- package/dist/node-systems-module-B8aKhvBo.d.mts +22 -0
- package/dist/node-systems-module-B8aKhvBo.d.mts.map +1 -0
- package/dist/node-systems-module-Dx-hISbg.d.cts +22 -0
- package/dist/node-systems-module-Dx-hISbg.d.cts.map +1 -0
- package/dist/node-types-CNO_-52M.cjs +1866 -0
- package/dist/node-types-CNO_-52M.cjs.map +1 -0
- package/dist/node-types-l0GwV0mz.mjs +1651 -0
- package/dist/node-types-l0GwV0mz.mjs.map +1 -0
- package/dist/nodes/index.cjs +10 -0
- package/dist/nodes/index.d.cts +3 -0
- package/dist/nodes/index.d.mts +3 -0
- package/dist/nodes/index.mjs +3 -0
- package/dist/template-tool-nodes-CiwTFU-N.d.cts +35 -0
- package/dist/template-tool-nodes-CiwTFU-N.d.cts.map +1 -0
- package/dist/template-tool-nodes-DWhekyQg.d.mts +35 -0
- package/dist/template-tool-nodes-DWhekyQg.d.mts.map +1 -0
- package/dist/templates/index.cjs +11 -0
- package/dist/templates/index.d.cts +2 -0
- package/dist/templates/index.d.mts +2 -0
- package/dist/templates/index.mjs +3 -0
- package/package.json +85 -25
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["EntityTypeUid","IEntityProxy","Node","EcsIdGenerator","EntityNodeData","ScopeGroupNodeData","SystemsModuleNodeData","EcsFlowRepository","nodes","Map","constructor","sizeNodes","size","addSystemModuleNode","node","set","data","entityType","toString","getSystemModuleNode","get","addScopeGroupNode","scope","scopeId","getScopeGroupNode","addEntityNode","entity","entityProxy","getEntityNode","addToolNode","tool","type","getToolNode","listAllNodes","Array","from","values","EntityEventUid","EntityUpdateType","EntityTypeUid","EntityUid","IEntity","IEntityEvent","IEntityEventsManager","IEntityModel","IEntityProxy","IEntityProxyRepository","IEntityRepository","IEntityRuntimeSchedulerInspector","IEntityUpdate","IEventData","PipelineCategory","PipelineCategoryName","SystemType","ISystemsModule","ISystemsModuleRepository","IPerformanceTimer","MiddlewareMetricsSummary","PerformanceTimeEntry","EcsEntitySpawnRequest","EcsEntityTypeDescriptor","EcsIdGenerator","EcsFlowRepository","INSTRUMENTATION","Symbol","for","InstrumentationListener","args","result","InstrumentedFunction","listeners","Set","original","EcsBridgeStoreName","EcsBridgeStore","getSnapshot","notify","subscribe","listener","TelemetryMetricsSource","metrics","ReadonlyMap","ReadonlyArray","clearMetrics","EntityUpdateCounts","removes","updates","EcsEventLogEntry","event","recordedAt","targets","EcsScopeSummary","entities","scopeId","scopedProxies","EcsEventStreamFilter","limit","source","target","type","EcsMetricsFilter","category","entityType","phase","PipelineMetricsSummary","avgMs","count","lastMs","maxMs","minMs","name","samples","totalMs","EcsSchedulerSnapshot","frameSubscriptions","isPaused","pendingCount","schedules","skippedEntityTypes","EcsUpdateQueueSnapshot","items","size","EcsBridgeInput","defaultScopeId","ecsFlowRepository","entityEventsManager","entityProxyRepository","entityRepository","entityScheduler","entityTypeDescriptors","eventLogSize","performanceTimer","systemsModuleRepository","createVersionStore","version","add","delete","notifyInstrumentedListeners","Array","from","instrumentMethod","TTarget","methodName","undefined","mutableTarget","Record","method","instrumented","bridgeInstrumentedMethod","this","apply","maybePromise","Promise","finally","isProxy","value","sameProxy","a","b","entityUid","entityTypeKey","toString","normalizeEntityTypeDescriptor","descriptor","id","normalizePhase","entryMs","entry","msPassed","endedAt","startedAt","matchesMetric","filter","toLowerCase","includes","system","EcsBridge","stores","Map","eventLog","metricEntries","updateCounts","unsubscribeInstrumentation","constructor","input","entityTypes","events","modules","proxies","queue","scheduler","scopes","subscriptions","normalized","set","instrumentRepositories","dispose","unsubscribe","splice","getEntityUpdateCounts","get","getEntitiesInScope","listAll","entity","identity","model","getEntityTypeDescriptor","idOrEntityType","key","values","find","getEntityTypeDescriptors","descriptors","explicitEntityTypes","list","keys","has","proxy","sort","localeCompare","registerEntityTypeDescriptor","getScopes","entitiesByScope","push","entries","map","getEventStream","data","uid","origin","some","slice","getMetricEntries","flat","getMiddlewareMetrics","summaries","ms","existing","Math","min","max","getPipelineMetrics","module","length","reduce","sum","Boolean","join","getSchedulerSnapshot","getUpdateQueueSnapshot","inspectDirtyUpdates","dirtyCount","createEntitySpawnUpdate","spawn","descriptorId","modelInput","createModel","snapshot","createSnapshot","update","enqueueEntitySpawn","enqueue","listSystemsModules","recordEvent","Date","now","bumpUpdate","counts","_args","createEcsBridge","PropsWithChildren","useMemo","EcsBridge","EcsCanvasContextOptions","EcsFlowContext","EcsFlowContextProps","EcsCanvasProviderProps","bridge","EcsCanvasProvider","t0","$","_c","children","readOnly","t1","telemetryThresholdMs","undefined","t2","Object","assign","value","t3"],"sources":["../../src/context/ecs-flow-repository.ts","../../src/context/ecs-bridge.ts","../../src/context/ecs-canvas-provider.tsx"],"sourcesContent":["import { EntityTypeUid, IEntityProxy } from '@awesome-ecs/abstract/entities';\nimport { Node } from '@xyflow/react';\nimport { EcsIdGenerator } from '../utils/id-generator';\nimport { EntityNodeData, ScopeGroupNodeData, SystemsModuleNodeData } from '../abstract/node-props';\n\nexport class EcsFlowRepository {\n private readonly 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 addScopeGroupNode(node: Node<ScopeGroupNodeData>) {\n this.nodes.set(EcsIdGenerator.scope(node.data.scopeId), node);\n }\n\n getScopeGroupNode(scopeId: string): Node<ScopeGroupNodeData> {\n return this.nodes.get(EcsIdGenerator.scope(scopeId)) as Node<ScopeGroupNodeData>;\n }\n\n addEntityNode(node: Node<EntityNodeData>) {\n if (!node.data.entity) {\n return;\n }\n\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 addToolNode(node: Node) {\n this.nodes.set(EcsIdGenerator.tool(node.type), node);\n }\n\n getToolNode(type: string): Node {\n return this.nodes.get(EcsIdGenerator.tool(type));\n }\n\n listAllNodes(): Node[] {\n return Array.from(this.nodes.values());\n }\n}\n","import {\n EntityEventUid,\n EntityUpdateType,\n EntityTypeUid,\n EntityUid,\n IEntity,\n IEntityEvent,\n IEntityEventsManager,\n IEntityModel,\n IEntityProxy,\n IEntityProxyRepository,\n IEntityRepository,\n IEntityRuntimeSchedulerInspector,\n IEntityUpdate,\n IEventData\n} from '@awesome-ecs/abstract/entities';\nimport { PipelineCategory, PipelineCategoryName } from '@awesome-ecs/abstract/factories';\nimport { SystemType, ISystemsModule, ISystemsModuleRepository } from '@awesome-ecs/abstract/systems';\nimport { IPerformanceTimer, MiddlewareMetricsSummary, PerformanceTimeEntry } from '@awesome-ecs/abstract/utils';\nimport { EcsEntitySpawnRequest, EcsEntityTypeDescriptor } from '../abstract/entity-type-descriptor';\nimport { EcsIdGenerator } from '../utils/id-generator';\nimport { EcsFlowRepository } from './ecs-flow-repository';\n\nconst INSTRUMENTATION = Symbol.for('@awesome-flow/ecs.bridge.instrumentation');\n\ntype InstrumentationListener = (args: unknown[], result: unknown) => void;\ntype InstrumentedFunction = ((...args: unknown[]) => unknown) & {\n [INSTRUMENTATION]?: {\n listeners: Set<InstrumentationListener>;\n original: (...args: unknown[]) => unknown;\n };\n};\n\nexport type EcsBridgeStoreName =\n | 'entities'\n | 'entityTypes'\n | 'events'\n | 'metrics'\n | 'modules'\n | 'proxies'\n | 'queue'\n | 'scheduler'\n | 'scopes'\n | 'subscriptions'\n | 'updates';\n\nexport type EcsBridgeStore = {\n getSnapshot(): number;\n notify(): void;\n subscribe(listener: () => void): () => void;\n};\n\nexport type TelemetryMetricsSource = IPerformanceTimer & {\n readonly metrics?: ReadonlyMap<string, ReadonlyArray<PerformanceTimeEntry>>;\n clearMetrics?(): void;\n};\n\nexport type EntityUpdateCounts = {\n removes: number;\n updates: number;\n};\n\nexport type EcsEventLogEntry = {\n event: IEntityEvent<IEventData>;\n recordedAt: number;\n targets: readonly IEntityProxy[];\n};\n\nexport type EcsScopeSummary = {\n entities: readonly IEntity[];\n scopeId: string;\n scopedProxies: ReadonlyMap<EntityTypeUid, IEntityProxy>;\n};\n\nexport type EcsEventStreamFilter = {\n limit?: number;\n scopeId?: string;\n source?: IEntityProxy;\n target?: IEntityProxy;\n type?: EntityEventUid;\n};\n\nexport type EcsMetricsFilter = {\n category?: PipelineCategoryName;\n entityType?: EntityTypeUid;\n phase?: SystemType | string;\n};\n\nexport type PipelineMetricsSummary = {\n avgMs: number;\n count: number;\n lastMs: number;\n maxMs: number;\n minMs: number;\n name: string;\n samples: readonly number[];\n totalMs: number;\n};\n\nexport type EcsSchedulerSnapshot = {\n frameSubscriptions: readonly IEntityProxy[];\n isPaused: boolean;\n pendingCount: number;\n schedules: readonly unknown[];\n skippedEntityTypes: readonly EntityTypeUid[];\n};\n\nexport type EcsUpdateQueueSnapshot = {\n items: readonly IEntityUpdate[];\n size: number;\n};\n\nexport type EcsBridgeInput = {\n defaultScopeId?: string;\n ecsFlowRepository?: EcsFlowRepository;\n entityEventsManager: IEntityEventsManager;\n entityProxyRepository: IEntityProxyRepository;\n entityRepository: IEntityRepository;\n entityScheduler?: IEntityRuntimeSchedulerInspector;\n entityTypeDescriptors?: readonly EcsEntityTypeDescriptor[];\n eventLogSize?: number;\n performanceTimer?: TelemetryMetricsSource;\n systemsModuleRepository: ISystemsModuleRepository;\n};\n\nfunction createVersionStore(): EcsBridgeStore {\n let version = 0;\n const listeners = new Set<() => void>();\n\n return {\n getSnapshot: () => version,\n notify: () => {\n version += 1;\n for (const listener of listeners) {\n listener();\n }\n },\n subscribe: (listener: () => void) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n };\n}\n\nfunction notifyInstrumentedListeners(listeners: Set<InstrumentationListener>, args: unknown[], result: unknown) {\n for (const listener of Array.from(listeners)) {\n listener(args, result);\n }\n}\n\nfunction instrumentMethod<TTarget extends object>(\n target: TTarget | undefined,\n methodName: string,\n listener: InstrumentationListener\n): () => void {\n if (!target) {\n return () => undefined;\n }\n\n const mutableTarget = target as Record<string, unknown>;\n const method = mutableTarget[methodName] as InstrumentedFunction | undefined;\n\n if (typeof method !== 'function') {\n return () => undefined;\n }\n\n let instrumented = method;\n if (!instrumented[INSTRUMENTATION]) {\n const original = method;\n const listeners = new Set<InstrumentationListener>();\n\n instrumented = function bridgeInstrumentedMethod(this: unknown, ...args: unknown[]) {\n const result = original.apply(this, args);\n const maybePromise = result as Promise<unknown> | undefined;\n\n if (maybePromise && typeof maybePromise.finally === 'function') {\n return maybePromise.finally(() => notifyInstrumentedListeners(listeners, args, result));\n }\n\n notifyInstrumentedListeners(listeners, args, result);\n return result;\n } as InstrumentedFunction;\n\n instrumented[INSTRUMENTATION] = { listeners, original };\n mutableTarget[methodName] = instrumented;\n }\n\n instrumented[INSTRUMENTATION].listeners.add(listener);\n\n return () => {\n instrumented[INSTRUMENTATION]?.listeners.delete(listener);\n };\n}\n\nfunction isProxy(value: unknown): value is IEntityProxy {\n return !!value && typeof value === 'object' && 'entityType' in value && 'entityUid' in value;\n}\n\nfunction sameProxy(a?: IEntityProxy, b?: IEntityProxy): boolean {\n return !!a && !!b && a.entityType === b.entityType && a.entityUid === b.entityUid;\n}\n\nfunction entityTypeKey(entityType: EntityTypeUid): string {\n return entityType.toString();\n}\n\nfunction normalizeEntityTypeDescriptor(descriptor: EcsEntityTypeDescriptor): EcsEntityTypeDescriptor & { id: string } {\n return {\n ...descriptor,\n id: descriptor.id ?? EcsIdGenerator.entityType(descriptor.entityType)\n };\n}\n\nfunction normalizePhase(phase?: SystemType | string): string | undefined {\n if (phase === undefined || phase === null) {\n return undefined;\n }\n\n if (typeof phase === 'number') {\n return SystemType[phase];\n }\n\n return phase;\n}\n\nfunction entryMs(entry: PerformanceTimeEntry): number | undefined {\n if (entry.msPassed !== undefined) {\n return entry.msPassed;\n }\n\n if (entry.endedAt !== undefined) {\n return entry.endedAt - entry.startedAt;\n }\n\n return undefined;\n}\n\nfunction matchesMetric(entry: PerformanceTimeEntry, filter?: EcsMetricsFilter): boolean {\n if (!filter) {\n return true;\n }\n\n if (filter.category && entry.category !== filter.category) {\n return false;\n }\n\n const phase = normalizePhase(filter.phase)?.toString().toLowerCase();\n if (phase && !entry.name.toLowerCase().includes(phase)) {\n return false;\n }\n\n if (filter.entityType && entry.category !== PipelineCategory.system) {\n const entityType = filter.entityType.toString().toLowerCase();\n if (!entry.name.toLowerCase().includes(entityType)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport class EcsBridge {\n readonly ecsFlowRepository: EcsFlowRepository;\n readonly entityEventsManager: IEntityEventsManager;\n readonly entityProxyRepository: IEntityProxyRepository;\n readonly entityRepository: IEntityRepository;\n readonly entityScheduler?: IEntityRuntimeSchedulerInspector;\n readonly performanceTimer?: TelemetryMetricsSource;\n readonly stores: Record<EcsBridgeStoreName, EcsBridgeStore>;\n readonly systemsModuleRepository: ISystemsModuleRepository;\n\n private readonly defaultScopeId?: string;\n private readonly entityTypeDescriptors = new Map<string, EcsEntityTypeDescriptor & { id: string }>();\n private readonly eventLogSize: number;\n private readonly eventLog: EcsEventLogEntry[] = [];\n private readonly metricEntries: PerformanceTimeEntry[] = [];\n private readonly scopedProxies = new Map<string, Map<EntityTypeUid, IEntityProxy>>();\n private readonly updateCounts = new Map<EntityUid, EntityUpdateCounts>();\n private readonly unsubscribeInstrumentation: (() => void)[] = [];\n\n constructor(input: EcsBridgeInput) {\n this.ecsFlowRepository = input.ecsFlowRepository ?? new EcsFlowRepository();\n this.entityEventsManager = input.entityEventsManager;\n this.entityProxyRepository = input.entityProxyRepository;\n this.entityRepository = input.entityRepository;\n this.entityScheduler = input.entityScheduler;\n this.defaultScopeId = input.defaultScopeId;\n this.performanceTimer = input.performanceTimer;\n this.systemsModuleRepository = input.systemsModuleRepository;\n this.eventLogSize = input.eventLogSize ?? 250;\n this.stores = {\n entities: createVersionStore(),\n entityTypes: createVersionStore(),\n events: createVersionStore(),\n metrics: createVersionStore(),\n modules: createVersionStore(),\n proxies: createVersionStore(),\n queue: createVersionStore(),\n scheduler: createVersionStore(),\n scopes: createVersionStore(),\n subscriptions: createVersionStore(),\n updates: createVersionStore()\n };\n\n for (const descriptor of input.entityTypeDescriptors ?? []) {\n const normalized = normalizeEntityTypeDescriptor(descriptor);\n this.entityTypeDescriptors.set(normalized.id, normalized);\n }\n\n this.instrumentRepositories();\n }\n\n dispose(): void {\n for (const unsubscribe of this.unsubscribeInstrumentation.splice(0)) {\n unsubscribe();\n }\n }\n\n getEntityUpdateCounts(target: IEntityProxy | EntityUid): EntityUpdateCounts {\n const entityUid = isProxy(target) ? target.entityUid : target;\n return this.updateCounts.get(entityUid) ?? { removes: 0, updates: 0 };\n }\n\n getEntitiesInScope(scopeId: string): IEntity[] {\n return Array.from(this.entityRepository.listAll()).filter((entity) => entity.identity?.model?.scopeId === scopeId);\n }\n\n getEntityTypeDescriptor(idOrEntityType: string | EntityTypeUid): EcsEntityTypeDescriptor | undefined {\n const key = idOrEntityType.toString();\n return (\n this.entityTypeDescriptors.get(key) ??\n Array.from(this.entityTypeDescriptors.values()).find((descriptor) => entityTypeKey(descriptor.entityType) === key)\n );\n }\n\n getEntityTypeDescriptors(): EcsEntityTypeDescriptor[] {\n const descriptors = new Map<string, EcsEntityTypeDescriptor>();\n const explicitEntityTypes = new Set<string>();\n\n for (const descriptor of this.entityTypeDescriptors.values()) {\n descriptors.set(descriptor.id, descriptor);\n explicitEntityTypes.add(entityTypeKey(descriptor.entityType));\n }\n\n for (const entityType of this.systemsModuleRepository.list().keys()) {\n if (!explicitEntityTypes.has(entityTypeKey(entityType))) {\n const descriptor = normalizeEntityTypeDescriptor({ entityType });\n descriptors.set(descriptor.id, descriptor);\n }\n }\n\n for (const entity of this.entityRepository.listAll()) {\n const { entityType } = entity.identity.proxy;\n if (!explicitEntityTypes.has(entityTypeKey(entityType))) {\n const descriptor = normalizeEntityTypeDescriptor({ entityType });\n descriptors.set(descriptor.id, descriptor);\n }\n }\n\n return Array.from(descriptors.values()).sort((a, b) => a.entityType.toString().localeCompare(b.entityType.toString()));\n }\n\n registerEntityTypeDescriptor(descriptor: EcsEntityTypeDescriptor): EcsEntityTypeDescriptor {\n const normalized = normalizeEntityTypeDescriptor(descriptor);\n this.entityTypeDescriptors.set(normalized.id, normalized);\n this.stores.entityTypes.notify();\n return normalized;\n }\n\n getScopes(): EcsScopeSummary[] {\n const entitiesByScope = new Map<string, IEntity[]>();\n\n for (const entity of this.entityRepository.listAll()) {\n const scopeId = entity.identity?.model?.scopeId;\n if (!scopeId) {\n continue;\n }\n\n const entities = entitiesByScope.get(scopeId) ?? [];\n entities.push(entity);\n entitiesByScope.set(scopeId, entities);\n }\n\n for (const scopeId of this.scopedProxies.keys()) {\n if (!entitiesByScope.has(scopeId)) {\n entitiesByScope.set(scopeId, []);\n }\n }\n\n return Array.from(entitiesByScope.entries()).map(([scopeId, entities]) => ({\n scopeId,\n entities,\n scopedProxies: this.scopedProxies.get(scopeId) ?? new Map()\n }));\n }\n\n getEventStream(filter?: EcsEventStreamFilter): EcsEventLogEntry[] {\n const entries = this.eventLog.filter((entry) => {\n if (filter?.type !== undefined && entry.event.data.uid !== filter.type) {\n return false;\n }\n\n if (filter?.scopeId && entry.event.scopeId !== filter.scopeId) {\n return false;\n }\n\n if (filter?.source && !sameProxy(entry.event.origin, filter.source)) {\n return false;\n }\n\n if (filter?.target) {\n const targets = entry.event.target ? [entry.event.target] : entry.targets;\n if (!targets.some((target) => sameProxy(target, filter.target))) {\n return false;\n }\n }\n\n return true;\n });\n\n return filter?.limit ? entries.slice(-filter.limit) : entries;\n }\n\n getMetricEntries(filter?: EcsMetricsFilter): PerformanceTimeEntry[] {\n const entries = this.performanceTimer?.metrics\n ? Array.from(this.performanceTimer.metrics.values()).flat()\n : this.metricEntries;\n\n return entries.filter((entry) => matchesMetric(entry, filter));\n }\n\n getMiddlewareMetrics(filter?: EcsMetricsFilter): MiddlewareMetricsSummary[] {\n const summaries = new Map<string, MiddlewareMetricsSummary>();\n\n for (const entry of this.getMetricEntries(filter)) {\n const ms = entryMs(entry);\n if (ms === undefined) {\n continue;\n }\n\n const category = entry.category ?? PipelineCategory.system;\n const key = `${category}:${entry.name}`;\n const existing = summaries.get(key);\n\n if (existing) {\n existing.count += 1;\n existing.totalMs += ms;\n existing.avgMs = existing.totalMs / existing.count;\n existing.minMs = Math.min(existing.minMs, ms);\n existing.maxMs = Math.max(existing.maxMs, ms);\n existing.lastMs = ms;\n } else {\n summaries.set(key, {\n name: entry.name,\n category,\n count: 1,\n totalMs: ms,\n avgMs: ms,\n minMs: ms,\n maxMs: ms,\n lastMs: ms\n });\n }\n }\n\n return Array.from(summaries.values()).sort((a, b) => b.totalMs - a.totalMs);\n }\n\n getPipelineMetrics(entityType?: EntityTypeUid, phase?: SystemType | string): PipelineMetricsSummary | undefined {\n const entries = this.getMetricEntries({\n category: PipelineCategory.module,\n entityType,\n phase\n });\n const samples = entries.map(entryMs).filter((ms): ms is number => ms !== undefined);\n\n if (!samples.length) {\n return undefined;\n }\n\n const totalMs = samples.reduce((sum, ms) => sum + ms, 0);\n\n return {\n name: [entityType, normalizePhase(phase)].filter(Boolean).join(':') || 'pipeline',\n count: samples.length,\n totalMs,\n avgMs: totalMs / samples.length,\n minMs: Math.min(...samples),\n maxMs: Math.max(...samples),\n lastMs: samples[samples.length - 1],\n samples\n };\n }\n\n getSchedulerSnapshot(): EcsSchedulerSnapshot | undefined {\n if (!this.entityScheduler) {\n return undefined;\n }\n\n return {\n frameSubscriptions: Array.from(this.entityScheduler.frameSubscriptions),\n isPaused: this.entityScheduler.isPaused,\n pendingCount: this.entityScheduler.pendingCount,\n schedules: Array.from(this.entityScheduler.schedules),\n skippedEntityTypes: Array.from(this.entityScheduler.skippedEntityTypes)\n };\n }\n\n getUpdateQueueSnapshot(limit?: number): EcsUpdateQueueSnapshot | undefined {\n if (!this.entityScheduler) {\n return undefined;\n }\n\n const items = this.entityScheduler.inspectDirtyUpdates();\n\n return {\n items: limit ? items.slice(-limit) : items,\n size: this.entityScheduler.dirtyCount\n };\n }\n\n createEntitySpawnUpdate(spawn: EcsEntitySpawnRequest): IEntityUpdate {\n const descriptor = spawn.descriptorId\n ? this.getEntityTypeDescriptor(spawn.descriptorId)\n : this.getEntityTypeDescriptor(spawn.entityType);\n const entityType = descriptor?.entityType ?? spawn.entityType;\n const uid = spawn.uid ?? EcsIdGenerator.entityUid(entityType);\n const scopeId = spawn.scopeId ?? descriptor?.scopeId ?? this.defaultScopeId;\n const modelInput = {\n descriptor: descriptor ?? normalizeEntityTypeDescriptor({ entityType }),\n entityType,\n scopeId,\n uid\n };\n const model: IEntityModel = descriptor?.createModel?.(modelInput) ?? {\n uid,\n scopeId\n };\n const snapshot = descriptor?.createSnapshot?.(modelInput);\n\n return {\n type: EntityUpdateType.update,\n entity: {\n entityType,\n entityUid: model.uid\n },\n model,\n snapshot\n };\n }\n\n enqueueEntitySpawn(spawn: EcsEntitySpawnRequest): IEntityUpdate | undefined {\n if (!this.entityScheduler) {\n return undefined;\n }\n\n const update = this.createEntitySpawnUpdate(spawn);\n this.entityScheduler.enqueue(update);\n return update;\n }\n\n listSystemsModules(): ReadonlyMap<EntityTypeUid, ISystemsModule<IEntity>> {\n return this.systemsModuleRepository.list() as ReadonlyMap<EntityTypeUid, ISystemsModule<IEntity>>;\n }\n\n recordEvent(event: IEntityEvent<IEventData>, targets: readonly IEntityProxy[] = []): void {\n this.eventLog.push({\n event,\n targets,\n recordedAt: Date.now()\n });\n\n if (this.eventLog.length > this.eventLogSize) {\n this.eventLog.splice(0, this.eventLog.length - this.eventLogSize);\n }\n\n this.stores.events.notify();\n }\n\n private bumpUpdate(entityUid: EntityUid, key: keyof EntityUpdateCounts): void {\n const counts = this.updateCounts.get(entityUid) ?? { removes: 0, updates: 0 };\n counts[key] += 1;\n this.updateCounts.set(entityUid, counts);\n this.stores.updates.notify();\n }\n\n private instrumentRepositories(): void {\n this.unsubscribeInstrumentation.push(\n instrumentMethod(this.entityRepository, 'set', (args) => {\n const entity = args[0] as IEntity | undefined;\n if (entity?.identity.proxy) {\n this.bumpUpdate(entity.identity.proxy.entityUid, 'updates');\n }\n this.stores.entities.notify();\n this.stores.entityTypes.notify();\n this.stores.scopes.notify();\n }),\n instrumentMethod(this.entityRepository, 'delete', (args) => {\n const proxy = args[0];\n if (isProxy(proxy)) {\n this.bumpUpdate(proxy.entityUid, 'removes');\n }\n this.stores.entities.notify();\n this.stores.entityTypes.notify();\n this.stores.scopes.notify();\n }),\n instrumentMethod(this.entityRepository, 'clear', () => {\n this.stores.entities.notify();\n this.stores.entityTypes.notify();\n this.stores.scopes.notify();\n }),\n instrumentMethod(this.systemsModuleRepository, 'set', () => {\n this.stores.modules.notify();\n this.stores.entityTypes.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'register', () => {\n this.stores.proxies.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'registerMany', () => {\n this.stores.proxies.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'remove', () => {\n this.stores.proxies.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'removeAllFor', () => {\n this.stores.proxies.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'setScopedProxy', (args) => {\n const entity = args[0];\n const scopeId = args[1];\n if (isProxy(entity) && typeof scopeId === 'string') {\n const proxies = this.scopedProxies.get(scopeId) ?? new Map<EntityTypeUid, IEntityProxy>();\n proxies.set(entity.entityType, entity);\n this.scopedProxies.set(scopeId, proxies);\n }\n this.stores.proxies.notify();\n this.stores.scopes.notify();\n }),\n instrumentMethod(this.entityProxyRepository, 'removeScopedProxy', (args) => {\n const entity = args[0];\n const scopeId = args[1];\n if (isProxy(entity) && typeof scopeId === 'string') {\n const proxies = this.scopedProxies.get(scopeId);\n const existing = proxies?.get(entity.entityType);\n if (existing?.entityUid === entity.entityUid) {\n proxies.delete(entity.entityType);\n }\n if (proxies?.size === 0) {\n this.scopedProxies.delete(scopeId);\n }\n }\n this.stores.proxies.notify();\n this.stores.scopes.notify();\n }),\n instrumentMethod(this.entityEventsManager, 'subscribe', () => {\n this.stores.subscriptions.notify();\n }),\n instrumentMethod(this.entityEventsManager, 'unsubscribe', () => {\n this.stores.subscriptions.notify();\n }),\n instrumentMethod(this.entityEventsManager, 'clearSubscriptions', () => {\n this.stores.subscriptions.notify();\n }),\n instrumentMethod(this.entityEventsManager, 'clearSubscriptionsForEntity', () => {\n this.stores.subscriptions.notify();\n }),\n instrumentMethod(this.entityEventsManager, 'clearSubscriptionsForEvent', () => {\n this.stores.subscriptions.notify();\n }),\n instrumentMethod(this.performanceTimer, 'endTimer', (_args, result) => {\n const entry = result as PerformanceTimeEntry | undefined;\n if (!this.performanceTimer?.metrics && entry?.name) {\n this.metricEntries.push(entry);\n }\n this.stores.metrics.notify();\n }),\n instrumentMethod(this.entityScheduler, 'schedule', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'removeSchedule', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'clearSchedules', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'skipEntityType', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'unskipEntityType', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'pause', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'resume', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'enqueue', () => {\n this.stores.queue.notify();\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'enqueueEvent', () => {\n this.stores.queue.notify();\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'enqueueEvents', () => {\n this.stores.queue.notify();\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'clearDirtyUpdates', () => {\n this.stores.queue.notify();\n this.stores.scheduler.notify();\n })\n );\n }\n}\n\nexport function createEcsBridge(input: EcsBridgeInput): EcsBridge {\n return new EcsBridge(input);\n}\n","import { PropsWithChildren, useMemo } from 'react';\nimport { EcsBridge } from './ecs-bridge';\nimport {\n EcsCanvasContextOptions,\n EcsFlowContext,\n EcsFlowContextProps\n} from './ecs-flow-context';\n\nexport type EcsCanvasProviderProps = PropsWithChildren<\n EcsCanvasContextOptions & {\n bridge: EcsBridge;\n }\n>;\n\nexport function EcsCanvasProvider({\n bridge,\n children,\n readOnly = false,\n telemetryThresholdMs\n}: Readonly<EcsCanvasProviderProps>) {\n const value = useMemo<EcsFlowContextProps>(() => {\n return Object.assign(bridge, {\n readOnly,\n telemetryThresholdMs\n });\n }, [bridge, readOnly, telemetryThresholdMs]);\n\n return <EcsFlowContext.Provider value={value}>{children}</EcsFlowContext.Provider>;\n}\n"],"mappings":";;;;;;;;AAKA,IAAaO,oBAAb,MAA+B;CAC7B,AAAiBC;CAEjBE,cAAc;EACZ,KAAKF,wBAAQ,IAAIC,IAAI;CACvB;CAEA,IAAIE,YAAoB;EACtB,OAAO,KAAKH,MAAMI;CACpB;CAEAC,oBAAoBC,MAAmC;EACrD,KAAKN,MAAMO,IAAID,KAAKE,KAAKC,WAAWC,SAAS,GAAGJ,IAAI;CACtD;CAEAK,oBAAoBF,YAAwD;EAC1E,OAAO,KAAKT,MAAMY,IAAIH,WAAWC,SAAS,CAAC;CAC7C;CAEAG,kBAAkBP,MAAgC;EAChD,KAAKN,MAAMO,IAAIZ,eAAemB,MAAMR,KAAKE,KAAKO,OAAO,GAAGT,IAAI;CAC9D;CAEAU,kBAAkBD,SAA2C;EAC3D,OAAO,KAAKf,MAAMY,IAAIjB,eAAemB,MAAMC,OAAO,CAAC;CACrD;CAEAE,cAAcX,MAA4B;EACxC,IAAI,CAACA,KAAKE,KAAKU,QACb;EAGF,KAAKlB,MAAMO,IAAIZ,eAAewB,YAAYb,KAAKE,KAAKU,MAAM,GAAGZ,IAAI;CACnE;CAEAc,cAAcF,QAA4C;EACxD,OAAO,KAAKlB,MAAMY,IAAIjB,eAAewB,YAAYD,MAAM,CAAC;CAC1D;CAEAG,YAAYf,MAAY;EACtB,KAAKN,MAAMO,IAAIZ,eAAe2B,KAAKhB,KAAKiB,IAAI,GAAGjB,IAAI;CACrD;CAEAkB,YAAYD,MAAoB;EAC9B,OAAO,KAAKvB,MAAMY,IAAIjB,eAAe2B,KAAKC,IAAI,CAAC;CACjD;CAEAE,eAAuB;EACrB,OAAOC,MAAMC,KAAK,KAAK3B,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QACEH;CAI2C,IAAAI;CAAA,IAAAX,EAAA,OAAAE,YAAAF,EAAA,OAAAU,OAAA;EAEtCC,KAAA,oBAAA,eAAA,UAAA;GAAgCD;GAAQR;EAAS;EAA0BF,EAAA,KAAAE;EAAAF,EAAA,KAAAU;EAAAV,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OAA3EW;AAA2E"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { Box, Button, Collapse, useComputedColorScheme } from "@mantine/core";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useDisclosure } from "@mantine/hooks";
|
|
6
|
+
import { Inspector } from "react-inspector";
|
|
7
|
+
|
|
8
|
+
//#region src/components/object-inspector.tsx
|
|
9
|
+
function ObjectInspector(props) {
|
|
10
|
+
const $ = c(3);
|
|
11
|
+
const theme = useComputedColorScheme() === "dark" ? "chromeDark" : "chromeLight";
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== props.data || $[1] !== theme) {
|
|
14
|
+
t0 = /* @__PURE__ */ jsx(Inspector, {
|
|
15
|
+
table: false,
|
|
16
|
+
theme,
|
|
17
|
+
data: props.data
|
|
18
|
+
});
|
|
19
|
+
$[0] = props.data;
|
|
20
|
+
$[1] = theme;
|
|
21
|
+
$[2] = t0;
|
|
22
|
+
} else t0 = $[2];
|
|
23
|
+
return t0;
|
|
24
|
+
}
|
|
25
|
+
var object_inspector_default = memo(ObjectInspector);
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/entity-component-inspector.tsx
|
|
29
|
+
function EntityComponentInspector(props) {
|
|
30
|
+
const $ = c(13);
|
|
31
|
+
const [opened, t0] = useDisclosure(false);
|
|
32
|
+
const { toggle } = t0;
|
|
33
|
+
const buttonColor = opened ? "light" : "indigo";
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[0] !== buttonColor || $[1] !== props.component.componentType || $[2] !== toggle) {
|
|
36
|
+
t1 = /* @__PURE__ */ jsx(Button, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
size: "xs",
|
|
39
|
+
onClick: toggle,
|
|
40
|
+
color: buttonColor,
|
|
41
|
+
fullWidth: true,
|
|
42
|
+
children: props.component.componentType
|
|
43
|
+
});
|
|
44
|
+
$[0] = buttonColor;
|
|
45
|
+
$[1] = props.component.componentType;
|
|
46
|
+
$[2] = toggle;
|
|
47
|
+
$[3] = t1;
|
|
48
|
+
} else t1 = $[3];
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[4] !== opened || $[5] !== props.component) {
|
|
51
|
+
t2 = opened && /* @__PURE__ */ jsx(object_inspector_default, { data: props.component });
|
|
52
|
+
$[4] = opened;
|
|
53
|
+
$[5] = props.component;
|
|
54
|
+
$[6] = t2;
|
|
55
|
+
} else t2 = $[6];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[7] !== opened || $[8] !== t2) {
|
|
58
|
+
t3 = /* @__PURE__ */ jsx(Collapse, {
|
|
59
|
+
expanded: opened,
|
|
60
|
+
children: t2
|
|
61
|
+
});
|
|
62
|
+
$[7] = opened;
|
|
63
|
+
$[8] = t2;
|
|
64
|
+
$[9] = t3;
|
|
65
|
+
} else t3 = $[9];
|
|
66
|
+
let t4;
|
|
67
|
+
if ($[10] !== t1 || $[11] !== t3) {
|
|
68
|
+
t4 = /* @__PURE__ */ jsxs(Box, { children: [t1, t3] });
|
|
69
|
+
$[10] = t1;
|
|
70
|
+
$[11] = t3;
|
|
71
|
+
$[12] = t4;
|
|
72
|
+
} else t4 = $[12];
|
|
73
|
+
return t4;
|
|
74
|
+
}
|
|
75
|
+
var entity_component_inspector_default = memo(EntityComponentInspector);
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { object_inspector_default as n, entity_component_inspector_default as t };
|
|
79
|
+
//# sourceMappingURL=entity-component-inspector-CNaN8Scf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-component-inspector-CNaN8Scf.mjs","names":["useComputedColorScheme","memo","useMemo","Inspector","ObjectInspectorProps","data","ObjectInspector","props","$","_c","colorScheme","theme","t0","IComponent","Box","Button","Collapse","useDisclosure","memo","useMemo","ObjectInspector","EntityComponentInspectorProps","component","EntityComponentInspector","props","$","_c","opened","t0","toggle","buttonColor","t1","componentType","t2","t3","t4"],"sources":["../src/components/object-inspector.tsx","../src/components/entity-component-inspector.tsx"],"sourcesContent":["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 expanded={opened}>{opened && <ObjectInspector data={props.component} />}</Collapse>\n </Box>\n );\n}\n\nexport default memo(EntityComponentInspector);\n"],"mappings":";;;;;;;;AAQA,SAAAM,gBAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAGE,MAAAE,QAFoBX,uBAGXU,MAAgB,SAAhB,eAA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,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAM,MAAAN,EAAA,QAAAS,IAAA;EAL/FC,KAAA,qBAAC,KAAD,aACEJ,IAIAG,EALE;EAMET,EAAA,MAAAM;EAAAN,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OANNU;AAMM;AAIV,yCAAejB,KAAKK,wBAAwB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
2
|
+
let _mantine_core = require("@mantine/core");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
let _mantine_hooks = require("@mantine/hooks");
|
|
6
|
+
let react_inspector = require("react-inspector");
|
|
7
|
+
|
|
8
|
+
//#region src/components/object-inspector.tsx
|
|
9
|
+
function ObjectInspector(props) {
|
|
10
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
11
|
+
const theme = (0, _mantine_core.useComputedColorScheme)() === "dark" ? "chromeDark" : "chromeLight";
|
|
12
|
+
let t0;
|
|
13
|
+
if ($[0] !== props.data || $[1] !== theme) {
|
|
14
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_inspector.Inspector, {
|
|
15
|
+
table: false,
|
|
16
|
+
theme,
|
|
17
|
+
data: props.data
|
|
18
|
+
});
|
|
19
|
+
$[0] = props.data;
|
|
20
|
+
$[1] = theme;
|
|
21
|
+
$[2] = t0;
|
|
22
|
+
} else t0 = $[2];
|
|
23
|
+
return t0;
|
|
24
|
+
}
|
|
25
|
+
var object_inspector_default = (0, react.memo)(ObjectInspector);
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/entity-component-inspector.tsx
|
|
29
|
+
function EntityComponentInspector(props) {
|
|
30
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
31
|
+
const [opened, t0] = (0, _mantine_hooks.useDisclosure)(false);
|
|
32
|
+
const { toggle } = t0;
|
|
33
|
+
const buttonColor = opened ? "light" : "indigo";
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[0] !== buttonColor || $[1] !== props.component.componentType || $[2] !== toggle) {
|
|
36
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
37
|
+
variant: "outline",
|
|
38
|
+
size: "xs",
|
|
39
|
+
onClick: toggle,
|
|
40
|
+
color: buttonColor,
|
|
41
|
+
fullWidth: true,
|
|
42
|
+
children: props.component.componentType
|
|
43
|
+
});
|
|
44
|
+
$[0] = buttonColor;
|
|
45
|
+
$[1] = props.component.componentType;
|
|
46
|
+
$[2] = toggle;
|
|
47
|
+
$[3] = t1;
|
|
48
|
+
} else t1 = $[3];
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[4] !== opened || $[5] !== props.component) {
|
|
51
|
+
t2 = opened && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(object_inspector_default, { data: props.component });
|
|
52
|
+
$[4] = opened;
|
|
53
|
+
$[5] = props.component;
|
|
54
|
+
$[6] = t2;
|
|
55
|
+
} else t2 = $[6];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[7] !== opened || $[8] !== t2) {
|
|
58
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Collapse, {
|
|
59
|
+
expanded: opened,
|
|
60
|
+
children: t2
|
|
61
|
+
});
|
|
62
|
+
$[7] = opened;
|
|
63
|
+
$[8] = t2;
|
|
64
|
+
$[9] = t3;
|
|
65
|
+
} else t3 = $[9];
|
|
66
|
+
let t4;
|
|
67
|
+
if ($[10] !== t1 || $[11] !== t3) {
|
|
68
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, { children: [t1, t3] });
|
|
69
|
+
$[10] = t1;
|
|
70
|
+
$[11] = t3;
|
|
71
|
+
$[12] = t4;
|
|
72
|
+
} else t4 = $[12];
|
|
73
|
+
return t4;
|
|
74
|
+
}
|
|
75
|
+
var entity_component_inspector_default = (0, react.memo)(EntityComponentInspector);
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
Object.defineProperty(exports, 'entity_component_inspector_default', {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return entity_component_inspector_default;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, 'object_inspector_default', {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return object_inspector_default;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=entity-component-inspector-VlwcaUqy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-component-inspector-VlwcaUqy.cjs","names":["useComputedColorScheme","memo","useMemo","Inspector","ObjectInspectorProps","data","ObjectInspector","props","$","_c","colorScheme","theme","t0","IComponent","Box","Button","Collapse","useDisclosure","memo","useMemo","ObjectInspector","EntityComponentInspectorProps","component","EntityComponentInspector","props","$","_c","opened","t0","toggle","buttonColor","t1","componentType","t2","t3","t4"],"sources":["../src/components/object-inspector.tsx","../src/components/entity-component-inspector.tsx"],"sourcesContent":["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 expanded={opened}>{opened && <ObjectInspector data={props.component} />}</Collapse>\n </Box>\n );\n}\n\nexport default memo(EntityComponentInspector);\n"],"mappings":";;;;;;;;AAQA,SAAAM,gBAAAC,OAAA;CAAA,MAAAC,kCAAA,CAAA;CAGE,MAAAG,kDACSD,MAAgB,SAAhB,eAAA;CAEP,IAAAE;CAAA,IAAAJ,EAAA,OAAAD,MAAAF,QAAAG,EAAA,OAAAG,OAAA;EAEKC,KAAA,2CAAC,2BAAD;GAAkB,OAAA;GAAcD;GAAa,MAAAJ,MAAKF;EAAK;EAAIG,EAAA,KAAAD,MAAAF;EAAAG,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAA3DI;AAA2D;AAGpE,+CAAoBN,eAAe;;;;ACTnC,SAAAiB,yBAAAC,OAAA;CAAA,MAAAC,kCAAA,EAAA;CACE,MAAA,CAAAE,QAAAC,wCAA2C,KAAK;CAAjC,MAAA,EAAAC,WAAAD;CAEf,MAAAE,cAAmCH,SAAA,UAAA;CAAwC,IAAAI;CAAA,IAAAN,EAAA,OAAAK,eAAAL,EAAA,OAAAD,MAAAF,UAAAU,iBAAAP,EAAA,OAAAI,QAAA;EAIvEE,KAAA,2CAAC,sBAAD;GAAgB,SAAA;GAAe,MAAA;GAAcF,SAAAA;GAAeC,OAAAA;GAAa,WAAA;aACtEN,MAAKF,UAAUU;EADX;EAEEP,EAAA,KAAAK;EAAAL,EAAA,KAAAD,MAAAF,UAAAU;EAAAP,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAE,UAAAF,EAAA,OAAAD,MAAAF,WAAA;EAEoBW,KAAAN,UAAU,2CAAC,0BAAD,EAAuB,MAAAH,MAAKF,UAAU;EAAIG,EAAA,KAAAE;EAAAF,EAAA,KAAAD,MAAAF;EAAAG,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAE,UAAAF,EAAA,OAAAQ,IAAA;EAAjFC,KAAA,2CAAC,wBAAD;GAAoBP,UAAAA;aAASM;EAApB;EAAoFR,EAAA,KAAAE;EAAAF,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAM,MAAAN,EAAA,QAAAS,IAAA;EAL/FC,KAAA,4CAAC,mBAAD,aACEJ,IAIAG,EALE;EAMET,EAAA,MAAAM;EAAAN,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OANNU;AAMM;AAIV,yDAAoBZ,wBAAwB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_node_types = require('../node-types-CNO_-52M.cjs');
|
|
3
|
+
|
|
4
|
+
exports.useBridgeStoreVersion = require_node_types.useBridgeStoreVersion;
|
|
5
|
+
exports.useEcsBridge = require_node_types.useEcsBridge;
|
|
6
|
+
exports.useEntitiesInScope = require_node_types.useEntitiesInScope;
|
|
7
|
+
exports.useEntity = require_node_types.useEntity;
|
|
8
|
+
exports.useEntityList = require_node_types.useEntityList;
|
|
9
|
+
exports.useEntityTypeDescriptors = require_node_types.useEntityTypeDescriptors;
|
|
10
|
+
exports.useEntityTypeTemplates = require_node_types.useEntityTypeTemplates;
|
|
11
|
+
exports.useEntityUpdates = require_node_types.useEntityUpdates;
|
|
12
|
+
exports.useEventStream = require_node_types.useEventStream;
|
|
13
|
+
exports.useMiddlewareMetrics = require_node_types.useMiddlewareMetrics;
|
|
14
|
+
exports.usePipelineMetrics = require_node_types.usePipelineMetrics;
|
|
15
|
+
exports.useScheduler = require_node_types.useScheduler;
|
|
16
|
+
exports.useScopeList = require_node_types.useScopeList;
|
|
17
|
+
exports.useSystemsModule = require_node_types.useSystemsModule;
|
|
18
|
+
exports.useSystemsModuleList = require_node_types.useSystemsModuleList;
|
|
19
|
+
exports.useUpdateQueue = require_node_types.useUpdateQueue;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as useScheduler, c as useEventStream, d as useEntityTypeDescriptors, f as useEntityList, g as useEcsBridge, h as useBridgeStoreVersion, i as useScopeList, l as useEntityUpdates, m as useEntitiesInScope, n as useSystemsModule, o as useMiddlewareMetrics, p as useEntity, r as useSystemsModuleList, s as usePipelineMetrics, t as useUpdateQueue, u as useEntityTypeTemplates } from "../index-CPTq4oOA.cjs";
|
|
2
|
+
export { useBridgeStoreVersion, useEcsBridge, useEntitiesInScope, useEntity, useEntityList, useEntityTypeDescriptors, useEntityTypeTemplates, useEntityUpdates, useEventStream, useMiddlewareMetrics, usePipelineMetrics, useScheduler, useScopeList, useSystemsModule, useSystemsModuleList, useUpdateQueue };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as useScheduler, c as useEventStream, d as useEntityTypeDescriptors, f as useEntityList, g as useEcsBridge, h as useBridgeStoreVersion, i as useScopeList, l as useEntityUpdates, m as useEntitiesInScope, n as useSystemsModule, o as useMiddlewareMetrics, p as useEntity, r as useSystemsModuleList, s as usePipelineMetrics, t as useUpdateQueue, u as useEntityTypeTemplates } from "../index-vf1CSWta.mjs";
|
|
2
|
+
export { useBridgeStoreVersion, useEcsBridge, useEntitiesInScope, useEntity, useEntityList, useEntityTypeDescriptors, useEntityTypeTemplates, useEntityUpdates, useEventStream, useMiddlewareMetrics, usePipelineMetrics, useScheduler, useScopeList, useSystemsModule, useSystemsModuleList, useUpdateQueue };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { C as usePipelineMetrics, E as useEntityTypeTemplates, F as useBridgeStoreVersion, I as useEcsBridge, M as useEntityList, N as useEntity, P as useEntitiesInScope, S as useMiddlewareMetrics, T as useEntityUpdates, _ as useUpdateQueue, b as useScopeList, j as useEntityTypeDescriptors, v as useSystemsModule, w as useEventStream, x as useScheduler, y as useSystemsModuleList } from "../node-types-l0GwV0mz.mjs";
|
|
2
|
+
|
|
3
|
+
export { useBridgeStoreVersion, useEcsBridge, useEntitiesInScope, useEntity, useEntityList, useEntityTypeDescriptors, useEntityTypeTemplates, useEntityUpdates, useEventStream, useMiddlewareMetrics, usePipelineMetrics, useScheduler, useScopeList, useSystemsModule, useSystemsModuleList, useUpdateQueue };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
let react = require("react");
|
|
2
|
+
|
|
3
|
+
//#region src/context/ecs-flow-context.ts
|
|
4
|
+
const EcsFlowContext = (0, react.createContext)(null);
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/utils/id-generator.ts
|
|
8
|
+
var EcsIdGenerator = class EcsIdGenerator {
|
|
9
|
+
static entityProxy(proxy) {
|
|
10
|
+
return `${proxy.entityType}:${proxy.entityUid}`;
|
|
11
|
+
}
|
|
12
|
+
static entityType(entityType) {
|
|
13
|
+
return `entity-type:${entityType}`;
|
|
14
|
+
}
|
|
15
|
+
static entityTypeTemplate(entityType, id) {
|
|
16
|
+
return `template:${id ?? EcsIdGenerator.entityType(entityType)}`;
|
|
17
|
+
}
|
|
18
|
+
static entityUid(entityType) {
|
|
19
|
+
return `${entityType}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
|
|
20
|
+
}
|
|
21
|
+
static event(uid) {
|
|
22
|
+
return `event:${uid}`;
|
|
23
|
+
}
|
|
24
|
+
static scope(scopeId) {
|
|
25
|
+
return `scope:${scopeId}`;
|
|
26
|
+
}
|
|
27
|
+
static tool(type) {
|
|
28
|
+
return `tool:${type}`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
Object.defineProperty(exports, 'EcsFlowContext', {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return EcsFlowContext;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, 'EcsIdGenerator', {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return EcsIdGenerator;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=id-generator-C2_8g29M.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-generator-C2_8g29M.cjs","names":["createContext","EcsBridge","EcsCanvasContextOptions","readOnly","telemetryThresholdMs","EcsFlowContextProps","EcsFlowContext","EntityTypeUid","IEntityProxy","EcsIdGenerator","entityProxy","proxy","entityType","entityUid","entityTypeTemplate","id","randomId","globalThis","crypto","randomUUID","Date","now","Math","random","toString","slice","event","uid","scope","scopeId","tool","type"],"sources":["../src/context/ecs-flow-context.ts","../src/utils/id-generator.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { EcsBridge } from './ecs-bridge';\n\nexport type EcsCanvasContextOptions = {\n readOnly?: boolean;\n telemetryThresholdMs?: number;\n};\n\nexport type EcsFlowContextProps = EcsBridge & EcsCanvasContextOptions;\n\nexport const EcsFlowContext = createContext<EcsFlowContextProps | null>(null);\n","import { EntityTypeUid, 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 static entityType(entityType: EntityTypeUid): string {\n return `entity-type:${entityType}`;\n }\n\n static entityTypeTemplate(entityType: EntityTypeUid, id?: string): string {\n return `template:${id ?? EcsIdGenerator.entityType(entityType)}`;\n }\n\n static entityUid(entityType: EntityTypeUid): string {\n const randomId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n return `${entityType}-${randomId}`;\n }\n\n static event(uid: string | number): string {\n return `event:${uid}`;\n }\n\n static scope(scopeId: string): string {\n return `scope:${scopeId}`;\n }\n\n static tool(type: string): string {\n return `tool:${type}`;\n }\n}\n"],"mappings":";;;AAUA,MAAaM,0CAA2D,IAAI;;;;ACR5E,IAAaG,iBAAb,MAAaA,eAAe;CAC1B,OAAOC,YAAYC,OAA6B;EAC9C,OAAO,GAAGA,MAAMC,WAAU,GAAID,MAAME;CACtC;CAEA,OAAOD,WAAWA,YAAmC;EACnD,OAAO,eAAeA;CACxB;CAEA,OAAOE,mBAAmBF,YAA2BG,IAAqB;EACxE,OAAO,YAAYA,MAAMN,eAAeG,WAAWA,UAAU;CAC/D;CAEA,OAAOC,UAAUD,YAAmC;EAElD,OAAO,GAAGA,WAAU,GADHK,WAAWC,QAAQC,aAAa,KAAK,GAAGC,KAAKC,IAAI,EAAC,GAAIC,KAAKC,OAAO,EAAEC,SAAS,EAAE,EAAEC,MAAM,CAAC;CAE3G;CAEA,OAAOC,MAAMC,KAA8B;EACzC,OAAO,SAASA;CAClB;CAEA,OAAOC,MAAMC,SAAyB;EACpC,OAAO,SAASA;CAClB;CAEA,OAAOC,KAAKC,MAAsB;EAChC,OAAO,QAAQA;CACjB;AACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/context/ecs-flow-context.ts
|
|
4
|
+
const EcsFlowContext = createContext(null);
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/utils/id-generator.ts
|
|
8
|
+
var EcsIdGenerator = class EcsIdGenerator {
|
|
9
|
+
static entityProxy(proxy) {
|
|
10
|
+
return `${proxy.entityType}:${proxy.entityUid}`;
|
|
11
|
+
}
|
|
12
|
+
static entityType(entityType) {
|
|
13
|
+
return `entity-type:${entityType}`;
|
|
14
|
+
}
|
|
15
|
+
static entityTypeTemplate(entityType, id) {
|
|
16
|
+
return `template:${id ?? EcsIdGenerator.entityType(entityType)}`;
|
|
17
|
+
}
|
|
18
|
+
static entityUid(entityType) {
|
|
19
|
+
return `${entityType}-${globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`;
|
|
20
|
+
}
|
|
21
|
+
static event(uid) {
|
|
22
|
+
return `event:${uid}`;
|
|
23
|
+
}
|
|
24
|
+
static scope(scopeId) {
|
|
25
|
+
return `scope:${scopeId}`;
|
|
26
|
+
}
|
|
27
|
+
static tool(type) {
|
|
28
|
+
return `tool:${type}`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { EcsFlowContext as n, EcsIdGenerator as t };
|
|
34
|
+
//# sourceMappingURL=id-generator-DDsv3NdX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-generator-DDsv3NdX.mjs","names":["createContext","EcsBridge","EcsCanvasContextOptions","readOnly","telemetryThresholdMs","EcsFlowContextProps","EcsFlowContext","EntityTypeUid","IEntityProxy","EcsIdGenerator","entityProxy","proxy","entityType","entityUid","entityTypeTemplate","id","randomId","globalThis","crypto","randomUUID","Date","now","Math","random","toString","slice","event","uid","scope","scopeId","tool","type"],"sources":["../src/context/ecs-flow-context.ts","../src/utils/id-generator.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { EcsBridge } from './ecs-bridge';\n\nexport type EcsCanvasContextOptions = {\n readOnly?: boolean;\n telemetryThresholdMs?: number;\n};\n\nexport type EcsFlowContextProps = EcsBridge & EcsCanvasContextOptions;\n\nexport const EcsFlowContext = createContext<EcsFlowContextProps | null>(null);\n","import { EntityTypeUid, 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 static entityType(entityType: EntityTypeUid): string {\n return `entity-type:${entityType}`;\n }\n\n static entityTypeTemplate(entityType: EntityTypeUid, id?: string): string {\n return `template:${id ?? EcsIdGenerator.entityType(entityType)}`;\n }\n\n static entityUid(entityType: EntityTypeUid): string {\n const randomId = globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;\n return `${entityType}-${randomId}`;\n }\n\n static event(uid: string | number): string {\n return `event:${uid}`;\n }\n\n static scope(scopeId: string): string {\n return `scope:${scopeId}`;\n }\n\n static tool(type: string): string {\n return `tool:${type}`;\n }\n}\n"],"mappings":";;;AAUA,MAAaM,iBAAiBN,cAA0C,IAAI;;;;ACR5E,IAAaS,iBAAb,MAAaA,eAAe;CAC1B,OAAOC,YAAYC,OAA6B;EAC9C,OAAO,GAAGA,MAAMC,WAAU,GAAID,MAAME;CACtC;CAEA,OAAOD,WAAWA,YAAmC;EACnD,OAAO,eAAeA;CACxB;CAEA,OAAOE,mBAAmBF,YAA2BG,IAAqB;EACxE,OAAO,YAAYA,MAAMN,eAAeG,WAAWA,UAAU;CAC/D;CAEA,OAAOC,UAAUD,YAAmC;EAElD,OAAO,GAAGA,WAAU,GADHK,WAAWC,QAAQC,aAAa,KAAK,GAAGC,KAAKC,IAAI,EAAC,GAAIC,KAAKC,OAAO,EAAEC,SAAS,EAAE,EAAEC,MAAM,CAAC;CAE3G;CAEA,OAAOC,MAAMC,KAA8B;EACzC,OAAO,SAASA;CAClB;CAEA,OAAOC,MAAMC,SAAyB;EACpC,OAAO,SAASA;CAClB;CAEA,OAAOC,KAAKC,MAAsB;EAChC,OAAO,QAAQA;CACjB;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as ScopeGroupNodeData, t as EcsToolNodeData } from "./node-props-Cusf_qtn.mjs";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
import { Node, NodeProps } from "@xyflow/react";
|
|
4
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/nodes/node-event-timeline.d.ts
|
|
7
|
+
declare function EventTimelineNode({
|
|
8
|
+
id,
|
|
9
|
+
data,
|
|
10
|
+
selected,
|
|
11
|
+
type
|
|
12
|
+
}: NodeProps<Node<EcsToolNodeData>>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
declare const _default$4: _$react.MemoExoticComponent<typeof EventTimelineNode>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/nodes/node-scheduler.d.ts
|
|
16
|
+
declare function SchedulerNode({
|
|
17
|
+
id,
|
|
18
|
+
data,
|
|
19
|
+
selected,
|
|
20
|
+
type
|
|
21
|
+
}: NodeProps<Node<EcsToolNodeData>>): _$react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare const _default$3: _$react.MemoExoticComponent<typeof SchedulerNode>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/nodes/node-scope-group.d.ts
|
|
25
|
+
declare function ScopeGroupNode({
|
|
26
|
+
id,
|
|
27
|
+
selected,
|
|
28
|
+
data,
|
|
29
|
+
type,
|
|
30
|
+
width,
|
|
31
|
+
height
|
|
32
|
+
}: NodeProps<Node<ScopeGroupNodeData>>): _$react_jsx_runtime0.JSX.Element;
|
|
33
|
+
declare const _default$2: _$react.MemoExoticComponent<typeof ScopeGroupNode>;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/nodes/node-telemetry.d.ts
|
|
36
|
+
declare function TelemetryNode({
|
|
37
|
+
id,
|
|
38
|
+
data,
|
|
39
|
+
selected,
|
|
40
|
+
type
|
|
41
|
+
}: NodeProps<Node<EcsToolNodeData>>): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
declare const _default$1: _$react.MemoExoticComponent<typeof TelemetryNode>;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/nodes/node-update-queue.d.ts
|
|
45
|
+
declare function UpdateQueueNode({
|
|
46
|
+
id,
|
|
47
|
+
data,
|
|
48
|
+
selected,
|
|
49
|
+
type
|
|
50
|
+
}: NodeProps<Node<EcsToolNodeData>>): _$react_jsx_runtime0.JSX.Element;
|
|
51
|
+
declare const _default: _$react.MemoExoticComponent<typeof UpdateQueueNode>;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { _default$4 as a, _default$3 as i, _default$1 as n, _default$2 as r, _default as t };
|
|
54
|
+
//# sourceMappingURL=index-2l9Vdh2S.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-2l9Vdh2S.d.mts","names":[],"sources":["../src/nodes/node-event-timeline.tsx","../src/nodes/node-scheduler.tsx","../src/nodes/node-scope-group.tsx","../src/nodes/node-telemetry.tsx","../src/nodes/node-update-queue.tsx"],"mappings":";;;;;;iBAQS,iBAAA,CAAA;EAAoB,EAAA;EAAI,IAAA;EAAM,QAAA;EAAU;AAAA,GAAQ,SAAA,CAAU,IAAA,CAAK,eAAA,KAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,UAAA;;;iBCDhF,aAAA,CAAA;EAAgB,EAAA;EAAI,IAAA;EAAM,QAAA;EAAU;AAAA,GAAQ,SAAA,CAAU,IAAA,CAAK,eAAA,KAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,UAAA;;;iBCA5E,cAAA,CAAA;EAAiB,EAAA;EAAI,QAAA;EAAU,IAAA;EAAM,IAAA;EAAM,KAAA;EAAO;AAAA,GAAU,SAAA,CAAU,IAAA,CAAK,kBAAA,KAAoB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,UAAA;;;iBCA/F,aAAA,CAAA;EAAgB,EAAA;EAAI,IAAA;EAAM,QAAA;EAAU;AAAA,GAAQ,SAAA,CAAU,IAAA,CAAK,eAAA,KAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,UAAA;;;iBCC5E,eAAA,CAAA;EAAkB,EAAA;EAAI,IAAA;EAAM,QAAA;EAAU;AAAA,GAAQ,SAAA,CAAU,IAAA,CAAK,eAAA,KAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,QAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { r as ScopeGroupNodeData, t as EcsToolNodeData } from "./node-props-Cusf_qtn.mjs";
|
|
2
|
+
import { n as EntityNode, t as SystemsModuleNode } from "./node-systems-module-B8aKhvBo.mjs";
|
|
3
|
+
import { a as SystemsModuleNodeTemplate, i as UpdateQueueNodeTemplate, n as SchedulerNodeTemplate, o as ScopeGroupNodeTemplate, r as TelemetryNodeTemplate, s as EntityNodeTemplate, t as EventTimelineNodeTemplate } from "./template-tool-nodes-DWhekyQg.mjs";
|
|
4
|
+
import * as _$react from "react";
|
|
5
|
+
import * as _$_xyflow_react0 from "@xyflow/react";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/abstract/node-types.d.ts
|
|
9
|
+
declare enum EcsNodeType {
|
|
10
|
+
systemsModule = "systems-module-node",
|
|
11
|
+
entity = "entity-node",
|
|
12
|
+
scopeGroup = "scope-group-node",
|
|
13
|
+
scheduler = "scheduler-node",
|
|
14
|
+
eventTimeline = "event-timeline-node",
|
|
15
|
+
telemetry = "telemetry-node",
|
|
16
|
+
updateQueue = "update-queue-node"
|
|
17
|
+
}
|
|
18
|
+
declare const ecsNodeTypes: {
|
|
19
|
+
"systems-module-node": typeof SystemsModuleNode;
|
|
20
|
+
"entity-node": typeof EntityNode;
|
|
21
|
+
"scope-group-node": _$react.MemoExoticComponent<({
|
|
22
|
+
id,
|
|
23
|
+
selected,
|
|
24
|
+
data,
|
|
25
|
+
type,
|
|
26
|
+
width,
|
|
27
|
+
height
|
|
28
|
+
}: _$_xyflow_react0.NodeProps<_$_xyflow_react0.Node<ScopeGroupNodeData>>) => _$react_jsx_runtime0.JSX.Element>;
|
|
29
|
+
"scheduler-node": _$react.MemoExoticComponent<({
|
|
30
|
+
id,
|
|
31
|
+
data,
|
|
32
|
+
selected,
|
|
33
|
+
type
|
|
34
|
+
}: _$_xyflow_react0.NodeProps<_$_xyflow_react0.Node<EcsToolNodeData>>) => _$react_jsx_runtime0.JSX.Element>;
|
|
35
|
+
"event-timeline-node": _$react.MemoExoticComponent<({
|
|
36
|
+
id,
|
|
37
|
+
data,
|
|
38
|
+
selected,
|
|
39
|
+
type
|
|
40
|
+
}: _$_xyflow_react0.NodeProps<_$_xyflow_react0.Node<EcsToolNodeData>>) => _$react_jsx_runtime0.JSX.Element>;
|
|
41
|
+
"telemetry-node": _$react.MemoExoticComponent<({
|
|
42
|
+
id,
|
|
43
|
+
data,
|
|
44
|
+
selected,
|
|
45
|
+
type
|
|
46
|
+
}: _$_xyflow_react0.NodeProps<_$_xyflow_react0.Node<EcsToolNodeData>>) => _$react_jsx_runtime0.JSX.Element>;
|
|
47
|
+
"update-queue-node": _$react.MemoExoticComponent<({
|
|
48
|
+
id,
|
|
49
|
+
data,
|
|
50
|
+
selected,
|
|
51
|
+
type
|
|
52
|
+
}: _$_xyflow_react0.NodeProps<_$_xyflow_react0.Node<EcsToolNodeData>>) => _$react_jsx_runtime0.JSX.Element>;
|
|
53
|
+
};
|
|
54
|
+
declare const ecsNodeTemplates: {
|
|
55
|
+
"entity-node": EntityNodeTemplate;
|
|
56
|
+
"systems-module-node": SystemsModuleNodeTemplate;
|
|
57
|
+
"scope-group-node": ScopeGroupNodeTemplate;
|
|
58
|
+
"scheduler-node": SchedulerNodeTemplate;
|
|
59
|
+
"event-timeline-node": EventTimelineNodeTemplate;
|
|
60
|
+
"telemetry-node": TelemetryNodeTemplate;
|
|
61
|
+
"update-queue-node": UpdateQueueNodeTemplate;
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/flow/flow-ecs-tool-nodes.d.ts
|
|
65
|
+
declare const defaultEcsToolNodes: readonly [EcsNodeType.scheduler, EcsNodeType.eventTimeline, EcsNodeType.telemetry, EcsNodeType.updateQueue];
|
|
66
|
+
type EcsToolNodeType = (typeof defaultEcsToolNodes)[number];
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/flow/flow-ecs-state.d.ts
|
|
69
|
+
type FlowEcsStateProps = {
|
|
70
|
+
showSystemModules: boolean;
|
|
71
|
+
showEntities: boolean;
|
|
72
|
+
autoLayout: boolean;
|
|
73
|
+
enableEntitySpawning?: boolean;
|
|
74
|
+
showScopes?: boolean;
|
|
75
|
+
toolNodes?: boolean | readonly EcsToolNodeType[];
|
|
76
|
+
};
|
|
77
|
+
declare function FlowEcsState(props: Readonly<FlowEcsStateProps>): _$react_jsx_runtime0.JSX.Element;
|
|
78
|
+
declare const _default: _$react.MemoExoticComponent<typeof FlowEcsState>;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/canvas/flow-ecs-canvas.d.ts
|
|
81
|
+
type FlowEcsCanvasProps = Partial<FlowEcsStateProps> & {
|
|
82
|
+
enableDragDrop?: boolean;
|
|
83
|
+
showEntityTypeTemplates?: boolean;
|
|
84
|
+
showTemplates?: boolean;
|
|
85
|
+
};
|
|
86
|
+
declare function FlowEcsCanvas({
|
|
87
|
+
autoLayout,
|
|
88
|
+
enableEntitySpawning,
|
|
89
|
+
enableDragDrop,
|
|
90
|
+
showEntities,
|
|
91
|
+
showEntityTypeTemplates,
|
|
92
|
+
showScopes,
|
|
93
|
+
showSystemModules,
|
|
94
|
+
showTemplates,
|
|
95
|
+
toolNodes
|
|
96
|
+
}: Readonly<FlowEcsCanvasProps>): _$react_jsx_runtime0.JSX.Element;
|
|
97
|
+
//#endregion
|
|
98
|
+
export { EcsNodeType as a, _default as i, FlowEcsCanvasProps as n, ecsNodeTemplates as o, FlowEcsStateProps as r, ecsNodeTypes as s, FlowEcsCanvas as t };
|
|
99
|
+
//# sourceMappingURL=index-BFqa6aqs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BFqa6aqs.d.mts","names":[],"sources":["../src/abstract/node-types.ts","../src/flow/flow-ecs-tool-nodes.tsx","../src/flow/flow-ecs-state.tsx","../src/canvas/flow-ecs-canvas.tsx"],"mappings":";;;;;;;;aAkBY,WAAA;EACV,aAAA;EACA,MAAA;EACA,UAAA;EACA,SAAA;EACA,aAAA;EACA,SAAA;EACA,WAAA;AAAA;AAAA,cAGW,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUA,gBAAA;;;;;;;;;;;cC9BA,mBAAA,YAAmB,WAAA,CAAA,SAAA,EAAA,WAAA,CAAA,aAAA,EAAA,WAAA,CAAA,SAAA,EAAA,WAAA,CAAA,WAAA;AAAA,KAOpB,eAAA,WAA0B,mBAAmB;;;KCN7C,iBAAA;EACV,iBAAA;EACA,YAAA;EACA,UAAA;EACA,oBAAA;EACA,UAAA;EACA,SAAA,sBAA+B,eAAe;AAAA;AAAA,iBAGvC,YAAA,CAAa,KAAA,EAAO,QAAA,CAAS,iBAAA,IAAkB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,QAAA;;;KCH5C,kBAAA,GAAqB,OAAO,CAAC,iBAAA;EACvC,cAAA;EACA,uBAAA;EACA,aAAA;AAAA;AAAA,iBAGc,aAAA,CAAA;EACd,UAAA;EACA,oBAAA;EACA,cAAA;EACA,YAAA;EACA,uBAAA;EACA,UAAA;EACA,iBAAA;EACA,aAAA;EACA;AAAA,GACC,QAAA,CAAS,kBAAA,IAAmB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
import { IComponent } from "@awesome-ecs/abstract/components";
|
|
4
|
+
|
|
5
|
+
//#region src/components/entity-component-inspector.d.ts
|
|
6
|
+
type EntityComponentInspectorProps = {
|
|
7
|
+
component: IComponent;
|
|
8
|
+
};
|
|
9
|
+
declare function EntityComponentInspector(props: Readonly<EntityComponentInspectorProps>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
declare const _default$1: _$react.MemoExoticComponent<typeof EntityComponentInspector>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/object-inspector.d.ts
|
|
13
|
+
type ObjectInspectorProps = {
|
|
14
|
+
data: any;
|
|
15
|
+
};
|
|
16
|
+
declare function ObjectInspector(props: Readonly<ObjectInspectorProps>): _$react_jsx_runtime0.JSX.Element;
|
|
17
|
+
declare const _default: _$react.MemoExoticComponent<typeof ObjectInspector>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { _default$1 as n, _default as t };
|
|
20
|
+
//# sourceMappingURL=index-BTs_8SY-.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BTs_8SY-.d.cts","names":[],"sources":["../src/components/entity-component-inspector.tsx","../src/components/object-inspector.tsx"],"mappings":";;;;;KAMY,6BAAA;EACV,SAAA,EAAW,UAAU;AAAA;AAAA,iBAGd,wBAAA,CAAyB,KAAA,EAAO,QAAA,CAAS,6BAAA,IAA8B,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,UAAA;;;KCNpE,oBAAA;EACV,IAAI;AAAA;AAAA,iBAGG,eAAA,CAAgB,KAAA,EAAO,QAAA,CAAS,oBAAA,IAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAAA,QAAA"}
|