The basic layout
The app shell of a space in the browser: a top bar with the space name and a light/dark switch, a sidebar with the space tree, the lens area with lens tabs for a collection, and an empty right panel. Lenses run in sandboxed frames and talk to the shell through lens.js (window.shtuk). The shell loads once; a lens is swapped in only after it has drawn.
О пакете
Этот текст ещё не переведён. Ниже английский оригинал.
The layout package of the prototype cloud app. It brings no pages; its files are laid into
.shtukbase/packages/layout-basic/ and served at /_pkg/layout-basic/.
shell.html,shell.css,shell.js: the shell served at/. Slots: top (space name, theme), sidebar (thetree), main (the lens area; tabs of the Collection lenses above it), panel (right, hidden for now).lens.js: the client every lens links; it gives the pagewindow.shtuk(path,call,open,ready,on('changed')). In a frame it talks to the shell bypostMessage; standalone it callsPOST /_apiitself.
How it stays fast
- The shell loads once. Navigation is
history.pushStatewith?path=<page>&lens=<id>; back and forward work, a reload opens the same view. - A lens loads in a hidden frame (
visibility: hidden) and is swapped in aftershtuk.ready()or after 800 ms. Until then the previous lens stays on screen, so nothing flashes. - The last 6 frames stay alive, hidden; going back to them is instant. Hovering a sidebar row starts loading its lens; the other lenses of an open collection are loaded after it draws.
- The shell passes the theme in the frame URL (
&skin=calm&theme=dark), solens.jssetsdata-skinanddata-themeon<html>before the first paint; later changes come as{type: 'theme'}messages. - After a
records.writethrough the shell, and when thetreepoll (every 5 s) sees a change, the shell posts{type: 'changed'}to every frame. The sidebar is updated in place, row by row. - Timings go to
window.__shellTimings(firstOpen,switches) andconsole.debug.
Test without a host
bun apps/standard/packages/layout-basic/test/fake-host.ts serves the shell, the kit, a fake
/_api with a "Заявки" collection and a demo lens (or lenses-records when it exists).
Файлы пакета 7
Ложатся в .shtukbase/packages/layout-basic/; отсюда запускаются действия.