Experiment with disabling prettier whitespace sensitivity

Prettier by default tries to preserve whitespace around inline tags,
which can prevent problems such as a space before the period in
'<a>text</a>.':

https://prettier.io/blog/2018/11/07/1.15.0.html#whitespace-sensitive-formatting

Unfortunately only standard HTML block elements are excluded from this
behaviour, so all of our Svelte components are treated the same way, even
if they are block-based, or used in a way where the extra whitespace
doesn't matter. This makes the code somewhat harder to read.

Changing this option does carry the risk that rogue spaces will creep
into our UI in the future as code is formatted, but as there don't appear
to be any such issues with this initial reformat, I think the improved
readability may justify the relatively small risk.
This commit is contained in:
Damien Elmes 2023-06-01 11:11:26 +10:00
parent 06a5ada99b
commit e63b4b9927
34 changed files with 185 additions and 101 deletions

View file

@ -11,7 +11,8 @@
"trailingComma": "all", "trailingComma": "all",
"printWidth": 88, "printWidth": 88,
"tabWidth": 4, "tabWidth": 4,
"semi": true "semi": true,
"htmlWhitespaceSensitivity": "ignore"
}, },
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,toml,svelte}"], "includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,toml,svelte}"],
"excludes": [ "excludes": [

View file

@ -6,7 +6,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let value: boolean; export let value: boolean;
</script> </script>
<label><input type="checkbox" bind:checked={value} /><slot /></label> <label>
<input type="checkbox" bind:checked={value} />
<slot />
</label>
<style lang="scss"> <style lang="scss">
label { label {

View file

@ -96,8 +96,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("maximumInterval"))} openHelpModal(Object.keys(settings).indexOf("maximumInterval"))}
>{settings.maximumInterval.title}</SettingTitle
> >
{settings.maximumInterval.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -111,8 +112,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("startingEase"))} openHelpModal(Object.keys(settings).indexOf("startingEase"))}
>{settings.startingEase.title}</SettingTitle
> >
{settings.startingEase.title}
</SettingTitle>
</SpinBoxFloatRow> </SpinBoxFloatRow>
</Item> </Item>
@ -126,8 +128,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("easyBonus"))} openHelpModal(Object.keys(settings).indexOf("easyBonus"))}
>{settings.easyBonus.title}</SettingTitle
> >
{settings.easyBonus.title}
</SettingTitle>
</SpinBoxFloatRow> </SpinBoxFloatRow>
</Item> </Item>
@ -142,8 +145,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("intervalModifier"), Object.keys(settings).indexOf("intervalModifier"),
)}>{settings.intervalModifier.title}</SettingTitle )}
> >
{settings.intervalModifier.title}
</SettingTitle>
</SpinBoxFloatRow> </SpinBoxFloatRow>
</Item> </Item>
@ -157,8 +162,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("hardInterval"))} openHelpModal(Object.keys(settings).indexOf("hardInterval"))}
>{settings.hardInterval.title}</SettingTitle
> >
{settings.hardInterval.title}
</SettingTitle>
</SpinBoxFloatRow> </SpinBoxFloatRow>
</Item> </Item>
@ -171,8 +177,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("newInterval"))} openHelpModal(Object.keys(settings).indexOf("newInterval"))}
>{settings.newInterval.title}</SettingTitle
> >
{settings.newInterval.title}
</SettingTitle>
</SpinBoxFloatRow> </SpinBoxFloatRow>
</Item> </Item>

View file

