EditorPanelDef
Interface of @v12-engine/editor
export interface EditorPanelDefA panel of the editor: one of its own, a game's (EditorOptions.panels) or one code adds (editor.dock.add). It has an icon on a rail of the editor and opens beside that rail when the icon is clicked. Drawn by a component (Solid, on the kit or not) or into an element of its own (mount: any HTML, any framework), which wins when both are said. Each is given the editor and the panel's handle (EditorPanel)
Members
badge
badge?: (editor: EditorClient) => EditorPanelBadge | undefined;What its icon has on it while it is closed too, worked out as the rails are drawn (the Problems panel's count). What the panel says with panel.setBadge while it is open comes first
beside
beside?: string;The panel it goes in with, as a tab, when that one is open
component
component?: (props: EditorPanelProps) => JSX.Element;A component that draws it, given the editor and its handle
docs
docs?: string;The page of the docs about it, as a path under EditorOptions.docs
frame
frame?: 'panel' | 'bare';The box it is drawn in: the editor's (panel, when left out: padded, scrolling, in the colours and the size of words of the panels) or none (bare), for one that draws from edge to edge and scrolls by itself
header
header?: Own<{
editor: EditorClient;
panel: EditorPanel;
}>;Buttons of its own in its title bar, before the editor's (a refresh, a lock, a menu): a component, or an element
help
help?: string | (() => JSX.Element);What the panel is for, in a few lines: shown by the ? in its header (FC2), with a link to its page of the docs (docs, a path under EditorOptions.docs) when there is one. Words, or a component for more
icon
icon?: string;Its icon on its rail, by name in the editor's table of icons (EditorOptions.icons adds to it). A puzzle piece when left out
id
id: string;The panel: what it is called in a layout and in code (editor.dock.open(id)). One panel of each id
key
key?: BindingLike;The key that opens and closes it ('Shift+W', 'KeyW'): the action toggle-<id>, in the list of every key, where the one who uses the editor can put it elsewhere. No key when left out; open-<id> opens it, on no key
maxSize
maxSize?: number;The most the panel can be made when docked, in pixels wide, or high at the bottom
minSize
minSize?: number;How small and how big it can be made, docked: pixels wide, or high at the bottom
mount
mount?: (element: HTMLElement, editor: EditorClient, panel: EditorPanel) => (() => void) | void;Puts the panel into element, with whatever it likes to draw with, given the editor and its handle. Returns what takes it away again (or nothing: what it started on the handle goes with the panel)
name
name?: string;What its tab, its icon's tooltip and the Window menu call it. Its id when left out
over
over?: boolean;Whether it opens over the scene, until one goes back to the scene, and not docked into the layout: what the panels of the bottom do when nothing is said, and those of the sides do not. The one who uses the editor pins and unpins each
prefix
prefix?: string;A first character typed in the search that searches its content alone ('w': "w boss"), as > searches what the editor does
search
search?: (editor: EditorClient) => PanelSearchEntry[] | Promise<PanelSearchEntry[]>;Its content, for the search of everything (Ctrl+K): asked as the search opens, the panel open or closed (a promise, for what is fetched). An entry picked opens the panel and tells it the entry's id (panel.onReveal). The Map settings' and Look's folds are theirs this way
searchFuzzy
searchFuzzy?: boolean;Whether a typo finds its content in the search of everything (SearchSource.fuzzy): yes when left out
side
side?: DockSide;The rail its icon is on, and the side it opens on: the right when left out
size
size?: number;How big it opens: pixels wide, or high at the bottom
title
title?: string;What it is called, as panels added in code said it: name is the same, and wins
when
when?: 'edit' | 'play' | 'always';When there is such a panel: while the map is edited, while it is played here (a live counter of waves), or both (when left out). One that is open when that ends is closed, and its icon is not on its rail meanwhile. A panel of Play here that was open as it last stopped opens by itself as it starts again (editor.shared('play.panels'))