title: $:/core/macros/tag-picker tags: $:/tags/Macro first-search-filter: [tags[]!is[system]search:titlesort[]] second-search-filter: [tags[]is[system]search:titlesort[]] \define get-tagpicker-focus-selector() [data-tiddler-title="$(currentTiddlerCSSEscaped)$"] .tc-add-tag-name input \define delete-tag-state-tiddlers() <$action-deletetiddler $filter="[] [] []"/> \define add-tag-actions(actions) <$set name="tag" value={{{ [<__tiddler__>get[text]] }}}> <$list filter="[!tag]" variable="ignore" emptyMessage=""" <$action-sendmessage $message="tm-remove-tag" $param=<>/> """> <$action-sendmessage $message="tm-add-tag" $param=<>/> $actions$ <> <$action-setfield $tiddler=<> text="yes"/> \end \define tag-button(actions,selectedClass) <$button class="tc-btn-invisible $selectedClass$" tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}> <$action-sendmessage $message="tm-add-tag" $param=<>/> <> $actions$ <$macrocall $name="tag-pill" tag=<>/> \end \define clear-tags-actions-inner() <$list filter="[has[text]] [has[text]]" variable="ignore" emptyMessage="""<><$action-sendmessage $message="tm-cancel-tiddler"/>"""> <> \end \define clear-tags-actions() <$set name="userInput" value={{{ [get[text]] }}}> <$list filter="[get[text]!match]" emptyMessage="""<>"""> <$action-setfield $tiddler=<> text=<>/><$action-setfield $tiddler=<> text="yes"/> \end \define tag-picker-inner(actions) \whitespace trim <$vars tagSelectionState=<> storeTitle=<> refreshTitle=<> nonSystemTagsFilter="[tags[]!is[system]search:titlesort[]]" systemTagsFilter="[tags[]is[system]search:titlesort[]]">
<$macrocall $name="keyboard-driven-input" tiddler=<> storeTitle=<> refreshTitle=<> selectionStateTitle=<> inputAcceptActions="""<$macrocall $name="add-tag-actions" actions=<<__actions__>>/>""" inputCancelActions=<> tag="input" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tc-edit-texteditor tc-popup-handle" tabindex=<> focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}} filterMinLength={{$:/config/Tags/MinLength}} cancelPopups=<> configTiddlerFilter="[[$:/core/macros/tag-picker]]"/> <$button popup=<> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}} <$set name="tag" value={{{ [get[text]] }}}> <$button set=<> setTo="" class=""> <$action-sendmessage $message="tm-add-tag" $param=<>/> $actions$ <$set name="currentTiddlerCSSEscaped" value={{{ [escapecss[]] }}}> <><$action-sendmessage $message="tm-focus-selector" $param=<>/> {{$:/language/EditTemplate/Tags/Add/Button}}
<$reveal state=<> type="nomatch" text="" default="">
<$set name="userInput" value={{{ [get[text]] }}}> <$list filter="[minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> <$list filter=<> variable="tag"> <$list filter="[addsuffix[-primaryList]] -[get[text]]" emptyMessage="""<$macrocall $name="tag-button" actions=<<__actions__>> selectedClass="tc-tag-button-selected"/>"""> <$macrocall $name="tag-button" actions=<<__actions__>>/>
<$list filter="[minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> <$list filter=<> variable="tag"> <$list filter="[addsuffix[-secondaryList]] -[get[text]]" emptyMessage="""<$macrocall $name="tag-button" actions=<<__actions__>> selectedClass="tc-tag-button-selected"/>"""> <$macrocall $name="tag-button" actions=<<__actions__>>/>
\end \define tag-picker(actions) \whitespace trim <$list filter="[match[]]" emptyMessage="""<$macrocall $name="tag-picker-inner" actions=<<__actions__>>/>"""> <$set name="newTagNameTiddler" value=<>> <$macrocall $name="tag-picker-inner" actions=<<__actions__>>/> \end