From cb487851e5eb183f64e08d59960861f3e542e624 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Mon, 27 Mar 2023 16:59:30 -0600 Subject: [PATCH] Run elm review --- review/elm.json | 15 ++++---- src/Nri/Ui/HighlighterToolbar/V3.elm | 52 +--------------------------- 2 files changed, 9 insertions(+), 58 deletions(-) diff --git a/review/elm.json b/review/elm.json index b85f1ad9..053957b7 100644 --- a/review/elm.json +++ b/review/elm.json @@ -9,26 +9,27 @@ "elm/core": "1.0.5", "elm/json": "1.1.3", "elm/project-metadata-utils": "1.0.2", - "jfmengels/elm-review": "2.7.0", - "jfmengels/elm-review-unused": "1.1.20", + "jfmengels/elm-review": "2.12.2", + "jfmengels/elm-review-unused": "1.1.29", "stil4m/elm-syntax": "7.2.9" }, "indirect": { + "elm/bytes": "1.0.8", "elm/html": "1.0.0", "elm/parser": "1.1.0", "elm/random": "1.0.0", "elm/time": "1.0.0", - "elm/virtual-dom": "1.0.2", - "elm-community/list-extra": "8.5.2", - "elm-explorations/test": "1.2.2", - "miniBill/elm-unicode": "1.0.2", + "elm/virtual-dom": "1.0.3", + "elm-community/list-extra": "8.7.0", + "elm-explorations/test": "2.1.1", + "miniBill/elm-unicode": "1.0.3", "rtfeldman/elm-hex": "1.0.0", "stil4m/structured-writer": "1.0.3" } }, "test-dependencies": { "direct": { - "elm-explorations/test": "1.2.2" + "elm-explorations/test": "2.1.1" }, "indirect": {} } diff --git a/src/Nri/Ui/HighlighterToolbar/V3.elm b/src/Nri/Ui/HighlighterToolbar/V3.elm index 584e9d63..944272b5 100644 --- a/src/Nri/Ui/HighlighterToolbar/V3.elm +++ b/src/Nri/Ui/HighlighterToolbar/V3.elm @@ -24,12 +24,10 @@ module Nri.Ui.HighlighterToolbar.V3 exposing (view) -} import Accessibility.Styled.Aria as Aria -import Accessibility.Styled.Key as Key import Accessibility.Styled.Role as Role import Css exposing (Color) -import EventExtras exposing (onClickPreventDefaultAndStopPropagation) import Html.Styled exposing (..) -import Html.Styled.Attributes as Attributes exposing (css, id, tabindex) +import Html.Styled.Attributes as Attributes exposing (css, id) import Html.Styled.Events exposing (onClick) import Nri.Ui.Colors.V1 as Colors import Nri.Ui.FocusRing.V1 as FocusRing @@ -162,54 +160,6 @@ viewTool name focusAndSelect theme selected tag tools currentTool getName = ] -keyEvents : ({ select : Maybe tag, focus : Maybe String } -> msg) -> Maybe tag -> List (Maybe tag) -> (tag -> String) -> List (Key.Event msg) -keyEvents focusAndSelect tag tools getName = - let - onFocus tag_ = - focusAndSelect - { select = tag_ - , focus = - case tag_ of - Just tag__ -> - Just ("tag-" ++ getName tag__) - - Nothing -> - Just "tag-Remove highlight" - } - - findAdjacentTag tag_ ( isAdjacentTab, acc ) = - if isAdjacentTab then - ( False, Just (onFocus tag_) ) - - else - ( tag_ == tag, acc ) - - goToNextTag : Maybe msg - goToNextTag = - List.foldl findAdjacentTag - ( False - , -- if there is no adjacent tag, default to the first tag - Maybe.map onFocus (List.head tools) - ) - tools - |> Tuple.second - - goToPreviousTag : Maybe msg - goToPreviousTag = - List.foldr findAdjacentTag - ( False - , -- if there is no adjacent tag, default to the last tag - Maybe.map onFocus (List.head (List.reverse tools)) - ) - tools - |> Tuple.second - in - List.filterMap identity - [ Maybe.map Key.right goToNextTag - , Maybe.map Key.left goToPreviousTag - ] - - active : { extras | colorLight : Color } -> Html msg