Rename all 1,169 components to path-based names with namespace support
Component names now reflect filesystem location using / as path separator and : as namespace separator for shared components: ~sx-header → ~layouts/header ~layout-app-body → ~shared:layout/app-body ~blog-admin-dashboard → ~admin/dashboard 209 files, 4,941 replacements across all services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
(defcomp ~app-body (&key header-rows filter aside menu content)
|
||||
(defcomp ~shared:layout/app-body (&key header-rows filter aside menu content)
|
||||
(div :class "max-w-screen-2xl mx-auto py-1 px-1"
|
||||
(when header-rows
|
||||
(div :class "w-full"
|
||||
@@ -24,7 +24,7 @@
|
||||
(when content content)
|
||||
(div :class "pb-8")))))))
|
||||
|
||||
(defcomp ~oob-sx (&key oobs filter aside menu content)
|
||||
(defcomp ~shared:layout/oob-sx (&key oobs filter aside menu content)
|
||||
(<>
|
||||
(when oobs oobs)
|
||||
(div :id "filter" :sx-swap-oob "outerHTML"
|
||||
@@ -38,7 +38,7 @@
|
||||
:class "flex-1 md:h-full md:min-h-0 overflow-y-auto overscroll-contain js-grid-viewport"
|
||||
(when content content))))
|
||||
|
||||
(defcomp ~hamburger ()
|
||||
(defcomp ~shared:layout/hamburger ()
|
||||
(div :class "md:hidden bg-stone-200 rounded"
|
||||
(svg :class "h-12 w-12 transition-transform group-open/root:hidden block self-start"
|
||||
:viewBox "0 0 24 24" :fill "none" :stroke "currentColor"
|
||||
@@ -48,17 +48,17 @@
|
||||
:class "w-12 h-12 rotate-180 transition-transform group-open/root:block hidden self-start"
|
||||
(path :d "M6 9l6 6 6-6" :fill "currentColor"))))
|
||||
|
||||
(defcomp ~post-label (&key (feature-image :as string?) (title :as string))
|
||||
(defcomp ~shared:layout/post-label (&key (feature-image :as string?) (title :as string))
|
||||
(<> (when feature-image
|
||||
(img :src feature-image :class "h-8 w-8 rounded-full object-cover border border-stone-300 flex-shrink-0"))
|
||||
(span title)))
|
||||
|
||||
(defcomp ~page-cart-badge (&key (href :as string) (count :as string))
|
||||
(defcomp ~shared:layout/page-cart-badge (&key (href :as string) (count :as string))
|
||||
(a :href href :class "relative inline-flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-full border border-emerald-300 bg-emerald-50 text-emerald-800 hover:bg-emerald-100 transition"
|
||||
(i :class "fa fa-shopping-cart" :aria-hidden "true")
|
||||
(span count)))
|
||||
|
||||
(defcomp ~header-row-sx (&key cart-mini (blog-url :as string?) (site-title :as string?)
|
||||
(defcomp ~shared:layout/header-row-sx (&key cart-mini (blog-url :as string?) (site-title :as string?)
|
||||
(app-label :as string?) nav-tree auth-menu nav-panel
|
||||
(settings-url :as string?) (is-admin :as boolean?) (oob :as boolean?))
|
||||
(<>
|
||||
@@ -79,13 +79,13 @@
|
||||
(when (and is-admin settings-url)
|
||||
(a :href settings-url :class "justify-center cursor-pointer flex flex-row items-center gap-2 rounded bg-stone-200 text-black p-3"
|
||||
(i :class "fa fa-cog" :aria-hidden "true"))))
|
||||
(~hamburger)))
|
||||
(~shared:layout/hamburger)))
|
||||
(div :class "block md:hidden text-md font-bold"
|
||||
(when auth-menu auth-menu))))
|
||||
|
||||
; @css bg-sky-400 bg-sky-300 bg-sky-200 bg-sky-100 bg-violet-400 bg-violet-300 bg-violet-200 bg-violet-100
|
||||
; @css aria-selected:bg-violet-200 aria-selected:text-violet-900 aria-selected:bg-stone-500 aria-selected:text-white
|
||||
(defcomp ~menu-row-sx (&key (id :as string) (level :as number?) (colour :as string?)
|
||||
(defcomp ~shared:layout/menu-row-sx (&key (id :as string) (level :as number?) (colour :as string?)
|
||||
(link-href :as string) (link-label :as string?) link-label-content
|
||||
(icon :as string?) (selected :as string?) (hx-select :as string?)
|
||||
nav (child-id :as string?) child (oob :as boolean?) (external :as boolean?))
|
||||
@@ -117,11 +117,11 @@
|
||||
(div :id child-id :class "flex flex-col w-full items-center"
|
||||
(when child child))))))
|
||||
|
||||
(defcomp ~oob-header-sx (&key (parent-id :as string) row)
|
||||
(defcomp ~shared:layout/oob-header-sx (&key (parent-id :as string) row)
|
||||
(div :id parent-id :sx-swap-oob "outerHTML" :class "flex flex-col w-full items-center"
|
||||
row))
|
||||
|
||||
(defcomp ~header-child-sx (&key (id :as string?) inner)
|
||||
(defcomp ~shared:layout/header-child-sx (&key (id :as string?) inner)
|
||||
(div :id (or id "root-header-child") :class "flex flex-col w-full items-center" inner))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
@@ -129,7 +129,7 @@
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
;; Labelled section: colour bar header + vertical nav items
|
||||
(defcomp ~mobile-menu-section (&key (label :as string) (href :as string?) (colour :as string?)
|
||||
(defcomp ~shared:layout/mobile-menu-section (&key (label :as string) (href :as string?) (colour :as string?)
|
||||
(level :as number?) items)
|
||||
(let* ((c (or colour "sky"))
|
||||
(lv (or level 1))
|
||||
@@ -143,7 +143,7 @@
|
||||
items))))
|
||||
|
||||
;; Root-level mobile nav: site nav items + auth links
|
||||
(defcomp ~mobile-root-nav (&key nav-tree auth-menu)
|
||||
(defcomp ~shared:layout/mobile-root-nav (&key nav-tree auth-menu)
|
||||
(<>
|
||||
(when nav-tree
|
||||
(div :class "flex flex-col gap-2 p-3 text-sm" nav-tree))
|
||||
@@ -156,27 +156,27 @@
|
||||
;; nested component calls in _aser are serialized without expansion.
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~root-header (&key cart-mini (blog-url :as string?) (site-title :as string?)
|
||||
(defcomp ~shared:layout/root-header (&key cart-mini (blog-url :as string?) (site-title :as string?)
|
||||
(app-label :as string?) nav-tree auth-menu nav-panel
|
||||
(settings-url :as string?) (is-admin :as boolean?) (oob :as boolean?))
|
||||
(~header-row-sx :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||
(~shared:layout/header-row-sx :cart-mini cart-mini :blog-url blog-url :site-title site-title
|
||||
:app-label app-label :nav-tree nav-tree :auth-menu auth-menu
|
||||
:nav-panel nav-panel :settings-url settings-url :is-admin is-admin
|
||||
:oob oob))
|
||||
|
||||
(defcomp ~root-mobile (&key nav-tree auth-menu)
|
||||
(~mobile-root-nav :nav-tree nav-tree :auth-menu auth-menu))
|
||||
(defcomp ~shared:layout/root-mobile (&key nav-tree auth-menu)
|
||||
(~shared:layout/mobile-root-nav :nav-tree nav-tree :auth-menu auth-menu))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Auto-fetching header/mobile macros — use IO primitives to self-populate.
|
||||
;; These expand inline so IO calls resolve in _aser mode within layout bodies.
|
||||
;; Replaces the 10-parameter ~root-header boilerplate in layout defcomps.
|
||||
;; Replaces the 10-parameter ~shared:layout/root-header boilerplate in layout defcomps.
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defmacro ~root-header-auto (oob)
|
||||
(quasiquote
|
||||
(let ((__rhctx (root-header-ctx)))
|
||||
(~header-row-sx :cart-mini (get __rhctx "cart-mini")
|
||||
(~shared:layout/header-row-sx :cart-mini (get __rhctx "cart-mini")
|
||||
:blog-url (get __rhctx "blog-url")
|
||||
:site-title (get __rhctx "site-title")
|
||||
:app-label (get __rhctx "app-label")
|
||||
@@ -190,7 +190,7 @@
|
||||
(defmacro ~root-mobile-auto ()
|
||||
(quasiquote
|
||||
(let ((__rhctx (root-header-ctx)))
|
||||
(~mobile-root-nav :nav-tree (get __rhctx "nav-tree")
|
||||
(~shared:layout/mobile-root-nav :nav-tree (get __rhctx "nav-tree")
|
||||
:auth-menu (get __rhctx "auth-menu")))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
@@ -198,31 +198,31 @@
|
||||
;; These use ~root-header-auto / ~root-mobile-auto macros (IO primitives).
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~layout-root-full ()
|
||||
(defcomp ~shared:layout/root-full ()
|
||||
(~root-header-auto))
|
||||
|
||||
(defcomp ~layout-root-oob ()
|
||||
(~oob-header-sx :parent-id "root-header-child"
|
||||
(defcomp ~shared:layout/root-oob ()
|
||||
(~shared:layout/oob-header-sx :parent-id "root-header-child"
|
||||
:row (~root-header-auto true)))
|
||||
|
||||
(defcomp ~layout-root-mobile ()
|
||||
(defcomp ~shared:layout/root-mobile ()
|
||||
(~root-mobile-auto))
|
||||
|
||||
;; Post layout — root + post header
|
||||
(defcomp ~layout-post-full ()
|
||||
(defcomp ~shared:layout/post-full ()
|
||||
(<> (~root-header-auto)
|
||||
(~header-child-sx :inner (~post-header-auto))))
|
||||
(~shared:layout/header-child-sx :inner (~post-header-auto))))
|
||||
|
||||
(defcomp ~layout-post-oob ()
|
||||
(defcomp ~shared:layout/post-oob ()
|
||||
(<> (~post-header-auto true)
|
||||
(~oob-header-sx :parent-id "post-header-child" :row "")))
|
||||
(~shared:layout/oob-header-sx :parent-id "post-header-child" :row "")))
|
||||
|
||||
(defcomp ~layout-post-mobile ()
|
||||
(defcomp ~shared:layout/post-mobile ()
|
||||
(let ((__phctx (post-header-ctx))
|
||||
(__rhctx (root-header-ctx)))
|
||||
(<>
|
||||
(when (get __phctx "slug")
|
||||
(~mobile-menu-section
|
||||
(~shared:layout/mobile-menu-section
|
||||
:label (slice (get __phctx "title") 0 40)
|
||||
:href (get __phctx "link-href")
|
||||
:level 1
|
||||
@@ -230,35 +230,35 @@
|
||||
(~root-mobile-auto))))
|
||||
|
||||
;; Post-admin layout — root + post header with nested admin row
|
||||
(defcomp ~layout-post-admin-full (&key (selected :as string?))
|
||||
(defcomp ~shared:layout/post-admin-full (&key (selected :as string?))
|
||||
(let ((__admin-hdr (~post-admin-header-auto nil selected)))
|
||||
(<> (~root-header-auto)
|
||||
(~header-child-sx
|
||||
(~shared:layout/header-child-sx
|
||||
:inner (~post-header-auto nil)))))
|
||||
|
||||
(defcomp ~layout-post-admin-oob (&key (selected :as string?))
|
||||
(defcomp ~shared:layout/post-admin-oob (&key (selected :as string?))
|
||||
(<> (~post-header-auto true)
|
||||
(~oob-header-sx :parent-id "post-header-child"
|
||||
(~shared:layout/oob-header-sx :parent-id "post-header-child"
|
||||
:row (~post-admin-header-auto nil selected))))
|
||||
|
||||
(defcomp ~layout-post-admin-mobile (&key (selected :as string?))
|
||||
(defcomp ~shared:layout/post-admin-mobile (&key (selected :as string?))
|
||||
(let ((__phctx (post-header-ctx)))
|
||||
(<>
|
||||
(when (get __phctx "slug")
|
||||
(~mobile-menu-section
|
||||
(~shared:layout/mobile-menu-section
|
||||
:label "admin"
|
||||
:href (get __phctx "admin-href")
|
||||
:level 2
|
||||
:items (~post-admin-nav-auto selected)))
|
||||
(when (get __phctx "slug")
|
||||
(~mobile-menu-section
|
||||
(~shared:layout/mobile-menu-section
|
||||
:label (slice (get __phctx "title") 0 40)
|
||||
:href (get __phctx "link-href")
|
||||
:level 1
|
||||
:items (~post-nav-auto)))
|
||||
(~root-mobile-auto))))
|
||||
|
||||
(defcomp ~error-content (&key (errnum :as string) (message :as string) (image :as string?))
|
||||
(defcomp ~shared:layout/error-content (&key (errnum :as string) (message :as string) (image :as string?))
|
||||
(div :class "text-center p-8 max-w-lg mx-auto"
|
||||
(div :class "font-bold text-2xl md:text-4xl text-red-500 mb-4" errnum)
|
||||
(div :class "text-stone-600 mb-4" message)
|
||||
@@ -266,7 +266,7 @@
|
||||
(div :class "flex justify-center"
|
||||
(img :src image :width "300" :height "300")))))
|
||||
|
||||
(defcomp ~clear-oob-div (&key (id :as string))
|
||||
(defcomp ~shared:layout/clear-oob-div (&key (id :as string))
|
||||
(div :id id :sx-swap-oob "outerHTML"))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
@@ -280,12 +280,12 @@
|
||||
(when (get __phctx "slug")
|
||||
(<>
|
||||
(when (> (get __phctx "page-cart-count") 0)
|
||||
(~page-cart-badge :href (get __phctx "cart-href")
|
||||
(~shared:layout/page-cart-badge :href (get __phctx "cart-href")
|
||||
:count (str (get __phctx "page-cart-count"))))
|
||||
(when (get __phctx "container-nav")
|
||||
(~container-nav-wrapper :content (get __phctx "container-nav")))
|
||||
(~shared:layout/container-nav-wrapper :content (get __phctx "container-nav")))
|
||||
(when (get __phctx "is-admin")
|
||||
(~admin-cog-button :href (get __phctx "admin-href")
|
||||
(~shared:layout/admin-cog-button :href (get __phctx "admin-href")
|
||||
:is-admin-page (get __phctx "is-admin-page"))))))))
|
||||
|
||||
(defmacro ~post-header-auto (oob)
|
||||
@@ -293,9 +293,9 @@
|
||||
(quasiquote
|
||||
(let ((__phctx (post-header-ctx)))
|
||||
(when (get __phctx "slug")
|
||||
(~menu-row-sx :id "post-row" :level 1
|
||||
(~shared:layout/menu-row-sx :id "post-row" :level 1
|
||||
:link-href (get __phctx "link-href")
|
||||
:link-label-content (~post-label
|
||||
:link-label-content (~shared:layout/post-label
|
||||
:feature-image (get __phctx "feature-image")
|
||||
:title (get __phctx "title"))
|
||||
:nav (~post-nav-auto)
|
||||
@@ -310,28 +310,28 @@
|
||||
(let ((__slug (get __phctx "slug"))
|
||||
(__sc (get __phctx "select-colours")))
|
||||
(<>
|
||||
(~nav-link :href (app-url "events" (str "/" __slug "/admin/"))
|
||||
(~shared:layout/nav-link :href (app-url "events" (str "/" __slug "/admin/"))
|
||||
:label "calendars" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "calendars") "true"))
|
||||
(~nav-link :href (app-url "market" (str "/" __slug "/admin/"))
|
||||
(~shared:layout/nav-link :href (app-url "market" (str "/" __slug "/admin/"))
|
||||
:label "markets" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "markets") "true"))
|
||||
(~nav-link :href (app-url "cart" (str "/" __slug "/admin/payments/"))
|
||||
(~shared:layout/nav-link :href (app-url "cart" (str "/" __slug "/admin/payments/"))
|
||||
:label "payments" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "payments") "true"))
|
||||
(~nav-link :href (app-url "blog" (str "/" __slug "/admin/entries/"))
|
||||
(~shared:layout/nav-link :href (app-url "blog" (str "/" __slug "/admin/entries/"))
|
||||
:label "entries" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "entries") "true"))
|
||||
(~nav-link :href (app-url "blog" (str "/" __slug "/admin/data/"))
|
||||
(~shared:layout/nav-link :href (app-url "blog" (str "/" __slug "/admin/data/"))
|
||||
:label "data" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "data") "true"))
|
||||
(~nav-link :href (app-url "blog" (str "/" __slug "/admin/preview/"))
|
||||
(~shared:layout/nav-link :href (app-url "blog" (str "/" __slug "/admin/preview/"))
|
||||
:label "preview" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "preview") "true"))
|
||||
(~nav-link :href (app-url "blog" (str "/" __slug "/admin/edit/"))
|
||||
(~shared:layout/nav-link :href (app-url "blog" (str "/" __slug "/admin/edit/"))
|
||||
:label "edit" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "edit") "true"))
|
||||
(~nav-link :href (app-url "blog" (str "/" __slug "/admin/settings/"))
|
||||
(~shared:layout/nav-link :href (app-url "blog" (str "/" __slug "/admin/settings/"))
|
||||
:label "settings" :select-colours __sc
|
||||
:is-selected (when (= (unquote selected) "settings") "true"))))))))
|
||||
|
||||
@@ -340,9 +340,9 @@
|
||||
(quasiquote
|
||||
(let ((__phctx (post-header-ctx)))
|
||||
(when (get __phctx "slug")
|
||||
(~menu-row-sx :id "post-admin-row" :level 2
|
||||
(~shared:layout/menu-row-sx :id "post-admin-row" :level 2
|
||||
:link-href (get __phctx "admin-href")
|
||||
:link-label-content (~post-admin-label
|
||||
:link-label-content (~shared:layout/post-admin-label
|
||||
:selected (unquote selected))
|
||||
:nav (~post-admin-nav-auto (unquote selected))
|
||||
:child-id "post-admin-header-child"
|
||||
@@ -352,27 +352,27 @@
|
||||
;; Shared nav helpers — used by post_header_sx / post_admin_header_sx
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
(defcomp ~container-nav-wrapper (&key content)
|
||||
(defcomp ~shared:layout/container-nav-wrapper (&key content)
|
||||
(div :id "entries-calendars-nav-wrapper"
|
||||
:class "flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
|
||||
content))
|
||||
|
||||
; @css justify-center cursor-pointer flex flex-row items-center gap-2 rounded bg-stone-200 text-black p-3 !bg-stone-500 !text-white
|
||||
(defcomp ~admin-cog-button (&key (href :as string) (is-admin-page :as boolean?))
|
||||
(defcomp ~shared:layout/admin-cog-button (&key (href :as string) (is-admin-page :as boolean?))
|
||||
(div :class "relative nav-group"
|
||||
(a :href href
|
||||
:class (str "justify-center cursor-pointer flex flex-row items-center gap-2 rounded bg-stone-200 text-black p-3 "
|
||||
(if is-admin-page "!bg-stone-500 !text-white" ""))
|
||||
(i :class "fa fa-cog" :aria-hidden "true"))))
|
||||
|
||||
(defcomp ~post-admin-label (&key (selected :as string?))
|
||||
(defcomp ~shared:layout/post-admin-label (&key (selected :as string?))
|
||||
(<>
|
||||
(i :class "fa fa-shield-halved" :aria-hidden "true")
|
||||
" admin"
|
||||
(when selected
|
||||
(span :class "text-white" selected))))
|
||||
|
||||
(defcomp ~nav-link (&key (href :as string) (hx-select :as string?) (label :as string?) (icon :as string?)
|
||||
(defcomp ~shared:layout/nav-link (&key (href :as string) (hx-select :as string?) (label :as string?) (icon :as string?)
|
||||
(aclass :as string?) (select-colours :as string?) (is-selected :as string?))
|
||||
(div :class "relative nav-group"
|
||||
(a :href href
|
||||
|
||||
Reference in New Issue
Block a user