the editor with the modes
the element the bar is added to
Optionalpanel: () => HTMLElement | null
returns the element that is hidden when the open mode is clicked again (the Tweakpane container)
the localStorage key that keeps the names shown or hidden, or null to not keep it.
Default: EditorModeBar.StorageKey. At the first visit, the names are shown in a window 920 px wide or more
(EditorModeBar.WideQuery); a narrower window (a phone) has no room for them.
Readonlyeditorthe editor with the modes
ReadonlyelementOptionalonCalled when the names are shown or hidden, with the new state (the toggle button, or setExpanded)
OptionalonCalled when the panel or the names show or hide, so the room next to the mode bar changes (for the frame)
Optional Readonlypanelreturns the element that is hidden when the open mode is clicked again (the Tweakpane container)
Readonlystoragethe localStorage key that keeps the names shown or hidden, or null to not keep it.
Default: EditorModeBar.StorageKey. At the first visit, the names are shown in a window 920 px wide or more
(EditorModeBar.WideQuery); a narrower window (a phone) has no room for them.
StaticLooksThe colour and icon of each mode name. A mode that is not here gets a grey dot. Read when the bar is made: set it
before TweakpaneEditorPlugin.loadPlugins.
StaticStorageThe default localStorage key that keeps the names shown or hidden, or null to not keep them
StaticWideThe media query of a window wide enough to show the names at the first visit (nothing stored)
StaticWidthsWidth of the bar without and with the names, in px
The names are shown next to the icons
The panel of the selected mode is shown
Adds a tooltip to a button of the bar (not a mode), shown with the others when the names are hidden
One step of the collapse states, as the button at the bottom and Ctrl+\ do: the names and the panel → the icons and the panel → the icons only (the panel hidden) → the names and the panel again. A window without room for the names (EditorModeBar.WideQuery) skips the names. A click on the open mode still hides or shows the panel.
Hides the tooltips of the bar and keeps them off while held is true, for a menu that a button of the bar opened
(the layout menu of EditorFrame): the tooltip would cover the menu. Then they show again, when the names
are hidden.
Removes the tooltip of a button that addTooltip added, when the button leaves the bar
Marks a mode as selected, when it changes elsewhere (the editor's setSelectedMode)
Shows or hides the names next to the icons
the names are shown
the person picked it (the toggle, Ctrl+, a UI): it is kept in localStorage (storageKey).
A change from code is not, so the person's pick, or the default of the window width, comes back at the next visit.
Shows or hides the panel of the selected mode
Changes the text of the tooltip of a button that addTooltip added
Opens a mode's panel (and shows the panel if it was hidden), like a click on its button
A vertical bar of mode buttons on the right of the page, for the modes of the TweakpaneEditorPlugin (Viewer, Interaction, Export...), instead of the tabs at the bottom.
editortheme of the editor).The bar sets the CSS variable
--mb-widthon the root element, and the classmb-panel-hiddenon the body when the panel is hidden, for the page layout (EditorFrame).