the editor with the modes, for the mode bar (TweakpaneEditorPlugin)
the layout, the app name, the theme and the callbacks
ReadonlyactionsThe keys of the frame, as actions (registered in viewer.actions of EditorFrameOptions.viewer, where a UI
lists and runs them, else in an own ViewerActions): Shift+T switches between the light and the dark theme,
Ctrl+\ (Cmd+\ on a Mac) steps through the collapse states of the mode bar and the panel, ? opens or closes the
sheet of the keyboard shortcuts (toggleShortcuts). The place of the T key, the \ key or its place (a layout
where it types another character), and the ? character (on each layout).
ReadonlymodeReadonlyoptionsthe layout, the app name, the theme and the callbacks
StaticAreaThe smallest and the largest size of each area in px (setAreaSize, a drag of its edge). The bottom area is also at most half of the window, and the left area and the panel leave MinCanvasWidth for the canvas, next to each other and the mode bar.
StaticAreaThe names of the places: the default names of the entries of the panels, and the Move menu (addPanel)
StaticAreaThe localStorage key that keeps the sizes and the collapsed left and bottom areas that the person picks (a drag
or a double-click of an edge), or null to not keep them. Read when the frame is made.
StaticBreakpointsThe window widths in px where the layout of the frame changes (read on each resize; change them before the frame is made, or call a resize):
stack: a portrait window narrower than this (a phone) has the canvas on top and the panel below it (the body
class lay-stack); else the parts are side by side (lay-side).singleView: a window narrower than this, in any orientation, has no room for the left and the bottom area next
to the canvas (the smallest left area, panel, mode bar and canvas: 160 + 240 + 44 + 240 = 684 px). The areas then
show in the place of the panel, one view at a time, picked with their entries in the mode bar (lay-single, also
set with lay-stack, see setStackedArea).StaticLongThe time in ms of a press on the entry of a panel, on a touch screen, that opens its Move menu (addPanel)
StaticMinThe width in px that the left area and the panel leave for the canvas (AreaLimits)
StaticMinThe smallest length in px of a card of the floating layout along its side (setAreaSpan)
StaticMinThe smallest size in px of a panel in the stack of a place, when a drag moves the split (addPanel)
StaticThemeThe default theme pairs: Shift+T goes from one to the other
The name in the bars: the open file or project. The app sets it (the frame does not follow the loads); empty, the
bars show no name. TweakpaneEditorPlugin.documentName sets it and keeps it when the frame is made again.
The settings of the mode are hidden (setModeSettingsHidden)
The ids of the panels, in the order they were added
The area that the place of the panel shows in a narrow window (setStackedArea)
Adds a panel to the frame, or puts a new element in the panel of this id. A panel is an element in a place of the frame, with an entry in the mode bar:
left, the sidebar left of the canvas; bottom, the strip below the canvas; right, the
top of the right sidebar, above the settings of the mode, in the panel of the Tweakpane UI. The panel starts in
options.area (left), until the person moves it: a right-click on its entry (a long press on a touch screen)
opens a menu of the places (movePanel).options. A tap on it shows or hides the
panel (setPanelHidden); hiding the last shown panel of a place collapses the place. In a narrow window
(Breakpoints) the left and the bottom place show in the place of the panel, one view at a time
(setStackedArea).lay-has-<area>), and the canvas makes room for it (the floating
layout: a card over the canvas); an empty place takes no room. The left place is --lay-left-area-size wide
(240px), the bottom place --lay-bottom-area-size tall (160px), CSS variables on body.lay-frame.localStorage
(AreaStorageKey), with the sizes.The panels go with the frame: TweakpaneEditorPlugin.addPanel adds them again when the plugin makes the frame again.
the id of the panel, for removePanel, movePanel, setPanelHidden and the kept state
the element of the panel; it fills its section
its entry in the mode bar (name, icon, colour) and the place where it starts
The offset of a card on screen in px (setAreaOffset): 0 when it is not moved, or outside the floating layout
The span of a card on screen in px (setAreaSpan), with the length of a card that fills its side; undefined outside the floating layout
Whether an area is collapsed (setAreaCollapsed); the panel (right) when the mode bar hides it
Whether a panel is hidden in its place (setPanelHidden); a collapsed place does not hide its panels
Moves a panel to another place (left, bottom or right), at the end of its stack, and shows it (the place
opens when it was collapsed, the panel when the mode bar hid it for the right place; in a narrow window, the place
shows in the place of the panel). The Move menu of its
entry does this.
keep it in localStorage (AreaStorageKey), as the person's pick
The place of a panel, or undefined for no panel of this id
Takes a panel out of the frame (addPanel); its kept place and size stay for when it is added again
Collapses an area or opens it again. A collapsed left or bottom area is hidden and takes no room; the edge stays,
to drag it out or double-click it. The panel (right) collapses as the mode bar hides it (EditorModeBar.setOpen).
left, bottom or right (the panel)
collapse or open
keep it in localStorage (AreaStorageKey), as the person's pick. Not for the panel.
Moves a card of the floating layout away from its side of the window, on the axis of its size: the left card to the
right, the bottom card up, the panel with the mode bar to the left. The card stays within the room that leaves
MinCanvasWidth for the canvas (the bottom card: within half of the window height); when the window gets
smaller, the offset gets smaller first, then the size. It applies only in the floating layout with the areas next to
the canvas (not in a narrow window, see Breakpoints); elsewhere it is kept for later. A drag of the grip of
a card (a strip in the gap on its side of the window) sets it and the start of its span (setAreaSpan); a
double-click of the grip puts the card back. The CSS variable --lay-<area>-offset on the body.
left, bottom or right (the panel and the mode bar)
the offset in px, or null for none
keep it in localStorage (AreaStorageKey), as the person's pick
Sets the size of an area in px: the width of the left area or the panel (right), the height of the bottom area.
It is kept between the limits of AreaLimits, and leaves room for the canvas. When the window gets smaller,
or another area or the panel opens, the area gets smaller to leave that room, and its size comes back when there is
room again. null sets the size of the CSS again (240 px, 160 px, and the panel width of the Tweakpane UI).
left, bottom or right (the panel)
the size in px, or null
keep it in localStorage (AreaStorageKey), as a size that the person picks
Sets the part of its side that a card of the floating layout takes: the top and the height of the left card and of
the panel with the mode bar, the left end and the width of the bottom card (in its row, between the left card and
the panel). The length is at least MinCardLength, and the card stays in its side. null: the whole side
(the default). It applies where setAreaOffset applies. A drag of the ends of a card (the top and the bottom
edge, or the left and the right end) sets it, and a double-click of an end fills the side again; a drag of the grip
moves the card along its side. The CSS variables --lay-<area>-start and --lay-<area>-length on the body.
left, bottom or right (the panel and the mode bar)
the start and the length in px (EditorFrameAreaSpan), or null
keep it in localStorage (AreaStorageKey), as the person's pick
Hides the settings of the mode in the panel while the right place shows panels (addPanel): the right place takes the whole panel. A click on the open mode in the mode bar does this too, and a click on a mode shows them again. Without the right area, the settings always show (the mode bar hides the panel). Not kept: an app sets it, for example while something is selected (an inspector in the right area, its settings in place of the modes). A panel that leaves the right place (a move or a remove) shows them again.
Shows or hides a panel, as its entry in the mode bar does. Hiding the last shown panel of a place collapses the place instead (the panel stays shown in it, for when the place opens); showing a panel opens its place.
keep it in localStorage (AreaStorageKey), as the person's pick
Sets the area that shows in the place of the panel in a narrow window (below the canvas on a phone, in the right
column of a narrow landscape window, see Breakpoints), where there is no room for the areas next to the
canvas: the panel (right, the default), or the left or the bottom area. The mode bar stays next to it: a tap on a
mode shows the panel again, a tap on the entry of an area shows that area. A left or bottom area without an element
shows the panel. It opens the place of the panel when the mode bar hid it. When the areas show next to the canvas,
this has no effect (it is kept for the next narrow window). The body has the class lay-stacked-left or
lay-stacked-bottom.
right (the panel), left or bottom
keep it in localStorage (AreaStorageKey), as the person's pick (an entry of the mode bar)
Opens or closes the sheet of the keyboard shortcuts: the actions in viewer.actions of
EditorFrameOptions.viewer that have a key, or the actions of the frame without a viewer (ShortcutsSheet).
The button of the mode bar and ? do this.
Switches between the light and the dark theme of the same family, when the current theme is in a pair
The frame of the page around the editor: the layout of the canvas, the Tweakpane panel and the EditorModeBar, with a title bar or a status bar (EditorFrameLayout).
Made by
TweakpaneEditorPlugin(itslayout). The actions (light or dark, layout) are at the bottom of the mode bar in each layout. The body has the classlay-frameandlay-<layout>. The canvas size follows the CSS of the layout, and the viewer follows the canvas size (the ResizeObserver ofThreeViewer).The frame has three fixed places (EditorFrameArea): the left sidebar, the bottom strip below the canvas, and the top of the right sidebar (above the settings of the mode, in the panel). An app adds panels to them with addPanel, and the person moves them (the Move menu of their entry); an empty place takes no room. The CSS variables
--lay-left-area,--lay-right-areaand--lay-bottom-areaon the body are the width or the height of each area (0pxwhen it is empty). In the floating layout the areas are cards over the canvas, and--lay-left-insetand--lay-bottom-insetare the parts of the canvas that the left and the bottom card cover with their gap: the perf pill, the bar of the sticky notes and the tool bar keep out of them.The left area, the bottom area and the panel have a size and can collapse (setAreaSize, setAreaCollapsed). A drag on the inner edge of the area changes its size, between the limits of AreaLimits; a drag past half of the smallest size collapses it, and a drag out of the edge opens it again. A double-click on the edge sets the default size, or opens a collapsed area. The sizes and the collapsed left and bottom areas that the person picks are kept in
localStorage(AreaStorageKey). The panel collapses as the mode bar hides it, and the mode bar shows it again.The layout changes at the window widths of Breakpoints. Side by side (
lay-side), the canvas, the panel and the mode bar are next to each other. In a portrait window under 920 px wide (a phone,lay-stack), the layout keeps its bars (floating has no gap there); the canvas is on top at full width, and the panel and the mode bar are below it, with the same height. The CSS variable--lay-splitis the part of the height for the canvas:0.45, set onbody.lay-frame(a page sets another with a more specific rule, likehtml body.lay-frame { --lay-split: 0.5; }). When the panel is hidden there, the mode bar is a row at the bottom.The mode bar lists the modes, then an entry for each panel (its name and icon from addPanel). A tap on an entry shows or hides its panel (setPanelHidden), a right-click or a long press moves it (movePanel). In a narrow window (
lay-single), the place of the panel shows one of them at a time (setStackedArea): a mode shows the panel there, an entry shows its area, and a tap on the one shown hides that place.In the floating layout, the cards move and take a part of their side (setAreaOffset, setAreaSpan), and a head at the top of the left column shows the logo, the app name and the file name.