{"tiddlers":{"$:/plugins/linonetwo/template-list/EditTemplate":{"title":"$:/plugins/linonetwo/template-list/EditTemplate","modifier":"LinOnetwo","creator":"LinOnetwo","tags":"$:/tags/EditTemplate","type":"text/vnd.tiddlywiki","text":"<% if [<currentTiddler>!has:field[_is_skinny]!has[text]] %>\n  <<template-list >>\n<% endif %>"},"Index":{"title":"Index","type":"text/vnd.tiddlywiki","text":"{{$:/snippets/minilanguageswitcher}}\n\n!! Usage\n\nTry create a new tiddler to see the template list below it.\n\n{{$:/core/ui/Buttons/new-tiddler}}"},"$:/plugins/linonetwo/NewTemplateButton":{"title":"$:/plugins/linonetwo/NewTemplateButton","creator":"LinOnetwo","type":"text/vnd.tiddlywiki","text":"<$button>\n  <$action-sendmessage $message=\"tm-new-tiddler\" title=<<now \"YYYY-MM-DD\">> tags=\"$:/tags/TextEditor/Template\" />\n  New Template\n</$button>"},"$:/plugins/linonetwo/template-list/ViewTemplate":{"title":"$:/plugins/linonetwo/template-list/ViewTemplate","tags":"$:/tags/ViewTemplate","text":"<% if [{$:/state/open-template-list}compare:string:eq[yes]] %>\n  <% if [<currentTiddler>!has:field[_is_skinny]!has[text]] %>\n    <<template-list targetBlankTiddler >>\n  <% endif %>\n<% endif %>"},"$:/plugins/linonetwo/template-list/language/en-GB/Readme":{"title":"$:/plugins/linonetwo/template-list/language/en-GB/Readme","text":"\\procedure lingo-base() $:/plugins/linonetwo/template-list/language/\n\n! <<lingo Name>>\n\n<<lingo Description>>\n\n!! Features\n\nWhen you are editing an empty tiddler, a template list and a search bar will show up. You can search for the template you want and apply it with one click.\n\nConsidering that the template feature is not commonly used in view mode, when viewing an empty tiddler, a view toolbar button {{$:/core/images/stamp}} will show up. Click on it to show the template list just like in edit mode.\n\n!! Add new template\n\n`$:/tags/TextEditor/Template` is the tag for the templates. Add this tag to a tiddler, and that tiddler will show up in the template list.\n\nThere is a `+` button in the template list, click on it to create a new template.\n\nOr you can use this button to create a new template [[$:/plugins/linonetwo/NewTemplateButton]]\n\n{{$:/plugins/linonetwo/NewTemplateButton}}\n\n!! Apply the template\n\nAfter you create an empty tiddler, that have an empty text field. You will notice that a template and a search bar show up in the bottom of the tiddler.\n\nClick on a template will apply all tags and all fields to the currentTiddler.\n\nYou can scroll to reveal more template if you have more than two rows of templates.\n"},"$:/plugins/linonetwo/template-list/language/en-GB/Name":{"title":"$:/plugins/linonetwo/template-list/language/en-GB/Name","text":"Template List"},"$:/plugins/linonetwo/template-list/language/en-GB/Description":{"title":"$:/plugins/linonetwo/template-list/language/en-GB/Description","text":"Provide a template list in the style of [[Feishu Document|https://www.feishu.cn/hc/en-US/articles/351142559376-use-templates-in-feishu-docs]] for newly created tiddlers."},"$:/plugins/linonetwo/template-list/language/en-GB/ToggleTemplateList":{"title":"$:/plugins/linonetwo/template-list/language/en-GB/ToggleTemplateList","text":"Toggle template list"},"$:/plugins/linonetwo/template-list/language/en-GB/ToggleTemplateListDescription":{"title":"$:/plugins/linonetwo/template-list/language/en-GB/ToggleTemplateListDescription","text":"Click to show or hide the template list, only show up on empty tiddlers."},"$:/plugins/linonetwo/template-list/language/zh-Hans/Readme":{"title":"$:/plugins/linonetwo/template-list/language/zh-Hans/Readme","text":"\\procedure lingo-base() $:/plugins/linonetwo/template-list/language/\n\n! <<lingo Name>>\n\n<<lingo Description>>\n\n!! 功能介绍\n\n在编辑内容为空的条目时，会显示一个模板列表和一个搜索栏。可以搜索所需的模板一键应用。\n\n考虑到查看模式不常用模板功能，所以在查看空白条目时，会显示一个查看工具栏按钮 {{$:/core/images/stamp}}，点击后才会显示和编辑模式一样的模板列表。\n\n!! 添加新模板\n\n`$:/tags/TextEditor/Template` 是模板的标签。将这个标签添加到一个条目上，该条目就会显示在新建条目时的模板列表中。\n\n在模板列表中有一个 `+` 按钮，点它就可以新建一个模板。\n\n你也可以用这个按钮来新建模板 [[$:/plugins/linonetwo/NewTemplateButton]]\n\n{{$:/plugins/linonetwo/NewTemplateButton}}\n\n!! 应用模板\n\n在你创建一个空的条目后，文本字段是空的，这时一个模板列表和一个搜索栏就会显示在条目的底部。\n\n点击列表中的任意一个模板就可以将该模板的标签、字段都应用到当前的条目中。\n\n如果你有很多模板，你可以将鼠标悬浮到列表上滚动来显示更多的模板。\n"},"$:/plugins/linonetwo/template-list/language/zh-Hans/Name":{"title":"$:/plugins/linonetwo/template-list/language/zh-Hans/Name","text":"模板列表"},"$:/plugins/linonetwo/template-list/language/zh-Hans/Description":{"title":"$:/plugins/linonetwo/template-list/language/zh-Hans/Description","text":"为新创建的条目提供[[飞书文档|https://www.feishu.cn/hc/zh-CN/articles/222318959624]]风格的模板列表。"},"$:/plugins/linonetwo/template-list/language/zh-Hans/ToggleTemplateList":{"title":"$:/plugins/linonetwo/template-list/language/zh-Hans/ToggleTemplateList","text":"开关模板列表"},"$:/plugins/linonetwo/template-list/language/zh-Hans/ToggleTemplateListDescription":{"title":"$:/plugins/linonetwo/template-list/language/zh-Hans/ToggleTemplateListDescription","text":"点击显示或隐藏模板列表，仅会在空白条目上展示。"},"$:/plugins/linonetwo/template-list/Readme":{"title":"$:/plugins/linonetwo/template-list/Readme","creator":"LinOnetwo","type":"text/vnd.tiddlywiki","text":"\\procedure lingo-base() $:/plugins/linonetwo/template-list/language/\n\n<<lingo Readme>>\n"},"$:/plugins/linonetwo/template-list/style.css":{"title":"$:/plugins/linonetwo/template-list/style.css","creator":"LinOnetwo","tags":"$:/tags/Stylesheet","type":"text/vnd.tiddlywiki","text":".linonetwo-template-list-container {\n  opacity: 0.5;\n  overflow-y: hidden;\n  border-radius: 5px;\n\t\n\tmargin-top: 1em;\n\tpadding-top: 2em;\n\n  /** make is small when not used */\n\tmax-height: 95px;\n\ttransition: max-height 0.5s cubic-bezier(0, 1, 0, 1);\n}\n.linonetwo-template-list-container:hover {\n  opacity: 1;\n\tmax-height: 400px;\n\ttransition: max-height 1s ease-in-out;\n}\n\n.linonetwo-template-list-search {\n  width: 100%;\n  height: 2em;\n}\n\n.linonetwo-template-list {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));\n  grid-auto-rows: 1fr;\n  gap: 16px;\n  max-height: calc(400px - 4em);\n  overflow: hidden;\n}\n/**\n* only have scroll bar when hover\n*/\n.linonetwo-template-list:hover {\n  overflow-y: overlay;\n}\n\n.linonetwo-template-list-item-container {\n  background: unset !important;\n  border: none !important;\n  padding: 0 !important;\n  margin: 0 1px !important;\n  background-color: unset !important;\n}\n\n.linonetwo-template-list-item-content {\n  height: 249px;\n  width: 100%;\n  border-radius: 3px;\n  background: #white;\n  box-shadow: rgb(15 15 15 / 20%) 0px 0px 0px 1px, rgb(15 15 15 / 20%) 0px 2px 4px;\n  overflow: hidden;\n  user-select: none;\n  cursor: pointer;\n  position: static;\n  display: flex;\n  flex-direction: column;\n}\n\n\n.linonetwo-template-list-item-new {\n  justify-content: center;\n  align-items: center;\n  opacity: 0.5;\n}\n.linonetwo-template-list-item-new:hover {\n  opacity: 1;\n}\n\n.linonetwo-template-list-item-content p {\n  margin: 5px;\n  margin-bottom: 0;\n  text-align: start;\n}\n"},"$:/plugins/linonetwo/template-list/template-list-item":{"title":"$:/plugins/linonetwo/template-list/template-list-item","creator":"LinOnetwo","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define template-list-item()\n\\whitespace trim\n\n<$button class=\"linonetwo-template-list-item-container\" >\n\n  <$reveal type=\"match\" stateTitle=<<target>> stateField=\"draft.of\" text=\"\">\n    <$action-createtiddler $basetitle=<<target>> $overwrite=yes $template=<<currentTiddler>> >\n      <!-- When copy the tag, we should remove the $:/tags/TextEditor/Template , otherwise new tiddler will become a template too -->\n      <$action-setfield $tiddler=<<target>> $field=\"tags\" $value={{{ [<currentTiddler>get[tags]split[ ]] +[remove[$:/tags/TextEditor/Template]] +[join[ ]] }}} />\n    </$action-createtiddler>\n  </$reveal>\n\n  <!-- Fix draft tiddler 's fields get overwrite by the createtiddler https://github.com/Jermolene/TiddlyWiki5/issues/4411#issuecomment-1015526629\n    And only do this in edit mode (has `draft.of` field).\n  -->\n  <$reveal type=\"nomatch\" stateTitle=<<target>> stateField=\"draft.of\" text=\"\">\n    <$action-createtiddler $basetitle=<<target>> $overwrite=yes $template=<<currentTiddler>> >\n      <!-- When copy the tag, we should remove the $:/tags/TextEditor/Template , otherwise new tiddler will become a template too -->\n      <$action-setfield $tiddler=<<target>> $field=\"tags\" $value={{{ [<currentTiddler>get[tags]split[ ]] +[remove[$:/tags/TextEditor/Template]] +[join[ ]] }}} />\n      <$action-setfield $tiddler=<<target>> $field=\"draft.of\" $value=<<draftOf>> />\n      <$action-setfield $tiddler=<<target>> $field=\"draft.title\" $value=<<targetTitle>> />\n    </$action-createtiddler>\n  </$reveal>\n\n\n  <div class=\"linonetwo-template-list-item-content\">\n    <div style=\"witdh: 100%; height: 180px; overflow: hidden;\">\n      <$reveal stateTitle=<<currentTiddler>> stateField=\"page-cover\" type=\"nomatch\" text=\"\">\n        <$image source={{{ [<currentTiddler>get[page-cover]] }}} width=\"100%\" height=\"auto\"/>\n      </$reveal>\n      <$wikify name=\"rendered\" text={{{ [<currentTiddler>get[text]] }}} output=html><<rendered>></$wikify>\n    </div>\n\n    <div style=\"width: 100%; padding: 8px 10px 10px; height: 69px; display: flex; flex-direction: row;\">\n\n      <$reveal stateTitle=<<currentTiddler>> stateField=\"icon\" type=\"nomatch\" text=\"\">\n        <div>\n          <$list filter=\"[<currentTiddler>get[icon]]\" variable=\"icon\">\n            <$list filter=\"[title<icon>is[shadow]]\"><$transclude tiddler=<<icon>>/></$list>\n            <$list filter=\"[title<icon>is[tiddler]]\"><$transclude tiddler=<<icon>>/></$list>\n            <$list filter=\"[title<icon>!is[shadow]!is[tiddler]]\">\n              <$wikify name=\"rendered\" text=<<icon>> output=html><<rendered>></$wikify>\n            </$list>\n          </$list>\n        </div>\n      </$reveal>\n      ''<$text text=<<currentTiddler>> />''\n    </div>\n  </div>\n</$button>\n\\end\n\n\\define template-list-item-new()\n\\whitespace trim\n\n<$button class=\"linonetwo-template-list-item-container\" >\n  <$action-createtiddler>\n    <$action-sendmessage $message=\"tm-new-tiddler\" param={{$:/state/search-template-list/input}} tags=\"$:/tags/TextEditor/Template\" />\n  </$action-createtiddler>\n  <div class=\"linonetwo-template-list-item-content linonetwo-template-list-item-new\">\n    {{$:/core/images/new-button}}\n  </div>\n</$button>\n\\end\n"},"$:/plugins/linonetwo/template-list/template-list":{"title":"$:/plugins/linonetwo/template-list/template-list","creator":"LinOnetwo","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define template-list()\n\\whitespace trim\n\n<div class=\"linonetwo-template-list-container\">\n  <!-- show search bar if there are at least one template -->\n  <$list filter=\"[all[tiddlers+shadows]tag[$:/tags/TextEditor/Template]!is[draft]count[]compare:number:gt[0]]\">\n    <$edit-text tiddler=\"$:/state/search-template-list/input\" default=\"\" placeholder=\"search template name\" tag=input class=\"linonetwo-template-list-search\" />\n  </$list>\n\n\n  <div class=\"linonetwo-template-list\">\n    <$let target=<<currentTiddler>> targetTitle={{{ [<target>get[draft.title]] ~[<target>get[title]] }}} search={{{ [[$:/state/search-template-list/input]get[text]] }}} draftOf={{{ [<target>get[draft.of]] }}} >\n      <$list filter=\"[all[tiddlers+shadows]tag[$:/tags/TextEditor/Template]!is[draft]search:title,name,description,readme<search>]\">\n        <<template-list-item>>\n      </$list>\n    </$let>\n    <<template-list-item-new>>\n  </div>\n</div>\n\n\\end\n"},"$:/plugins/linonetwo/template-list/toolbar/ToggleTemplateList":{"title":"$:/plugins/linonetwo/template-list/toolbar/ToggleTemplateList","tags":"$:/tags/ViewToolbar","caption":"{{$:/core/images/stamp}} <<lingo ToggleTemplateList $:/plugins/linonetwo/template-list/language/>>","description":"<<lingo ToggleTemplateListDescription $:/plugins/linonetwo/template-list/language/>>","text":"\\whitespace trim\n\\define lingo-base() $:/plugins/linonetwo/template-list/language/\n\n<%if [<currentTiddler>!has:field[_is_skinny]!has[text]] %>\n  <$wikify name=\"ToggleTemplateList\" text=\"<<lingo ToggleTemplateList>>\" mode=\"inline\">\n    <$button\n      tooltip=<<ToggleTemplateList>>\n      aria-label=<<ToggleTemplateList>>\n      class=<<tv-config-toolbar-class>>\n      set=\"$:/state/open-template-list\"\n      setTo={{{ [[$:/state/open-template-list]get[text]compare:string:eq[yes]then[no]else[yes]] }}}\n    >\n      <$list filter=\"[<tv-config-toolbar-icons>match[yes]]\">\n        {{$:/core/images/stamp}}\n      </$list>\n      <$list filter=\"[<tv-config-toolbar-text>match[yes]]\">\n        <span class=\"tc-btn-text\">\n          <$text text=<<ToggleTemplateList>>/>\n        </span>\n      </$list>\n    </$button>\n  </$wikify>\n<% endif %>"},"$:/plugins/linonetwo/template-list/tree":{"title":"$:/plugins/linonetwo/template-list/tree","text":"<<tree prefix:\"$:/plugins/linonetwo/template-list/\">>"}}}