From 83647a07c10ee156367e49af85b4359ecbe21dfd Mon Sep 17 00:00:00 2001 From: Anatoliy Date: Sat, 1 Sep 2018 12:47:05 +0100 Subject: [PATCH] Update to elm 0.19 --- elm-package.json | 18 - elm.json | 32 + index.html | 11164 ++++++++++++++++++++++++++++++++ package.json | 4 +- src/CustomElement.elm | 68 +- src/Demo.elm | 79 +- src/ErrorMessages.elm | 58 +- src/Json/Form.elm | 138 +- src/Json/Form/Definitions.elm | 6 +- src/Json/Form/Helper.elm | 29 +- src/Json/Form/Selection.elm | 96 +- src/Json/Form/TextField.elm | 96 +- src/Json/Form/UiSpec.elm | 4 +- src/JsonFormCustomElement.elm | 5 +- src/JsonViewer.elm | 56 +- src/LegacyFormComponent.elm | 1137 ++-- src/Main.elm | 5 +- src/Snippets.elm | 6 +- src/Util.elm | 18 +- webpack.config.js | 4 +- yarn-error.log | 321 +- yarn.lock | 300 +- 22 files changed, 12575 insertions(+), 1069 deletions(-) delete mode 100644 elm-package.json create mode 100644 elm.json create mode 100644 index.html diff --git a/elm-package.json b/elm-package.json deleted file mode 100644 index cd7afef..0000000 --- a/elm-package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.1.0", - "summary": "Form generator based on JSON Schema", - "repository": "https://github.com/1602/json-form.git", - "license": "BSD3", - "source-directories": [ - "src" - ], - "exposed-modules": [ ], - "dependencies": { - "1602/elm-feather": "2.2.0 <= v < 3.0.0", - "1602/json-value": "1.1.0 <= v < 2.0.0", - "1602/json-schema": "4.1.0 <= v < 5.0.0", - "elm-lang/core": "5.0.0 <= v < 6.0.0", - "elm-lang/html": "2.0.0 <= v < 3.0.0" - }, - "elm-version": "0.18.0 <= v < 0.19.0" -} diff --git a/elm.json b/elm.json new file mode 100644 index 0000000..fb1f5b6 --- /dev/null +++ b/elm.json @@ -0,0 +1,32 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.0", + "dependencies": { + "direct": { + "1602/elm-feather": "2.3.2", + "1602/json-schema": "4.1.1", + "1602/json-value": "3.0.1", + "elm/browser": "1.0.0", + "elm/core": "1.0.0", + "elm/html": "1.0.0", + "elm/json": "1.0.0" + }, + "indirect": { + "NoRedInk/elm-json-decode-pipeline": "1.0.0", + "elm/random": "1.0.0", + "elm/regex": "1.0.0", + "elm/svg": "1.0.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.0", + "zwilias/elm-utf-tools": "2.0.1" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..d7cc3af --- /dev/null +++ b/index.html @@ -0,0 +1,11164 @@ + + + + + Main + + + +
+ + + \ No newline at end of file diff --git a/package.json b/package.json index 4c80436..ae7a5c7 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ "clean-webpack-plugin": "^0.1.17", "copy-webpack-plugin": "^4.2.3", "css-loader": "^0.28.7", - "elm": "^0.18.0", + "elm": "^0.19.0", "elm-hot-loader": "^0.5.4", "elm-verify-examples": "^2.3.1", - "elm-webpack-loader": "^4.4.0", + "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "gh-pages": "^1.1.0", diff --git a/src/CustomElement.elm b/src/CustomElement.elm index 1d268b6..9e210ea 100644 --- a/src/CustomElement.elm +++ b/src/CustomElement.elm @@ -1,22 +1,20 @@ -port module CustomElement exposing (init, update, view, subscriptions) - -import Html exposing (Html, div, text, h3) - +port module CustomElement exposing (init, subscriptions, update, view) --import Html.Attributes exposing (class, classList) --import Html.Events exposing (onClick) +import Html exposing (Html, div, h3, text) import Json.Decode exposing (Value, decodeValue) import Json.Encode as Encode -import JsonValue exposing (decoder) import Json.Form import Json.Schema.Definitions +import Json.Value exposing (decoder) type alias Model = { form : Json.Form.Model , schema : Json.Schema.Definitions.Schema - , editedValue : Maybe JsonValue.JsonValue + , editedValue : Maybe Json.Value.JsonValue } @@ -26,19 +24,20 @@ init v = schema = v |> decodeValue (Json.Decode.at [ "schema" ] Json.Schema.Definitions.decoder) - |> Result.mapError Debug.log + |> Result.mapError (Json.Decode.errorToString >> Debug.log) |> Result.withDefault Json.Schema.Definitions.blankSchema - value = + valueLocal = v - |> decodeValue (Json.Decode.at [ "value" ] JsonValue.decoder) + |> decodeValue (Json.Decode.at [ "value" ] Json.Value.decoder) |> Result.toMaybe in - { form = Json.Form.init schema value - , editedValue = value - , schema = schema - } - ! [] + ( { form = Json.Form.init schema valueLocal + , editedValue = valueLocal + , schema = schema + } + , Cmd.none + ) type Msg @@ -57,24 +56,26 @@ update message model = |> decodeValue Json.Schema.Definitions.decoder |> Result.withDefault Json.Schema.Definitions.blankSchema in - { model - | schema = schema - , form = Json.Form.init schema model.editedValue - } - ! [] + ( { model + | schema = schema + , form = Json.Form.init schema model.editedValue + } + , Cmd.none + ) ChangeValue v -> let - value = + valueLocal = v - |> decodeValue JsonValue.decoder + |> decodeValue Json.Value.decoder |> Result.toMaybe in - { model - | editedValue = value - , form = Json.Form.init model.schema value - } - ! [] + ( { model + | editedValue = valueLocal + , form = Json.Form.init model.schema valueLocal + } + , Cmd.none + ) JsonFormMsg msg -> let @@ -88,8 +89,8 @@ update message model = , Encode.object [ ( "value" , v - |> Maybe.withDefault JsonValue.NullValue - |> JsonValue.encode + |> Maybe.withDefault Json.Value.NullValue + |> Json.Value.encode ) , ( "isValid", Encode.bool isValid ) ] @@ -99,11 +100,12 @@ update message model = _ -> ( model.editedValue, Cmd.none ) in - { model - | form = m - , editedValue = editedValue - } - ! [ cmd |> Cmd.map JsonFormMsg, exCmd ] + ( { model + | form = m + , editedValue = editedValue + } + , Cmd.batch [ cmd |> Cmd.map JsonFormMsg, exCmd ] + ) view : Model -> Html Msg diff --git a/src/Demo.elm b/src/Demo.elm index 92efb27..0c070d6 100644 --- a/src/Demo.elm +++ b/src/Demo.elm @@ -1,14 +1,14 @@ module Demo exposing (init, update, view) -import Html exposing (Html, div, text, h3, h4, pre) +import Html exposing (Html, div, h3, h4, pre, text) import Html.Attributes exposing (class, classList, style) import Html.Events exposing (onClick) -import JsonViewer -import JsonValue exposing (JsonValue) +import Json.Encode exposing (Value) import Json.Form -import Snippets exposing (Snippet(..), getSnippet, getSnippetTitle) import Json.Schema.Definitions -import Json.Encode +import Json.Value exposing (JsonValue) +import JsonViewer +import Snippets exposing (Snippet(..), getSnippet, getSnippetTitle) type alias Model = @@ -24,14 +24,15 @@ initialShowcase = FlightBooking -init : ( Model, Cmd Msg ) -init = - { showcase = initialShowcase - , form = Json.Form.init (getSnippet initialShowcase) Nothing - , editedValue = Nothing - , expandedNodes = [ [] ] - } - ! [] +init : Value -> ( Model, Cmd Msg ) +init _ = + ( { showcase = initialShowcase + , form = Json.Form.init (getSnippet initialShowcase) Nothing + , editedValue = Nothing + , expandedNodes = [ [] ] + } + , Cmd.none + ) type Msg @@ -48,28 +49,32 @@ update message model = ( ( m, cmd ), exMsg ) = Json.Form.update msg model.form in - { model - | form = m - , editedValue = - case exMsg of - Json.Form.UpdateValue v _ -> - v - - _ -> - model.editedValue - } - ! [ cmd |> Cmd.map JsonFormMsg ] + ( { model + | form = m + , editedValue = + case exMsg of + Json.Form.UpdateValue v _ -> + v + + _ -> + model.editedValue + } + , cmd |> Cmd.map JsonFormMsg + ) ToggleNode path -> - { model + ( { model | expandedNodes = model.expandedNodes |> JsonViewer.toggle path - } - ! [] + } + , Cmd.none + ) SetShowcase s -> - { model | showcase = s, form = Json.Form.init (getSnippet s) Nothing, editedValue = Nothing } ! [] + ( { model | showcase = s, form = Json.Form.init (getSnippet s) Nothing, editedValue = Nothing } + , Cmd.none + ) view : Model -> Html Msg @@ -106,13 +111,13 @@ content : Model -> Html Msg content model = let jsonSchema = - div [ style [ ( "width", "50%" ), ( "vertical-align", "top" ), ( "display", "inline-block" ), ( "min-width", "300px" ), ( "max-width", "80ch" ), ( "overflow", "auto" ) ] ] + div [ style "width" "50%", style "vertical-align" "top", style "display" "inline-block", style "min-width" "300px", style "max-width" "80ch", style "overflow" "auto" ] [ h4 [] [ text <| "JSON Schema" ] - , pre [ style [ ( "line-height", "1.3" ) ] ] [ getSnippet model.showcase |> Json.Schema.Definitions.encode |> Json.Encode.encode 4 |> text ] + , pre [ style "line-height" "1.3" ] [ getSnippet model.showcase |> Json.Schema.Definitions.encode |> Json.Encode.encode 4 |> text ] ] generatedForm = - div [ style [ ( "width", "50%" ), ( "display", "inline-block" ), ( "min-width", "300px" ) ] ] + div [ style "width" "50%", style "display" "inline-block", style "min-width" "300px" ] [ model.form |> Json.Form.view |> Html.map JsonFormMsg @@ -128,10 +133,10 @@ content model = |> Maybe.withDefault (text "") ] in - div [ class "app-content" ] - [ h3 [ style [ ( "padding", "8px" ), ( "border-bottom", "1px solid #e8e8e8" ) ] ] [ text <| "Showcase: " ++ (getSnippetTitle model.showcase) ] - , div [ style [] ] - [ generatedForm - , jsonSchema - ] + div [ class "app-content" ] + [ h3 [ style "padding" "8px", style "border-bottom" "1px solid #e8e8e8" ] [ text <| "Showcase: " ++ getSnippetTitle model.showcase ] + , div [] + [ generatedForm + , jsonSchema ] + ] diff --git a/src/ErrorMessages.elm b/src/ErrorMessages.elm index a692bec..d8453f1 100644 --- a/src/ErrorMessages.elm +++ b/src/ErrorMessages.elm @@ -1,7 +1,7 @@ module ErrorMessages exposing (stringifyError) -import Json.Schema.Validation as Validation exposing (ValidationError(..)) import Json.Encode as Encode +import Json.Schema.Validation as Validation exposing (ValidationError(..)) pluralize : Int -> String -> String @@ -11,58 +11,73 @@ pluralize n name = "1 " ++ name _ -> - toString n ++ " " ++ name ++ "s" + intToString n ++ " " ++ name ++ "s" + + +encodeString : String -> String +encodeString = + Encode.string >> Encode.encode 0 + + +intToString : Int -> String +intToString = + String.fromInt + + +floatToString : Float -> String +floatToString = + String.fromFloat stringifyError : Validation.ValidationError -> String stringifyError e = case e of MultipleOf multiplier actual -> - toString actual + floatToString actual ++ " is not a multiple of " - ++ (toString multiplier) + ++ floatToString multiplier Maximum max actual -> - toString actual ++ " is more than maximum " ++ (toString max) + floatToString actual ++ " is more than maximum " ++ floatToString max Minimum min actual -> - toString actual ++ " is less than minimum " ++ (toString min) + floatToString actual ++ " is less than minimum " ++ floatToString min ExclusiveMaximum max actual -> - toString actual ++ " is not less than exclusive maximum " ++ (toString max) + floatToString actual ++ " is not less than exclusive maximum " ++ floatToString max ExclusiveMinimum min actual -> - toString actual ++ " is not more than exclusive minimum " ++ (toString min) + floatToString actual ++ " is not more than exclusive minimum " ++ floatToString min MaxLength expected actual -> "Expected string not longer than " - ++ (pluralize expected "character") + ++ pluralize expected "character" ++ " but actual length is " - ++ (pluralize actual "character") + ++ pluralize actual "character" MinLength expected actual -> "Expected string to be at least " - ++ (pluralize expected "character") + ++ pluralize expected "character" ++ " long but its length is " - ++ (pluralize actual "character") + ++ pluralize actual "character" Pattern pattern string -> - "String " ++ (toString string) ++ " does not match pattern " ++ pattern + "String " ++ encodeString string ++ " does not match pattern " ++ pattern MaxItems expected actual -> "List expected to have at most " - ++ (pluralize expected "item") + ++ pluralize expected "item" ++ " but it has " - ++ (pluralize actual "item") + ++ pluralize actual "item" MinItems expected actual -> "List expected to have at least " - ++ (pluralize expected "item") + ++ pluralize expected "item" ++ " but it has " - ++ (pluralize actual "item") + ++ pluralize actual "item" UniqueItems x -> - "Expected array of unique items, but a duplicate found: " ++ (Encode.encode 0 x) + "Expected array of unique items, but a duplicate found: " ++ Encode.encode 0 x Contains -> "None of array items is valid against the given schema" @@ -90,9 +105,10 @@ stringifyError e = ++ (extraPropertyNames |> List.map toString |> String.join ", ") -} InvalidPropertyName invalidPropertyNames -> + -- TODO stringify this somehow "Some property names are not passing validation: " - ++ (invalidPropertyNames |> List.map toString |> String.join ", ") + --++ (invalidPropertyNames |> List.map encodeString |> String.join ", ") Enum -> "Value does not match enumeration defined in the schema" @@ -106,7 +122,7 @@ stringifyError e = "Value does not pass the validation with none of the schemata listed in '.oneOf'" OneOfManySucceed int -> - "Value should pass validation with exactly one schema, but " ++ (toString int) ++ " return a positive result" + "Value should pass validation with exactly one schema, but " ++ intToString int ++ " return a positive result" Not -> "This value expected to fail validation" @@ -115,4 +131,4 @@ stringifyError e = "This is not expected to succeed" UnresolvableReference ref -> - "Reference " ++ (toString ref) ++ " can not be resolved" + "Reference " ++ encodeString ref ++ " can not be resolved" diff --git a/src/Json/Form.elm b/src/Json/Form.elm index 7542118..96517a9 100644 --- a/src/Json/Form.elm +++ b/src/Json/Form.elm @@ -1,25 +1,24 @@ -module Json.Form - exposing - ( Model - , Msg - , ExternalMsg(..) - , init - , update - , view - ) +module Json.Form exposing + ( ExternalMsg(..) + , Model + , Msg + , init + , update + , view + ) +import Dict exposing (Dict) +import ErrorMessages exposing (stringifyError) import Html exposing (..) +import Json.Decode as Decode exposing (decodeValue) +import Json.Form.Definitions as Definitions exposing (EditingMode(..), Msg(..), Path) +import Json.Form.Selection as Selection +import Json.Form.TextField as TextField import Json.Form.UiSpec as UiSpec -import Json.Form.Definitions as Definitions exposing (Path, EditingMode(..), Msg(..)) -import Json.Schema.Definitions exposing (..) import Json.Schema +import Json.Schema.Definitions exposing (..) import Json.Schema.Validation exposing (Error) -import JsonValue exposing (JsonValue(..)) -import Json.Decode as Decode exposing (decodeValue) -import ErrorMessages exposing (stringifyError) -import Dict exposing (Dict) -import Json.Form.TextField as TextField -import Json.Form.Selection as Selection +import Json.Value exposing (JsonValue(..)) import Util exposing (..) @@ -65,7 +64,7 @@ viewNode model schema isRequired path = viewObject model schema isRequired path x -> - text (toString x ++ ": not implemented") + text "not implemented" editingMode : Model -> Schema -> EditingMode @@ -112,27 +111,29 @@ viewObject model schema isRequired path = viewNode model subSchema (required |> Maybe.withDefault [] |> List.member propName) (path ++ [ propName ]) ) in - case schema of - ObjectSchema os -> - os.properties - |> Maybe.map (iterateOverSchemata Dict.empty os.required) - |> Maybe.withDefault [] - |> div [] + case schema of + ObjectSchema os -> + os.properties + |> Maybe.map (iterateOverSchemata Dict.empty os.required) + |> Maybe.withDefault [] + |> div [] - _ -> - text "" + _ -> + text "" update : Msg -> Model -> ( ( Model, Cmd Msg ), ExternalMsg ) update msg model = case msg of FocusInput focused -> - { model - | focused = focused - , beingEdited = touch focused model.focused model.beingEdited - } - ! [] - => None + ( ( { model + | focused = focused + , beingEdited = touch focused model.focused model.beingEdited + } + , Cmd.none + ) + , None + ) FocusNumericInput focused -> case focused of @@ -141,36 +142,42 @@ update msg model = { model | beingEdited = touch focused model.focused model.beingEdited } (model.focused |> Maybe.withDefault []) (case model.editedNumber |> String.toFloat of - Ok num -> - JsonValue.NumericValue num + Just num -> + Json.Value.NumericValue num _ -> - JsonValue.StringValue model.editedNumber + Json.Value.StringValue model.editedNumber ) Just somePath -> - { model - | focused = focused - , editedNumber = - model.value - |> Maybe.map (JsonValue.getIn somePath) - |> Maybe.andThen Result.toMaybe - |> Maybe.map jsonValueToString - |> Maybe.withDefault "" - } - ! [] - => None + ( ( { model + | focused = focused + , editedNumber = + model.value + |> Maybe.map (Json.Value.getIn somePath) + |> Maybe.andThen Result.toMaybe + |> Maybe.map jsonValueToString + |> Maybe.withDefault "" + } + , Cmd.none + ) + , None + ) EditValue path val -> editValue model path val EditNumber str -> case str |> String.toFloat of - Ok num -> - editValue { model | editedNumber = str } (model.focused |> Maybe.withDefault []) (JsonValue.NumericValue num) + Just num -> + editValue { model | editedNumber = str } (model.focused |> Maybe.withDefault []) (Json.Value.NumericValue num) _ -> - { model | editedNumber = str } ! [] => None + ( ( { model | editedNumber = str } + , Cmd.none + ) + , None + ) touch : Maybe Path -> Maybe Path -> List Path -> List Path @@ -178,6 +185,7 @@ touch path focused beingEdited = if path == Nothing then beingEdited |> (::) (focused |> Maybe.withDefault []) + else beingEdited @@ -187,38 +195,42 @@ editValue model path val = let updatedJsonValue = model.value - |> Maybe.withDefault JsonValue.NullValue - |> JsonValue.setIn path val + |> Maybe.withDefault Json.Value.NullValue + |> Json.Value.setIn path val |> Result.toMaybe - |> Maybe.withDefault JsonValue.NullValue + |> Maybe.withDefault Json.Value.NullValue updatedValue = updatedJsonValue - |> JsonValue.encode + |> Json.Value.encode validationResult = model.schema |> Json.Schema.validateValue { applyDefaults = True } updatedValue in - case validationResult of - Ok v -> - { model + case validationResult of + Ok v -> + ( ( { model | value = v - |> decodeValue JsonValue.decoder + |> decodeValue Json.Value.decoder |> Result.toMaybe , errors = Dict.empty } - ! [] - => UpdateValue (Just updatedJsonValue) True + , Cmd.none + ) + , UpdateValue (Just updatedJsonValue) True + ) - Err e -> - { model + Err e -> + ( ( { model | value = Just updatedJsonValue , errors = dictFromListErrors e } - ! [] - => UpdateValue (Just updatedJsonValue) False + , Cmd.none + ) + , UpdateValue (Just updatedJsonValue) False + ) dictFromListErrors : List Error -> Dict Path (List String) diff --git a/src/Json/Form/Definitions.elm b/src/Json/Form/Definitions.elm index 921feb6..4a67490 100644 --- a/src/Json/Form/Definitions.elm +++ b/src/Json/Form/Definitions.elm @@ -1,8 +1,8 @@ -module Json.Form.Definitions exposing (Model, Msg(..), Path, EditingMode(..), init) +module Json.Form.Definitions exposing (EditingMode(..), Model, Msg(..), Path, init) -import Json.Schema.Definitions exposing (..) -import JsonValue exposing (JsonValue) import Dict exposing (Dict) +import Json.Schema.Definitions exposing (..) +import Json.Value exposing (JsonValue) type alias Model = diff --git a/src/Json/Form/Helper.elm b/src/Json/Form/Helper.elm index b984152..45022b8 100644 --- a/src/Json/Form/Helper.elm +++ b/src/Json/Form/Helper.elm @@ -1,9 +1,9 @@ module Json.Form.Helper exposing (view) -import Json.Form.Definitions exposing (..) -import Json.Schema.Definitions exposing (Schema) import Dict exposing (Dict) import Html exposing (Html, text) +import Json.Form.Definitions exposing (..) +import Json.Schema.Definitions exposing (Schema) import Util exposing (..) @@ -17,15 +17,16 @@ view model schema path = hasError = errors /= Nothing && List.member path model.beingEdited in - ( hasError - , if hasError then - errors - |> Maybe.withDefault [] - |> String.join ", " - |> (++) "Error: " - |> text - else - schema - |> getDescription - |> text - ) + ( hasError + , if hasError then + errors + |> Maybe.withDefault [] + |> String.join ", " + |> (++) "Error: " + |> text + + else + schema + |> getDescription + |> text + ) diff --git a/src/Json/Form/Selection.elm b/src/Json/Form/Selection.elm index 78af96b..c065534 100644 --- a/src/Json/Form/Selection.elm +++ b/src/Json/Form/Selection.elm @@ -1,20 +1,20 @@ module Json.Form.Selection exposing (checkbox, switch) -import Json.Form.Definitions exposing (..) -import Json.Schema.Definitions exposing (Schema, getCustomKeywordValue) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onFocus, onBlur, onInput, onCheck) -import JsonValue exposing (JsonValue(BoolValue)) -import Util exposing (..) +import Html.Events exposing (onBlur, onCheck, onFocus, onInput) +import Json.Form.Definitions exposing (..) import Json.Form.Helper as Helper +import Json.Schema.Definitions exposing (Schema, getCustomKeywordValue) +import Json.Value exposing (JsonValue(..)) +import Util exposing (..) switch : Model -> Schema -> Bool -> Path -> Html Msg switch model schema isRequired path = let isChecked = - case model.value |> Maybe.andThen (JsonValue.getIn path >> Result.toMaybe) of + case model.value |> Maybe.andThen (Json.Value.getIn path >> Result.toMaybe) of Just (BoolValue x) -> x @@ -24,35 +24,35 @@ switch model schema isRequired path = ( hasError, helperText ) = Helper.view model schema path in - label - [ classList - [ ( "jf-switch", True ) - , ( "jf-switch--on", isChecked ) - , ( "jf-switch--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) - , ( "jf-switch--invalid", hasError ) - ] + label + [ classList + [ ( "jf-switch", True ) + , ( "jf-switch--on", isChecked ) + , ( "jf-switch--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) + , ( "jf-switch--invalid", hasError ) ] - [ input - [ type_ "checkbox" - , class "jf-switch__input" - , checked isChecked - , onFocus <| FocusInput (Just path) - , onBlur <| FocusInput Nothing - , onCheck <| (JsonValue.BoolValue >> EditValue path) - ] - [] - , span [ class "jf-switch__label" ] [ schema |> getTitle isRequired |> text ] - , div [ class "jf-switch__track" ] [] - , div [ class "jf-switch__thumb" ] [] - , div [ class "jf-switch__helper-text" ] [ helperText ] + ] + [ input + [ type_ "checkbox" + , class "jf-switch__input" + , checked isChecked + , onFocus <| FocusInput (Just path) + , onBlur <| FocusInput Nothing + , onCheck <| (Json.Value.BoolValue >> EditValue path) ] + [] + , span [ class "jf-switch__label" ] [ schema |> getTitle isRequired |> text ] + , div [ class "jf-switch__track" ] [] + , div [ class "jf-switch__thumb" ] [] + , div [ class "jf-switch__helper-text" ] [ helperText ] + ] checkbox : Model -> Schema -> Bool -> Path -> Html Msg checkbox model schema isRequired path = let isChecked = - case model.value |> Maybe.andThen (JsonValue.getIn path >> Result.toMaybe) of + case model.value |> Maybe.andThen (Json.Value.getIn path >> Result.toMaybe) of Just (BoolValue x) -> x @@ -62,26 +62,26 @@ checkbox model schema isRequired path = ( hasError, helperText ) = Helper.view model schema path in - label - [ classList - [ ( "jf-checkbox", True ) - , ( "jf-checkbox--on", isChecked ) - , ( "jf-checkbox--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) - , ( "jf-checkbox--invalid", hasError ) - ] + label + [ classList + [ ( "jf-checkbox", True ) + , ( "jf-checkbox--on", isChecked ) + , ( "jf-checkbox--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) + , ( "jf-checkbox--invalid", hasError ) + ] + ] + [ input + [ type_ "checkbox" + , class "jf-checkbox__input" + , checked isChecked + , onFocus <| FocusInput (Just path) + , onBlur <| FocusInput Nothing + , onCheck <| (Json.Value.BoolValue >> EditValue path) ] - [ input - [ type_ "checkbox" - , class "jf-checkbox__input" - , checked isChecked - , onFocus <| FocusInput (Just path) - , onBlur <| FocusInput Nothing - , onCheck <| (JsonValue.BoolValue >> EditValue path) - ] - [] - , span [ class "jf-checkbox__label" ] [ schema |> getTitle isRequired |> text ] - , div [ class "jf-checkbox__box-outline" ] - [ div [ class "jf-checkbox__tick-outline" ] [] - ] - , div [ class "jf-checkbox__helper-text" ] [ helperText ] + [] + , span [ class "jf-checkbox__label" ] [ schema |> getTitle isRequired |> text ] + , div [ class "jf-checkbox__box-outline" ] + [ div [ class "jf-checkbox__tick-outline" ] [] ] + , div [ class "jf-checkbox__helper-text" ] [ helperText ] + ] diff --git a/src/Json/Form/TextField.elm b/src/Json/Form/TextField.elm index 50b2a49..8fbc449 100644 --- a/src/Json/Form/TextField.elm +++ b/src/Json/Form/TextField.elm @@ -1,14 +1,14 @@ module Json.Form.TextField exposing (view, viewNumeric) -import Json.Form.Definitions exposing (..) -import Json.Schema.Definitions exposing (Schema, getCustomKeywordValue) -import Json.Form.UiSpec exposing (UiSpec(..)) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onFocus, onBlur, onInput) -import JsonValue exposing (JsonValue) -import Util exposing (..) +import Html.Events exposing (onBlur, onFocus, onInput) +import Json.Form.Definitions exposing (..) import Json.Form.Helper as Helper +import Json.Form.UiSpec exposing (UiSpec(..)) +import Json.Schema.Definitions exposing (Schema, getCustomKeywordValue) +import Json.Value exposing (JsonValue) +import Util exposing (..) view : Model -> Schema -> Bool -> Path -> Html Msg @@ -16,7 +16,7 @@ view model schema isRequired path = let editedValue = model.value - |> Maybe.map (JsonValue.getIn path) + |> Maybe.map (Json.Value.getIn path) |> Maybe.andThen Result.toMaybe |> Maybe.map jsonValueToString |> Maybe.withDefault "" @@ -32,29 +32,30 @@ view model schema isRequired path = _ -> False in - div - [ classList - [ ( "jf-textfield", True ) - , ( "jf-textfield--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) - , ( "jf-textfield--empty", editedValue == "" ) - , ( "jf-textfield--invalid", hasError ) - ] + div + [ classList + [ ( "jf-textfield", True ) + , ( "jf-textfield--focused", model.focused |> Maybe.map ((==) path) |> Maybe.withDefault False ) + , ( "jf-textfield--empty", editedValue == "" ) + , ( "jf-textfield--invalid", hasError ) ] - [ input - [ class "jf-textfield__input" - , onFocus <| FocusInput (Just path) - , onBlur <| FocusInput Nothing - , onInput <| (\str -> EditValue path (JsonValue.StringValue str)) - , value <| editedValue - , if isPassword then - type_ "password" - else - type_ "text" - ] - [] - , label [ class "jf-textfield__label" ] [ schema |> getTitle isRequired |> text ] - , div [ class "jf-textfield__helper-text" ] [ helperText ] + ] + [ input + [ class "jf-textfield__input" + , onFocus <| FocusInput (Just path) + , onBlur <| FocusInput Nothing + , onInput <| \str -> EditValue path (Json.Value.StringValue str) + , value <| editedValue + , if isPassword then + type_ "password" + + else + type_ "text" ] + [] + , label [ class "jf-textfield__label" ] [ schema |> getTitle isRequired |> text ] + , div [ class "jf-textfield__helper-text" ] [ helperText ] + ] viewNumeric : Model -> Schema -> Bool -> Path -> Html Msg @@ -68,9 +69,10 @@ viewNumeric model schema isRequired path = editedValue = if isFocused then model.editedNumber + else model.value - |> Maybe.map (JsonValue.getIn path) + |> Maybe.map (Json.Value.getIn path) |> Maybe.andThen Result.toMaybe |> Maybe.map Util.jsonValueToString |> Maybe.withDefault "" @@ -78,23 +80,23 @@ viewNumeric model schema isRequired path = ( hasError, helperText ) = Helper.view model schema path in - div - [ classList - [ ( "jf-textfield", True ) - , ( "jf-textfield--focused", isFocused ) - , ( "jf-textfield--empty", editedValue == "" ) - , ( "jf-textfield--invalid", hasError ) - ] + div + [ classList + [ ( "jf-textfield", True ) + , ( "jf-textfield--focused", isFocused ) + , ( "jf-textfield--empty", editedValue == "" ) + , ( "jf-textfield--invalid", hasError ) ] - [ input - [ class "jf-textfield__input" - , onFocus <| FocusNumericInput (Just path) - , onBlur <| FocusNumericInput Nothing - , onInput <| EditNumber - , value <| editedValue - , type_ "number" - ] - [] - , label [ class "jf-textfield__label" ] [ schema |> getTitle isRequired |> text ] - , div [ class "jf-textfield__helper-text" ] [ helperText ] + ] + [ input + [ class "jf-textfield__input" + , onFocus <| FocusNumericInput (Just path) + , onBlur <| FocusNumericInput Nothing + , onInput <| EditNumber + , value <| editedValue + , type_ "number" ] + [] + , label [ class "jf-textfield__label" ] [ schema |> getTitle isRequired |> text ] + , div [ class "jf-textfield__helper-text" ] [ helperText ] + ] diff --git a/src/Json/Form/UiSpec.elm b/src/Json/Form/UiSpec.elm index 4b31df9..4d0ccdd 100644 --- a/src/Json/Form/UiSpec.elm +++ b/src/Json/Form/UiSpec.elm @@ -1,6 +1,6 @@ module Json.Form.UiSpec exposing (UiSpec(..), decoder) -import Json.Decode as Decode exposing (Decoder, Value, succeed, fail) +import Json.Decode as Decode exposing (Decoder, Value, fail, succeed) type UiSpec @@ -17,8 +17,10 @@ decoder = (\widget -> if widget == "password" then succeed PasswordField + else if widget == "switch" then succeed Switch + else fail "" ) diff --git a/src/JsonFormCustomElement.elm b/src/JsonFormCustomElement.elm index 6a5977a..0a71c80 100644 --- a/src/JsonFormCustomElement.elm +++ b/src/JsonFormCustomElement.elm @@ -1,11 +1,12 @@ module JsonFormCustomElement exposing (main) +import Browser +import CustomElement exposing (init, subscriptions, update, view) import Html -import CustomElement exposing (init, update, view, subscriptions) main = - Html.programWithFlags + Browser.element { init = init , update = update , view = view diff --git a/src/JsonViewer.elm b/src/JsonViewer.elm index e2e48af..d8b44da 100644 --- a/src/JsonViewer.elm +++ b/src/JsonViewer.elm @@ -1,36 +1,42 @@ module JsonViewer exposing (JsonViewer, ExpandedNodes, Path, view, toggle) {-| + @docs JsonViewer, ExpandedNodes, Path, view, toggle + -} import Html exposing (..) import Html.Attributes exposing (..) import Html.Events exposing (onClick) -import JsonValue exposing (JsonValue) +import Json.Encode as Encode +import Json.Value exposing (JsonValue) -{-| -Expanded nodes in JSON value, use it to define model +toString : String -> String +toString = + Encode.string >> Encode.encode 0 + + +{-| Expanded nodes in JSON value, use it to define model type alias Model = { expandedNodes : JsonViewer.ExpandedNodes , {- ... the rest of applications model -} } + -} type alias ExpandedNodes = List Path -{-| -Path in JSON value +{-| Path in JSON value -} type alias Path = List String -{-| -Configuration for JsonViewer component +{-| Configuration for JsonViewer component -} type alias JsonViewer msg = { expandedNodes : ExpandedNodes @@ -38,8 +44,7 @@ type alias JsonViewer msg = } -{-| -Toggle expandable node. A helper to use in update function: +{-| Toggle expandable node. A helper to use in update function: type Msg = ToggleNode Path @@ -61,46 +66,48 @@ toggle : Path -> ExpandedNodes -> ExpandedNodes toggle path expandedNodes = if List.member path expandedNodes then expandedNodes |> List.filter ((/=) path) + else path :: expandedNodes -{-| -Render JsonViewer +{-| Render JsonViewer jsonValue |> view { expandedNodes = expandedNodes , onToggle = ToggleNode - } [] + } + [] + -} view : JsonViewer msg -> Path -> JsonValue -> Html msg view jvr path jv = case jv of - JsonValue.BoolValue bv -> + Json.Value.BoolValue bv -> bv |> boolToString |> text |> inline JsonBoolean - JsonValue.NumericValue nv -> + Json.Value.NumericValue nv -> nv - |> toString + |> String.fromFloat |> text |> inline JsonNumber - JsonValue.StringValue sv -> + Json.Value.StringValue sv -> sv |> toString |> text |> inline JsonString - JsonValue.NullValue -> + Json.Value.NullValue -> "null" |> text |> inline JsonNull - JsonValue.ObjectValue props -> + Json.Value.ObjectValue props -> if List.member path jvr.expandedNodes then props |> List.map @@ -111,6 +118,7 @@ view jvr path jv = ] ) |> div [ class "json-viewer json-viewer--expandable" ] + else props |> List.take 5 @@ -124,23 +132,24 @@ view jvr path jv = [ "{ " ++ s ++ "... }" |> text ] ) - JsonValue.ArrayValue items -> + Json.Value.ArrayValue items -> if List.member path jvr.expandedNodes then items |> List.indexedMap (\index v -> div [ class "json-viewer json-viewer__array-item" ] - [ span [ class "json-viewer json-viewer__key" ] [ toString index |> text ] - , v |> view jvr (path ++ [ toString index ]) + [ span [ class "json-viewer json-viewer__key" ] [ index |> String.fromInt |> text ] + , v |> view jvr (path ++ [ index |> String.fromInt ]) ] ) |> div [ class "json-viewer json-viewer--expandable" ] + else span [ class "json-viewer json-viewer--collapsed" , onClick <| jvr.onToggle path ] - [ "[ " ++ (List.length items |> toString) ++ " items... ]" |> text + [ "[ " ++ (List.length items |> String.fromInt) ++ " items... ]" |> text ] @@ -154,7 +163,7 @@ type JsonType inline : JsonType -> Html msg -> Html msg inline jsonType el = span - [ class <| "json-viewer json-viewer--" ++ (jsonTypeToString jsonType) ] + [ class <| "json-viewer json-viewer--" ++ jsonTypeToString jsonType ] [ el ] @@ -178,5 +187,6 @@ boolToString : Bool -> String boolToString bv = if bv then "true" + else "false" diff --git a/src/LegacyFormComponent.elm b/src/LegacyFormComponent.elm index 056a782..704bebe 100644 --- a/src/LegacyFormComponent.elm +++ b/src/LegacyFormComponent.elm @@ -1,76 +1,66 @@ -module StatefulComponent.Form - exposing - ( Model - , Msg - , ExternalMsg(UpdateValue, SaveExpandedNodes) - , init - , update - , updateValue - , updateSchema - , view - , defaultOptions - , FormOptions - ) +module StatefulComponent.Form exposing + ( ExternalMsg(..) + , FormOptions + , Model + , Msg + , defaultOptions + , init + , update + , updateSchema + , updateValue + , view + ) -import Task -import Dom -import ErrorMessages exposing (stringifyError) import Dict exposing (Dict) -import Ref -import Json.Decode as Decode exposing (Decoder, decodeValue) -import Json.Encode as Encode exposing (Value) -import JsonValue exposing (JsonValue(..), getIn) -import Json.Schema -import Json.Schema.Validation exposing (Error, ValidationError) -import Json.Schema.Definitions as Schema - exposing - ( Schemata(Schemata) - , Type(SingleType) - , SingleType(StringType, IntegerType, NumberType) - , Schema(ObjectSchema, BooleanSchema) - , Items(NoItems, ItemDefinition, ArrayOfItems) - , blankSchema - , blankSubSchema - ) -import Element.Events as Events exposing (onInput, onClick, onFocus, onBlur) -import FeatherIcons as Icons +import Dom +import Element exposing (Element, column, el, empty, paragraph, row, text) import Element.Attributes as Attributes exposing ( center - , verticalCenter - , vary + , class + , fill + , height , inlineStyle - , spacing + , minWidth , padding - , paddingTop + , paddingBottom , paddingLeft , paddingRight - , paddingBottom - , height - , minWidth - , width - , fill - , px + , paddingTop , percent - , class + , px + , spacing , tabindex + , vary + , verticalCenter + , width + ) +import Element.Events as Events exposing (onBlur, onClick, onFocus, onInput) +import ErrorMessages exposing (stringifyError) +import FeatherIcons as Icons +import Json.Decode as Decode exposing (Decoder, decodeValue) +import Json.Encode as Encode exposing (Value) +import Json.Schema +import Json.Schema.Definitions as Schema + exposing + ( Items(..) + , Schema(..) + , Schemata(..) + , SingleType(..) + , Type(..) + , blankSchema + , blankSubSchema ) -import Element exposing (Element, el, row, text, column, paragraph, empty) +import Json.Schema.Validation exposing (Error, ValidationError) +import JsonValue exposing (JsonValue(..), getIn) +import Ref import Styles exposing - ( Styles - ( None - , Main - , SourceCode - , TextInput - , InputRow - , MenuItem - , PropertyName - , InlineError - ) - , Variations(Active) + ( Styles(..) + , Variations(..) , stylesheet ) +import Task type alias View = @@ -132,7 +122,8 @@ type alias FormOptions = , useTitleAsLabel : Bool , allowExpandingNodes : Bool - --, monospaceTitle : Bool + + --, monospaceTitle : Bool } @@ -146,7 +137,8 @@ defaultOptions = , useTitleAsLabel = False , allowExpandingNodes = True - --, monospaceTitle = AlwaysMonospace | MonospaceWhenKeyUsedAsLabel | NeverMonospace + + --, monospaceTitle = AlwaysMonospace | MonospaceWhenKeyUsedAsLabel | NeverMonospace } @@ -203,7 +195,7 @@ init formOptions v = , editPropName = "" } in - blankModel + blankModel updateValue : Value -> Model -> Model @@ -225,7 +217,10 @@ update : Msg -> Model -> ( ( Model, Cmd Msg ), ExternalMsg ) update msg model = case msg of NoMsg -> - model ! [] => NoOp + ( model + , Cmd.none + ) + => NoOp ValueInput path str -> let @@ -237,12 +232,10 @@ update msg model = model.value |> JsonValue.setIn path v -- TODO display setIn error - |> - Result.mapError (Debug.log "ValueInput.setIn") + |> Result.mapError (Debug.log "ValueInput.setIn") ) -- TODO display parse error - |> - Result.mapError (Debug.log "ValueInput.parse") + |> Result.mapError (Debug.log "ValueInput.parse") |> Result.withDefault model.value encodedValue = @@ -259,15 +252,17 @@ update msg model = Err list -> ( updatedValue, list |> dictFromListErrors ) in - { model - | value = updatedValue - , editingNow = str - , validationErrors = - validationErrors - --, edited = model.edited |> Dict.insert path True - } - ! [] - => UpdateValue (value |> JsonValue.encode) + ( { model + | value = updatedValue + , editingNow = str + , validationErrors = + validationErrors + + --, edited = model.edited |> Dict.insert path True + } + , Cmd.none + ) + => UpdateValue (value |> JsonValue.encode) StringInput path str -> let @@ -291,15 +286,17 @@ update msg model = Err list -> ( updatedValue, list |> dictFromListErrors ) in - { model - | value = updatedValue - , editingNow = str - , validationErrors = - validationErrors - --, edited = model.edited |> Dict.insert path True - } - ! [] - => UpdateValue (value |> JsonValue.encode) + ( { model + | value = updatedValue + , editingNow = str + , validationErrors = + validationErrors + + --, edited = model.edited |> Dict.insert path True + } + , Cmd.none + ) + => UpdateValue (value |> JsonValue.encode) NumericInput path str -> let @@ -324,15 +321,17 @@ update msg model = Err list -> ( updatedValue, list |> dictFromListErrors ) in - { model - | value = value - , editingNow = str - , validationErrors = - validationErrors - --, edited = model.edited |> Dict.insert path True - } - ! [] - => UpdateValue (value |> JsonValue.encode) + ( { model + | value = value + , editingNow = str + , validationErrors = + validationErrors + + --, edited = model.edited |> Dict.insert path True + } + , Cmd.none + ) + => UpdateValue (value |> JsonValue.encode) BoolInput path bool -> let @@ -342,9 +341,10 @@ update msg model = |> Result.mapError (Debug.log "BoolInput") |> Result.withDefault model.value in - { model | value = updatedValue } - ! [] - => UpdateValue (updatedValue |> JsonValue.encode) + ( { model | value = updatedValue } + , Cmd.none + ) + => UpdateValue (updatedValue |> JsonValue.encode) DeletePath path -> let @@ -354,7 +354,10 @@ update msg model = |> Result.mapError (Debug.log "DeletePath") |> Result.withDefault model.value in - { model | value = value } ! [] => UpdateValue (value |> JsonValue.encode) + ( { model | value = value } + , Cmd.none + ) + => UpdateValue (value |> JsonValue.encode) AddItem path -> let @@ -380,7 +383,10 @@ update msg model = |> Result.mapError (Debug.log "AddItem") |> Result.withDefault model.value in - { model | value = value } ! [ makeId itemPath |> Dom.focus |> Task.attempt (\_ -> NoMsg) ] => UpdateValue (value |> JsonValue.encode) + ( { model | value = value } + , makeId itemPath |> Dom.focus |> Task.attempt (\_ -> NoMsg) + ) + => UpdateValue (value |> JsonValue.encode) AddProperty path -> let @@ -412,47 +418,50 @@ update msg model = en = path :: options.expandedNodes in - { model - | value = value - , editPropPath = path - , editPropIndex = Just nextIndex |> Debug.log "index" - , editPropName = "" - , options = { options | expandedNodes = en } - , focusInput = [] - } - ! [ path - |> String.join "/" - |> (\x -> x ++ ":propname") - |> Debug.log "will focus" - |> Dom.focus - |> Task.attempt - (\x -> - let - a = - Debug.log "focus" x - in - NoMsg - ) - ] - => SaveExpandedNodes en + ( { model + | value = value + , editPropPath = path + , editPropIndex = Just nextIndex |> Debug.log "index" + , editPropName = "" + , options = { options | expandedNodes = en } + , focusInput = [] + } + , path + |> String.join "/" + |> (\x -> x ++ ":propname") + |> Debug.log "will focus" + |> Dom.focus + |> Task.attempt + (\x -> + let + a = + Debug.log "focus" x + in + NoMsg + ) + ) + => SaveExpandedNodes en SetEditPropertyName propName path index -> - { model + ( { model | editPropPath = path , editPropIndex = Just index , editPropName = propName , focusInput = [] - } - ! [ path - |> String.join "/" - |> (\x -> x ++ ":propname") - |> Dom.focus - |> Task.attempt (\x -> NoMsg) - ] + } + , path + |> String.join "/" + |> (\x -> x ++ ":propname") + |> Dom.focus + |> Task.attempt (\x -> NoMsg) + ) => NoOp EditPropertyName str -> - { model | editPropName = str } ! [] => NoOp + ( { model | editPropName = str } + , Cmd.none + ) + => NoOp StopEditingPropertyName -> let @@ -465,13 +474,14 @@ update msg model = model.editPropName |> Result.withDefault model.value in - { model - | editPropPath = [] - , editPropIndex = Nothing - , value = updatedValue - } - ! [] - => UpdateValue (updatedValue |> JsonValue.encode) + ( { model + | editPropPath = [] + , editPropIndex = Nothing + , value = updatedValue + } + , Cmd.none + ) + => UpdateValue (updatedValue |> JsonValue.encode) ExpandNode path -> let @@ -481,7 +491,10 @@ update msg model = en = path :: options.expandedNodes in - { model | options = { options | expandedNodes = en } } ! [] => SaveExpandedNodes en + ( { model | options = { options | expandedNodes = en } } + , Cmd.none + ) + => SaveExpandedNodes en CollapseNode path -> let @@ -492,16 +505,25 @@ update msg model = options.expandedNodes |> List.filter ((/=) path) in - { model | options = { options | expandedNodes = en } } ! [] => SaveExpandedNodes en + ( { model | options = { options | expandedNodes = en } } + , Cmd.none + ) + => SaveExpandedNodes en OpenMenu path -> - { model | menu = Just path } ! [] => NoOp + ( { model | menu = Just path } + , Cmd.none + ) + => NoOp CloseMenu -> - { model | menu = Nothing } ! [] => NoOp + ( { model | menu = Nothing } + , Cmd.none + ) + => NoOp FocusInput path schema -> - { model + ( { model | focusInput = path , editingSchema = Just schema , editingNow = @@ -514,21 +536,27 @@ update msg model = _ -> "" - } - ! [] + } + , Cmd.none + ) => NoOp BlurInput path -> if path == model.focusInput then - { model + ( { model | focusInput = [] , editingSchema = Nothing , edited = model.edited |> Dict.insert path True - } - ! [] + } + , Cmd.none + ) => NoOp + else - model ! [] => NoOp + ( model + , Cmd.none + ) + => NoOp view : Model -> View @@ -555,7 +583,7 @@ delete path = isBlankSchema : Schema -> Bool isBlankSchema = - Schema.encode >> (Encode.encode 0) >> ((==) "{}") + Schema.encode >> Encode.encode 0 >> (==) "{}" pickOneOf : List Schema -> Value -> Schema @@ -571,27 +599,26 @@ pickOneOf listSchemas value = |> Result.toMaybe |> (/=) Nothing in - listSchemas - |> List.filter isValid - |> List.head - |> Maybe.withDefault defaultResult + listSchemas + |> List.filter isValid + |> List.head + |> Maybe.withDefault defaultResult resolve : Schema -> Schema -> Schema resolve rootSchema rawSubSchema = let ( _, resolvedSchema ) = - (case rawSubSchema of + case rawSubSchema of ObjectSchema os -> os.ref |> Maybe.andThen (Ref.resolveReference "" Ref.defaultPool rootSchema) - |> Maybe.withDefault (( "", rawSubSchema )) + |> Maybe.withDefault ( "", rawSubSchema ) _ -> ( "", rawSubSchema ) - ) in - resolvedSchema + resolvedSchema viewProperty : Model -> Bool -> Maybe Int -> Path -> String -> Schema -> JsonValue -> View @@ -656,6 +683,7 @@ viewProperty model deletionAllowed indexInObject path key rawSubSchema value = -} _ -> False + else False @@ -677,6 +705,7 @@ viewProperty model deletionAllowed indexInObject path key rawSubSchema value = --List.member deeperLevelPath model.expandedNodes _ -> True + else True @@ -694,25 +723,26 @@ viewProperty model deletionAllowed indexInObject path key rawSubSchema value = _ -> [] in - list - |> List.filterMap - (\( propName, _ ) -> - if List.member propName existingProps then - Nothing - else - text propName - |> Element.node "option" - |> Just + list + |> List.filterMap + (\( propName, _ ) -> + if List.member propName existingProps then + Nothing + + else + text propName + |> Element.node "option" + |> Just + ) + |> row None + [ inlineStyle [ ( "display", "none" ) ] + , Attributes.id + (deeperLevelPath + |> String.join "/" + |> (\x -> x ++ ":props") ) - |> row None - [ inlineStyle [ ( "display", "none" ) ] - , Attributes.id - (deeperLevelPath - |> String.join "/" - |> (\x -> x ++ ":props") - ) - ] - |> Element.node "datalist" + ] + |> Element.node "datalist" Nothing -> empty @@ -720,151 +750,162 @@ viewProperty model deletionAllowed indexInObject path key rawSubSchema value = _ -> empty in - column None - [ paddingTop 0 ] - [ row None - [ verticalCenter, spacing 5, class "key-container" ] - [ (if isExpandable then - (if isExpanded then - Icons.chevronDown - else - Icons.chevronRight - ) - |> Icons.withSize 18 - |> Icons.withStrokeWidth 2 - |> Icons.toHtml [] - |> Element.html - |> el None - [ width <| px 18 - , height <| px 18 - , inlineStyle [ ( "cursor", "pointer" ) ] - , if isExpanded then - onClick <| CollapseNode deeperLevelPath - else - onClick <| ExpandNode deeperLevelPath - ] - else + column None + [ paddingTop 0 ] + [ row None + [ verticalCenter, spacing 5, class "key-container" ] + [ if isExpandable then + (if isExpanded then Icons.chevronDown - |> Icons.withSize 18 - |> Icons.withStrokeWidth 2 - |> Icons.toHtml [] - |> Element.html - |> el None - [ width <| px 18 - , height <| px 18 - , inlineStyle [ ( "visibility", "hidden" ) ] - ] - ) - , if indexInObject /= Nothing && indexInObject == model.editPropIndex && path == model.editPropPath then - row InputRow - [ vary Active True ] - [ model.editPropName - |> Element.inputText TextInput - [ onInput EditPropertyName - , onBlur <| StopEditingPropertyName - , path - |> String.join "/" - |> (\x -> x ++ ":propname") - |> Attributes.id - , path - |> String.join "/" - |> (\x -> x ++ ":props") - |> Attributes.list - ] - ] - else - (if model.options.useTitleAsLabel then - objectSchema - |> Maybe.map - (\os -> - case os.type_ of - SingleType StringType -> - empty - SingleType IntegerType -> - empty + else + Icons.chevronRight + ) + |> Icons.withSize 18 + |> Icons.withStrokeWidth 2 + |> Icons.toHtml [] + |> Element.html + |> el None + [ width <| px 18 + , height <| px 18 + , inlineStyle [ ( "cursor", "pointer" ) ] + , if isExpanded then + onClick <| CollapseNode deeperLevelPath - SingleType NumberType -> - empty + else + onClick <| ExpandNode deeperLevelPath + ] - _ -> - key |> text - ) - |> Maybe.withDefault (key |> text) - else - key |> text - ) - |> el PropertyName - [ vary Active <| deeperLevelPath == model.focusInput - ] - {- - , objectSchema - |> Maybe.andThen .title - |> Maybe.withDefault key - |> text - -} - , Icons.moreVertical + else + Icons.chevronDown |> Icons.withSize 18 |> Icons.withStrokeWidth 2 |> Icons.toHtml [] |> Element.html |> el None - [ class "action" - , inlineStyle [ ( "cursor", "pointer" ), ( "outline", "none" ) ] - , width <| px 18 + [ width <| px 18 , height <| px 18 - , tabindex 2 - , onFocus <| OpenMenu deeperLevelPath - , onBlur <| CloseMenu + , inlineStyle [ ( "visibility", "hidden" ) ] ] - |> Element.below - [ if Just deeperLevelPath == model.menu then - [ text "Edit as JSON" |> el MenuItem [] - , case indexInObject of - Just index -> - text "Edit property name" - |> el MenuItem - [ onClick <| SetEditPropertyName key path index - ] - - _ -> - empty - , if isArray then - text "Add item" |> el MenuItem [ onClick <| AddItem deeperLevelPath ] - else if isDictionary then - text "Add property" |> el MenuItem [ onClick <| AddProperty deeperLevelPath ] - else - empty + , if indexInObject /= Nothing && indexInObject == model.editPropIndex && path == model.editPropPath then + row InputRow + [ vary Active True ] + [ model.editPropName + |> Element.inputText TextInput + [ onInput EditPropertyName + , onBlur <| StopEditingPropertyName + , path + |> String.join "/" + |> (\x -> x ++ ":propname") + |> Attributes.id + , path + |> String.join "/" + |> (\x -> x ++ ":props") + |> Attributes.list ] - |> column None - [ inlineStyle - [ ( "z-index", "2" ) - , ( "background", "white" ) - , ( "min-width", "200px" ) - , ( "border-radius", "2px" ) - , ( "box-shadow", "0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12)" ) + ] + + else + (if model.options.useTitleAsLabel then + objectSchema + |> Maybe.map + (\os -> + case os.type_ of + SingleType StringType -> + empty + + SingleType IntegerType -> + empty + + SingleType NumberType -> + empty + + _ -> + key |> text + ) + |> Maybe.withDefault (key |> text) + + else + key |> text + ) + |> el PropertyName + [ vary Active <| deeperLevelPath == model.focusInput + ] + + {- + , objectSchema + |> Maybe.andThen .title + |> Maybe.withDefault key + |> text + -} + , Icons.moreVertical + |> Icons.withSize 18 + |> Icons.withStrokeWidth 2 + |> Icons.toHtml [] + |> Element.html + |> el None + [ class "action" + , inlineStyle [ ( "cursor", "pointer" ), ( "outline", "none" ) ] + , width <| px 18 + , height <| px 18 + , tabindex 2 + , onFocus <| OpenMenu deeperLevelPath + , onBlur <| CloseMenu + ] + |> Element.below + [ if Just deeperLevelPath == model.menu then + [ text "Edit as JSON" |> el MenuItem [] + , case indexInObject of + Just index -> + text "Edit property name" + |> el MenuItem + [ onClick <| SetEditPropertyName key path index ] - , padding 2 - ] + + _ -> + empty + , if isArray then + text "Add item" |> el MenuItem [ onClick <| AddItem deeperLevelPath ] + + else if isDictionary then + text "Add property" |> el MenuItem [ onClick <| AddProperty deeperLevelPath ] + else empty ] - , if deletionAllowed then - delete deeperLevelPath - else - empty - ] - --, displayDescription subSchema - , if isExpanded then - row None - [] - [ viewValue model subSchema value deeperLevelPath - , propertyNamesAutocomplete + |> column None + [ inlineStyle + [ ( "z-index", "2" ) + , ( "background", "white" ) + , ( "min-width", "200px" ) + , ( "border-radius", "2px" ) + , ( "box-shadow", "0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.2), 0 1px 5px 0 rgba(0,0,0,.12)" ) + ] + , padding 2 + ] + + else + empty ] + , if deletionAllowed then + delete deeperLevelPath + else empty ] + --, displayDescription subSchema + , if isExpanded then + row None + [] + [ viewValue model subSchema value deeperLevelPath + , propertyNamesAutocomplete + ] + + else + empty + ] + viewObject : Model -> Schema -> List ( String, JsonValue ) -> Bool -> Path -> List View viewObject model schema props isArray path = @@ -880,14 +921,14 @@ viewObject model schema props isArray path = shouldRenderDefault required propName = if model.options.showEmptyOptionalProps then True + else - (case required of + case required of Just names -> List.member propName names Nothing -> False - ) iterateOverSchemata propsDict required (Schemata schemata) = schemata @@ -895,11 +936,12 @@ viewObject model schema props isArray path = (\( propName, subSchema ) -> case propsDict |> Dict.get propName of Just value -> - viewProperty model (isOptional propName required && (not model.options.showEmptyOptionalProps)) Nothing path propName subSchema value + viewProperty model (isOptional propName required && not model.options.showEmptyOptionalProps) Nothing path propName subSchema value Nothing -> if shouldRenderDefault required propName then - viewProperty model (isOptional propName required && (not model.options.showEmptyOptionalProps)) Nothing path propName subSchema JsonValue.NullValue + viewProperty model (isOptional propName required && not model.options.showEmptyOptionalProps) Nothing path propName subSchema JsonValue.NullValue + else empty ) @@ -914,6 +956,7 @@ viewObject model schema props isArray path = True (if isObject then Just index + else Nothing ) @@ -926,73 +969,75 @@ viewObject model schema props isArray path = empty ) in - case schema of - BooleanSchema True -> - iterateOverProps True (props |> List.map Just) blankSchema + case schema of + BooleanSchema True -> + iterateOverProps True (props |> List.map Just) blankSchema - BooleanSchema False -> - iterateOverProps True (props |> List.map Just) disallowEverythingSchema + BooleanSchema False -> + iterateOverProps True (props |> List.map Just) disallowEverythingSchema - ObjectSchema os -> - let - knownProperties = - case os.properties of - Just (Schemata x) -> - x - |> List.map (\( key, _ ) -> key) + ObjectSchema os -> + let + knownProperties = + case os.properties of + Just (Schemata x) -> + x + |> List.map (\( key, _ ) -> key) - _ -> - [] + _ -> + [] - justProps = - props - |> List.map Just + justProps = + props + |> List.map Just - extraProps = - props - |> List.map - (\( name, v ) -> - if List.member name knownProperties then - Nothing - else - Just ( name, v ) - ) - in - if isBlankSchema schema then - [ (ObjectValue props) - |> JsonValue.encode - |> Encode.encode 4 - |> text - |> el SourceCode [ paddingLeft 10 ] - ] - else - (if isArray then - case os.items of - NoItems -> - iterateOverProps False justProps blankSchema + extraProps = + props + |> List.map + (\( name, v ) -> + if List.member name knownProperties then + Nothing - ItemDefinition s -> - iterateOverProps False justProps s + else + Just ( name, v ) + ) + in + if isBlankSchema schema then + [ ObjectValue props + |> JsonValue.encode + |> Encode.encode 4 + |> text + |> el SourceCode [ paddingLeft 10 ] + ] - -- TODO: hande arrayOfItems - _ -> - iterateOverProps False justProps disallowEverythingSchema - else - [ os.properties - |> Maybe.map (iterateOverSchemata (Dict.fromList props) os.required) - |> Maybe.withDefault [] - , case os.additionalProperties of - Just (ObjectSchema os) -> - iterateOverProps True extraProps (ObjectSchema os) - - Just (BooleanSchema False) -> - iterateOverProps True extraProps disallowEverythingSchema + else + if isArray then + case os.items of + NoItems -> + iterateOverProps False justProps blankSchema - _ -> - iterateOverProps True extraProps blankSchema - ] - |> List.concat - ) + ItemDefinition s -> + iterateOverProps False justProps s + + -- TODO: hande arrayOfItems + _ -> + iterateOverProps False justProps disallowEverythingSchema + + else + [ os.properties + |> Maybe.map (iterateOverSchemata (Dict.fromList props) os.required) + |> Maybe.withDefault [] + , case os.additionalProperties of + Just (ObjectSchema os) -> + iterateOverProps True extraProps (ObjectSchema os) + + Just (BooleanSchema False) -> + iterateOverProps True extraProps disallowEverythingSchema + + _ -> + iterateOverProps True extraProps blankSchema + ] + |> List.concat disallowEverythingSchema : Schema @@ -1024,23 +1069,24 @@ viewNumber model schema numValue path = isFocused = path == model.focusInput in - row - InputRow - [ vary Active isFocused ] - [ (if isFocused then - model.editingNow - else - numValue |> Maybe.map toString |> Maybe.withDefault "" - ) - |> Element.inputText TextInput - [ onInput <| NumericInput path - , onFocus <| FocusInput path schema - , onBlur <| BlurInput path - , Attributes.type_ "number" - , width <| fill 1 - , Attributes.id <| makeId path - ] - ] + row + InputRow + [ vary Active isFocused ] + [ (if isFocused then + model.editingNow + + else + numValue |> Maybe.map toString |> Maybe.withDefault "" + ) + |> Element.inputText TextInput + [ onInput <| NumericInput path + , onFocus <| FocusInput path schema + , onBlur <| BlurInput path + , Attributes.type_ "number" + , width <| fill 1 + , Attributes.id <| makeId path + ] + ] viewBool : Model -> Schema -> Bool -> Path -> View @@ -1049,23 +1095,24 @@ viewBool model schema boolValue path = ( icon, label, color ) = if boolValue then ( Icons.toggleRight, "true", "darkgreen" ) + else ( Icons.toggleLeft, "false", "darkred" ) in - row None - [ onClick <| BoolInput path <| not boolValue - , verticalCenter - , spacing 5 - , inlineStyle [ ( "cursor", "pointer" ), ( "color", color ) ] - ] - [ icon - |> Icons.withSize 18 - |> Icons.toHtml [] - |> Element.html - |> el None - [ width <| px 18, height <| px 18 ] - , label |> text - ] + row None + [ onClick <| BoolInput path <| not boolValue + , verticalCenter + , spacing 5 + , inlineStyle [ ( "cursor", "pointer" ), ( "color", color ) ] + ] + [ icon + |> Icons.withSize 18 + |> Icons.toHtml [] + |> Element.html + |> el None + [ width <| px 18, height <| px 18 ] + , label |> text + ] labeledInput : Model -> (Path -> String -> Msg) -> Schema -> String -> Path -> View @@ -1097,7 +1144,7 @@ labeledInput model inputHandler schema stringValue path = strValue = v |> decodeValue Decode.string |> Result.withDefault "" in - Element.node "option" <| text strValue + Element.node "option" <| text strValue ) |> row None [ inlineStyle [ ( "display", "none" ) ], Attributes.id listId ] |> Element.node "datalist" @@ -1110,6 +1157,7 @@ labeledInput model inputHandler schema stringValue path = hasValue = (if isFocused then model.editingNow + else stringValue ) @@ -1125,91 +1173,96 @@ labeledInput model inputHandler schema stringValue path = highlightAsError = hasError && (model.options.showInitialValidationErrors || (model.edited |> Dict.member path)) in - if isBlankSchema schema then - row - InputRow - [ vary Active isFocused ] - [ stringValue - |> toString - |> Element.textArea TextInput - [ onInput <| ValueInput path - , onFocus <| FocusInput path schema - , onBlur <| BlurInput path - , width <| fill 1 - , Attributes.id <| makeId path - ] - ] - else - column - InputRow - [ vary Active isFocused - , paddingLeft 16 - , paddingRight 16 - , inlineStyle [ ( "background", "transparent" ), ( "height", "56px" ), ( "position", "relative" ) ] - ] - [ (if isFocused then - model.editingNow - else - stringValue - ) - |> Element.inputText TextInput - [ onFocus <| FocusInput path schema - , onBlur <| BlurInput path - , onInput <| inputHandler path - , Attributes.list listId - , Attributes.id inputId - , Attributes.autocomplete False - , inlineStyle - [ ( "position", "absolute" ) - , ( "bottom", "8px" ) - , ( "left", "16px" ) - , ( "right", "16px" ) - , ( "width", "calc(100% - 32px)" ) - , ( "top", "auto" ) - ] + if isBlankSchema schema then + row + InputRow + [ vary Active isFocused ] + [ stringValue + |> toString + |> Element.textArea TextInput + [ onInput <| ValueInput path + , onFocus <| FocusInput path schema + , onBlur <| BlurInput path + , width <| fill 1 + , Attributes.id <| makeId path + ] + ] + + else + column + InputRow + [ vary Active isFocused + , paddingLeft 16 + , paddingRight 16 + , inlineStyle [ ( "background", "transparent" ), ( "height", "56px" ), ( "position", "relative" ) ] + ] + [ (if isFocused then + model.editingNow + + else + stringValue + ) + |> Element.inputText TextInput + [ onFocus <| FocusInput path schema + , onBlur <| BlurInput path + , onInput <| inputHandler path + , Attributes.list listId + , Attributes.id inputId + , Attributes.autocomplete False + , inlineStyle + [ ( "position", "absolute" ) + , ( "bottom", "8px" ) + , ( "left", "16px" ) + , ( "right", "16px" ) + , ( "width", "calc(100% - 32px)" ) + , ( "top", "auto" ) ] - , autocompleteOptions - , (if model.options.useTitleAsLabel then - objectSchema - |> Maybe.andThen .title - |> (\x -> - case x of - Just t -> - Just t + ] + , autocompleteOptions + , (if model.options.useTitleAsLabel then + objectSchema + |> Maybe.andThen .title + |> (\x -> + case x of + Just t -> + Just t - Nothing -> - path |> List.reverse |> List.head - ) - |> Maybe.map text - |> Maybe.withDefault empty - else - empty - ) - |> el None - [ inlineStyle - [ ( "transform-origin", "left top" ) - , if isFocused || hasValue then - ( "transform", "translateY(-100%) scale(0.75, 0.75)" ) - else - ( "cursor", "text" ) - , ( "transform-origin", "left top" ) - , ( "left", "16px" ) - , ( "position", "absolute" ) - , ( "bottom", "8px" ) - , ( "top", "auto" ) - , ( "font-size", "14px" ) - , ( "transition", "transform 180ms cubic-bezier(0.4, 0, 0.2, 1)" ) - , ( "color" - , if highlightAsError then - "red" - else - "black" - ) - ] - , Attributes.for inputId + Nothing -> + path |> List.reverse |> List.head + ) + |> Maybe.map text + |> Maybe.withDefault empty + + else + empty + ) + |> el None + [ inlineStyle + [ ( "transform-origin", "left top" ) + , if isFocused || hasValue then + ( "transform", "translateY(-100%) scale(0.75, 0.75)" ) + + else + ( "cursor", "text" ) + , ( "transform-origin", "left top" ) + , ( "left", "16px" ) + , ( "position", "absolute" ) + , ( "bottom", "8px" ) + , ( "top", "auto" ) + , ( "font-size", "14px" ) + , ( "transition", "transform 180ms cubic-bezier(0.4, 0, 0.2, 1)" ) + , ( "color" + , if highlightAsError then + "red" + + else + "black" + ) ] - |> Element.node "label" - ] + , Attributes.for inputId + ] + |> Element.node "label" + ] viewValue : Model -> Schema -> JsonValue -> Path -> View @@ -1218,86 +1271,88 @@ viewValue model schema value path = isFocused = model.focusInput == path in - (case value of - JsonValue.ObjectValue ov -> - viewObject model schema ov False path + (case value of + JsonValue.ObjectValue ov -> + viewObject model schema ov False path - JsonValue.ArrayValue av -> - viewObject model schema (av |> List.indexedMap (\index val -> ( toString index, val ))) True path + JsonValue.ArrayValue av -> + viewObject model schema (av |> List.indexedMap (\index val -> ( toString index, val ))) True path - JsonValue.StringValue sv -> - [ labeledInput model StringInput schema sv path ] + JsonValue.StringValue sv -> + [ labeledInput model StringInput schema sv path ] - JsonValue.NumericValue nv -> - [ labeledInput model NumericInput schema (toString nv) path ] + JsonValue.NumericValue nv -> + [ labeledInput model NumericInput schema (toString nv) path ] - JsonValue.BoolValue bv -> - [ viewBool model schema bv path ] + JsonValue.BoolValue bv -> + [ viewBool model schema bv path ] - JsonValue.NullValue -> - case schema of - ObjectSchema os -> - case os.type_ of - SingleType StringType -> - [ labeledInput model StringInput schema "" path ] + JsonValue.NullValue -> + case schema of + ObjectSchema os -> + case os.type_ of + SingleType StringType -> + [ labeledInput model StringInput schema "" path ] - SingleType IntegerType -> - [ viewNumber model schema Nothing path ] + SingleType IntegerType -> + [ viewNumber model schema Nothing path ] - _ -> - [ row InputRow - [ vary Active <| isFocused ] - [ "null" - |> Element.textArea TextInput - [ onInput <| ValueInput path - , width <| fill 1 - , onFocus <| FocusInput path schema - , onBlur <| BlurInput path - ] - ] + _ -> + [ row InputRow + [ vary Active <| isFocused ] + [ "null" + |> Element.textArea TextInput + [ onInput <| ValueInput path + , width <| fill 1 + , onFocus <| FocusInput path schema + , onBlur <| BlurInput path + ] ] - - _ -> - [ row InputRow - [ vary Active <| model.focusInput == path ] - [ "null" - |> Element.textArea TextInput - [ onInput <| ValueInput path - , width <| fill 1 - , onFocus <| FocusInput path schema - , onBlur <| BlurInput path - ] ] + + _ -> + [ row InputRow + [ vary Active <| model.focusInput == path ] + [ "null" + |> Element.textArea TextInput + [ onInput <| ValueInput path + , width <| fill 1 + , onFocus <| FocusInput path schema + , onBlur <| BlurInput path + ] ] - ) - |> column None [ spacing 0, width <| fill 1 ] - |> Element.below - [ case model.validationErrors |> Dict.get path of - Just errors -> - if model.options.showInitialValidationErrors || (model.edited |> Dict.member path) then - errors - |> List.filter ((/=) "") - |> List.map (((++) "Error: ") >> text >> (el InlineError [])) - |> column None [ paddingLeft 16, paddingTop 8 ] - else - empty + ] + ) + |> column None [ spacing 0, width <| fill 1 ] + |> Element.below + [ case model.validationErrors |> Dict.get path of + Just errors -> + if model.options.showInitialValidationErrors || (model.edited |> Dict.member path) then + errors + |> List.filter ((/=) "") + |> List.map ((++) "Error: " >> text >> el InlineError []) + |> column None [ paddingLeft 16, paddingTop 8 ] - Nothing -> - case schema of - ObjectSchema os -> - case os.description of - Just d -> - if isFocused then - text d |> el None [ paddingLeft 16, paddingTop 8, inlineStyle [ ( "font-size", "10px" ) ] ] - else - empty + else + empty + + Nothing -> + case schema of + ObjectSchema os -> + case os.description of + Just d -> + if isFocused then + text d |> el None [ paddingLeft 16, paddingTop 8, inlineStyle [ ( "font-size", "10px" ) ] ] - Nothing -> + else empty - _ -> - empty - ] + Nothing -> + empty + + _ -> + empty + ] (=>) : a -> b -> ( a, b ) diff --git a/src/Main.elm b/src/Main.elm index 013d3e9..8a02dfc 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -1,11 +1,12 @@ module Main exposing (main) -import Html +import Browser import Demo exposing (init, update, view) +import Html main = - Html.program + Browser.element { init = init , update = update , view = view diff --git a/src/Snippets.elm b/src/Snippets.elm index 7e6b9a7..4a09a9d 100644 --- a/src/Snippets.elm +++ b/src/Snippets.elm @@ -1,8 +1,8 @@ -module Snippets exposing (Snippet(..), index, getSnippet, getSnippetTitle) +module Snippets exposing (Snippet(..), getSnippet, getSnippetTitle, index) -import Json.Schema.Definitions exposing (Schema(..), blankSchema, blankSubSchema, Type(..), SingleType(..)) -import Json.Schema.Builder exposing (..) import Json.Encode as Encode exposing (string) +import Json.Schema.Builder exposing (..) +import Json.Schema.Definitions exposing (Schema(..), SingleType(..), Type(..), blankSchema, blankSubSchema) type Snippet diff --git a/src/Util.elm b/src/Util.elm index 82d9747..94c9ae5 100644 --- a/src/Util.elm +++ b/src/Util.elm @@ -1,20 +1,20 @@ -module Util exposing (..) +module Util exposing (getDescription, getTextProp, getTitle, getUiSpec, jsonValueToString) -import JsonValue exposing (JsonValue) -import Json.Encode as Encode import Json.Decode as Decode +import Json.Encode as Encode import Json.Form.UiSpec exposing (UiSpec, decoder) import Json.Schema.Definitions exposing (Schema(..), SubSchema, getCustomKeywordValue) +import Json.Value exposing (JsonValue) jsonValueToString : JsonValue -> String jsonValueToString jv = case jv of - JsonValue.StringValue s -> + Json.Value.StringValue s -> s - JsonValue.NumericValue n -> - toString n + Json.Value.NumericValue n -> + n |> String.fromFloat _ -> "" @@ -26,6 +26,7 @@ getTitle isRequired schema = |> (\title -> if isRequired then title ++ " *" + else title ) @@ -59,8 +60,3 @@ getUiSpec schema = |> Result.toMaybe ) |> Maybe.withDefault (Json.Form.UiSpec.Unknown Encode.null) - - -(=>) : a -> b -> ( a, b ) -(=>) a b = - ( a, b ) diff --git a/webpack.config.js b/webpack.config.js index 29a997f..60e2984 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -109,9 +109,7 @@ if (TARGET_ENV === "development") { test: /\.elm$/, exclude: [/elm-stuff/, /node_modules/], use: [ - { - loader: "elm-hot-loader" - }, + // { loader: "elm-hot-loader" }, { loader: "elm-webpack-loader", // add Elm's debug overlay to output diff --git a/yarn-error.log b/yarn-error.log index c4d6bf2..8f8b468 100644 --- a/yarn-error.log +++ b/yarn-error.log @@ -1,5 +1,5 @@ Arguments: - /usr/local/bin/node /usr/local/bin/yarn run add to-string-loader --dev + /usr/local/bin/node /usr/local/bin/yarn rudev PATH: /Users/anatoliy/.local/bin/luna-studio:/Users/anatoliy/google-cloud-sdk/bin:./node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/anatoliy/Library/Android/sdk/tools:/Users/anatoliy/Library/Android/sdk/platform-tools:/usr/local/opt/go/libexec/bin @@ -16,11 +16,11 @@ Platform: npm manifest: { "name": "json-form-custom-element", - "private": true, - "version": "1.0.0", + "private": false, + "version": "1.1.0", "description": "JSON Schema based form generator", "main": "build/custom-element.js", - "repository": "git@github.com:1602/json-form.git", + "repository": "git://github.com/1602/json-form.git", "author": "Anatoliy ", "license": "GNU GENERAL PUBLIC LICENSE v3", "scripts": { @@ -40,10 +40,10 @@ npm manifest: "clean-webpack-plugin": "^0.1.17", "copy-webpack-plugin": "^4.2.3", "css-loader": "^0.28.7", - "elm": "^0.18.0", + "elm": "^0.19.0", "elm-hot-loader": "^0.5.4", "elm-verify-examples": "^2.3.1", - "elm-webpack-loader": "^4.4.0", + "elm-webpack-loader": "https://github.com/xtian/elm-webpack-loader.git#0.19", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "gh-pages": "^1.1.0", @@ -52,6 +52,7 @@ npm manifest: "postcss-loader": "^2.0.9", "resolve-url-loader": "^2.2.1", "style-loader": "^0.19.0", + "to-string-loader": "^1.1.5", "uglifyjs-webpack-plugin": "^1.2.7", "url-loader": "^0.6.2", "webpack": "^3.10.0", @@ -122,7 +123,7 @@ Lockfile: co "^4.6.0" json-stable-stringify "^1.0.1" - ajv@^5.0.0, ajv@^5.1.0: + ajv@^5.0.0, ajv@^5.1.0, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -280,10 +281,6 @@ Lockfile: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -322,7 +319,7 @@ Lockfile: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" - async@2.6.0, async@^2.0.1, async@^2.1.2, async@^2.4.1: + async@2.6.0, async@^2.1.2, async@^2.4.1: version "2.6.0" resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" dependencies: @@ -367,6 +364,10 @@ Lockfile: version "1.7.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" + aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -879,6 +880,13 @@ Lockfile: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + "binary@>= 0.3.0 < 1": + version "0.3.0" + resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" + dependencies: + buffers "~0.1.1" + chainsaw "~0.1.0" + binstall@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/binstall/-/binstall-1.2.0.tgz#6b2c0f580b9e3c607f50ef7a22a54ce9fdc8d933" @@ -886,11 +894,14 @@ Lockfile: request "2.79.0" tar "2.2.1" - bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" + binwrap@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/binwrap/-/binwrap-0.1.4.tgz#ca1f7870302212518fa24b07726f9c50a15c7559" dependencies: - readable-stream "~2.0.5" + request "^2.81.0" + request-promise "^4.2.0" + tar "^2.2.1" + unzip "^0.1.11" block-stream@*: version "0.0.9" @@ -902,7 +913,7 @@ Lockfile: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" - bluebird@^3.4.7, bluebird@^3.5.1: + bluebird@^3.4.7, bluebird@^3.5.0, bluebird@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -1078,6 +1089,10 @@ Lockfile: ieee754 "^1.1.4" isarray "^1.0.0" + buffers@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1184,6 +1199,12 @@ Lockfile: align-text "^0.1.3" lazy-cache "^1.0.3" + chainsaw@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" + dependencies: + traverse ">=0.3.0 <0.4" + chalk@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" @@ -1396,7 +1417,7 @@ Lockfile: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: + combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: @@ -2008,24 +2029,21 @@ Lockfile: rimraf "^2.6.2" yargs "^10.0.3" - elm-webpack-loader@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/elm-webpack-loader/-/elm-webpack-loader-4.5.0.tgz#b39988ac7c70db3c0922daf695c97d1d6bdb1e41" + "elm-webpack-loader@https://github.com/xtian/elm-webpack-loader.git#0.19": + version "4.3.1" + resolved "https://github.com/xtian/elm-webpack-loader.git#f8c56b5f2ba46fcc513ee711bc023bb8595faa80" dependencies: - elm "^0.18.0" + elm "^0.19.0" glob "^7.1.1" loader-utils "^1.0.2" - node-elm-compiler "^4.5.0" + node-elm-compiler "^5.0.0-alpha1" yargs "^6.5.0" - elm@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/elm/-/elm-0.18.0.tgz#919b8309cd939dfe2ff9d252d961b6c89509b970" + elm@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.0.tgz#c6ad86afea9e971424ebe75e36c9d03412a787fa" dependencies: - mkdirp "0.5.1" - promise "7.1.1" - request "2.74.0" - tar "2.2.1" + binwrap "0.1.4" emojis-list@^2.0.0: version "2.1.0" @@ -2296,6 +2314,10 @@ Lockfile: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -2467,14 +2489,6 @@ Lockfile: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - form-data@~1.0.0-rc4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" - dependencies: - async "^2.0.1" - combined-stream "^1.0.5" - mime-types "^2.1.11" - form-data@~2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" @@ -2483,7 +2497,7 @@ Lockfile: combined-stream "^1.0.5" mime-types "^2.1.12" - form-data@~2.3.1: + form-data@~2.3.1, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -2573,6 +2587,15 @@ Lockfile: inherits "2" minimatch "^3.0.0" + "fstream@>= 0.1.30 < 1": + version "0.1.31" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-0.1.31.tgz#7337f058fbbbbefa8c9f561a28cab0849202c988" + dependencies: + graceful-fs "~3.0.2" + inherits "~2.0.0" + mkdirp "0.5" + rimraf "2" + fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" @@ -2727,6 +2750,12 @@ Lockfile: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + graceful-fs@~3.0.2: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" @@ -2762,6 +2791,13 @@ Lockfile: ajv "^5.1.0" har-schema "^2.0.0" + har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + dependencies: + ajv "^5.3.0" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -3663,6 +3699,10 @@ Lockfile: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + lodash@^4.13.1: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" @@ -3719,6 +3759,13 @@ Lockfile: dependencies: object-visit "^1.0.0" + "match-stream@>= 0.0.2 < 1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/match-stream/-/match-stream-0.0.2.tgz#99eb050093b34dffade421b9ac0b410a9cfa17cf" + dependencies: + buffers "~0.1.1" + readable-stream "~1.0.0" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" @@ -3817,12 +3864,22 @@ Lockfile: version "1.33.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: + mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" + + mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: version "2.1.18" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: mime-db "~1.33.0" + mime-types@~2.1.19: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" + dependencies: + mime-db "~1.35.0" + mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" @@ -3879,7 +3936,7 @@ Lockfile: for-in "^1.0.2" is-extendable "^1.0.1" - mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + mkdirp@0.5, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3936,6 +3993,10 @@ Lockfile: snapdragon "^0.8.1" to-regex "^3.0.1" + natives@^1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -3963,9 +4024,9 @@ Lockfile: lodash "4.14.2" temp "^0.8.3" - node-elm-compiler@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-4.5.0.tgz#3029f053cfbfc68730e75a54f93495cc58bf7ceb" + node-elm-compiler@^5.0.0-alpha1: + version "5.0.0-alpha1" + resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-5.0.0-alpha1.tgz#ddfd35788595e5c127039975b50096188d1ae4f6" dependencies: cross-spawn "4.0.0" find-elm-dependencies "1.0.2" @@ -4062,10 +4123,6 @@ Lockfile: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" - node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -4140,6 +4197,10 @@ Lockfile: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -4244,6 +4305,10 @@ Lockfile: os-homedir "^1.0.0" os-tmpdir "^1.0.0" + "over@>= 0.0.5 < 1": + version "0.0.5" + resolved "https://registry.yarnpkg.com/over/-/over-0.0.5.tgz#f29852e70fd7e25f360e013a8ec44c82aedb5708" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -4730,10 +4795,6 @@ Lockfile: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -4746,12 +4807,6 @@ Lockfile: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" - promise@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" - dependencies: - asap "~2.0.3" - proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -4767,6 +4822,10 @@ Lockfile: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + public-encrypt@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" @@ -4777,6 +4836,15 @@ Lockfile: parse-asn1 "^5.0.0" randombytes "^2.0.1" + "pullstream@>= 0.4.1 < 1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/pullstream/-/pullstream-0.4.1.tgz#d6fb3bf5aed697e831150eb1002c25a3f8ae1314" + dependencies: + over ">= 0.0.5 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.2 < 2" + slice-stream ">= 1.0.0 < 2" + pump@^2.0.0, pump@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" @@ -4812,10 +4880,6 @@ Lockfile: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" - qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" @@ -4824,6 +4888,10 @@ Lockfile: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + query-string@^4.1.0: version "4.3.4" resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" @@ -4931,7 +4999,7 @@ Lockfile: string_decoder "~1.1.1" util-deprecate "~1.0.1" - readable-stream@1.0: + readable-stream@1.0, readable-stream@~1.0.0, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -4940,17 +5008,6 @@ Lockfile: isarray "0.0.1" string_decoder "~0.10.x" - readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -5072,6 +5129,21 @@ Lockfile: dependencies: is-finite "^1.0.0" + request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + + request-promise@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2: version "2.85.0" resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" @@ -5099,32 +5171,6 @@ Lockfile: tunnel-agent "^0.6.0" uuid "^3.1.0" - request@2.74.0: - version "2.74.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~1.0.0-rc4" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - request@2.79.0, request@~2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -5177,6 +5223,31 @@ Lockfile: tunnel-agent "^0.6.0" uuid "^3.0.0" + request@^2.81.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5269,6 +5340,10 @@ Lockfile: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + safe-buffer@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -5395,7 +5470,7 @@ Lockfile: is-plain-object "^2.0.3" split-string "^3.0.1" - setimmediate@^1.0.4: + "setimmediate@>= 1.0.1 < 2", "setimmediate@>= 1.0.2 < 2", setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -5441,6 +5516,12 @@ Lockfile: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + "slice-stream@>= 1.0.0 < 2": + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-stream/-/slice-stream-1.0.0.tgz#5b33bd66f013b1a7f86460b03d463dec39ad3ea0" + dependencies: + readable-stream "~1.0.31" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -5663,6 +5744,10 @@ Lockfile: dependencies: readable-stream "^2.0.1" + stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -5894,16 +5979,33 @@ Lockfile: regex-not "^1.0.2" safe-regex "^1.1.0" + to-string-loader@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/to-string-loader/-/to-string-loader-1.1.5.tgz#7b7aa17891b7bb4947a7a11bfb03b5fde9c6e695" + dependencies: + loader-utils "^0.2.16" + toposort@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.6.tgz#c31748e55d210effc00fdcdc7d6e68d7d7bb9cec" + tough-cookie@>=2.3.3, tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" + "traverse@>=0.3.0 <0.4": + version "0.3.9" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -6049,6 +6151,17 @@ Lockfile: has-value "^0.3.1" isobject "^3.0.0" + unzip@^0.1.11: + version "0.1.11" + resolved "https://registry.yarnpkg.com/unzip/-/unzip-0.1.11.tgz#89749c63b058d7d90d619f86b98aa1535d3b97f0" + dependencies: + binary ">= 0.3.0 < 1" + fstream ">= 0.1.30 < 1" + match-stream ">= 0.0.2 < 1" + pullstream ">= 0.4.1 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.1 < 2" + upath@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" @@ -6128,6 +6241,10 @@ Lockfile: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" + uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + validate-npm-package-license@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" @@ -6454,7 +6571,7 @@ Lockfile: window-size "0.1.0" Trace: - Error: Command "add" not found. + Error: Command "rudev" not found. at new MessageError (/usr/local/lib/node_modules/yarn/lib/cli.js:186:110) at /usr/local/lib/node_modules/yarn/lib/cli.js:87307:17 at Generator.next () diff --git a/yarn.lock b/yarn.lock index 14b05de..9f5683c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,7 +56,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.0.0, ajv@^5.1.0: +ajv@^5.0.0, ajv@^5.1.0, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -214,10 +214,6 @@ arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -256,7 +252,7 @@ async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" -async@2.6.0, async@^2.0.1, async@^2.1.2, async@^2.4.1: +async@2.6.0, async@^2.1.2, async@^2.4.1: version "2.6.0" resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" dependencies: @@ -301,6 +297,10 @@ aws4@^1.2.1, aws4@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -813,6 +813,13 @@ binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" +"binary@>= 0.3.0 < 1": + version "0.3.0" + resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" + dependencies: + buffers "~0.1.1" + chainsaw "~0.1.0" + binstall@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/binstall/-/binstall-1.2.0.tgz#6b2c0f580b9e3c607f50ef7a22a54ce9fdc8d933" @@ -820,11 +827,14 @@ binstall@1.2.0: request "2.79.0" tar "2.2.1" -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" +binwrap@0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/binwrap/-/binwrap-0.1.4.tgz#ca1f7870302212518fa24b07726f9c50a15c7559" dependencies: - readable-stream "~2.0.5" + request "^2.81.0" + request-promise "^4.2.0" + tar "^2.2.1" + unzip "^0.1.11" block-stream@*: version "0.0.9" @@ -836,7 +846,7 @@ bluebird@^2.9.24: version "2.11.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" -bluebird@^3.4.7, bluebird@^3.5.1: +bluebird@^3.4.7, bluebird@^3.5.0, bluebird@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -1012,6 +1022,10 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +buffers@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1118,6 +1132,12 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chainsaw@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" + dependencies: + traverse ">=0.3.0 <0.4" + chalk@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" @@ -1330,7 +1350,7 @@ colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: @@ -1942,24 +1962,21 @@ elm-verify-examples@^2.3.1: rimraf "^2.6.2" yargs "^10.0.3" -elm-webpack-loader@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/elm-webpack-loader/-/elm-webpack-loader-4.5.0.tgz#b39988ac7c70db3c0922daf695c97d1d6bdb1e41" +"elm-webpack-loader@https://github.com/xtian/elm-webpack-loader.git#0.19": + version "4.3.1" + resolved "https://github.com/xtian/elm-webpack-loader.git#f8c56b5f2ba46fcc513ee711bc023bb8595faa80" dependencies: - elm "^0.18.0" + elm "^0.19.0" glob "^7.1.1" loader-utils "^1.0.2" - node-elm-compiler "^4.5.0" + node-elm-compiler "^5.0.0-alpha1" yargs "^6.5.0" -elm@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/elm/-/elm-0.18.0.tgz#919b8309cd939dfe2ff9d252d961b6c89509b970" +elm@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/elm/-/elm-0.19.0.tgz#c6ad86afea9e971424ebe75e36c9d03412a787fa" dependencies: - mkdirp "0.5.1" - promise "7.1.1" - request "2.74.0" - tar "2.2.1" + binwrap "0.1.4" emojis-list@^2.0.0: version "2.1.0" @@ -2230,6 +2247,10 @@ extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -2401,14 +2422,6 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -form-data@~1.0.0-rc4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" - dependencies: - async "^2.0.1" - combined-stream "^1.0.5" - mime-types "^2.1.11" - form-data@~2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" @@ -2417,7 +2430,7 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" -form-data@~2.3.1: +form-data@~2.3.1, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -2507,6 +2520,15 @@ fstream-ignore@^1.0.5: inherits "2" minimatch "^3.0.0" +"fstream@>= 0.1.30 < 1": + version "0.1.31" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-0.1.31.tgz#7337f058fbbbbefa8c9f561a28cab0849202c988" + dependencies: + graceful-fs "~3.0.2" + inherits "~2.0.0" + mkdirp "0.5" + rimraf "2" + fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" @@ -2661,6 +2683,12 @@ graceful-fs@4.1.11, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +graceful-fs@~3.0.2: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" @@ -2696,6 +2724,13 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" +har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + dependencies: + ajv "^5.3.0" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -3597,6 +3632,10 @@ lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, l version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" +lodash@^4.13.1: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" @@ -3653,6 +3692,13 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +"match-stream@>= 0.0.2 < 1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/match-stream/-/match-stream-0.0.2.tgz#99eb050093b34dffade421b9ac0b410a9cfa17cf" + dependencies: + buffers "~0.1.1" + readable-stream "~1.0.0" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" @@ -3751,12 +3797,22 @@ miller-rabin@^4.0.0: version "1.33.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: +mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" + +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: version "2.1.18" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: mime-db "~1.33.0" +mime-types@~2.1.19: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" + dependencies: + mime-db "~1.35.0" + mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" @@ -3813,7 +3869,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3870,6 +3926,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +natives@^1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -3897,9 +3957,9 @@ node-elm-compiler@4.3.3: lodash "4.14.2" temp "^0.8.3" -node-elm-compiler@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-4.5.0.tgz#3029f053cfbfc68730e75a54f93495cc58bf7ceb" +node-elm-compiler@^5.0.0-alpha1: + version "5.0.0-alpha1" + resolved "https://registry.yarnpkg.com/node-elm-compiler/-/node-elm-compiler-5.0.0-alpha1.tgz#ddfd35788595e5c127039975b50096188d1ae4f6" dependencies: cross-spawn "4.0.0" find-elm-dependencies "1.0.2" @@ -3996,10 +4056,6 @@ node-sass@^4.7.2: stdout-stream "^1.4.0" "true-case-path" "^1.0.2" -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -4074,6 +4130,10 @@ oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -4178,6 +4238,10 @@ osenv@0, osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +"over@>= 0.0.5 < 1": + version "0.0.5" + resolved "https://registry.yarnpkg.com/over/-/over-0.0.5.tgz#f29852e70fd7e25f360e013a8ec44c82aedb5708" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -4664,10 +4728,6 @@ private@^0.1.6, private@^0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -4680,12 +4740,6 @@ promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" -promise@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" - dependencies: - asap "~2.0.3" - proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -4701,6 +4755,10 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + public-encrypt@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" @@ -4711,6 +4769,15 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" +"pullstream@>= 0.4.1 < 1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/pullstream/-/pullstream-0.4.1.tgz#d6fb3bf5aed697e831150eb1002c25a3f8ae1314" + dependencies: + over ">= 0.0.5 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.2 < 2" + slice-stream ">= 1.0.0 < 2" + pump@^2.0.0, pump@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" @@ -4746,10 +4813,6 @@ qs@6.5.1, qs@~6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" @@ -4758,6 +4821,10 @@ qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + query-string@^4.1.0: version "4.3.4" resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" @@ -4865,7 +4932,7 @@ read-pkg@^2.0.0: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@1.0: +readable-stream@1.0, readable-stream@~1.0.0, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -4874,17 +4941,6 @@ readable-stream@1.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -5006,6 +5062,21 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2: version "2.85.0" resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" @@ -5033,32 +5104,6 @@ request@2: tunnel-agent "^0.6.0" uuid "^3.1.0" -request@2.74.0: - version "2.74.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~1.0.0-rc4" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - request@2.79.0, request@~2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -5111,6 +5156,31 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" +request@^2.81.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5203,6 +5273,10 @@ safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" +safe-buffer@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -5329,7 +5403,7 @@ set-value@^2.0.0: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4: +"setimmediate@>= 1.0.1 < 2", "setimmediate@>= 1.0.2 < 2", setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -5375,6 +5449,12 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +"slice-stream@>= 1.0.0 < 2": + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-stream/-/slice-stream-1.0.0.tgz#5b33bd66f013b1a7f86460b03d463dec39ad3ea0" + dependencies: + readable-stream "~1.0.31" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -5597,6 +5677,10 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-browserify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" @@ -5838,12 +5922,23 @@ toposort@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.6.tgz#c31748e55d210effc00fdcdc7d6e68d7d7bb9cec" +tough-cookie@>=2.3.3, tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" +"traverse@>=0.3.0 <0.4": + version "0.3.9" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -5989,6 +6084,17 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +unzip@^0.1.11: + version "0.1.11" + resolved "https://registry.yarnpkg.com/unzip/-/unzip-0.1.11.tgz#89749c63b058d7d90d619f86b98aa1535d3b97f0" + dependencies: + binary ">= 0.3.0 < 1" + fstream ">= 0.1.30 < 1" + match-stream ">= 0.0.2 < 1" + pullstream ">= 0.4.1 < 1" + readable-stream "~1.0.31" + setimmediate ">= 1.0.1 < 2" + upath@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" @@ -6068,6 +6174,10 @@ uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + validate-npm-package-license@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338"