Send all responses as sexp wire format with client-side rendering
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5m35s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5m35s
- Server sends sexp source text, client (sexp.js) renders everything - SexpExpr marker class for nested sexp composition in serialize() - sexp_page() HTML shell with data-mount="body" for full page loads - sexp_response() returns text/sexp for OOB/partial responses - ~app-body layout component replaces ~app-layout (no raw!) - ~rich-text is the only component using raw! (for CMS HTML content) - Fragment endpoints return text/sexp, auto-wrapped in SexpExpr - All _*_html() helpers converted to _*_sexp() returning sexp source - Head auto-hoist: sexp.js moves meta/title/link/script[ld+json] from rendered body to document.head automatically - Unknown components render warning box instead of crashing page - Component kwargs preserve AST for lazy rendering (fixes <> in kwargs) - Fix unterminated paren in events/sexp/tickets.sexpr Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
;; Profile and actor timeline components
|
||||
|
||||
(defcomp ~federation-actor-profile-header (&key avatar-html display-name username domain summary-html follow-html)
|
||||
(defcomp ~federation-actor-profile-header (&key avatar display-name username domain summary follow)
|
||||
(div :class "bg-white rounded-lg shadow-sm border border-stone-200 p-6 mb-6"
|
||||
(div :class "flex items-center gap-4"
|
||||
(raw! avatar-html)
|
||||
avatar
|
||||
(div :class "flex-1"
|
||||
(h1 :class "text-xl font-bold" (raw! display-name))
|
||||
(div :class "text-stone-500" "@" (raw! username) "@" (raw! domain))
|
||||
(raw! summary-html))
|
||||
(raw! follow-html))))
|
||||
(h1 :class "text-xl font-bold" display-name)
|
||||
(div :class "text-stone-500" "@" username "@" domain)
|
||||
summary)
|
||||
follow)))
|
||||
|
||||
(defcomp ~federation-actor-timeline-layout (&key header-html timeline-html)
|
||||
(raw! header-html)
|
||||
(div :id "timeline" (raw! timeline-html)))
|
||||
(defcomp ~federation-actor-timeline-layout (&key header timeline)
|
||||
header
|
||||
(div :id "timeline" timeline))
|
||||
|
||||
(defcomp ~federation-follow-form (&key action csrf actor-url label cls)
|
||||
(div :class "flex-shrink-0"
|
||||
(form :method "post" :action action
|
||||
(input :type "hidden" :name "csrf_token" :value csrf)
|
||||
(input :type "hidden" :name "actor_url" :value actor-url)
|
||||
(button :type "submit" :class cls (raw! label)))))
|
||||
(button :type "submit" :class cls label))))
|
||||
|
||||
(defcomp ~federation-profile-summary (&key summary)
|
||||
(div :class "text-sm text-stone-600 mt-2" (raw! summary)))
|
||||
(div :class "text-sm text-stone-600 mt-2" (~rich-text :html summary)))
|
||||
|
||||
;; Public profile page
|
||||
|
||||
(defcomp ~federation-activity-obj-type (&key obj-type)
|
||||
(span :class "text-sm text-stone-500" (raw! obj-type)))
|
||||
(span :class "text-sm text-stone-500" obj-type))
|
||||
|
||||
(defcomp ~federation-activity-card (&key activity-type published obj-type-html)
|
||||
(defcomp ~federation-activity-card (&key activity-type published obj-type)
|
||||
(div :class "bg-white rounded-lg shadow p-4"
|
||||
(div :class "flex justify-between items-start"
|
||||
(span :class "font-medium" (raw! activity-type))
|
||||
(span :class "text-sm text-stone-400" (raw! published)))
|
||||
(raw! obj-type-html)))
|
||||
(span :class "font-medium" activity-type)
|
||||
(span :class "text-sm text-stone-400" published))
|
||||
obj-type))
|
||||
|
||||
(defcomp ~federation-activities-list (&key items-html)
|
||||
(div :class "space-y-4" (raw! items-html)))
|
||||
(defcomp ~federation-activities-list (&key items)
|
||||
(div :class "space-y-4" items))
|
||||
|
||||
(defcomp ~federation-activities-empty ()
|
||||
(p :class "text-stone-500" "No activities yet."))
|
||||
|
||||
(defcomp ~federation-profile-page (&key display-name username domain summary-html activities-heading activities-html)
|
||||
(defcomp ~federation-profile-page (&key display-name username domain summary activities-heading activities)
|
||||
(div :class "py-8"
|
||||
(div :class "bg-white rounded-lg shadow p-6 mb-6"
|
||||
(h1 :class "text-2xl font-bold" (raw! display-name))
|
||||
(p :class "text-stone-500" "@" (raw! username) "@" (raw! domain))
|
||||
(raw! summary-html))
|
||||
(h2 :class "text-xl font-bold mb-4" (raw! activities-heading))
|
||||
(raw! activities-html)))
|
||||
(h1 :class "text-2xl font-bold" display-name)
|
||||
(p :class "text-stone-500" "@" username "@" domain)
|
||||
summary)
|
||||
(h2 :class "text-xl font-bold mb-4" activities-heading)
|
||||
activities))
|
||||
|
||||
(defcomp ~federation-profile-summary-text (&key text)
|
||||
(p :class "mt-2" (raw! text)))
|
||||
(p :class "mt-2" text))
|
||||
|
||||
Reference in New Issue
Block a user