@awesome-flow/ecs 0.11.0 → 0.14.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/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-C4nDXlkK.mjs +677 -0
- package/dist/canvas-C4nDXlkK.mjs.map +1 -0
- package/dist/canvas-DlWcWu05.cjs +688 -0
- package/dist/canvas-DlWcWu05.cjs.map +1 -0
- package/dist/context/index.cjs +497 -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 +492 -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-B9WbxxFC.d.mts +67 -0
- package/dist/index-B9WbxxFC.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-C-TDFHpq.d.mts +54 -0
- package/dist/index-C-TDFHpq.d.mts.map +1 -0
- package/dist/index-CNCqWBLh.d.cts +54 -0
- package/dist/index-CNCqWBLh.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-DCOd7jg-.d.mts +99 -0
- package/dist/index-DCOd7jg-.d.mts.map +1 -0
- package/dist/index-DGjpWDlm.d.cts +99 -0
- package/dist/index-DGjpWDlm.d.cts.map +1 -0
- package/dist/index-DLoAMD9J.d.cts +1 -0
- package/dist/index-YNgbjS9S.d.cts +159 -0
- package/dist/index-YNgbjS9S.d.cts.map +1 -0
- package/dist/index-_BgjSgkQ.d.mts +159 -0
- package/dist/index-_BgjSgkQ.d.mts.map +1 -0
- package/dist/index-t3_yRTa6.d.cts +67 -0
- package/dist/index-t3_yRTa6.d.cts.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-BtAkmdqr.d.mts +45 -0
- package/dist/node-props-BtAkmdqr.d.mts.map +1 -0
- package/dist/node-props-DkuSwMA0.d.cts +45 -0
- package/dist/node-props-DkuSwMA0.d.cts.map +1 -0
- package/dist/node-systems-module-CPDV8u8O.d.mts +22 -0
- package/dist/node-systems-module-CPDV8u8O.d.mts.map +1 -0
- package/dist/node-systems-module-CzkoMbdF.d.cts +22 -0
- package/dist/node-systems-module-CzkoMbdF.d.cts.map +1 -0
- package/dist/node-types-BRcpbaeR.mjs +1604 -0
- package/dist/node-types-BRcpbaeR.mjs.map +1 -0
- package/dist/node-types-D_NfbsUT.cjs +1819 -0
- package/dist/node-types-D_NfbsUT.cjs.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-B7sT2iRc.d.cts +35 -0
- package/dist/template-tool-nodes-B7sT2iRc.d.cts.map +1 -0
- package/dist/template-tool-nodes-BwavFwMh.d.mts +35 -0
- package/dist/template-tool-nodes-BwavFwMh.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","IEntityScheduler","IEntityUpdate","IEntityUpdateQueue","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","entityUpdateQueue","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","myProxy","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","createEntitySpawnUpdate","spawn","descriptorId","modelInput","createModel","snapshot","createSnapshot","update","enqueueEntitySpawn","enqueue","listSystemsModules","recordEvent","Date","now","bumpUpdate","counts","proxy","_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 IEntityScheduler,\n IEntityUpdate,\n IEntityUpdateQueue,\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?: IEntityScheduler;\n entityTypeDescriptors?: readonly EcsEntityTypeDescriptor[];\n entityUpdateQueue?: IEntityUpdateQueue;\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?: IEntityScheduler;\n readonly entityUpdateQueue?: IEntityUpdateQueue;\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.entityUpdateQueue = input.entityUpdateQueue;\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.myProxy;\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.entityUpdateQueue) {\n return undefined;\n }\n\n const items = this.entityUpdateQueue.items();\n\n return {\n items: limit ? items.slice(-limit) : items,\n size: this.entityUpdateQueue.size\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.entityUpdateQueue) {\n return undefined;\n }\n\n const update = this.createEntitySpawnUpdate(spawn);\n this.entityUpdateQueue.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?.myProxy) {\n this.bumpUpdate(entity.myProxy.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, 'remove', () => {\n this.stores.scheduler.notify();\n }),\n instrumentMethod(this.entityScheduler, 'clear', () => {\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.entityUpdateQueue, 'enqueue', () => {\n this.stores.queue.notify();\n }),\n instrumentMethod(this.entityUpdateQueue, 'dequeue', () => {\n this.stores.queue.notify();\n }),\n instrumentMethod(this.entityUpdateQueue, 'clear', () => {\n this.stores.queue.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,MAAM4B,OAAO,CAAC;CACvC;AACF;;;;AC/BA,MAAM4B,kBAAkBC,OAAO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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,eAAA;CAEP,IAAAE;CAAA,IAAAJ,EAAA,OAAAD,MAAAF,QAAAG,EAAA,OAAAG,OAAA;EAEKC,KAAA,oBAAC,WAAD;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,+BAAeX,KAAKK,eAAe;;;;ACTnC,SAA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
|
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\nex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AAA;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-D_NfbsUT.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-t3_yRTa6.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-B9WbxxFC.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-BRcpbaeR.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,67 @@
|
|
|
1
|
+
import { n as EntityNodeData, s as EcsEntityTypeDescriptor } from "./node-props-BtAkmdqr.mjs";
|
|
2
|
+
import { _ as PipelineMetricsSummary, a as EcsFlowContextProps, d as EcsEventStreamFilter, f as EcsMetricsFilter, g as EntityUpdateCounts, h as EcsUpdateQueueSnapshot, l as EcsBridgeStoreName, m as EcsScopeSummary, p as EcsSchedulerSnapshot, u as EcsEventLogEntry } from "./index-_BgjSgkQ.mjs";
|
|
3
|
+
import { ISystemsModule, SystemType } from "@awesome-ecs/abstract/systems";
|
|
4
|
+
import * as _$_awesome_flow_core_abstract0 from "@awesome-flow/core/abstract";
|
|
5
|
+
import { EntityTypeUid, EntityUid, IEntity, IEntityProxy } from "@awesome-ecs/abstract/entities";
|
|
6
|
+
import { PipelineCategoryName } from "@awesome-ecs/abstract/factories";
|
|
7
|
+
import * as _$_awesome_ecs_abstract_utils0 from "@awesome-ecs/abstract/utils";
|
|
8
|
+
|
|
9
|
+
//#region src/abstract/handle-types.d.ts
|
|
10
|
+
declare enum EcsHandleDataType {
|
|
11
|
+
proxy = "proxy",
|
|
12
|
+
module = "module"
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/abstract/templates.d.ts
|
|
16
|
+
declare enum EcsTemplateGroup {
|
|
17
|
+
ecs = "ECS",
|
|
18
|
+
entities = "ECS Entities",
|
|
19
|
+
tools = "ECS Tools"
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/hooks/use-ecs-bridge.d.ts
|
|
23
|
+
declare function useEcsBridge(): EcsFlowContextProps;
|
|
24
|
+
declare function useBridgeStoreVersion(storeName: EcsBridgeStoreName): number;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/hooks/use-entities-in-scope.d.ts
|
|
27
|
+
declare function useEntitiesInScope<TEntity extends IEntity = IEntity>(scopeId: string | undefined): TEntity[];
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/hooks/use-entity.d.ts
|
|
30
|
+
declare function useEntity<TEntity extends IEntity = IEntity>(proxy: IEntityProxy | undefined): TEntity | undefined;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/hooks/use-entity-list.d.ts
|
|
33
|
+
declare function useEntityList<TEntity extends IEntity = IEntity>(type?: EntityTypeUid): TEntity[];
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/hooks/use-entity-type-descriptors.d.ts
|
|
36
|
+
declare function useEntityTypeDescriptors(): EcsEntityTypeDescriptor[];
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/hooks/use-entity-type-templates.d.ts
|
|
39
|
+
declare function useEntityTypeTemplates(enabled?: boolean): _$_awesome_flow_core_abstract0.NodeTemplate<EntityNodeData>[];
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/hooks/use-entity-updates.d.ts
|
|
42
|
+
declare function useEntityUpdates(target: IEntityProxy | EntityUid): EntityUpdateCounts;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/hooks/use-event-stream.d.ts
|
|
45
|
+
declare function useEventStream(filter?: EcsEventStreamFilter): EcsEventLogEntry[];
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/hooks/use-pipeline-metrics.d.ts
|
|
48
|
+
declare function usePipelineMetrics(entityType?: EntityTypeUid, phase?: SystemType | string): PipelineMetricsSummary;
|
|
49
|
+
declare function useMiddlewareMetrics(filter?: EcsMetricsFilter & {
|
|
50
|
+
category?: PipelineCategoryName;
|
|
51
|
+
}): _$_awesome_ecs_abstract_utils0.MiddlewareMetricsSummary[];
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/hooks/use-scheduler.d.ts
|
|
54
|
+
declare function useScheduler(): EcsSchedulerSnapshot;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/hooks/use-scope-list.d.ts
|
|
57
|
+
declare function useScopeList(): EcsScopeSummary[];
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/hooks/use-systems-module.d.ts
|
|
60
|
+
declare function useSystemsModule<TEntity extends IEntity = IEntity>(type: EntityTypeUid | undefined): ISystemsModule<TEntity> | undefined;
|
|
61
|
+
declare function useSystemsModuleList(): ReadonlyMap<EntityTypeUid, ISystemsModule<IEntity>>;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/hooks/use-update-queue.d.ts
|
|
64
|
+
declare function useUpdateQueue(limit?: number): EcsUpdateQueueSnapshot;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { EcsTemplateGroup as _, useScheduler as a, useEventStream as c, useEntityTypeDescriptors as d, useEntityList as f, useEcsBridge as g, useBridgeStoreVersion as h, useScopeList as i, useEntityUpdates as l, useEntitiesInScope as m, useSystemsModule as n, useMiddlewareMetrics as o, useEntity as p, useSystemsModuleList as r, usePipelineMetrics as s, useUpdateQueue as t, useEntityTypeTemplates as u, EcsHandleDataType as v };
|
|
67
|
+
//# sourceMappingURL=index-B9WbxxFC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B9WbxxFC.d.mts","names":[],"sources":["../src/abstract/handle-types.ts","../src/abstract/templates.ts","../src/hooks/use-ecs-bridge.ts","../src/hooks/use-entities-in-scope.ts","../src/hooks/use-entity.ts","../src/hooks/use-entity-list.ts","../src/hooks/use-entity-type-descriptors.ts","../src/hooks/use-entity-type-templates.ts","../src/hooks/use-entity-updates.ts","../src/hooks/use-event-stream.ts","../src/hooks/use-pipeline-metrics.ts","../src/hooks/use-scheduler.ts","../src/hooks/use-scope-list.ts","../src/hooks/use-systems-module.ts","../src/hooks/use-update-queue.ts"],"mappings":";;;;;;;;;aAAY,iBAAA;EACV,KAAA;EACA,MAAM;AAAA;;;aCFI,gBAAA;EACV,GAAA;EACA,QAAA;EACA,KAAA;AAAA;;;iBCCc,YAAA,CAAA,GAAY,mBAAA;AAAA,iBAUZ,qBAAA,CAAsB,SAA6B,EAAlB,kBAAkB;;;iBCVnD,kBAAA,iBAAmC,OAAA,GAAU,OAAA,CAAA,CAC3D,OAAA,uBACC,OAAA;;;iBCDa,SAAA,iBAA0B,OAAA,GAAU,OAAA,CAAA,CAClD,KAAA,EAAO,YAAA,eACN,OAAA;;;iBCHa,aAAA,iBAA8B,OAAA,GAAU,OAAA,CAAA,CACtD,IAAA,GAAO,aAAA,GACN,OAAA;;;iBCHa,wBAAA,CAAA,GAAwB,uBAAA;;;iBCCxB,sBAAA,CAAuB,OAAA,aAAc,8BAAA,CAAA,YAAA,CAAf,cAAA;;;iBCCtB,gBAAA,CAAiB,MAAA,EAAQ,YAAA,GAAe,SAAA,GAAY,kBAAA;;;iBCDpD,cAAA,CAAe,MAAA,GAAS,oBAAA,GAAoB,gBAAA;;;iBCG5C,kBAAA,CAAmB,UAAA,GAAa,aAAA,EAAe,KAAA,GAAQ,UAAA,YAAU,sBAAA;AAAA,iBAUjE,oBAAA,CAAqB,MAAA,GAAS,gBAAA;EAAqB,QAAA,GAAW,oBAAA;AAAA,IAAoB,8BAAA,CAAE,wBAAA;;;iBCdpF,YAAA,CAAA,GAAY,oBAAA;;;iBCAZ,YAAA,CAAA,GAAY,eAAA;;;iBCEZ,gBAAA,iBAAiC,OAAA,GAAU,OAAA,CAAA,CACzD,IAAA,EAAM,aAAA,eACL,cAAA,CAAe,OAAA;AAAA,iBAaF,oBAAA,CAAA,GAAwB,WAAA,CAAY,aAAA,EAAe,cAAA,CAAe,OAAA;;;iBCjBlE,cAAA,CAAe,KAAA,YAAD,sBAAe"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as ScopeGroupNodeData, t as EcsToolNodeData } from "./node-props-BtAkmdqr.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-C-TDFHpq.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C-TDFHpq.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"}
|