@ -64,8 +64,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("disableAutoplay"))} openHelpModal(Object.keys(settings).indexOf("disableAutoplay"))}
>{settings.disableAutoplay.title}</SettingTitle
> >
{settings.disableAutoplay.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
@ -78,8 +79,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("skipQuestionWhenReplaying"), Object.keys(settings).indexOf("skipQuestionWhenReplaying"),
)}>{settings.skipQuestionWhenReplaying.title}</SettingTitle )}
> >
{settings.skipQuestionWhenReplaying.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
</DynamicallySlottable> </DynamicallySlottable>

View file

@ -69,8 +69,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("buryNewSiblings"))} openHelpModal(Object.keys(settings).indexOf("buryNewSiblings"))}
>{settings.buryNewSiblings.title}</SettingTitle
> >
{settings.buryNewSiblings.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
@ -83,8 +84,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("buryReviewSiblings"), Object.keys(settings).indexOf("buryReviewSiblings"),
)}>{settings.buryReviewSiblings.title}</SettingTitle )}
> >
{settings.buryReviewSiblings.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
@ -101,8 +104,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
"buryInterdayLearningSiblings", "buryInterdayLearningSiblings",
), ),
)} )}
>{settings.buryInterdayLearningSiblings.title}</SettingTitle
> >
{settings.buryInterdayLearningSiblings.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
{/if} {/if}

View file

@ -178,8 +178,9 @@
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("newLimit"))} openHelpModal(Object.keys(settings).indexOf("newLimit"))}
>{settings.newLimit.title}</SettingTitle
> >
{settings.newLimit.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -192,8 +193,9 @@
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("reviewLimit"))} openHelpModal(Object.keys(settings).indexOf("reviewLimit"))}
>{settings.reviewLimit.title}</SettingTitle
> >
{settings.reviewLimit.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -210,8 +212,10 @@
Object.keys(settings).indexOf( Object.keys(settings).indexOf(
"newCardsIgnoreReviewLimit", "newCardsIgnoreReviewLimit",
), ),
)}>{settings.newCardsIgnoreReviewLimit.title}</SettingTitle )}
> >
{settings.newCardsIgnoreReviewLimit.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</Item> </Item>
{/if} {/if}

View file

@ -148,8 +148,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("newGatherPriority"), Object.keys(settings).indexOf("newGatherPriority"),
)}>{settings.newGatherPriority.title}</SettingTitle )}
> >
{settings.newGatherPriority.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
@ -164,8 +166,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("newCardSortOrder"), Object.keys(settings).indexOf("newCardSortOrder"),
)}>{settings.newCardSortOrder.title}</SettingTitle )}
> >
{settings.newCardSortOrder.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
@ -179,8 +183,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("newReviewPriority"), Object.keys(settings).indexOf("newReviewPriority"),
)}>{settings.newReviewPriority.title}</SettingTitle )}
> >
{settings.newReviewPriority.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
@ -194,8 +200,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("interdayStepPriority"), Object.keys(settings).indexOf("interdayStepPriority"),
)}>{settings.interdayStepPriority.title}</SettingTitle )}
> >
{settings.interdayStepPriority.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
@ -208,8 +216,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("reviewSortOrder"))} openHelpModal(Object.keys(settings).indexOf("reviewSortOrder"))}
>{settings.reviewSortOrder.title}</SettingTitle
> >
{settings.reviewSortOrder.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
</DynamicallySlottable> </DynamicallySlottable>

View file

@ -15,8 +15,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<Select bind:value {label}> <Select bind:value {label}>
{#each options as option, idx} {#each options as option, idx}
<SelectOption value={idx} disabled={disabled.includes(idx)} <SelectOption value={idx} disabled={disabled.includes(idx)}>
>{option}</SelectOption {option}
> </SelectOption>
{/each} {/each}
</Select> </Select>

View file

@ -130,9 +130,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</Row> </Row>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-primary" on:click={onOkClicked} <button type="button" class="btn btn-primary" on:click={onOkClicked}>
>OK</button OK
> </button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -92,8 +92,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("relearningSteps"))} openHelpModal(Object.keys(settings).indexOf("relearningSteps"))}
>{settings.relearningSteps.title}</SettingTitle
> >
{settings.relearningSteps.title}
</SettingTitle>
</StepsInputRow> </StepsInputRow>
</Item> </Item>
@ -106,8 +107,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("minimumInterval"))} openHelpModal(Object.keys(settings).indexOf("minimumInterval"))}
>{settings.minimumInterval.title}</SettingTitle
> >
{settings.minimumInterval.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -124,8 +126,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("leechThreshold"))} openHelpModal(Object.keys(settings).indexOf("leechThreshold"))}
>{settings.leechThreshold.title}</SettingTitle
> >
{settings.leechThreshold.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -139,8 +142,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("leechAction"))} openHelpModal(Object.keys(settings).indexOf("leechAction"))}
>{settings.leechAction.title}</SettingTitle
> >
{settings.leechAction.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>
</DynamicallySlottable> </DynamicallySlottable>

View file

@ -108,8 +108,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("learningSteps"))} openHelpModal(Object.keys(settings).indexOf("learningSteps"))}
>{settings.learningSteps.title}</SettingTitle
> >
{settings.learningSteps.title}
</SettingTitle>
</StepsInputRow> </StepsInputRow>
</Item> </Item>
@ -122,8 +123,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("graduatingInterval"), Object.keys(settings).indexOf("graduatingInterval"),
)}>{settings.graduatingInterval.title}</SettingTitle )}
> >
{settings.graduatingInterval.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -139,8 +142,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("easyInterval"))} openHelpModal(Object.keys(settings).indexOf("easyInterval"))}
>{settings.easyInterval.title}</SettingTitle
> >
{settings.easyInterval.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -158,8 +162,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<SettingTitle <SettingTitle
on:click={() => on:click={() =>
openHelpModal(Object.keys(settings).indexOf("insertionOrder"))} openHelpModal(Object.keys(settings).indexOf("insertionOrder"))}
>{settings.insertionOrder.title}</SettingTitle
> >
{settings.insertionOrder.title}
</SettingTitle>
</EnumSelectorRow> </EnumSelectorRow>
</Item> </Item>

View file

@ -95,17 +95,18 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{@html chevronDown} {@html chevronDown}
</IconButton> </IconButton>
<Popover slot="floating"> <Popover slot="floating">
<DropdownItem on:click={() => dispatch("add")} <DropdownItem on:click={() => dispatch("add")}>
>{tr.deckConfigAddGroup()}</DropdownItem {tr.deckConfigAddGroup()}
> </DropdownItem>
<DropdownItem on:click={() => dispatch("clone")} <DropdownItem on:click={() => dispatch("clone")}>
>{tr.deckConfigCloneGroup()}</DropdownItem {tr.deckConfigCloneGroup()}
> </DropdownItem>
<DropdownItem on:click={() => dispatch("rename")}> <DropdownItem on:click={() => dispatch("rename")}>
{tr.deckConfigRenameGroup()} {tr.deckConfigRenameGroup()}
</DropdownItem> </DropdownItem>
<DropdownItem on:click={removeConfig}>{tr.deckConfigRemoveGroup()}</DropdownItem <DropdownItem on:click={removeConfig}>
> {tr.deckConfigRemoveGroup()}
</DropdownItem>
<DropdownDivider /> <DropdownDivider />
<DropdownItem on:click={() => save(true)}> <DropdownItem on:click={() => save(true)}>
{tr.deckConfigSaveToAllSubdecks()} {tr.deckConfigSaveToAllSubdecks()}

View file

@ -66,9 +66,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<div class="modal-body"> <div class="modal-body">
<form on:submit|preventDefault={onOkClicked}> <form on:submit|preventDefault={onOkClicked}>
<div class="mb-3"> <div class="mb-3">
<label for="prompt-input" class="col-form-label" <label for="prompt-input" class="col-form-label">
>{prompt}:</label {prompt}:
> </label>
<input <input
id="prompt-input" id="prompt-input"
bind:this={inputRef} bind:this={inputRef}
@ -81,12 +81,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
>Cancel</button Cancel
> </button>
<button type="button" class="btn btn-primary" on:click={onOkClicked} <button type="button" class="btn btn-primary" on:click={onOkClicked}>
>OK</button OK
> </button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -74,8 +74,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("maximumAnswerSecs"), Object.keys(settings).indexOf("maximumAnswerSecs"),
)}>{settings.maximumAnswerSecs.title}</SettingTitle )}
> >
{settings.maximumAnswerSecs.title}
</SettingTitle>
</SpinBoxRow> </SpinBoxRow>
</Item> </Item>
@ -94,8 +96,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => on:click={() =>
openHelpModal( openHelpModal(
Object.keys(settings).indexOf("showAnswerTimer"), Object.keys(settings).indexOf("showAnswerTimer"),
)}>{settings.showAnswerTimer.title}</SettingTitle )}
> >
{settings.showAnswerTimer.title}
</SettingTitle>
</SwitchRow> </SwitchRow>
</div> </div>
</Item> </Item>

