HS: transition to initial + commit pending E37/E40 test impls
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 17s
parser.sx: detect bare ident "initial" after "to" in parse-one-transition,
emit string sentinel instead of (ref "initial") which evaluated to nil.
runtime.sx: hs-transition stores pre-first-transition style as
data-hs-init-{prop}; restores it when value=="initial".
Also commits E37 tokenizer and E40 fetch test implementations that
accumulated in the working tree but weren't staged in prior commits.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1694,7 +1694,7 @@
|
||||
((from-val (if (match-kw "from") (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
|
||||
(expect-kw! "to")
|
||||
(let
|
||||
((value (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v))))
|
||||
((value (if (and (= (tp-type) "ident") (= (tp-val) "initial")) (do (adv!) "initial") (let ((v (parse-atom))) (if (and v (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)))))
|
||||
(let
|
||||
((dur (if (match-kw "over") (let ((v (parse-atom))) (if (and (number? v) (= (tp-type) "ident") (not (hs-keyword? (tp-val)))) (let ((unit (get (adv!) "value"))) (list (quote string-postfix) v unit)) v)) nil)))
|
||||
(let
|
||||
|
||||
@@ -1362,14 +1362,21 @@
|
||||
hs-transition
|
||||
(fn
|
||||
(target prop value duration)
|
||||
(when
|
||||
duration
|
||||
(dom-set-style
|
||||
target
|
||||
"transition"
|
||||
(str prop " " (/ duration 1000) "s")))
|
||||
(dom-set-style target prop value)
|
||||
(when duration (hs-settle target))))
|
||||
(let
|
||||
((init-attr (str "data-hs-init-" prop)))
|
||||
(when
|
||||
(not (dom-get-attr target init-attr))
|
||||
(dom-set-attr target init-attr (dom-get-style target prop)))
|
||||
(let
|
||||
((actual-value (if (= value "initial") (dom-get-attr target init-attr) value)))
|
||||
(when
|
||||
duration
|
||||
(dom-set-style
|
||||
target
|
||||
"transition"
|
||||
(str prop " " (/ duration 1000) "s")))
|
||||
(dom-set-style target prop actual-value)
|
||||
(when duration (hs-settle target))))))
|
||||
|
||||
(define
|
||||
hs-transition-from
|
||||
|
||||
Reference in New Issue
Block a user