urbit / shrub

An operating function (Prototype)
https://urbit.org
MIT License
28 stars 2 forks source link

Improvements to the Sail enhancers #19

Closed will-hanlen closed 3 months ago

will-hanlen commented 3 months ago

1. Configured Idiomorph and the morph-retain attribute

this swap will retain the specified attributes of the DOM element when swapping it.

a matching strategy provided by the HTMX idiomorph extension does the hard work of matchin DOM elements and retaining the state (including HTML :focus & :active states)

this allows for subscription-based interfaces that can safely push UI updates which swap overtop a DOM which has local state - without destroying the local state.

example:

;div
  =hx-post  "/neo/hawk{...}"
  =hx-swap  "morph"
  =hx-target  "#some-target"
  =morph-retain  "class,open"  ::  these attributes will persist
  ; ...
==

2. Improved the names of the arms I added to manx-utils