View file

@ -448,9 +448,9 @@ the AddCards dialog) should be implemented in the user of this component.
{#if hint} {#if hint}
<Absolute bottom right --margin="10px"> <Absolute bottom right --margin="10px">
<Notification> <Notification>
<Badge --badge-color="tomato" --icon-align="top" <Badge --badge-color="tomato" --icon-align="top">
>{@html alertIcon}</Badge {@html alertIcon}
> </Badge>
<span>{@html hint}</span> <span>{@html hint}</span>
</Notification> </Notification>
</Absolute> </Absolute>

View file

@ -39,8 +39,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
> >
<Badge <Badge
tooltip="{tr.editingToggleHtmlEditor()} ({getPlatformString(keyCombination)})" tooltip="{tr.editingToggleHtmlEditor()} ({getPlatformString(keyCombination)})"
iconSize={80}>{@html plainTextIcon}</Badge iconSize={80}
> >
{@html plainTextIcon}
</Badge>
</span> </span>
<style lang="scss"> <style lang="scss">

View file

@ -39,8 +39,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
> >
<Badge <Badge
tooltip="{tr.editingToggleVisualEditor()} ({getPlatformString(keyCombination)})" tooltip="{tr.editingToggleVisualEditor()} ({getPlatformString(keyCombination)})"
iconSize={80}>{@html richTextIcon}</Badge iconSize={80}
> >
{@html richTextIcon}
</Badge>
</span> </span>
<style lang="scss"> <style lang="scss">

View file

@ -42,8 +42,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
> >
<Badge <Badge
tooltip="{tr.editingToggleSticky()} ({getPlatformString(keyCombination)})" tooltip="{tr.editingToggleSticky()} ({getPlatformString(keyCombination)})"
widthMultiplier={0.7}>{@html stickyIcon}</Badge widthMultiplier={0.7}
> >
{@html stickyIcon}
</Badge>
</span> </span>
<style lang="scss"> <style lang="scss">

View file

@ -89,16 +89,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<CommandIconButton <CommandIconButton
key="insertUnorderedList" key="insertUnorderedList"
tooltip={tr.editingUnorderedList()} tooltip={tr.editingUnorderedList()}
shortcut="Control+,">{@html ulIcon}</CommandIconButton shortcut="Control+,"
> >
{@html ulIcon}
</CommandIconButton>
</ButtonGroupItem> </ButtonGroupItem>
<ButtonGroupItem> <ButtonGroupItem>
<CommandIconButton <CommandIconButton
key="insertOrderedList" key="insertOrderedList"
tooltip={tr.editingOrderedList()} tooltip={tr.editingOrderedList()}
shortcut="Control+.">{@html olIcon}</CommandIconButton shortcut="Control+."
> >
{@html olIcon}
</CommandIconButton>
</ButtonGroupItem> </ButtonGroupItem>
<ButtonGroupItem> <ButtonGroupItem>
@ -126,27 +130,31 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tooltip={tr.editingAlignLeft()} tooltip={tr.editingAlignLeft()}
--border-left-radius="5px" --border-left-radius="5px"
--border-right-radius="0px" --border-right-radius="0px"
>{@html justifyLeftIcon}</CommandIconButton
> >
{@html justifyLeftIcon}
</CommandIconButton>
<CommandIconButton <CommandIconButton
key="justifyCenter" key="justifyCenter"
tooltip={tr.editingCenter()} tooltip={tr.editingCenter()}
>{@html justifyCenterIcon}</CommandIconButton
> >
{@html justifyCenterIcon}
</CommandIconButton>
<CommandIconButton <CommandIconButton
key="justifyRight" key="justifyRight"
tooltip={tr.editingAlignRight()} tooltip={tr.editingAlignRight()}
>{@html justifyRightIcon}</CommandIconButton
> >
{@html justifyRightIcon}
</CommandIconButton>
<CommandIconButton <CommandIconButton
key="justifyFull" key="justifyFull"
tooltip={tr.editingJustify()} tooltip={tr.editingJustify()}
--border-right-radius="5px" --border-right-radius="5px"
>{@html justifyFullIcon}</CommandIconButton
> >
{@html justifyFullIcon}
</CommandIconButton>
</ButtonGroup> </ButtonGroup>
<ButtonGroup> <ButtonGroup>

View file

@ -100,9 +100,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{#each dropdownItems as [callback, keyCombination, label]} {#each dropdownItems as [callback, keyCombination, label]}
<DropdownItem on:click={() => setTimeout(callback, 100)}> <DropdownItem on:click={() => setTimeout(callback, 100)}>
<span>{label}</span> <span>{label}</span>
<span class="ms-auto ps-2 shortcut" <span class="ms-auto ps-2 shortcut">
>{getPlatformString(keyCombination)}</span {getPlatformString(keyCombination)}
> </span>
</DropdownItem> </DropdownItem>
{/each} {/each}
</Popover> </Popover>

View file

@ -36,8 +36,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
image.style.float = "left"; image.style.float = "left";
setTimeout(() => dispatch("update")); setTimeout(() => dispatch("update"));
}} }}
--border-left-radius="5px">{@html inlineStartIcon}</IconButton --border-left-radius="5px"
> >
{@html inlineStartIcon}
</IconButton>
<IconButton <IconButton
tooltip={tr.editingFloatNone()} tooltip={tr.editingFloatNone()}
@ -49,8 +51,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
image.style.float = "none"; image.style.float = "none";
removeStyleProperties(image, "float"); removeStyleProperties(image, "float");
setTimeout(() => dispatch("update")); setTimeout(() => dispatch("update"));
}}>{@html floatNoneIcon}</IconButton }}
> >
{@html floatNoneIcon}
</IconButton>
<IconButton <IconButton
tooltip={tr.editingFloatRight()} tooltip={tr.editingFloatRight()}
@ -60,6 +64,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
image.style.float = "right"; image.style.float = "right";
setTimeout(() => dispatch("update")); setTimeout(() => dispatch("update"));
}} }}
--border-right-radius="5px">{@html inlineEndIcon}</IconButton --border-right-radius="5px"
> >
{@html inlineEndIcon}
</IconButton>
</ButtonGroup> </ButtonGroup>

