Fix stepper: restore source as string, clean def-store application
Previous sed edits corrupted the file. Restored from 5c8b05a and
applied only the def-store change cleanly via python (no sed/sx-tools).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,14 +3,8 @@
|
|||||||
()
|
()
|
||||||
(let
|
(let
|
||||||
((source "(div (~cssx/tw :tokens \"text-center\")\n (h1 (~cssx/tw :tokens \"text-3xl font-bold mb-2\")\n (span (~cssx/tw :tokens \"text-rose-500\") \"the \")\n (span (~cssx/tw :tokens \"text-amber-500\") \"joy \")\n (span (~cssx/tw :tokens \"text-emerald-500\") \"of \")\n (span (~cssx/tw :tokens \"text-violet-600 text-4xl\") \"sx\")))")
|
((source "(div (~cssx/tw :tokens \"text-center\")\n (h1 (~cssx/tw :tokens \"text-3xl font-bold mb-2\")\n (span (~cssx/tw :tokens \"text-rose-500\") \"the \")\n (span (~cssx/tw :tokens \"text-amber-500\") \"joy \")\n (span (~cssx/tw :tokens \"text-emerald-500\") \"of \")\n (span (~cssx/tw :tokens \"text-violet-600 text-4xl\") \"sx\")))")
|
||||||
(h1 (~cssx/tw :tokens "text-3xl font-bold mb-2")
|
|
||||||
(span (~cssx/tw :tokens "text-rose-500") "the ")
|
|
||||||
(span (~cssx/tw :tokens "text-amber-500") "joy ")
|
|
||||||
(span (~cssx/tw :tokens "text-emerald-500") "of ")
|
|
||||||
(span (~cssx/tw :tokens "text-violet-600 text-4xl") "sx")))")
|
|
||||||
(store
|
|
||||||
(if (client?) (def-store "home-stepper" (fn () {:step-idx (signal 9)})) nil))
|
|
||||||
(steps (signal (list)))
|
(steps (signal (list)))
|
||||||
|
(store (if (client?) (def-store "home-stepper" (fn () {:step-idx (signal 9)})) nil))
|
||||||
(step-idx (if store (get store "step-idx") (signal 9)))
|
(step-idx (if store (get store "step-idx") (signal 9)))
|
||||||
(dom-stack-sig (signal (list)))
|
(dom-stack-sig (signal (list)))
|
||||||
(code-tokens (signal (list))))
|
(code-tokens (signal (list))))
|
||||||
@@ -271,7 +265,17 @@
|
|||||||
((target (- (deref step-idx) 1)))
|
((target (- (deref step-idx) 1)))
|
||||||
(rebuild-preview target)
|
(rebuild-preview target)
|
||||||
(reset! step-idx target)
|
(reset! step-idx target)
|
||||||
(update-code-highlight))))))
|
(update-code-highlight)
|
||||||
|
)))))
|
||||||
|
|
||||||
|
(let
|
||||||
|
((saved (get-cookie "sx-home-stepper")))
|
||||||
|
(when
|
||||||
|
saved
|
||||||
|
(thaw-from-sx saved)
|
||||||
|
(when
|
||||||
|
(or (< (deref step-idx) 0) (> (deref step-idx) 16))
|
||||||
|
(reset! step-idx 9))))
|
||||||
(let
|
(let
|
||||||
((parsed (sx-parse source)))
|
((parsed (sx-parse source)))
|
||||||
(when
|
(when
|
||||||
@@ -317,7 +321,10 @@
|
|||||||
(div
|
(div
|
||||||
:class "flex items-center justify-center gap-2 md:gap-3"
|
:class "flex items-center justify-center gap-2 md:gap-3"
|
||||||
(button
|
(button
|
||||||
:on-click (fn (e) (do-back))
|
:on-click (fn
|
||||||
|
(e)
|
||||||
|
(do-back)
|
||||||
|
)
|
||||||
:class (str
|
:class (str
|
||||||
"px-2 py-1 rounded text-3xl "
|
"px-2 py-1 rounded text-3xl "
|
||||||
(if
|
(if
|
||||||
@@ -331,7 +338,10 @@
|
|||||||
" / "
|
" / "
|
||||||
(len (deref steps)))
|
(len (deref steps)))
|
||||||
(button
|
(button
|
||||||
:on-click (fn (e) (do-step))
|
:on-click (fn
|
||||||
|
(e)
|
||||||
|
(do-step)
|
||||||
|
)
|
||||||
:class (str
|
:class (str
|
||||||
"px-2 py-1 rounded text-3xl "
|
"px-2 py-1 rounded text-3xl "
|
||||||
(if
|
(if
|
||||||
|
|||||||
Reference in New Issue
Block a user