[{"title":"$:/plugins/NoteStreams/streams-states","created":"20250201170849483","text":"{\n    \"tiddlers\": {\n        \"$:/plugins/linonetwo/streams-outliner-lib/templates/stream-row-body\": {\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/templates/stream-row-body\",\n            \"created\": \"20250116045135514\",\n            \"text\": \"<$list filter=\\\"[all[current]get[stream-type]match[fused]]\\\" emptyMessage=\\\"\\\"\\\"<$transclude mode=\\\"block\\\"/>\\\"\\\"\\\">\\n  <$transclude tiddler={{!!text}} mode=\\\"block\\\"/>\\n</$list>\",\n            \"modified\": \"20250116045243371\"\n        },\n        \"$:/plugins/linonetwo/streams-outliner-lib/nodes-list-template\": {\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/nodes-list-template\",\n            \"created\": \"20250116164218097\",\n            \"text\": \"\\\\import [[$:/plugins/linonetwo/streams-outliner-lib/action-macros]] [all[shadows+tiddlers]tag[$:/tags/streams/actionmacros]]  [all[shadows+tiddlers]tag[$:/tags/streams/user-actionmacros]]\\n\\\\whitespace trim\\n\\n<$vars stream-root-title=<<currentTiddler>>\\n\\tcontextmenu-state=<<qualify \\\"$:/state/sq-context-popup\\\">>\\n\\trow-edit-state=<<qualify \\\"$:/state/sq/streams/current-edit-tiddler\\\">>\\n\\tdrag-title-state=<<qualify \\\"$:/state/sq/streams/current-drag-title\\\">>\\n\\tdrag-title-nextsibling-state=<<qualify \\\"$:/state/sq/streams/current-drag-nextsibling\\\">> \\n>\\n\\t<$eventcatcher\\n\\t\\tevents=\\\"click\\\"\\n\\t\\tselector=\\\".stream-node-ctrl-btn\\\"\\n\\t\\tactions-click=<<node-ctrl-btn-actions>>\\n\\t\\ttag=\\\"div\\\"\\n\\t>\\n\\t<$eventcatcher\\n\\t\\tevents=\\\"dblclick swiped-right swiped-left\\\"\\n\\t\\ttag=\\\"div\\\"\\n\\t\\tselector=\\\".stream-row\\\"\\n\\t\\tactions-dblclick=<<toggle-row-edit-state>>\\n\\t\\tactions-swiped-right=<<swiped-right-actions>>\\n\\t\\tactions-swiped-left=<<swiped-left-actions>>\\n\\t>\\n\\t<$eventcatcher\\n\\t\\ttag=\\\"div\\\"\\n\\t\\tevents=\\\"contextmenu\\\"\\n\\t\\tselector=\\\".sq-contextmenu-container\\\"\\n\\t\\tactions-contextmenu=<<oncontext-menu-actions>>\\n\\t>\\n\\t<$swiper\\n\\t\\ttag=\\\"div\\\"\\n\\t\\tenable={{$:/config/sq/streams/swipe-enabled}}\\n\\t\\tswipethreshold={{$:/config/sq/streams/swipe-threshold}}\\n\\t>\\n\\t<div class={{{ stream-root [{$:/state/sq/nodes/global-drag-state}match[yes]then[stream-dragactive]] [<currentTiddler>!has[stream-list]then[stream-newlist]] +[join[ ]] }}}>\\n\\t\\t{{||$:/plugins/linonetwo/streams-outliner-lib/templates/stream-root-template}}\\n\\t\\t<$list filter=\\\"[all[current]match<stream-root-title>]\\\" variable=\\\"_NULL\\\">\\n\\t\\t\\t<!-- if we are the root, add a button to add more nodes-->\\n\\t\\t\\t<div class=\\\"stream-row\\\">\\n\\t\\t\\t\\t<div class=\\\"stream-node-control stream-node-control-addnew\\\">\\n\\t\\t\\t\\t\\t<div class=\\\"stream-node-collapser\\\">\\n\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t<div class=\\\"stream-node-handle\\\">\\n\\t\\t\\t\\t\\t\\t<$button tag=\\\"div\\\" class=\\\"tc-btn-invisible\\\" tooltip=\\\"add node\\\" actions=<<add-new-node-actions>> >\\n\\t\\t\\t\\t\\t\\t\\t{{$:/plugins/linonetwo/streams-outliner-lib/icons/new-node-btn}}\\n\\t\\t\\t\\t\\t\\t</$button>\\n\\t</div>\\n\\t\\t\\t\\t\\t<$list filter=\\\"[all[shadows+tiddlers]tag[$:/tags/streams/root-buttons]]\\\" variable=\\\"btnTiddler\\\">\\n\\t\\t\\t\\t\\t\\t<div class=\\\"stream-node-handle\\\">\\n\\t\\t\\t\\t\\t\\t\\t<$transclude tiddler=<<btnTiddler>>/>\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</$list>\\n\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t<div class=\\\"stream-node-block\\\">\\n\\t\\t\\t\\t\\t<!--consider moving last child dropzone in here, though thats for children too-->\\n\\t\\t\\t\\t</div>\\n\\t\\t\\t</div>\\t\\t\\t\\t\\n\\t\\t\\t<$set name=\\\"currentTiddler\\\" filter=\\\"[<contextmenu-state>get[current]]\\\">\\n\\t\\t\\t\\t{{||$:/plugins/linonetwo/streams-outliner-lib/contextmenu/contextmenu-template}}\\n\\t\\t\\t</$set>\\n\\t\\t</$list>\\t\\n\\t</div>\\n\\t</$swiper>\\n\\t</$eventcatcher>\\n\\t</$eventcatcher>\\n\\t</$eventcatcher>\\n</$vars>\\n\",\n            \"modified\": \"20250117190107585\"\n        },\n        \"$:/plugins/NoteStreams/streams-states/unfuse-icon\": {\n            \"created\": \"20250201223028921\",\n            \"text\": \"<svg version=\\\"1.0\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"15.000000pt\\\" viewBox=\\\"0 0 64.000000 64.000000\\\" preserveAspectRatio=\\\"xMidYMid meet\\\">\\n  <g transform=\\\"translate(64.000000,64.000000) scale(-0.100000,-0.100000)\\\" fill=\\\"#000000\\\" stroke=\\\"none\\\">\\n    <path d=\\\"M116 558 c-20 -28 -20 -48 0 -76 20 -28 68 -29 91 -2 27 31 38 25 67 -35 18 -38 37 -62 61 -76 19 -12 32 -25 29 -30 -3 -5 -59 -9 -124 -9 -110 0 -119 1 -125 20 -13 41 -81 39 -105 -3 -13 -24 -13 -30 0 -54 24 -42 92 -44 105 -3 6 19 15 20 125 20 65 0 121 -4 125 -10 3 -5 -8 -16 -25 -25 -32 -16 -43 -43 -12 -29 9 4 50 9 90 12 69 4 72 3 72 -18 0 -16 4 -20 16 -16 24 9 134 88 134 96 0 8 -131 100 -143 100 -4 0 -7 -9 -7 -20 0 -18 -6 -20 -62 -19 -35 0 -71 4 -81 8 -10 4 -33 34 -50 66 -18 33 -42 64 -54 70 -13 5 -23 13 -23 17 0 3 -7 14 -16 22 -23 24 -70 20 -88 -6z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z m419 -230 c0 -13 -79 -59 -85 -50 -3 5 -33 10 -66 10 l-59 0 0 40 0 40 59 0 c33 0 63 5 66 10 6 9 85 -37 85 -50z m-519 30 c23 -13 25 -43 3 -61 -31 -26 -70 25 -44 56 15 18 16 18 41 5z\\\"/>\\n    <path d=\\\"M280 200 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0 -10 -4 -10 -10z\\\"/>\\n    <path d=\\\"M116 158 c-20 -28 -20 -48 0 -76 10 -14 26 -22 44 -22 28 0 60 22 60 41 0 5 6 9 13 9 16 0 53 38 45 46 -4 3 -15 0 -27 -8 -18 -11 -23 -10 -41 10 -27 29 -74 29 -94 0z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z\\\"/>\\n  </g>\\n</svg>\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/NoteStreams/streams-states/unfuse-icon\",\n            \"modified\": \"20250201223038289\"\n        },\n        \"$:/plugins/linonetwo/streams-outliner-lib/stream-view-template\": {\n            \"created\": \"20250116052807024\",\n            \"text\": \"\\\\define stream-dynamic-styles(\\n  outlinerID,\\n  enableEditToolbar,\\n  nodeMaxWidth\\n)\\n<%if [[$enableEditToolbar$]compare:string:eq[no]] %>\\n  <style>\\n    #$outlinerID$ .stream-node-block .tc-editor-toolbar {\\n      display: none;\\n    }\\n  </style>\\n<%endif%>\\n<style>\\n  #$outlinerID$ .stream-node-block {\\n    max-width: $nodeMaxWidth$;\\n  }\\n  #$outlinerID$ span.sq-breadcrumbs-fragment {\\n    max-width: calc($nodeMaxWidth$ - 50px);\\n  }\\n</style>\\n\\\\end\\n\\n\\\\procedure stream-outliner(\\n  currentTiddler,\\n  id,\\n  enableEditToolbar:\\\"no\\\",\\n  nodeMaxWidth:100%,\\n  newNodeTitle:\\\"\\\"\\\"<<stream-root-title>>/<<now \\\"[UTC]YYYY0MM0DD0hh0mm0ssXXX\\\">>\\\"\\\"\\\",\\n  newNodeTiddlerTemplate,\\n)\\n\\\\whitespace trim\\n<$set name=outlinerID value=<<id>> emptyValue=<<qualify \\\"stream-outliner\\\">>>\\n  <div id=<<outlinerID>>>\\n    <$transclude\\n      $variable=\\\"stream-dynamic-styles\\\"\\n      outlinerID=<<outlinerID>>\\n      enableEditToolbar=<<enableEditToolbar>>\\n      nodeMaxWidth=<<nodeMaxWidth>>\\n    />\\n\\n<$vars currentTiddler=<<currentTiddler>>>\\n<div class=\\\"se-section\\\">\\n  <header class=\\\"se-sectionheader\\\">\\n    <$button class=\\\"tc-btn-invisible\\\" actions=\\\"\\\"\\\"<$action-setfield $field=\\\"se-collapsed\\\" $value={{{ [<currentTiddler>get[se-collapsed]match[yes]then[no]else[yes]] }}}/>\\\"\\\"\\\">\\n      <h2>\\n        <$list filter=\\\"[<currentTiddler>has[caption]]\\\" emptyMessage={{!!title}}>\\n          {{!!caption}}\\n        </$list>\\n      </h2>\\n      <$list filter=\\\"[<currentTiddler>get[se-collapsed]match[yes]]\\\" emptyMessage=\\\"{{$:/core/images/down-arrow}}\\\" variable=\\\"null\\\">\\n        {{$:/core/images/right-arrow}}\\n      </$list>\\n    </$button>\\n  </header>\\n\\n  <$list filter=\\\"[<currentTiddler>!has[se-collapsed]] [<currentTiddler>get[se-collapsed]!match[yes]]\\\" variable=\\\"null\\\">\\n    <div class=\\\"se-sectionbody\\\">\\n      <!-- Check stream-type and conditionally render -->\\n      <$list filter=\\\"[<currentTiddler>get[stream-type]match[fused]]\\\" variable=\\\"NULL\\\" emptyMessage=\\\"\\\"\\\"\\n        <!-- Default node-list template for non-fused nodes -->\\n        {{||$:/plugins/linonetwo/streams-outliner-lib/nodes-list-template}}\\n      \\\"\\\"\\\">\\n        <!-- Direct transclude for fused nodes -->\\n        {{||$:/plugins/NoteStreams/States/editorTemplate}}\\n        {{||$:/plugins/NoteStreams/streams-states/unfuse}}\\n      </$list>\\n    </div>\\n  </$list>\\n</div>\\n</$vars>\\n\\\\end\\n\\n\\\\procedure stream-outliner-breadcrumbs(\\n  currentTiddler,\\n  enableEditToolbar,\\n  nodeMaxWidth,\\n  newNodeTitle,\\n  newNodeTiddlerTemplate,\\n)\\n<<stream-show-breadcrumbs>>\\n\\n<$transclude\\n  $variable=\\\"stream-outliner\\\"\\n  currentTiddler=<<currentTiddler>>\\n  enableEditToolbar=<<enableEditToolbar>>\\n  nodeMaxWidth=<<nodeMaxWidth>>\\n  newNodeTitle=<<newNodeTitle>>\\n  newNodeTiddlerTemplate=<<newNodeTiddlerTemplate>>\\n/>\\n\\\\end\\n\\n<style>\\n.se-section {\\n  margin-bottom: 5px;\\n}\\n\\n.se-sectionheader button {\\n  width: 100%;\\n  display: inline-flex;\\n  align-items: center;\\n  justify-content: space-between;\\n  border-bottom: 1px solid #ccc;\\n  padding-bottom: 3px;\\n}\\n\\n.se-sectionheader button h2 {\\n  margin: 0;\\n  padding: 0;\\n  text-align: left;\\n}\\n\\n.se-sectionbody {\\n  padding: 8px;\\n}\\n</style>\",\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/stream-view-template\",\n            \"tags\": \"$:/tags/Global\",\n            \"modified\": \"20250201223251337\"\n        },\n        \"$:/plugins/NoteStreams/States/editorTemplate\": {\n            \"created\": \"20250201223201780\",\n            \"text\": \"<div class=\\\"se-section\\\">\\n    <$vars currentTiddler=<<stream-root-title>> \\n           editTid={{{ [[$:/temp/edit/]addsuffix<stream-root-title>] }}}\\n           stateTid={{{ [[$:/state/edit/]addsuffix<stream-root-title>] }}}>\\n        \\n        <$reveal stateTitle=<<stateTid>> type=\\\"nomatch\\\" text=\\\"edit\\\">\\n            <div class=\\\"se-section-toolbar\\\">\\n                <$button class=\\\"tc-btn-invisible\\\">\\n                    <$action-setfield $tiddler=<<stateTid>> text=\\\"edit\\\"/>\\n                    <$action-setfield $tiddler=<<editTid>> text={{{[<currentTiddler>get[text]]}}}/>\\n                    {{$:/core/images/edit-button}}\\n                </$button>\\n            </div>\\n            <$transclude tiddler=<<currentTiddler>> mode=\\\"block\\\"/>\\n        </$reveal>\\n        \\n        <$reveal stateTitle=<<stateTid>> type=\\\"match\\\" text=\\\"edit\\\">\\n            <div class=\\\"se-section-edit\\\">\\n                <$edit-text tiddler=<<editTid>> class=\\\"tc-edit-texteditor\\\"/>\\n                <div class=\\\"se-section-toolbar\\\">\\n                    <$button class=\\\"tc-btn-invisible\\\">\\n                        <$action-deletetiddler $tiddler=<<editTid>>/>\\n                        <$action-deletetiddler $tiddler=<<stateTid>>/>\\n                        {{$:/core/images/cancel-button}}\\n                    </$button>\\n                    \\n                    <$button class=\\\"tc-btn-invisible\\\">\\n                        <$action-setfield $tiddler=<<currentTiddler>> text={{{[<editTid>get[text]]}}}/>\\n                        <$action-deletetiddler $tiddler=<<editTid>>/>\\n                        <$action-deletetiddler $tiddler=<<stateTid>>/>\\n                        {{$:/core/images/done-button}}\\n                    </$button>\\n                </div>\\n            </div>\\n        </$reveal>\\n        \\n    </$vars>\\n</div>\",\n            \"title\": \"$:/plugins/NoteStreams/States/editorTemplate\",\n            \"tags\": \"\",\n            \"modified\": \"20250201223208365\",\n            \"stream-type\": \"default\"\n        },\n        \"$:/plugins/NoteStreams/streams-states/macros\": {\n            \"created\": \"20250201230157061\",\n            \"text\": \"\\\\define pattern() (</[^>]+>)\\n\\\\define formatter() $1<br>\\n\\n\\\\define convert-stream-to-tiddlers(tiddler)\\n<$vars currentTiddler=<<tiddler>> openBrackets=\\\"[[\\\" closeBrackets=\\\"]]\\\">\\n    <$action-setfield $tiddler=\\\"$:/temp/new-list\\\" list=\\\"\\\"/>\\n    <$set name=\\\"parentTitle\\\" value={{{ [<currentTiddler>get[title]] }}}>\\n        <$set name=\\\"parentStreamList\\\" value={{{ [<currentTiddler>get[stream-list]] }}}>\\n            <$action-setfield $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\" text=\\\"\\\"/>\\n            <$action-setfield $tiddler=\\\"$:/temp/last-non-asterisk\\\" text=\\\"\\\"/>\\n            \\n            <$list filter=\\\"[<currentTiddler>get[text]split[<br>]]\\\" variable=\\\"part\\\" counter=\\\"partIndex\\\">\\n                <$set name=\\\"cleanPart\\\" value={{{ [<part>trim[]!is[blank]] }}}>\\n                    <$list filter=\\\"[<cleanPart>!is[blank]]\\\">\\n                        <$set name=\\\"leadingPart\\\" value={{{ [<cleanPart>split[ ]first[]] }}}>\\n                            <$set name=\\\"leadingPartLen\\\" value={{{ [<leadingPart>length[]] }}}>\\n                                <$set name=\\\"leadingPartNoA\\\" value={{{ [<leadingPart>search-replace:g:regexp[\\\\*],]length[]] }}}>\\n                                    <$set name=\\\"startsWithAsterisk\\\" value={{{ [<leadingPart>prefix[*]then[yes]else[no]] }}}>\\n                                        <$set name=\\\"asteriskCount\\\" value={{{ [<startsWithAsterisk>match[yes]then<leadingPartLen>subtract<leadingPartNoA>else[0]] }}}>\\n                                            <$set name=\\\"contentWithoutAsterisks\\\" value={{{ [<cleanPart>search-replace:g:regexp[^\\\\*+\\\\s*],[]trim[]] }}}>\\n                                                \\n                                                <!-- First check for existing match -->\\n                                                <$set name=\\\"matchedTiddler\\\" value={{{ [<parentTitle>get-stream-nodes[]] :filter[get[text]search-replace:g:regexp[\\\\*\\\\s*],[]match<contentWithoutAsterisks>] :and[first[]] }}}>\\n                                                    \\n                                                    <!-- If match found, handle existing content -->\\n                                                    <$list filter=\\\"[<matchedTiddler>!is[blank]!match<parentTitle>]\\\">\\n                                                        <$set name=\\\"currentParent\\\" value={{{ [<matchedTiddler>get[parent]] }}}>\\n                                                            <$list filter=\\\"[<currentParent>!is[blank]]\\\">\\n                                                                <$action-listops \\n                                                                    $tiddler=<<currentParent>>\\n                                                                    $field=\\\"stream-list\\\"\\n                                                                    $subfilter=\\\"-[<matchedTiddler>]\\\"\\n                                                                />\\n                                                            </$list>\\n                                                            \\n                                                            <!-- Update text if needed -->\\n                                                            <$action-setfield \\n                                                                $tiddler=<<matchedTiddler>>\\n                                                                text=<<contentWithoutAsterisks>>\\n                                                            />\\n                                                            \\n                                                            <$list filter=\\\"[<asteriskCount>match[0]]\\\">\\n                                                                <$set name=\\\"wrappedTitle\\\" value={{{ [<matchedTiddler>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                    <$action-listops \\n                                                                        $tiddler=\\\"$:/temp/new-list\\\" \\n                                                                        $field=\\\"list\\\" \\n                                                                        $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                    />\\n                                                                    <$action-setfield \\n                                                                        $tiddler=<<matchedTiddler>>\\n                                                                        parent=<<parentTitle>>\\n                                                                    />\\n                                                                    <$action-setfield \\n                                                                        $tiddler=\\\"$:/temp/last-non-asterisk\\\"\\n                                                                        text=<<matchedTiddler>>\\n                                                                    />\\n                                                                </$set>\\n                                                            </$list>\\n                                                            \\n                                                            <$list filter=\\\"[<asteriskCount>match[1]]\\\">\\n                                                                <$set name=\\\"wrappedTitle\\\" value={{{ [<matchedTiddler>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                    <$action-listops \\n                                                                        $tiddler={{{ [[$:/temp/last-non-asterisk]get[text]] }}}\\n                                                                        $field=\\\"stream-list\\\"\\n                                                                        $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                    />\\n                                                                    <$action-setfield \\n                                                                        $tiddler=<<matchedTiddler>>\\n                                                                        parent={{{ [[$:/temp/last-non-asterisk]get[text]] }}}\\n                                                                    />\\n                                                                </$set>\\n                                                                <$action-setfield \\n                                                                    $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\" \\n                                                                    $index=\\\"1\\\"\\n                                                                    $value=<<matchedTiddler>>\\n                                                                />\\n                                                            </$list>\\n                                                            \\n                                                            <$list filter=\\\"[<asteriskCount>compare:number:gt[1]]\\\">\\n                                                                <$set name=\\\"parentDepth\\\" value={{{ [<asteriskCount>subtract[1]] }}}>\\n                                                                    <$set name=\\\"wrappedTitle\\\" value={{{ [<matchedTiddler>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                        <$action-listops \\n                                                                            $tiddler={{{ [[$:/temp/last-tiddler-by-depth]getindex<parentDepth>] }}}\\n                                                                            $field=\\\"stream-list\\\"\\n                                                                            $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                        />\\n                                                                        <$action-setfield \\n                                                                            $tiddler=<<matchedTiddler>>\\n                                                                            parent={{{ [[$:/temp/last-tiddler-by-depth]getindex<parentDepth>] }}}\\n                                                                        />\\n                                                                    </$set>\\n                                                                    <$action-setfield \\n                                                                        $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\" \\n                                                                        $index=<<asteriskCount>>\\n                                                                        $value=<<matchedTiddler>>\\n                                                                    />\\n                                                                </$set>\\n                                                            </$list>\\n                                                        </$set>\\n                                                    </$list>\\n                                                    \\n                                                    <!-- Only if no match found, create new node -->\\n                                                    <$list filter=\\\"[<matchedTiddler>is[blank]]\\\">\\n                                                        <$set name=\\\"newNodeTitle\\\" value={{{ [<parentTitle>addsuffix[/]addsuffix<partIndex>addsuffix[/]addsuffix<now [UTC]YYYY0MM0DD0hh0mm0ssXXX>] }}}>\\n                                                            <$list filter=\\\"[<asteriskCount>match[0]]\\\">\\n                                                                <$action-createtiddler \\n                                                                    $basetitle=<<newNodeTitle>> \\n                                                                    text=<<contentWithoutAsterisks>>\\n                                                                    type=\\\"text/vnd.tiddlywiki\\\"\\n                                                                    stream-type=\\\"default\\\"\\n                                                                    parent=<<parentTitle>>\\n                                                                />\\n                                                                <$set name=\\\"wrappedTitle\\\" value={{{ [<newNodeTitle>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                    <$action-listops \\n                                                                        $tiddler=\\\"$:/temp/new-list\\\" \\n                                                                        $field=\\\"list\\\" \\n                                                                        $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                    />\\n                                                                </$set>\\n                                                                <$action-setfield \\n                                                                    $tiddler=\\\"$:/temp/last-non-asterisk\\\"\\n                                                                    text=<<newNodeTitle>>\\n                                                                />\\n                                                            </$list>\\n\\n                                                            <$list filter=\\\"[<asteriskCount>match[1]]\\\">\\n                                                                <$action-createtiddler \\n                                                                    $basetitle=<<newNodeTitle>> \\n                                                                    text=<<contentWithoutAsterisks>>\\n                                                                    type=\\\"text/vnd.tiddlywiki\\\"\\n                                                                    stream-type=\\\"default\\\"\\n                                                                    parent={{{ [[$:/temp/last-non-asterisk]get[text]] }}}\\n                                                                />\\n                                                                <$set name=\\\"wrappedTitle\\\" value={{{ [<newNodeTitle>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                    <$action-listops \\n                                                                        $tiddler={{{ [[$:/temp/last-non-asterisk]get[text]] }}}\\n                                                                        $field=\\\"stream-list\\\"\\n                                                                        $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                    />\\n                                                                </$set>\\n                                                                <$action-setfield \\n                                                                    $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\" \\n                                                                    $index=\\\"1\\\"\\n                                                                    $value=<<newNodeTitle>>\\n                                                                />\\n                                                            </$list>\\n\\n                                                            <$list filter=\\\"[<asteriskCount>compare:number:gt[1]]\\\">\\n                                                                <$set name=\\\"parentDepth\\\" value={{{ [<asteriskCount>subtract[1]] }}}>\\n                                                                    <$action-createtiddler \\n                                                                        $basetitle=<<newNodeTitle>> \\n                                                                        text=<<contentWithoutAsterisks>>\\n                                                                        type=\\\"text/vnd.tiddlywiki\\\"\\n                                                                        stream-type=\\\"default\\\"\\n                                                                        parent={{{ [[$:/temp/last-tiddler-by-depth]getindex<parentDepth>] }}}\\n                                                                    />\\n                                                                    <$set name=\\\"wrappedTitle\\\" value={{{ [<newNodeTitle>addprefix<openBrackets>addsuffix<closeBrackets>] }}}>\\n                                                                        <$action-listops \\n                                                                            $tiddler={{{ [[$:/temp/last-tiddler-by-depth]getindex<parentDepth>] }}}\\n                                                                            $field=\\\"stream-list\\\"\\n                                                                            $subfilter=\\\"+[append<wrappedTitle>] -[<currentTiddler>]\\\"\\n                                                                        />\\n                                                                    </$set>\\n                                                                    <$action-setfield \\n                                                                        $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\" \\n                                                                        $index=<<asteriskCount>>\\n                                                                        $value=<<newNodeTitle>>\\n                                                                    />\\n                                                                </$set>\\n                                                            </$list>\\n                                                        </$set>\\n                                                    </$list>\\n                                                </$set>\\n                                            </$set>\\n                                        </$set>\\n                                    </$set>\\n                                </$set>\\n                            </$set>\\n                        </$set>\\n                    </$list>\\n                </$set>\\n            </$list>\\n\\n            <!-- Update stream-list and ensure no self-references -->\\n            <$action-setfield \\n                $tiddler=<<parentTitle>> \\n                stream-list={{{ [[$:/temp/new-list]get[list]] -[<currentTiddler>] }}}\\n            />\\n            \\n            <!-- Clean up temp values -->\\n            <$action-deletetiddler $tiddler=\\\"$:/temp/new-list\\\"/>\\n            <$action-deletetiddler $tiddler=\\\"$:/temp/last-tiddler-by-depth\\\"/>\\n            <$action-deletetiddler $tiddler=\\\"$:/temp/last-non-asterisk\\\"/>\\n        </$set>\\n    </$set>\\n</$vars>\\n\\\\end\\n\\n\\\\define export-row(start_depth:\\\"\\\", separator:\\\"\\\")\\n\\\\whitespace trim\\n<$let\\n    linebreak=\\\"<br>\\n\\\"\\n    depth={{{ [<currentTiddler>get-stream-root:includeall[]count[]subtract<start_depth>] }}}\\n    asterisks={{{ [<depth>subtract[2]compare:number:gt[0]] :map:flat[range{!!title}] :map[[*]] +[join[]addprefix[ ]] }}}\\n    regular={{{ [<currentTiddler>get[text]addprefix[ ]addprefix<asterisks>addsuffix<linebreak>] }}}\\n>\\n    <$text text=<<regular>> />\\n    <%if [<currentTiddler>has[stream-list]] %>\\n        <$list filter=\\\"[enlist{!!stream-list}is[tiddler]]\\\">\\n            <$macrocall $name=\\\"export-row\\\" start_depth=\\\"$start_depth$\\\" separator=\\\"$separator$\\\"/>\\n        </$list>\\n    <%endif%>\\n</$let>\\n\\\\end\\n\\n\\n\\\\define stream-export(tiddler:\\\"\\\", separator:\\\"\\\")\\n\\\\whitespace trim\\n    <$vars linebreak=\\\"<br>\\n\\\" currentTiddler=\\\"$tiddler$\\\" separator=\\\"$separator$\\\">\\n        <$set name=\\\"start_depth\\\" filter=\\\"[<currentTiddler>get-stream-root:includeall[]count[]subtract[1]]\\\">\\n        <!-- Remove this section that was including root tiddler content\\n        <$list filter=\\\"[<currentTiddler>has[text]]\\\">\\n            <$set name=\\\"rootcontent\\\" filter=\\\"[<currentTiddler>get[text]addsuffix<linebreak>]\\\" select=\\\"0\\\">\\n                <$text text=<<rootcontent>> />\\n            </$set>\\n        </$list>\\n        -->\\n        <$list filter=\\\"[enlist{!!stream-list}is[tiddler]]\\\">\\n            <$macrocall $name=\\\"export-row\\\" start_depth=<<start_depth>> separator=<<separator>> />\\n        </$list>\\n        </$set>\\n    </$vars>\\n\\\\end\\n\\n\\n\\\\define fuse-handler(action:\\\"new\\\", type:\\\"tree\\\")\\n<$vars separator={{$:/config/sq/streams-fusion/listformat!!text}}\\n    outputformat-config={{$:/config/sq/streams-fusion/outputformat!!text}} \\n    action=$action$ \\n    linebreak=\\\"\\n\\\" >\\n    <!-- generate wikitext output using stream-export macro for the root tiddler's children -->\\n    <$wikify name=\\\"wikitextoutput\\\" text=\\\"\\\"\\\"\\n        <$macrocall $name=\\\"stream-export\\\" tiddler=<<stream-root-title>> separator=<<separator>>/>\\n    \\\"\\\"\\\">\\n        <!-- generate raw HTML output -->\\n        <$wikify name=\\\"htmloutput\\\" text=<<wikitextoutput>> output=\\\"html\\\">\\n            <!-- pick the correct output based on configuration setting -->\\n            <$set name=\\\"output\\\" filter=\\\"[<outputformat-config>match[html]then<htmloutput>search-replace:g:regexp<pattern>,<formatter>else<wikitextoutput>]\\\" select=\\\"0\\\">\\n                <!-- handle action correctly between new tiddler, overwrite tiddler, copy to clipboard -->\\n                <$list filter=\\\"[<action>match[new]]\\\">\\n                    <<create-and-edit>>\\n                </$list>\\n\\n                <$list filter=\\\"[<action>match[overwrite]]\\\">\\n                    <$set name=\\\"currentTiddler\\\" value=<<stream-root-title>> >\\n                        <$set name=\\\"target\\\" value=<<stream-root-title>> >\\n                            <<overwrite-and-edit $type$>>\\n                        </$set>\\n                    </$set>\\n                </$list>\\n\\n                <$list filter=\\\"[<action>match[clipboard]]\\\">\\n                    <<copy-clipboard>>\\n                </$list>\\n            </$set>\\n        </$wikify>\\n    </$wikify>\\n</$vars>\\n\\\\end\\n\\n\\n\\\\define create-and-edit()\\n<$set name=\\\"outputformat\\\" value=\\\"$(outputformat-config)$\\\">\\n\\t<!-- as a courtesy, set the tiddler type to markdown when needed -->\\n\\t<$set name=\\\"tiddlertype\\\" filter=\\\"[<outputformat>match[markdown]then[text/x-markdown]else[text/vnd.tiddlywiki]]\\\" select=\\\"0\\\">\\n\\t\\t<$reveal type=\\\"match\\\" state=\\\"$:/config/sq/streams-fusion/editmode!!text\\\" text=\\\"yes\\\">\\n\\t\\t\\t<$action-sendmessage $message=\\\"tm-new-tiddler\\\" title=\\\"$(export-name)$\\\" text=<<output>> type=<<tiddlertype>> />\\n\\t\\t</$reveal>\\n\\t\\t<$reveal type=\\\"nomatch\\\" state=\\\"$:/config/sq/streams-fusion/editmode!!text\\\" text=\\\"yes\\\">\\n\\t\\t\\t<$action-createtiddler $basetitle=\\\"$(export-name)$\\\" text=<<output>> type=<<tiddlertype>> $overwrite=\\\"yes\\\" />\\n\\t\\t\\t<$action-navigate $to=<<export-name>> $scroll=\\\"yes\\\"/>\\n\\t\\t</$reveal>\\n\\t</$set>\\n</$set>\\n\\\\end\\n\\n\\n\\\\define overwrite-and-edit()\\n<$set name=\\\"outputformat\\\" value=\\\"$(outputformat-config)$\\\">\\n    <$action-confirm $message={{$:/plugins/phiv/streams-fusion/language##overwrite-warning-message}}>\\n        <$set name=\\\"tiddlertype\\\" filter=\\\"[<outputformat>match[markdown]then[text/x-markdown]else[text/vnd.tiddlywiki]]\\\" select=\\\"0\\\">\\n            <$action-setfield \\n                $tiddler=<<target>>\\n                $field=\\\"text\\\" \\n                $value=<<output>> \\n                type=<<tiddlertype>>\\n                stream-type=\\\"fused\\\" />\\n            <$list filter=\\\"[<target>get[stream-list]count[]!match[0]]\\\" variable=\\\"ignore\\\">\\n                <<delete-children>>\\n            </$list>\\n            <$action-deletefield $tiddler=<<target>> stream-list />\\n            <$reveal type=\\\"match\\\" state=\\\"$:/config/sq/streams-fusion/editmode!!text\\\" text=\\\"yes\\\">\\n                <$action-sendmessage $message=\\\"tm-edit-tiddler\\\" $param=<<target>> />\\n            </$reveal>\\n        </$set>\\n    </$action-confirm>\\n</$set>\\n\\\\end\\n\\n\\n\\\\define copy-clipboard() <$action-sendmessage $message=\\\"tm-copy-to-clipboard\\\" $param=<<output>>/>\\n\\n\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/NoteStreams/streams-states/macros\",\n            \"modified\": \"20250201230209745\"\n        },\n        \"$:/plugins/NoteStreams/streams-states/button.png\": {\n            \"created\": \"20250201230246307\",\n            \"text\": \"<svg version=\\\"1.0\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"  width=\\\"64.000000pt\\\" viewBox=\\\"0 0 64.000000 64.000000\\\"  preserveAspectRatio=\\\"xMidYMid meet\\\">  <g transform=\\\"translate(0.000000,64.000000) scale(0.100000,-0.100000)\\\" fill=\\\"#000000\\\" stroke=\\\"none\\\"> <path d=\\\"M116 558 c-20 -28 -20 -48 0 -76 20 -28 68 -29 91 -2 27 31 38 25 67 -35 18 -38 37 -62 61 -76 19 -12 32 -25 29 -30 -3 -5 -59 -9 -124 -9 -110 0 -119 1 -125 20 -13 41 -81 39 -105 -3 -13 -24 -13 -30 0 -54 24 -42 92 -44 105 -3 6 19 15 20 125 20 65 0 121 -4 125 -10 3 -5 -8 -16 -25 -25 -32 -16 -43 -43 -12 -29 9 4 50 9 90 12 69 4 72 3 72 -18 0 -16 4 -20 16 -16 24 9 134 88 134 96 0 8 -131 100 -143 100 -4 0 -7 -9 -7 -20 0 -18 -6 -20 -62 -19 -35 0 -71 4 -81 8 -10 4 -33 34 -50 66 -18 33 -42 64 -54 70 -13 5 -23 13 -23 17 0 3 -7 14 -16 22 -23 24 -70 20 -88 -6z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z m419 -230 c0 -13 -79 -59 -85 -50 -3 5 -33 10 -66 10 l-59 0 0 40 0 40 59 0 c33 0 63 5 66 10 6 9 85 -37 85 -50z m-519 30 c23 -13 25 -43 3 -61 -31 -26 -70 25 -44 56 15 18 16 18 41 5z\\\"/> <path d=\\\"M280 200 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0 -10 -4 -10 -10z\\\"/> <path d=\\\"M116 158 c-20 -28 -20 -48 0 -76 10 -14 26 -22 44 -22 28 0 60 22 60 41 0 5 6 9 13 9 16 0 53 38 45 46 -4 3 -15 0 -27 -8 -18 -11 -23 -10 -41 10 -27 29 -74 29 -94 0z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z\\\"/> </g> </svg>\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/NoteStreams/streams-states/button.png\",\n            \"modified\": \"20250201230255112\"\n        },\n        \"$:/plugins/NoteStreams/streams-states/unfuse\": {\n            \"created\": \"20250201223059995\",\n            \"text\": \"\\\\import $:/plugins/NoteStreams/streams-states/macros $:/plugins/sq/streams/contextmenu/contextmenu-template $:/plugins/sq/streams/delete-hook/actions\\n\\n\\n<$button class=\\\"tc-btn-invisible sq-contextmenu-itemwrapper\\\">\\n    <$vars currentTiddler=<<stream-root-title>> linebreak=\\\"<br>\\\">\\n        <$macrocall $name=\\\"convert-stream-to-tiddlers\\\" tiddler=<<stream-root-title>>/>\\n        <$action-setfield $tiddler=<<currentTiddler>> stream-type=\\\"default\\\"/>\\n       {{$:/plugins/NoteStreams/streams-states/unfuse-icon}}\\n    </$vars>\\n</$button>\\n\",\n            \"title\": \"$:/plugins/NoteStreams/streams-states/unfuse\",\n            \"type\": \"text/vnd.tiddlywiki\",\n            \"tags\": \"\",\n            \"revision\": \"2\",\n            \"modified\": \"20250201231112079\",\n            \"icon\": \"<svg version=\\\"1.0\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"  width=\\\"64.000000pt\\\" viewBox=\\\"0 0 64.000000 64.000000\\\"  preserveAspectRatio=\\\"xMidYMid meet\\\">  <g transform=\\\"translate(0.000000,64.000000) scale(0.100000,-0.100000)\\\" fill=\\\"#000000\\\" stroke=\\\"none\\\"> <path d=\\\"M116 558 c-20 -28 -20 -48 0 -76 20 -28 68 -29 91 -2 27 31 38 25 67 -35 18 -38 37 -62 61 -76 19 -12 32 -25 29 -30 -3 -5 -59 -9 -124 -9 -110 0 -119 1 -125 20 -13 41 -81 39 -105 -3 -13 -24 -13 -30 0 -54 24 -42 92 -44 105 -3 6 19 15 20 125 20 65 0 121 -4 125 -10 3 -5 -8 -16 -25 -25 -32 -16 -43 -43 -12 -29 9 4 50 9 90 12 69 4 72 3 72 -18 0 -16 4 -20 16 -16 24 9 134 88 134 96 0 8 -131 100 -143 100 -4 0 -7 -9 -7 -20 0 -18 -6 -20 -62 -19 -35 0 -71 4 -81 8 -10 4 -33 34 -50 66 -18 33 -42 64 -54 70 -13 5 -23 13 -23 17 0 3 -7 14 -16 22 -23 24 -70 20 -88 -6z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z m419 -230 c0 -13 -79 -59 -85 -50 -3 5 -33 10 -66 10 l-59 0 0 40 0 40 59 0 c33 0 63 5 66 10 6 9 85 -37 85 -50z m-519 30 c23 -13 25 -43 3 -61 -31 -26 -70 25 -44 56 15 18 16 18 41 5z\\\"/> <path d=\\\"M280 200 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0 -10 -4 -10 -10z\\\"/> <path d=\\\"M116 158 c-20 -28 -20 -48 0 -76 10 -14 26 -22 44 -22 28 0 60 22 60 41 0 5 6 9 13 9 16 0 53 38 45 46 -4 3 -15 0 -27 -8 -18 -11 -23 -10 -41 10 -27 29 -74 29 -94 0z m65 -8 c38 -21 12 -79 -31 -65 -22 7 -27 44 -8 63 15 15 15 15 39 2z\\\"/> </g> </svg>\",\n            \"bag\": \"default\",\n            \"stream-list\": \"\",\n            \"stream-type\": \"default\"\n        },\n        \"$:/plugins/NoteStreams/streams-states/fuse-button\": {\n            \"created\": \"20250201230216960\",\n            \"text\": \"\\\\import $:/plugins/NoteStreams/streams-states/macros $:/plugins/sq/streams/contextmenu/contextmenu-template $:/plugins/sq/streams/delete-hook/actions\\n\\n\\\\define menu-item(title,subtitle:\\\"\\\",actions:\\\"\\\")\\n\\t\\t<$button class=\\\"tc-menu-list-item tc-btn-invisible\\\" actions=<<__actions__>> >\\n\\t\\t\\t<span class=\\\"sq-contextmenu-itemwrapper\\\">\\n\\t\\t\\t\\t<span class=\\\"sq-contextmenu-itemtext\\\" style=\\\"font-weight: bold;\\\">$title$</span>\\n\\t\\t\\t</span>\\n\\t\\t</$button>\\n\\\\end\\n\\n\\\\define fuse-export() <$macrocall $name=\\\"stream-export\\\" tiddler=\\\"$(storyTiddler)$\\\" separator=\\\"$(separator)$\\\" />\\n\\n\\n<$vars fuse-menu-state=<<qualify \\\"$:/state/fuse-popup\\\">> target=<<storyTiddler>> >\\n    <$button class=\\\"tc-btn-invisible szen-streams-btn\\\" popup=<<fuse-menu-state>> >\\n        {{$:/plugins/NoteStreams/streams-states/button.png}}\\n    </$button>\\n        <$reveal type=\\\"popup\\\" state=<<fuse-menu-state>> position=\\\"aboveright\\\" tag=\\\"div\\\">\\n            <div class=\\\"tc-drop-down sq-contextmenu\\\">\\n                <$wikify name=\\\"export-name\\\" text={{$:/config/sq/streams-fusion/fused-tiddler-title!!text}} >\\n                    <$macrocall $name=\\\"menu-item\\\" title={{$:/plugins/phiv/streams-fusion/language##contextmenu-new}} actions=<<fuse-handler \\\"new\\\" \\\"\\\" \\\"$(stream-root-title)$\\\">> />\\n                    <$macrocall $name=\\\"menu-item\\\" title={{$:/plugins/phiv/streams-fusion/language##contextmenu-overwrite}} actions=<<fuse-handler \\\"overwrite\\\" \\\"\\\" \\\"$(stream-root-title)$\\\">> />\\n                    <$macrocall $name=\\\"menu-item\\\" title={{$:/plugins/phiv/streams-fusion/language##contextmenu-clipboard}} actions=<<fuse-handler \\\"clipboard\\\" \\\"\\\" \\\"$(stream-root-title)$\\\">> />\\n                    <<menu-divider>>\\n                    <span class=\\\"tc-popup-keep\\\" style=\\\"min-width:fit-content\\\">\\n                        &nbsp;&nbsp;<$link to=\\\"$:/plugins/sq/streams/Settings/config\\\">Quick settings :</$link>\\n                            <table><tr><th>list format</th><th>output</th></tr><tr>\\n                                <td>{{$:/config/sq/streams-fusion/listformat||$:/plugins/phiv/streams-fusion/ui/templates/settings/menu-radio-3}}</td>\\n                                <td>{{$:/config/sq/streams-fusion/outputformat||$:/plugins/phiv/streams-fusion/ui/templates/settings/menu-radio-2}}</td>\\n                            </tr></table>\\n                    </span>\\n                </$wikify>\\n            </div>\\n        </$reveal>\\n</$vars>\\n\",\n            \"tags\": \"$:/tags/streams/root-buttons\",\n            \"title\": \"$:/plugins/NoteStreams/streams-states/fuse-button\",\n            \"modified\": \"20250201231015428\"\n        },\n        \"$:/plugins/linonetwo/streams-outliner-lib/droppable-tweaks.js\": {\n            \"created\": \"20250203002627954\",\n            \"text\": \"\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/droppable-tweaks.js\",\n            \"modified\": \"20250203002635388\",\n            \"type\": \"application/javascript\"\n        },\n        \"$:/plugins/linonetwo/streams-outliner-lib/draggable-tweaks.js\": {\n            \"created\": \"20250203002612391\",\n            \"text\": \"\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/draggable-tweaks.js\",\n            \"modified\": \"20250203002624958\",\n            \"type\": \"application/javascript\"\n        },\n        \"$:/plugins/linonetwo/streams-outliner-lib/delete-hook/hook\": {\n            \"created\": \"20250203012309890\",\n            \"text\": \"/*\\\\\\ntitle: $:/plugins/linonetwo/streams-outliner-lib/delete-hook/hook\\ntype: application/javascript\\nmodule-type: startup\\n\\n\\\\*/\\n\\n// Let Streams handle deletion if it's installed\\n$tw.hooks.addHook(\\\"th-deleting-tiddler\\\",function(tiddler) {\\n    // Skip if this is a draft\\n    if(tiddler.fields[\\\"draft.of\\\"]) {\\n        return;\\n    }\\n    \\n    // Check if Streams plugin is installed and let it handle deletion\\n    if($tw.modules.titles[\\\"$:/plugins/sq/streams/delete-hook/hook\\\"]) {\\n        return;\\n    }\\n\\n    // Only invoke our delete actions if Streams isn't present\\n    $tw.rootWidget.invokeActionsByTag(\\\"$:/tags/deleteTiddlerAction\\\",null,{currentTiddler : tiddler.fields.title});\\n});\",\n            \"tags\": \"\",\n            \"title\": \"$:/plugins/linonetwo/streams-outliner-lib/delete-hook/hook\",\n            \"modified\": \"20250203014851967\",\n            \"type\": \"application/javascript\"\n        }\n    }\n}","type":"application/json","author":"Thomas E Tuoti","description":"An early demo","name":"Streams States","plugin-type":"plugin","dependents":"Streams, Streams-Fusion, Stream-Outliner","version":"0.0.25","core-version":"","modified":"20250201213304856","plugin-priority":"3000"}]