caption: {{$:/plugins/flibbles/relink/language/ui/Attributes/Caption}}
tags: $:/tags/flibbles/relink/Configuration
title: $:/plugins/flibbles/relink/ui/configuration/Attributes

\import $:/plugins/flibbles/relink/ui/components/tables
\define prefix-attr() $:/config/flibbles/relink/attributes/
\define lingo-base() $:/plugins/flibbles/relink/language/Buttons/
\define element-name-tiddler() $:/state/flibbles/relink/element-name
\define attribute-name-tiddler() $:/state/flibbles/relink/attribute-name

\define row()
\whitespace trim
<$set name='element'
      value={{{[<key>splitbefore[/]removesuffix[/]]}}}>
<$set name="attribute"
      value={{{[<key>removeprefix<element>removeprefix[/]]}}}>
<td><$text text=<<element>> /></td>
<td><$text text=<<attribute>> /></td>
</$set></$set>
\end
\define body()
\whitespace trim

<em class="tc-edit">Add a new attribute:</em>
&#32;
<$edit-text
	tiddler=<<element-name-tiddler>>
	tag="input"
	default=""
	placeholder="widget/element" />
&#32;
<$edit-text
	tiddler=<<attribute-name-tiddler>>
	tag="input"
	default=""
	placeholder="attribute" />
&#32;
<$reveal type="nomatch" text="" state=<<element-name-tiddler>> >
<$reveal type="nomatch" text="" state=<<attribute-name-tiddler>> >
<$relinkmangler>
<$button
	tooltip={{$(lingo-base)$NewAttribute/Hint}}
	aria-label={{$(lingo-base)$NewAttribute/Caption}}>
<$action-sendmessage
	$message="relink-add-attribute"
	element={{$(element-name-tiddler)$}}
	attribute={{$(attribute-name-tiddler)$}} />
<$action-deletetiddler $tiddler=<<attribute-name-tiddler>> />
<$action-deletetiddler $tiddler=<<element-name-tiddler>> />
<$text text={{$(lingo-base)$NewAttribute/Caption}}/>
</$button>
</$relinkmangler>
</$reveal>
<$reveal type="match" text="" state=<<attribute-name-tiddler>> >
<$button>
<$text text={{$(lingo-base)$NewAttribute/Caption}}/>
</$button>
</$reveal>
</$reveal>
<$reveal type="match" text="" state=<<element-name-tiddler>> >
<$button>
<$text text={{$(lingo-base)$NewAttribute/Caption}}/>
</$button>
</$reveal>

@@.tc-control-panel
<$macrocall
	$name=tables
	category="attributes"
	header-list="[[Widget/HTML Element]] Attribute Type"
	list-row-macro="row" />
@@
\end

{{$:/plugins/flibbles/relink/language/Help/Attributes}}

<<body>>
