Skip to main content

Module studio_workbench

Module studio_workbench 

Source
Expand description

The Studio’s workbench: the toolbar, the Files tree, the editor and output columns, the Socratic guide and the status bar, with every mode’s handlers.

Two pages draw it. The Studio page (Host::Page) wraps it with its head, its nav, the reader’s own store and the address bar, which the workbench never reaches. The front page (Host::Frame) frames it over a shelf of shipped examples. Its state is WorkbenchState, which the host holds (use_workbench), so both pages show one Studio: one markup, one stylesheet, one set of handlers.

Re-exports§

pub use StudioFrame_completions::Component::StudioFrame;
pub use Workbench_completions::Component::Workbench;

Structs§

Shelf
The files a frame shows: shipped examples, in the Studio’s own folders, and the one it opens on.
StoreNote
What the reader’s store says beside the files: an error reading it, whether it lasts only for the browser session, and why New file cannot make a file yet.
StudioFrameProps
Properties for the StudioFrame component.
WorkbenchProps
Properties for the Workbench component.
WorkbenchState
Everything the workbench shows and edits: what is open, each mode’s editor and what each mode last made, and how the columns are laid out. The host holds it (use_workbench), so the Studio page’s own effects, its store and its address bar, and the workbench’s handlers work on one state; it is signals, so it is Copy.

Enums§

Host
Where a workbench is drawn, and so what it may reach beyond itself.

Constants§

FRAME_ID
The Studio in a frame on another page: the workbench with the Studio’s own stylesheet, and FRAME_STYLE for what a frame lays out itself. The id of the frame’s element on its page: what a Try it button names, and scrolls to.
FRAME_STYLE
What a frame lays out itself, every rule inside the frame: its box on the page and its height in each band, its columns in the proportions the Studio first opens with, which hold until the reader drags a column bar (from then on the frame draws the columns as the Studio page does, in its own width), and the link into the Studio.
PREVIEW_CENTERING_STYLE
What the Studio adds to a page’s preview document, in its head: the page stands in the middle of the frame, across and down, however small it is, and from the top once it is taller than the frame (safe center). A page served by largo gets none of this: it is the Studio’s frame, not the page, that centers.
PREVIEW_TITLE
The Web preview’s name, for a screen reader.

Functions§

StudioFrame
Props
Workbench
The Studio’s working area for state, drawn for host.
prebuilt_preview_path
Where the site serves a shipped Web page’s prebuilt preview document: /previews/<path>.html for a page under /examples/, written at release by web_previews_lock’s regenerator from preview_document. None for anything that is not a shipped page, so a reader’s own file or an edited page is built in the browser as before.
preview_document
The document the Studio’s Web preview frames for source: the page as largo serve would paint it, first paint included, with PREVIEW_CENTERING_STYLE in its head; or, when the page does not build, the themed overlay that says why.
use_shelf
The state of a frame over shelf, for a page to hold: opened on shelf.opens, its tree the shelf’s files. A page calls it once, as it calls any hook, and hands it to StudioFrame.
use_workbench
The workbench’s state, for a host to hold: what opening opens on, over the files tree lists. The host calls it once, as it calls any hook, and hands what it returns to Workbench.