Add Phase 2 P1 features: reactive class/style, refs, portals
- :class-map dict toggles classes reactively via classList.add/remove - :style-map dict sets inline styles reactively via el.style[prop] - ref/ref-get/ref-set! mutable boxes (non-reactive, like useRef) - :ref attribute sets ref.current to DOM element after rendering - portal render-dom form renders children into remote target element - Portal content auto-removed on island disposal via register-in-scope - Added #portal-root div to page shell template - Added stop-propagation and dom-focus platform functions - Demo islands for all three features on the demo page - Updated status tables: all P0/P1 features marked Done Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -306,7 +306,28 @@
|
||||
|
||||
|
||||
;; ==========================================================================
|
||||
;; 12. Named stores — page-level signal containers (L3)
|
||||
;; 12. Refs — mutable boxes, no reactivity
|
||||
;; ==========================================================================
|
||||
;;
|
||||
;; A ref is a mutable container that does NOT trigger subscriptions when
|
||||
;; written. Like React's useRef: holds mutable values between renders, and
|
||||
;; provides imperative DOM element access via :ref attribute.
|
||||
|
||||
(define ref
|
||||
(fn (initial)
|
||||
(dict "current" initial)))
|
||||
|
||||
(define ref-get
|
||||
(fn (r)
|
||||
(get r "current")))
|
||||
|
||||
(define ref-set!
|
||||
(fn (r v)
|
||||
(dict-set! r "current" v)))
|
||||
|
||||
|
||||
;; ==========================================================================
|
||||
;; 13. Named stores — page-level signal containers (L3)
|
||||
;; ==========================================================================
|
||||
;;
|
||||
;; Stores persist across island creation/destruction. They live at page
|
||||
|
||||
Reference in New Issue
Block a user