Slots, events and URIs
Every slot Studio declares, with its shape and owner, plus the events and witwin:// URI helpers, generated from the Studio code.
Unstable: registering into a slot through the
slotsservice uses a proposed service, which only system Plugins and Plugins loaded from a local path may use. Slot ids and their owners can change between releases.
Every slot some Studio code declares, found by reading the declare(...) calls. Register into a slot with the slots service (proposed) or with the host.register* function that targets it; see Web API and Linking panels. "Owner" is the Plugin whose activation declares the slot (workbench and kernel are Studio itself). A slot declared twice is listed twice.
36 declarations.
| Slot | Shape | Owner | Key | Value type | Declared in | What it holds |
|---|---|---|---|---|---|---|
console.channels | list | studio.console | studio/src/plugins/console/index.tsx | console.channels (list slot, owner studio.console): Console channels whose lines do not come from the Project's console topic, such as the desktop app's server process log. | ||
document.viewer | chain | studio.document | DocumentViewer | studio/src/plugins/document/index.tsx | The chain slot the Document panel reads its viewers from. | |
hierarchy.create | single | studio.hierarchy | studio/src/plugins/hierarchy/index.tsx | Slots Hierarchy owns (D16 P5b). | ||
hierarchy.externalDrag | list | studio.hierarchy | studio/src/plugins/hierarchy/index.tsx | |||
opener.handlers | chain | workbench | OpenHandler | studio/packages/witwin-workbench/src/services/opener.ts | Opener: open(uri) (plan §5.5). | |
parameters.variedBy | list | studio.parameters | studio/src/plugins/parameters/index.tsx | Slot Parameters owns (D16 P5b): who varies a parameter. | ||
plot.result | single | kernel | studio/src/app/bootstrap/builtinPanels.tsx | |||
project.fileTypes | keyed | studio.project | ProjectFileType | studio/src/plugins/project/index.ts | The Project slot of file types (owner studio.project). | |
properties.inspector | keyed | studio.properties | PropertiesInspector | studio/src/plugins/properties/index.tsx | The Properties slot of inspectors (owner studio.properties). | |
selection.kinds | keyed | workbench | kind | SelectionKind | studio/packages/witwin-workbench/src/services/selection.ts | keyed by kind: the domains that take part in the selection. |
settings.pages | keyed | kernel | id | SettingsPageEntry | studio/src/features/settings/settingsPagesSlot.ts | settings.pages (plan §5.4): pages of the Settings dialog that plugins add with host.registerSettingsPage. |
studies.kind.editor | keyed | studio.studies | kind | StudyKindEditor | studio/src/plugins/studies/panel/registerSlots.ts | Keyed by Study kind: the Setup and Results views of that kind. |
studies.method.editor | keyed | studio.studies | method | StudyMethodEditor | studio/src/plugins/studies/panel/registerSlots.ts | Keyed by method kind: a settings editor that replaces the settings_schema form. |
tasks.step.editor | keyed | studio.tasks | kind | TaskStepKind | studio/src/plugins/tasks/stepKinds.ts | |
viewport.create | single | kernel | studio/src/app/bootstrap/builtinPanels.tsx | Slots the Scene view (kernel) declares for what Plugins add to it (D16 P5). | ||
viewport.drop | list | kernel | studio/src/app/bootstrap/builtinPanels.tsx | |||
viewport.gizmos | list | studio.viewport | studio/src/plugins/viewport/index.tsx | |||
viewport.mode | single | studio.viewport | studio/src/plugins/viewport/index.tsx | single, ViewportModeEntry. | ||
viewport.overlay | list | kernel | studio/src/app/bootstrap/builtinPanels.tsx | |||
viewport.overlayMenu | list | studio.viewport | studio/src/plugins/viewport/index.tsx | list, ViewportOverlayMenuEntry: items of the Overlays menu. | ||
viewport.overlays | list | studio.viewport | studio/src/plugins/viewport/index.tsx | Value: { id, zone, render }. | ||
viewport.passes | list | studio.viewport | studio/src/plugins/viewport/index.tsx | |||
viewport.sceneLayers | list | studio.viewport | studio/src/plugins/viewport/index.tsx | list, ViewportSceneLayerEntry: drawn inside the 3D scene. | ||
viewport.toolbar | list | studio.viewport | studio/src/plugins/viewport/index.tsx | list, ViewportToolbarEntry. | ||
viewport.tools | list | studio.viewport | studio/src/plugins/viewport/index.tsx | |||
viewport.visualizers | list | studio.viewport | studio/src/plugins/viewport/index.tsx | |||
workbench.chat | single | workbench | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | single: the Agent chat column left of the editor (studio.agent). | ||
workbench.pages | list | kernel | WorkbenchPageEntry | studio/src/features/plugins/workbenchPages.tsx | ||
workbench.panels | keyed | workbench | id | WorkbenchPanelEntry | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | keyed by panel id: every dockable panel, built-in or from a plugin. |
workbench.primary | single | workbench | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | single: the main view behind the tracks (the Scene view). | ||
workbench.rail | list | workbench | WorkbenchRailEntry | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | list: buttons on the bottom rail, by order. | |
workbench.root | list | kernel | WorkbenchRootEntry | studio/src/app/workbenchRootSlot.tsx | ||
workbench.topBar.center | list | workbench | { order?: number } | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | ||
workbench.topBar.left | list | workbench | { order?: number } | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | list: top bar items of each region, by order. | |
workbench.topBar.menus | list | workbench | { order?: number } | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts | list: top bar menus (File, Edit, ...), by order. | |
workbench.topBar.right | list | workbench | { order?: number } | studio/packages/witwin-workbench/src/slots/workbenchSlots.ts |
Events (events service)#
Typed in WorkbenchEventMap (studio/packages/witwin-workbench/src/services/events.ts). Other names carry unknown; a Plugin's own events are <pluginId>.<what>.
| Event | Payload | When |
|---|---|---|
project.file.created | { path: string } | A file appeared in the Project (created, imported, copied). |
run.finished | { runId: string; status: string } | A Run reached a final status. |
study.updated | { studyId: string } | A Study's record or its runs changed. |
scene.saved | { sceneId: string | null } | The current Scene was written to disk (File > Save). |
library.placed | { itemId?: string } | The user placed an item from the Library (a temporary Library panel closes). |
console.message | { level: 'log' | 'warning' | 'error'; message: string; source: string; timestamp: string } | A line for the Console's Default channel from outside the Project's console topic (Electron's server process log promotes tracebacks). |
witwin:// URI helpers#
Exported by @witwin/workbench/services (studio/packages/witwin-workbench/src/services/witwinUri.ts). Form: witwin://<kind>/<id>[?key=value][#fragment]; a Plugin's own kinds are <pluginId>.<kind>.
| Function | What it returns |
|---|---|
isWitwinUriKind(kind: string) | |
parseWitwinUri(href: string) | Parse a witwin:// href; null for any other scheme or a malformed URI. |
formatWitwinUri(uri: Pick<WitwinUri, 'kind' | 'id'> & Partial<Pick<WitwinUri, 'params' | 'fragment'>>) | Build a href from parts; the inverse of parseWitwinUri for well-formed input. |
fileUri(path: string, lines?: { line: number; endLine?: number }) | witwin://file/<project-relative path>; #L10-L20 selects lines. |
sceneUri(sceneId: string) | witwin://scene/<sceneId>. |
sceneObjectUri(target: SceneObjectTarget & { objectId: string }) | witwin://scene/<sceneId>/object/<objectId>[?index=1][#Component.field]. |
parseSceneTarget(uri: WitwinUri) | The scene, object and field a scene URI points at; null for another kind. |
resultUri(resultId: string) | witwin://result/<id>. |
studyUri(studyId: string, options: { variable?: string } = {}) | witwin://study/<id>[?variable=<parameter>]; variable scrolls its Setup to that variable. |
parameterUri(name: string) | witwin://parameter/<name>: a Scene parameter by name. |
runUri(runId: string) | witwin://run/<id>. |
panelUri(panelId: string) | witwin://panel/<id>: show a panel by its id. |