From 264561cd0dec2054a28b01270a25da7c4f8f946e Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Tue, 25 Oct 2022 08:18:50 +0200 Subject: [PATCH] Redesign deck options screen, swap tooltips for help modals (#2139) * Redesign deck config, swap tooltips for help modals, link to manual * Replace canvas-inset with canvas-code for custom scheduling * Make section header link to manual too * Include elevation Sass library * Remove two unused exports * Fix tabbed spinboxes * Update ftl/core/deck-config.ftl * Update ftl/core/deck-config.ftl * Fix format * Make border-radius and box-shadow more subtle * Fix margin for vertical aspect ratio * Make direct hover on info badge apply effect instantly * Add redirect line to manual underneath chapter --- ftl/core/deck-config.ftl | 13 +- ftl/core/help.ftl | 26 +++ ts/components/Col.svelte | 5 +- ts/deck-options/AdvancedOptions.svelte | 115 +++++++++++-- ts/deck-options/AudioOptions.svelte | 50 +++++- ts/deck-options/BUILD.bazel | 3 + ts/deck-options/BuryOptions.svelte | 71 ++++++-- ts/deck-options/CardStateCustomizer.svelte | 19 ++- ts/deck-options/ConfigInput.svelte | 38 +++++ ts/deck-options/DailyLimits.svelte | 69 ++++++-- ts/deck-options/DeckOptionsPage.svelte | 2 +- ts/deck-options/DisplayOrder.svelte | 89 ++++++++-- ts/deck-options/EnumSelectorRow.svelte | 15 +- ts/deck-options/HelpModal.svelte | 183 +++++++++++++++++++++ ts/deck-options/HelpSection.svelte | 70 ++++++++ ts/deck-options/LapseOptions.svelte | 78 ++++++++- ts/deck-options/NewOptions.svelte | 77 ++++++++- ts/deck-options/RevertButton.svelte | 1 + ts/deck-options/SettingTitle.svelte | 17 ++ ts/deck-options/SpinBoxFloatRow.svelte | 17 +- ts/deck-options/SpinBoxRow.svelte | 20 ++- ts/deck-options/StepsInputRow.svelte | 17 +- ts/deck-options/SwitchRow.svelte | 15 +- ts/deck-options/TabbedValue.svelte | 20 +-- ts/deck-options/TimerOptions.svelte | 52 +++++- ts/deck-options/TitledContainer.svelte | 47 +++++- ts/deck-options/TooltipLabel.svelte | 39 ----- ts/deck-options/deck-options-base.scss | 4 + ts/deck-options/index.ts | 1 + ts/deck-options/types.ts | 8 + 30 files changed, 996 insertions(+), 185 deletions(-) create mode 100644 ftl/core/help.ftl create mode 100644 ts/deck-options/ConfigInput.svelte create mode 100644 ts/deck-options/HelpModal.svelte create mode 100644 ts/deck-options/HelpSection.svelte create mode 100644 ts/deck-options/SettingTitle.svelte delete mode 100644 ts/deck-options/TooltipLabel.svelte create mode 100644 ts/deck-options/types.ts diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index af0007bab..df143ce44 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -101,9 +101,13 @@ deck-config-bury-title = Burying deck-config-bury-new-siblings = Bury new siblings deck-config-bury-review-siblings = Bury review siblings deck-config-bury-interday-learning-siblings = Bury interday learning siblings -deck-config-bury-tooltip = - Whether other cards of the same note (eg reverse cards, adjacent - cloze deletions) will be delayed until the next day. +deck-config-bury-new-tooltip = + Whether other `new` cards of the same note (eg reverse cards, adjacent cloze deletions) + will be delayed until the next day. +deck-config-bury-review-tooltip = Whether other `review` cards of the same note will be delayed until the next day. +deck-config-bury-interday-learning-tooltip = + Whether other `learning` cards of the same note with intervals > 1 day + will be delayed until the next day. ## Ordering section @@ -202,6 +206,9 @@ deck-config-show-answer-timer-tooltip = deck-config-audio-title = Audio deck-config-disable-autoplay = Don't play audio automatically +deck-config-disable-autoplay-tooltip = + When enabled, Anki will not play audio automatically. + It can be played manually by clicking/tapping on an audio icon, or by using the replay audio action. deck-config-skip-question-when-replaying = Skip question when replaying answer deck-config-always-include-question-audio-tooltip = Whether the question audio should be included when the Replay action is diff --git a/ftl/core/help.ftl b/ftl/core/help.ftl new file mode 100644 index 000000000..9b34523c8 --- /dev/null +++ b/ftl/core/help.ftl @@ -0,0 +1,26 @@ +### Text shown in Help pages + + +## Basic terminology + +help-chapter = chapter + +## Header + +# Tooltip for links to the manual +help-open-manual-chapter = Open chapter { $name } in Anki manual +# Displayed underneath chapter title +help-view-chapter-in-manual = View the { $chapter } on this topic in the official manual. + +## Body + +# Newly introduced settings may not have an explanation yet +help-no-explanation = + Whoops! There doesn't seem to be an explanation for this setting yet. + + You can help us complete this help page on { $link }. + +## Footer + +# Link to more detailed information in the manual +help-for-more-info = For more information, see { $link } in the manual. diff --git a/ts/components/Col.svelte b/ts/components/Col.svelte index bb4181f85..8b5f55712 100644 --- a/ts/components/Col.svelte +++ b/ts/components/Col.svelte @@ -5,13 +5,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
+ { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - {tr.schedulingMaximumInterval()} + + openHelpModal(Object.keys(settings).indexOf("maximumInterval"))} + >{settings.maximumInterval.title} @@ -40,9 +106,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.initialEase} min={1.31} max={5} - markdownTooltip={tr.deckConfigStartingEaseTooltip()} > - {tr.schedulingStartingEase()} + + openHelpModal(Object.keys(settings).indexOf("startingEase"))} + >{settings.startingEase.title} @@ -52,9 +121,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.easyMultiplier} min={1} max={5} - markdownTooltip={tr.deckConfigEasyBonusTooltip()} > - {tr.schedulingEasyBonus()} + + openHelpModal(Object.keys(settings).indexOf("easyBonus"))} + >{settings.easyBonus.title} @@ -64,9 +136,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.intervalMultiplier} min={0.5} max={2} - markdownTooltip={tr.deckConfigIntervalModifierTooltip()} > - {tr.schedulingIntervalModifier()} + + openHelpModal( + Object.keys(settings).indexOf("intervalModifier"), + )}>{settings.intervalModifier.title} @@ -76,9 +152,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.hardMultiplier} min={0.5} max={1.3} - markdownTooltip={tr.deckConfigHardIntervalTooltip()} > - {tr.schedulingHardInterval()} + + openHelpModal(Object.keys(settings).indexOf("hardInterval"))} + >{settings.hardInterval.title} @@ -87,15 +166,25 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.lapseMultiplier} defaultValue={defaults.lapseMultiplier} max={1} - markdownTooltip={tr.deckConfigNewIntervalTooltip()} > - {tr.schedulingNewInterval()} + + openHelpModal(Object.keys(settings).indexOf("newInterval"))} + >{settings.newInterval.title} {#if state.v3Scheduler} - + + openHelpModal( + Object.keys(settings).indexOf("customScheduling"), + )} + bind:value={$cardStateCustomizer} + /> {/if} diff --git a/ts/deck-options/AudioOptions.svelte b/ts/deck-options/AudioOptions.svelte index ef78c89a8..a1e2a59d8 100644 --- a/ts/deck-options/AudioOptions.svelte +++ b/ts/deck-options/AudioOptions.svelte @@ -3,28 +3,68 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - {tr.deckConfigDisableAutoplay()} + + openHelpModal(Object.keys(settings).indexOf("disableAutoplay"))} + >{settings.disableAutoplay.title} @@ -32,9 +72,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - {tr.deckConfigSkipQuestionWhenReplaying()} + + openHelpModal( + Object.keys(settings).indexOf("skipQuestionWhenReplaying"), + )}>{settings.skipQuestionWhenReplaying.title} diff --git a/ts/deck-options/BUILD.bazel b/ts/deck-options/BUILD.bazel index bf51443b1..66d6c25f5 100644 --- a/ts/deck-options/BUILD.bazel +++ b/ts/deck-options/BUILD.bazel @@ -18,6 +18,7 @@ compile_sass( "//sass:breakpoints_lib", "//sass:scrollbar_lib", "//sass:night_mode_lib", + "//sass:elevation_lib", "//sass/bootstrap", ], ) @@ -43,6 +44,7 @@ compile_svelte( "//sass:breakpoints_lib", "//sass:scrollbar_lib", "//sass:night_mode_lib", + "//sass:elevation_lib", "//sass/bootstrap", ], ) @@ -88,6 +90,7 @@ svelte_check( "//sass:scrollbar_lib", "//sass:breakpoints_lib", "//sass:night_mode_lib", + "//sass:elevation_lib", "//sass/bootstrap", "//ts/components", "//ts/sveltelib:sveltelib_pkg", diff --git a/ts/deck-options/BuryOptions.svelte b/ts/deck-options/BuryOptions.svelte index e846cf20d..ad46d8d0f 100644 --- a/ts/deck-options/BuryOptions.svelte +++ b/ts/deck-options/BuryOptions.svelte @@ -3,29 +3,69 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - - {tr.deckConfigBuryNewSiblings()} + + + openHelpModal(Object.keys(settings).indexOf("buryNewSiblings"))} + >{settings.buryNewSiblings.title} @@ -33,9 +73,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - {tr.deckConfigBuryReviewSiblings()} + + openHelpModal( + Object.keys(settings).indexOf("buryReviewSiblings"), + )}>{settings.buryReviewSiblings.title} @@ -44,9 +88,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - {tr.deckConfigBuryInterdayLearningSiblings()} + + openHelpModal( + Object.keys(settings).indexOf( + "buryInterdayLearningSiblings", + ), + )} + >{settings.buryInterdayLearningSiblings.title} {/if} diff --git a/ts/deck-options/CardStateCustomizer.svelte b/ts/deck-options/CardStateCustomizer.svelte index cd9f3acf4..2565e5efb 100644 --- a/ts/deck-options/CardStateCustomizer.svelte +++ b/ts/deck-options/CardStateCustomizer.svelte @@ -5,20 +5,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- - {tr.deckConfigCustomScheduling()}: - + + {title} + +
@@ -32,13 +33,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html diff --git a/ts/deck-options/DailyLimits.svelte b/ts/deck-options/DailyLimits.svelte index dfaa7858a..92755937a 100644 --- a/ts/deck-options/DailyLimits.svelte +++ b/ts/deck-options/DailyLimits.svelte @@ -3,14 +3,20 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - - - {tr.schedulingNewCardsday()} + + + + openHelpModal(Object.keys(settings).indexOf("newLimit"))} + >{settings.newLimit.title} - - - - {tr.schedulingMaximumReviewsday()} + + + + openHelpModal(Object.keys(settings).indexOf("reviewLimit"))} + >{settings.reviewLimit.title} diff --git a/ts/deck-options/DeckOptionsPage.svelte b/ts/deck-options/DeckOptionsPage.svelte index 46616a77c..c38684d6f 100644 --- a/ts/deck-options/DeckOptionsPage.svelte +++ b/ts/deck-options/DeckOptionsPage.svelte @@ -64,7 +64,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html diff --git a/ts/deck-options/DisplayOrder.svelte b/ts/deck-options/DisplayOrder.svelte index 3039df645..2087d491d 100644 --- a/ts/deck-options/DisplayOrder.svelte +++ b/ts/deck-options/DisplayOrder.svelte @@ -3,14 +3,20 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - {tr.deckConfigNewGatherPriority()} + + openHelpModal( + Object.keys(settings).indexOf("newGatherPriority"), + )}>{settings.newGatherPriority.title} @@ -106,9 +157,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.newCardSortOrder} choices={newSortOrderChoices} disabled={disabledNewSortOrders} - markdownTooltip={tr.deckConfigNewCardSortOrderTooltip_2() + currentDeck} > - {tr.deckConfigNewCardSortOrder()} + + openHelpModal( + Object.keys(settings).indexOf("newCardSortOrder"), + )}>{settings.newCardSortOrder.title} @@ -117,9 +172,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.newMix} defaultValue={defaults.newMix} choices={reviewMixChoices()} - markdownTooltip={tr.deckConfigNewReviewPriorityTooltip() + currentDeck} > - {tr.deckConfigNewReviewPriority()} + + openHelpModal( + Object.keys(settings).indexOf("newReviewPriority"), + )}>{settings.newReviewPriority.title} @@ -128,10 +187,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.interdayLearningMix} defaultValue={defaults.interdayLearningMix} choices={reviewMixChoices()} - markdownTooltip={tr.deckConfigInterdayStepPriorityTooltip() + - currentDeck} > - {tr.deckConfigInterdayStepPriority()} + + openHelpModal( + Object.keys(settings).indexOf("interdayStepPriority"), + )}>{settings.interdayStepPriority.title} @@ -140,9 +202,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.reviewOrder} defaultValue={defaults.reviewOrder} choices={reviewOrderChoices} - markdownTooltip={tr.deckConfigReviewSortOrderTooltip() + currentDeck} > - {tr.deckConfigReviewSortOrder()} + + openHelpModal(Object.keys(settings).indexOf("reviewSortOrder"))} + >{settings.reviewSortOrder.title} diff --git a/ts/deck-options/EnumSelectorRow.svelte b/ts/deck-options/EnumSelectorRow.svelte index b57b0e2bd..3f3bb7073 100644 --- a/ts/deck-options/EnumSelectorRow.svelte +++ b/ts/deck-options/EnumSelectorRow.svelte @@ -6,24 +6,25 @@ import Col from "../components/Col.svelte"; import Row from "../components/Row.svelte"; import type { Breakpoint } from "../components/types"; + import ConfigInput from "./ConfigInput.svelte"; import EnumSelector from "./EnumSelector.svelte"; import RevertButton from "./RevertButton.svelte"; - import TooltipLabel from "./TooltipLabel.svelte"; export let value: number; export let defaultValue: number; export let breakpoint: Breakpoint = "md"; export let choices: string[]; export let disabled: number[] = []; - export let markdownTooltip: string; - + - + - - - + + + + + diff --git a/ts/deck-options/HelpModal.svelte b/ts/deck-options/HelpModal.svelte new file mode 100644 index 000000000..77fc508c2 --- /dev/null +++ b/ts/deck-options/HelpModal.svelte @@ -0,0 +1,183 @@ + + + + modal.show()}> + {@html infoCircle} + + + + + diff --git a/ts/deck-options/HelpSection.svelte b/ts/deck-options/HelpSection.svelte new file mode 100644 index 000000000..dad287c1e --- /dev/null +++ b/ts/deck-options/HelpSection.svelte @@ -0,0 +1,70 @@ + + + + +

