DESIGN.md §3 — the plugin contract. Plugins init at new Shoji()
construction time — the lightbox DOM (hidden, display:none until the
first open()) is built eagerly specifically so init() can rely on
ctx.ui.* synchronously, with zero queueing, from the very start. This
also means a plugin can act before any open() call — the layout
plugin (§5) depends on that: it renders ctx.gallery.element (the inline
thumbnail container) immediately, since that's what the viewer clicks to
open in the first place, not something that only matters once already open.
DESIGN.md §3 — the plugin contract. Plugins init at
new Shoji()construction time — the lightbox DOM (hidden,display:noneuntil the firstopen()) is built eagerly specifically soinit()can rely onctx.ui.*synchronously, with zero queueing, from the very start. This also means a plugin can act before anyopen()call — the layout plugin (§5) depends on that: it rendersctx.gallery.element(the inline thumbnail container) immediately, since that's what the viewer clicks to open in the first place, not something that only matters once already open.