Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change key implementation #34

Merged
merged 3 commits into from
Nov 2, 2022
Merged

Change key implementation #34

merged 3 commits into from
Nov 2, 2022

Conversation

tesk9
Copy link
Owner

@tesk9 tesk9 commented Nov 2, 2022

Json.Decode.oneOf is not safe to use due to elm/json#15. This PR changes Key to avoid using it entirely.

This PR will cause a major bump:

---- Accessibility.Styled.Key - MAJOR ----

    Added:
        type alias Event msg =
            { keyCode : Basics.Int, shiftKey : Basics.Bool, msg : msg }
        shift : msg -> Accessibility.Styled.Key.Event msg

    Changed:
      - down : msg -> Decoder msg
      + down : msg -> Accessibility.Styled.Key.Event msg

      - enter : msg -> Decoder msg
      + enter : msg -> Accessibility.Styled.Key.Event msg

      - escape : msg -> Decoder msg
      + escape : msg -> Accessibility.Styled.Key.Event msg

      - left : msg -> Decoder msg
      + left : msg -> Accessibility.Styled.Key.Event msg

      - onKeyDown : List (Decoder msg) -> Attribute msg
      + onKeyDown :
            List.List (Accessibility.Styled.Key.Event msg)
            -> Html.Styled.Attribute msg

      - onKeyDownPreventDefault : List (Decoder msg) -> Attribute msg
      + onKeyDownPreventDefault :
            List.List (Accessibility.Styled.Key.Event msg)
            -> Html.Styled.Attribute msg

      - onKeyUp : List (Decoder msg) -> Attribute msg
      + onKeyUp :
            List.List (Accessibility.Styled.Key.Event msg)
            -> Html.Styled.Attribute msg

      - onKeyUpPreventDefault : List (Decoder msg) -> Attribute msg
      + onKeyUpPreventDefault :
            List.List (Accessibility.Styled.Key.Event msg)
            -> Html.Styled.Attribute msg

      - right : msg -> Decoder msg
      + right : msg -> Accessibility.Styled.Key.Event msg

      - shiftDown : msg -> Decoder msg
      + shiftDown : msg -> Accessibility.Styled.Key.Event msg

      - shiftLeft : msg -> Decoder msg
      + shiftLeft : msg -> Accessibility.Styled.Key.Event msg

      - shiftRight : msg -> Decoder msg
      + shiftRight : msg -> Accessibility.Styled.Key.Event msg

      - shiftUp : msg -> Decoder msg
      + shiftUp : msg -> Accessibility.Styled.Key.Event msg

      - space : msg -> Decoder msg
      + space : msg -> Accessibility.Styled.Key.Event msg

      - tab : msg -> Decoder msg
      + tab : msg -> Accessibility.Styled.Key.Event msg

      - tabBack : msg -> Decoder msg
      + tabBack : msg -> Accessibility.Styled.Key.Event msg

      - up : msg -> Decoder msg
      + up : msg -> Accessibility.Styled.Key.Event msg

Upgrading ought to be relatively straightforward, despite the type changes.

@tesk9 tesk9 merged commit 089fca6 into master Nov 2, 2022
@tesk9 tesk9 deleted the change-key-implementation branch November 2, 2022 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant