component_inspectors
Registry of per-component custom inspector views for the editor's entity inspector. A component type registers a view to replace the generic read-only field grid with its own widget tree — editable fields, actions, derived displays. The entity-details tab consults the registry per component and falls back to the generic view for types without one.
A view is a table { render(entityId, proxy, opts) -> widget tree | nil, onCallback(callbackId, data, state) -> boolean }. render receives the owning
entity id, the live component proxy, and opts.idPrefix; every widget id the
view emits must start with that prefix so the tab can route clicks back to the
view's onCallback. Returning nil falls back to the generic view.
Exports
M.register(typeName, view)— register (or replace) the view for a component type. Hot-reload re-runs the component and re-registers.M.get(typeName)— the registered view, or nil.M.dispatch(callbackId, data, state)— route an inspector callback to the registered views until one handles it; returns whether it was handled.
Usage
local Inspectors = require("@builtin::modules.editor.component_inspectors")
Inspectors.register("Generator", require("~.generator_inspector"))
Scoped to this part · feeds back into the world's score.