1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-13 14:23:14 +00:00

Componentise more preview components

This commit is contained in:
Jeremy Ruston 2024-11-17 14:45:41 +00:00
parent cfabc92945
commit b2d0c22d75
5 changed files with 28 additions and 17 deletions

View File

@ -0,0 +1,7 @@
title: $:/core/ui/Palettes/Preview/SideBar
tags: $:/tags/Preview/Page
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-sidebar" styleName="color" styleColour="sidebar-foreground">
<<palette-preview-component-list "$:/tags/Preview/SideBar">>
</$colour.div>

View File

@ -0,0 +1,9 @@
title: $:/core/ui/Palettes/Preview/Story
tags: $:/tags/Preview/Page
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-story">
<$list filter="HelloThere GettingStarted" variable="title">
<<palette-preview-component-list "$:/tags/Preview/Story">>
</$list>
</$colour.div>

View File

@ -4,7 +4,5 @@ tags: $:/tags/Preview/Story
\parameters (title)
\whitespace trim
<$colour.div class="tc-palette-preview-thumbnail-tiddler" styleName="background-color" styleColour="tiddler-background">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/Tiddler]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
<<palette-preview-component-list "$:/tags/Preview/Tiddler">>
</$colour.div>

View File

@ -3,11 +3,11 @@ title: $:/snippets/currpalettepreview
\whitespace trim
\procedure colour-div-filtered(class,styleName,styleColour)
\function colour(name) [<colour-palette>getindex<name>] :else[<colour-palette>get[palette-import]getindex<name>] :else[[none]] :map[subfilter<currentTiddler>] +[join[ ]]
<!-- Note the join, needed to cope with palette entries containing spaces -->
\function colour(name) [<colour-palette>getindex<name>] :else[<colour-palette>get[palette-import]getindex<name>] :else[[none]] :map[subfilter<currentTiddler>join[ ]]
<$let
colour-palette=<<currentTiddler>>
colour-result={{{ [function[colour],<styleColour>] +[join[ ]] }}}
colour-result={{{ [function[colour],<styleColour>] }}}
>
<div class=<<class>> style={{{ [<styleName>addsuffix[:]addsuffix<colour-result>addsuffix[;]] }}}>
<$slot $name="ts-raw" $depth="2"/>
@ -45,20 +45,15 @@ title: $:/snippets/currpalettepreview
<%endif%>
\end $colour.div
\procedure palette-preview-component-list(tag)
<$list filter="[all[shadows+tiddlers]tag<tag>!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
\end palette-preview-component-list
\procedure palette-preview-thumbnail()
<$colour.div class="tc-palette-preview-thumbnail" styleName="background-color" styleColour="page-background">
<$colour.div class="tc-palette-preview-thumbnail-story">
<$list filter="HelloThere GettingStarted" variable="title">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/Story]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
</$list>
</$colour.div>
<$colour.div class="tc-palette-preview-thumbnail-sidebar" styleName="color" styleColour="sidebar-foreground">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Preview/SideBar]!has[draft.of]]" variable="componentTitle">
<$transclude $tiddler=<<componentTitle>> title=<<title>>/>
</$list>
</$colour.div>
<<palette-preview-component-list "$:/tags/Preview/Page">>
</$colour.div>
\end palette-preview-thumbnail

View File

@ -0,0 +1,2 @@
title: $:/tags/Preview/Page
list: $:/core/ui/Palettes/Preview/Alert $:/core/ui/Palettes/Preview/Story $:/core/ui/Palettes/Preview/Sidebar