View file

@ -308,8 +308,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{:else} {:else}
<span>{actualWidth}&times;{actualHeight}</span> <span>{actualWidth}&times;{actualHeight}</span>
{#if customDimensions} {#if customDimensions}
<span>(Original: {naturalWidth}&times;{naturalHeight})</span <span>
> (Original: {naturalWidth}&times;{naturalHeight})
</span>
{/if} {/if}
{/if} {/if}
</HandleLabel> </HandleLabel>

View file

@ -28,13 +28,17 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
flipX={$direction === "rtl"} flipX={$direction === "rtl"}
tooltip="{tr.editingActualSize()} ({tr.editingDoubleClickImage()})" tooltip="{tr.editingActualSize()} ({tr.editingDoubleClickImage()})"
on:click={() => dispatch("imagetoggle")} on:click={() => dispatch("imagetoggle")}
--border-left-radius="5px">{@html icon}</IconButton --border-left-radius="5px"
> >
{@html icon}
</IconButton>
<IconButton <IconButton
disabled={restoringDisabled} disabled={restoringDisabled}
tooltip={tr.editingRestoreOriginalSize()} tooltip={tr.editingRestoreOriginalSize()}
on:click={() => dispatch("imageclear")} on:click={() => dispatch("imageclear")}
--border-right-radius="5px">{@html sizeClear}</IconButton --border-right-radius="5px"
> >
{@html sizeClear}
</IconButton>
</ButtonGroup> </ButtonGroup>

View file

@ -45,7 +45,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tooltip={tr.actionsDelete()} tooltip={tr.actionsDelete()}
on:click={() => dispatch("delete")} on:click={() => dispatch("delete")}
--border-left-radius="5px" --border-left-radius="5px"
--border-right-radius="5px">{@html deleteIcon}</IconButton --border-right-radius="5px"
> >
{@html deleteIcon}
</IconButton>
</ButtonGroup> </ButtonGroup>
</ButtonToolbar> </ButtonToolbar>

View file

@ -76,7 +76,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{/each} {/each}
<tr> <tr>
<td><span style="visibility: hidden;"></span> {total}</td> <td>
<span style="visibility: hidden;"></span>
{total}
</td>
<td class="right">{graphData.totalCards}</td> <td class="right">{graphData.totalCards}</td>
<td /> <td />
</tr> </tr>

View file

@ -57,7 +57,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<Graph {title} {subtitle}> <Graph {title} {subtitle}>
<InputBox> <InputBox>
<label> <input type="checkbox" bind:checked={showTime} /> {time} </label> <label>
<input type="checkbox" bind:checked={showTime} />
{time}
</label>
<GraphRangeRadios bind:graphRange {revlogRange} followRevlog={true} /> <GraphRangeRadios bind:graphRange {revlogRange} followRevlog={true} />
</InputBox> </InputBox>

View file

@ -57,8 +57,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
active={activeTool === tool.id} active={activeTool === tool.id}
on:click={() => { on:click={() => {
activeTool = tool.id; activeTool = tool.id;
}}>{@html tool.icon}</IconButton }}
> >
{@html tool.icon}
</IconButton>
{/each} {/each}
</div> </div>

View file

@ -19,8 +19,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<div class="toast {type === 'success' ? 'success' : 'error'}"> <div class="toast {type === 'success' ? 'success' : 'error'}">
{message} {message}
<IconButton iconSize={96} on:click={closeToast} class="toast-icon"> <IconButton iconSize={96} on:click={closeToast} class="toast-icon">
{@html mdiClose}</IconButton {@html mdiClose}
> </IconButton>
</div> </div>
</div> </div>
{/if} {/if}

View file

@ -24,6 +24,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
class="note-tool-icon-button right-border-radius" class="note-tool-icon-button right-border-radius"
{iconSize} {iconSize}
on:click={() => tool.action()} on:click={() => tool.action()}
tooltip={tool.title}>{@html tool.icon}</IconButton tooltip={tool.title}
> >
{@html tool.icon}
</IconButton>
{/each} {/each}

View file

@ -46,8 +46,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
on:click={() => { on:click={() => {
// setActiveTool(tool); // setActiveTool(tool);
textFormat(tool); textFormat(tool);
}}>{@html tool.icon}</IconButton }}
> >
{@html tool.icon}
</IconButton>
{/each} {/each}
<style lang="scss"> <style lang="scss">

View file

@ -24,8 +24,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
tags={globalTagsWritable} tags={globalTagsWritable}
on:tagsupdate={({ detail }) => (globalTags = detail.tags)} on:tagsupdate={({ detail }) => (globalTags = detail.tags)}
keyCombination={"Control+T"} keyCombination={"Control+T"}
/></Col />
> </Col>
</Row> </Row>
<Row --cols={2}> <Row --cols={2}>
<Col>{tr.importingTagUpdatedNotes()}</Col> <Col>{tr.importingTagUpdatedNotes()}</Col>
@ -33,6 +33,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<TagEditor <TagEditor
tags={updatedTagsWritable} tags={updatedTagsWritable}
on:tagsupdate={({ detail }) => (updatedTags = detail.tags)} on:tagsupdate={({ detail }) => (updatedTags = detail.tags)}
/></Col />
> </Col>
</Row> </Row>

View file

@ -10,6 +10,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export { className as class }; export { className as class };
</script> </script>
<Badge class="d-flex align-items-center ms-1 {className}" on:click iconSize={80} <Badge class="d-flex align-items-center ms-1 {className}" on:click iconSize={80}>
>{@html deleteIcon}</Badge {@html deleteIcon}
> </Badge>

View file

@ -150,8 +150,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}} }}
on:mouseenter={(event) => selectIfMousedown(event, index)} on:mouseenter={(event) => selectIfMousedown(event, index)}
on:mouseleave={() => (active = false)} on:mouseleave={() => (active = false)}
>{suggestion}</AutocompleteItem
> >
{suggestion}
</AutocompleteItem>
{:else} {:else}
<AutocompleteItem <AutocompleteItem
on:mousedown={() => setSelectedAndActive(index)} on:mousedown={() => setSelectedAndActive(index)}
@ -160,8 +161,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
chooseSelected(); chooseSelected();
}} }}
on:mouseenter={(event) => selectIfMousedown(event, index)} on:mouseenter={(event) => selectIfMousedown(event, index)}
>{suggestion}</AutocompleteItem
> >
{suggestion}
</AutocompleteItem>
{/if} {/if}
{/each} {/each}
</div> </div>

View file

@ -38,15 +38,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{tr.editingTagsSelectAll()} ({getPlatformString(selectAllShortcut)}) {tr.editingTagsSelectAll()} ({getPlatformString(selectAllShortcut)})
</DropdownItem> </DropdownItem>
<DropdownItem on:click={() => dispatch("tagcopy")} <DropdownItem on:click={() => dispatch("tagcopy")}>
>{tr.editingTagsCopy()} ({getPlatformString(copyShortcut)})</DropdownItem {tr.editingTagsCopy()} ({getPlatformString(copyShortcut)})
> </DropdownItem>
<DropdownItem on:click={() => dispatch("tagdelete")} <DropdownItem on:click={() => dispatch("tagdelete")}>
>{tr.editingTagsRemove()} ({getPlatformString( {tr.editingTagsRemove()} ({getPlatformString(removeShortcut)})
removeShortcut, </DropdownItem>
)})</DropdownItem
>
</Popover> </Popover>
</WithFloating> </WithFloating>