{#if hint}
{@html alertIcon}
{@html hint}
{/if}
(fieldsPane.height = e.detail.height)}
>
{#each fieldsData as field, index}
{@const content = fieldStores[index]}
{
$focusedField = fields[index];
bridgeCommand(`focus:${index}`);
}}
on:focusout={() => {
$focusedField = null;
bridgeCommand(
`blur:${index}:${getNoteId()}:${transformContentBeforeSave(
get(content),
)}`,
);
}}
on:mouseenter={() => {
$hoveredField = fields[index];
}}
on:mouseleave={() => {
$hoveredField = null;
}}
collapsed={fieldsCollapsed[index]}
--dupes-color={cols[index] === "dupe"
? "var(--accent-danger)"
: "transparent"}
>
{
fieldsCollapsed[index] =
!fieldsCollapsed[index];
const defaultInput = !plainTextDefaults[index]
? richTextInputs[index]
: plainTextInputs[index];
if (!fieldsCollapsed[index]) {
refocusInput(defaultInput.api);
} else if (!plainTextDefaults[index]) {
plainTextsHidden[index] = true;
} else {
richTextsHidden[index] = true;
}
}}
>
{field.name}
{#if cols[index] === "dupe"}
{/if}
{#if plainTextDefaults[index]}
{
richTextsHidden[index] =
!richTextsHidden[index];
if (!richTextsHidden[index]) {
refocusInput(
richTextInputs[index].api,
);
}
}}
/>
{:else}
{
plainTextsHidden[index] =
!plainTextsHidden[index];
if (!plainTextsHidden[index]) {
refocusInput(
plainTextInputs[index].api,
);
}
}}
/>
{/if}
{
saveFieldNow();
$focusedInput = null;
}}
bind:this={richTextInputs[index]}
>
{#if insertSymbols}
{/if}
{field.description}
{
saveFieldNow();
$focusedInput = null;
}}
bind:this={plainTextInputs[index]}
/>
{/each}
{#if $tagsCollapsed}
{
tagEditor.appendEmptyTag();
}}
keyCombination="Control+Shift+T"
>
{@html tagAmount > 0 ? `${tagAmount} Tags` : ""}
{/if}
{
if ($tagsCollapsed) {
expandTags();
bridgeCommand("expandTags");
$tagsCollapsed = false;
} else {
collapseTags();
bridgeCommand("collapseTags");
$tagsCollapsed = true;
}
}}
/>
{
tagsPane.height = e.detail.height;
$tagsCollapsed = tagsPane.height == 0;
}}
>
{
expandTags();
$tagsCollapsed = false;
}}
on:heightChange={(e) => {
tagsPane.maxHeight = e.detail.height;
if (!$tagsCollapsed) {
expandTags();
}
}}
/>