+ {#if section.url} + + {@html section.title} + + {:else} + {@html section.title} + {/if} +

+ {#if section.help} + {@html marked(section.help)} + {:else} + {@html marked( + tr.helpNoExplanation({ + link: "[GitHub](https://github.com/ankitects/anki)", + }), + )} + {/if} +
+{#if section.url} +
+
+ {@html marked( + tr.helpForMoreInfo({ + link: `${section.title}`, + }), + )} +
+{/if} + + diff --git a/ts/deck-options/LapseOptions.svelte b/ts/deck-options/LapseOptions.svelte index 0bd9e5301..f09642bc4 100644 --- a/ts/deck-options/LapseOptions.svelte +++ b/ts/deck-options/LapseOptions.svelte @@ -3,14 +3,20 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - {tr.deckConfigRelearningSteps()} + + openHelpModal(Object.keys(settings).indexOf("relearningSteps"))} + >{settings.relearningSteps.title} @@ -50,9 +101,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.minimumLapseInterval} defaultValue={defaults.minimumLapseInterval} min={1} - markdownTooltip={tr.deckConfigMinimumIntervalTooltip()} > - {tr.schedulingMinimumInterval()} + + openHelpModal(Object.keys(settings).indexOf("minimumInterval"))} + >{settings.minimumInterval.title} @@ -65,9 +119,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.leechThreshold} defaultValue={defaults.leechThreshold} min={1} - markdownTooltip={tr.deckConfigLeechThresholdTooltip()} > - {tr.schedulingLeechThreshold()} + + openHelpModal(Object.keys(settings).indexOf("leechThreshold"))} + >{settings.leechThreshold.title} @@ -76,10 +133,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:value={$config.leechAction} defaultValue={defaults.leechAction} choices={leechChoices} - breakpoint="sm" - markdownTooltip={tr.deckConfigLeechActionTooltip()} + breakpoint="md" > - {tr.schedulingLeechAction()} + + openHelpModal(Object.keys(settings).indexOf("leechAction"))} + >{settings.leechAction.title} diff --git a/ts/deck-options/NewOptions.svelte b/ts/deck-options/NewOptions.svelte index 647260daa..48b4515f8 100644 --- a/ts/deck-options/NewOptions.svelte +++ b/ts/deck-options/NewOptions.svelte @@ -3,15 +3,21 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> + { + modal = e.detail.modal; + carousel = e.detail.carousel; + }} + /> - {tr.deckConfigLearningSteps()} + + openHelpModal(Object.keys(settings).indexOf("learningSteps"))} + >{settings.learningSteps.title} @@ -65,9 +116,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - {tr.schedulingGraduatingInterval()} + + openHelpModal( + Object.keys(settings).indexOf("graduatingInterval"), + )}>{settings.graduatingInterval.title} @@ -79,9 +134,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - {tr.schedulingEasyInterval()} + + openHelpModal(Object.keys(settings).indexOf("easyInterval"))} + >{settings.easyInterval.title} @@ -95,9 +153,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={defaults.newCardInsertOrder} choices={newInsertOrderChoices} breakpoint={"md"} - markdownTooltip={tr.deckConfigNewInsertionOrderTooltip()} > - {tr.deckConfigNewInsertionOrder()} + + openHelpModal(Object.keys(settings).indexOf("insertionOrder"))} + >{settings.insertionOrder.title} diff --git a/ts/deck-options/RevertButton.svelte b/ts/deck-options/RevertButton.svelte index 966fb0b81..97995a70e 100644 --- a/ts/deck-options/RevertButton.svelte +++ b/ts/deck-options/RevertButton.svelte @@ -53,6 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html >
{ if (modified) { diff --git a/ts/deck-options/SettingTitle.svelte b/ts/deck-options/SettingTitle.svelte new file mode 100644 index 000000000..e65e23de8 --- /dev/null +++ b/ts/deck-options/SettingTitle.svelte @@ -0,0 +1,17 @@ + +
+ +
+ + diff --git a/ts/deck-options/SpinBoxFloatRow.svelte b/ts/deck-options/SpinBoxFloatRow.svelte index a95db9ce8..3de3fd868 100644 --- a/ts/deck-options/SpinBoxFloatRow.svelte +++ b/ts/deck-options/SpinBoxFloatRow.svelte @@ -6,22 +6,23 @@ import Col from "../components/Col.svelte"; import Row from "../components/Row.svelte"; import SpinBox from "../components/SpinBox.svelte"; + import ConfigInput from "./ConfigInput.svelte"; import RevertButton from "./RevertButton.svelte"; - import TooltipLabel from "./TooltipLabel.svelte"; export let value: any; export let defaultValue: any; export let min = 0; export let max: number | undefined = undefined; - export let markdownTooltip: string; - - - + + + - - - + + + + + diff --git a/ts/deck-options/SpinBoxRow.svelte b/ts/deck-options/SpinBoxRow.svelte index 3ebea4fd0..50e0311c5 100644 --- a/ts/deck-options/SpinBoxRow.svelte +++ b/ts/deck-options/SpinBoxRow.svelte @@ -6,22 +6,26 @@ import Col from "../components/Col.svelte"; import Row from "../components/Row.svelte"; import SpinBox from "../components/SpinBox.svelte"; + import ConfigInput from "./ConfigInput.svelte"; import RevertButton from "./RevertButton.svelte"; - import TooltipLabel from "./TooltipLabel.svelte"; export let value: any; export let defaultValue: any; export let min = 0; export let max: number | undefined = undefined; - export let markdownTooltip: string; - - - + + + - - - + + + + + + + + diff --git a/ts/deck-options/StepsInputRow.svelte b/ts/deck-options/StepsInputRow.svelte index 307551ec0..d1ebcb456 100644 --- a/ts/deck-options/StepsInputRow.svelte +++ b/ts/deck-options/StepsInputRow.svelte @@ -5,21 +5,22 @@ - - - + + + - - - + + + + + diff --git a/ts/deck-options/SwitchRow.svelte b/ts/deck-options/SwitchRow.svelte index 21bd8ac46..89f9c8451 100644 --- a/ts/deck-options/SwitchRow.svelte +++ b/ts/deck-options/SwitchRow.svelte @@ -6,25 +6,22 @@ import Col from "../components/Col.svelte"; import Row from "../components/Row.svelte"; import Switch from "../components/Switch.svelte"; + import ConfigInput from "./ConfigInput.svelte"; import Label from "./Label.svelte"; import RevertButton from "./RevertButton.svelte"; - import TooltipLabel from "./TooltipLabel.svelte"; export let value: boolean; export let defaultValue: boolean; - export let markdownTooltip: string | undefined = undefined; const id = Math.random().toString(36).substring(2); - {#if markdownTooltip}{:else}{/if} + - - + + + + diff --git a/ts/deck-options/TabbedValue.svelte b/ts/deck-options/TabbedValue.svelte index d59872eba..687e24ad4 100644 --- a/ts/deck-options/TabbedValue.svelte +++ b/ts/deck-options/TabbedValue.svelte @@ -44,7 +44,7 @@
    {#each tabs as tab, idx} -
  • +
  • {tab.title}
  • {/each} @@ -52,31 +52,27 @@ diff --git a/ts/deck-options/TooltipLabel.svelte b/ts/deck-options/TooltipLabel.svelte deleted file mode 100644 index a0c477fe3..000000000 --- a/ts/deck-options/TooltipLabel.svelte +++ /dev/null @@ -1,39 +0,0 @@ - - - - - {#if forId} - - {:else} - - {/if} - - createTooltip(event.detail.span)} - > - {@html infoCircle} - - - diff --git a/ts/deck-options/deck-options-base.scss b/ts/deck-options/deck-options-base.scss index 82cb4b02a..598153688 100644 --- a/ts/deck-options/deck-options-base.scss +++ b/ts/deck-options/deck-options-base.scss @@ -1,10 +1,14 @@ @import "sass/base"; +// override Bootstrap transition duration +$carousel-transition: 0.2s; + @import "sass/bootstrap/scss/dropdown"; @import "sass/bootstrap/scss/buttons"; @import "sass/bootstrap/scss/button-group"; @import "sass/bootstrap/scss/transitions"; @import "sass/bootstrap/scss/modal"; +@import "sass/bootstrap/scss/carousel"; @import "sass/bootstrap/scss/close"; @import "sass/bootstrap/scss/alert"; @import "sass/bootstrap/scss/badge"; diff --git a/ts/deck-options/index.ts b/ts/deck-options/index.ts index d9bc2adbd..6c378fa4d 100644 --- a/ts/deck-options/index.ts +++ b/ts/deck-options/index.ts @@ -17,6 +17,7 @@ import { DeckOptionsState } from "./lib"; const i18n = setupI18n({ modules: [ + ModuleName.HELP, ModuleName.SCHEDULING, ModuleName.ACTIONS, ModuleName.DECK_CONFIG, diff --git a/ts/deck-options/types.ts b/ts/deck-options/types.ts new file mode 100644 index 000000000..59594c14a --- /dev/null +++ b/ts/deck-options/types.ts @@ -0,0 +1,8 @@ +// Copyright: Ankitects Pty Ltd and contributors +// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +export type DeckOption = { + title: string; + help?: string; + url?: string; +};