Liking cljdoc? Tell your friends :D

dev.zeko.stube.frame

Rendering an instance into a fragment.

Three small jobs:

  • Invoke the user's :render against the merged instance map (with render/*conv* bound so s/render-slot can resolve children).
  • Decorate the outer hiccup with halo data-attrs when halos are active, and cache the resulting HTML on the instance for the dev panel's HTML tab.
  • Decide between selector=#root, mode=inner (first render of a frame) and Datastar's default morph-by-id (subsequent renders), so input focus and scroll state survive across re-renders.
Rendering an instance into a fragment.

Three small jobs:

* Invoke the user's `:render` against the merged instance map (with
  `render/*conv*` bound so `s/render-slot` can resolve children).
* Decorate the outer hiccup with halo data-attrs when halos are
  active, and cache the resulting HTML on the instance for the dev
  panel's HTML tab.
* Decide between `selector=#root, mode=inner` (first render of a
  frame) and Datastar's default morph-by-id (subsequent renders),
  so input focus and scroll state survive across re-renders.
raw docstring

default-renderclj

(default-render self)

Default renderer for components that don't supply one (e.g. tasks). An empty hidden div with the instance id keeps the morph-by-id wire contract intact.

Default renderer for components that don't supply one (e.g. tasks).
An empty hidden div with the instance id keeps the morph-by-id wire
contract intact.
sourceraw docstring

render-frameclj

(render-frame conv iid)

Produce the elements fragment for iid and return [conv' fragment].

Patching strategy:

  • First render of a frame — its id is not yet in the DOM, so we target the shell's <div id="root"> with mode inner.
  • Subsequent renders — the id is in the DOM, so we let Datastar's default morph-by-id do the work. Sibling DOM state — input focus, selection, scroll position — is preserved.
Produce the elements fragment for `iid` and return `[conv' fragment]`.

Patching strategy:

* **First render of a frame** — its id is not yet in the DOM, so we
  target the shell's `<div id="root">` with `mode inner`.
* **Subsequent renders** — the id is in the DOM, so we let Datastar's
  default morph-by-id do the work.  Sibling DOM state — input focus,
  selection, scroll position — is preserved.
sourceraw docstring

render-instanceclj

(render-instance conv iid opts)

Render iid with explicit Datastar patch opts, mark it and its rendered descendants as present in the DOM, and return [conv' frag].

When :conv/halos? is set, the outer hiccup is decorated with data-stube-* attrs and the resulting HTML is cached on the instance under :instance/last-html so the dev panel's HTML tab can show it.

Render `iid` with explicit Datastar patch `opts`, mark it and its
rendered descendants as present in the DOM, and return `[conv' frag]`.

When `:conv/halos?` is set, the outer hiccup is decorated with
`data-stube-*` attrs and the resulting HTML is cached on the instance
under `:instance/last-html` so the dev panel's HTML tab can show it.
sourceraw docstring

render-slot-overlayclj

(render-slot-overlay conv parent-id old-iid new-iid)

Render the child currently occupying slot after a :call-in-slot. If the slot already had a DOM root, patch that root outer; otherwise fall back to re-rendering the parent because there is no child anchor yet.

Render the child currently occupying `slot` after a `:call-in-slot`.
If the slot already had a DOM root, patch that root `outer`; otherwise
fall back to re-rendering the parent because there is no child anchor
yet.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close