{#if hint}
{@html alertIcon}
{@html hint}
{/if}
{#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]}
--label-color={cols[index] === "dupe"
? "palette-of(flag-1)"
: "palette-of(canvas)"}
>
{
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}