{#- The dashboard studio: palette, canvas, toolbar, properties panel and keyboard list, shared by every page that embeds the editor. Plain HTML with no template syntax. The comments are Jinja-style comment blocks, so a template engine that includes this file (FLARE's Askama) drops them at build time, and a plain consumer removes them before it inserts the markup (README.md, "Consuming the editor"). Nothing else in this file may use template delimiters, and tests/fragment.test.mjs holds that. The host supplies what is not here: an element carrying `data-dashboard-editor` around this markup, optionally with `data-sources-href` naming the source-list route; the raw JSON pane (a textarea carrying `data-dashboard-raw` inside a details element, with a `data-dashboard-raw-error` beside it); and the save control. -#} {#- data-mode is the whole selection model: "nav" while the canvas owns the arrow keys and "edit" while the properties panel has the focus. It is an attribute rather than a class because studio.css reads it and dashboard-editor.js writes it, and neither wants to own a list of class names the other has to match. -#}
This canvas needs scripting. The document is in the Raw dashboard JSON pane below, which posts without it.
{#- One toolbar, server-rendered once and moved onto whichever block is selected, rather than one per block. It is the only place a block's own operations live, which is what keeps them reachable when the properties panel is stacked below the canvas on a narrow screen. role="toolbar" and a roving tabindex: the whole thing is one Tab stop and the arrow keys move between its buttons, so a person tabbing through the page passes it in one press instead of six. Alt+F10 reaches it from the canvas. -#} {#- The inserter. The palette appends at the end of the document, which is the only position a palette can mean; this one inserts at a position, directly after the selected block and in that block's own list, so an insert inside a row stays in the row. On the grid it had to push everything below down by the height of the block going in; a flow document has no rows to run out of, so it is a splice. The same kinds the palette offers, because a second list of kinds is a second list to keep in step. -#}Insert under this block