StatifierBlocks.Editor.Toolbar (StatifierBlocks v0.3.0)

Copy Markdown View Source

The canvas toolbar (ADR-0005, the 2026-08-29 shell amendment, ruling 8A).

8A splits the chrome: the package ships everything that operates on the document that is open - this toolbar, the tabbed inspector, the drawer, the grouped palette - and the host ships everything that decides which document is open. So there is no document name here, no switcher, no theme control and no compile button, and their absence is the ruling rather than an omission. The host renders those into the editor's :header slot.

What is here is zoom, the two fits, and the two document metrics.

The fits set a mode, they do not measure

Fit width and Fit active are modes, not computed percentages, and that is decision 7's constraint showing through: nothing in this section adds a JavaScript hook, and a fit that resolves to a number needs the rendered width of an element, which only the client knows. So the toolbar records which fit the author asked for, the canvas carries it as data-fit, and a stylesheet does what a stylesheet can do with it. The measured form arrives with the read-only measurement hook the decision 7 amendment records (sb-k7r); until then a mode is the honest half, and it is the half a server can test.

Fit active is disabled with nothing selected, because "fit the active block" with no active block is a control whose only outcome is nothing happening.

Undo and redo are here too

They are not in 8A's list, which enumerates what was newly arranged rather than what the toolbar already held. They operate on the open document, which is the package's half of the split by 8A's own rule.

Summary

Functions

Zoom, the two fits, the document metrics, and the history controls.

Functions

toolbar(assigns)

Zoom, the two fits, the document metrics, and the history controls.

Attributes

  • zoom (:integer) (required)
  • fit (:atom) - :manual, :width or :active. Defaults to :manual.
  • depth (:integer) (required)
  • count (:integer) (required)
  • can_undo? (:boolean) (required)
  • can_redo? (:boolean) (required)
  • selected? (:boolean) - Defaults to false.
  • inserting? (:boolean) - Defaults to false.
  • target (:any) (required)
  • class (:string) - Defaults to nil.