diff --git a/elm.json b/elm.json index 1fff7fa..f39b5bf 100644 --- a/elm.json +++ b/elm.json @@ -1,17 +1,14 @@ { - "type": "package", - "name": "MacCASOutreach/graphicsvg", - "summary": "Library for creating SVG graphics", - "license": "BSD-3-Clause", - "version": "3.0.0", - "source-directories": [ - "src" - ], + "type": "package", + "name": "MacCASOutreach/graphicsvg", + "summary": "Library for creating SVG graphics", + "license": "BSD-3-Clause", + "version": "4.0.0", "exposed-modules": [ "GraphicSVG", "GraphicSVG.App" ], - "elm-version": "0.19.0 <= v < 0.20.0", + "elm-version": "0.19.0 <= v < 0.20.0", "dependencies": { "elm/browser": "1.0.0 <= v < 2.0.0", "elm/core": "1.0.0 <= v < 2.0.0", @@ -23,5 +20,5 @@ "elm/url": "1.0.0 <= v < 2.0.0", "elm/virtual-dom": "1.0.0 <= v < 2.0.0" }, - "test-dependencies": {} + "test-dependencies": {} } \ No newline at end of file diff --git a/src/GraphicSVG.elm b/src/GraphicSVG.elm index 13e3cd6..b6263d8 100644 --- a/src/GraphicSVG.elm +++ b/src/GraphicSVG.elm @@ -38,6 +38,11 @@ other applications including keyboard presses and mouse movements. @docs App, app +# EllieApp + +@docs EllieApp, ellieApp + + # Stencils @docs line, polygon, openPolygon, ngon, triangle, rightTriangle, isosceles, sideAngleSide, square, rect, rectangle, roundedRect, circle, oval, wedge diff --git a/src/GraphicSVG/App.elm b/src/GraphicSVG/App.elm index c4d94ee..e31ac2d 100644 --- a/src/GraphicSVG/App.elm +++ b/src/GraphicSVG/App.elm @@ -20,6 +20,11 @@ and other applications including response to time, keyboard presses, and mouse a @docs InputHandler, GetKeyState, Keys, KeyState + +# Barebones app with keyboard and time + +@docs AppWithTick, appWithTick + -} import Browser exposing (UrlRequest(..)) @@ -709,11 +714,28 @@ hiddenGameUpdate userUpdate msg ( userModel, hiddenModel ) = ( ( userModel, hiddenModel ), Cmd.none ) +{-| This type alias is only used as a target for a user `main` type signature to make +the type signature more clear and concise when `main` calls `gameApp`: +main : GameApp Model Msg +main = + appWithTick Tick + { model = init + , update = update + , view = view + , subscriptions = subscriptions + , onUrlRequest = OnUrlRequest + , onUrlChange = OnUrlChange + } +where `Tick` is the message handler called once per browser window update, +`Model` is the type alias of the user persistent model, and +`Msg` is the name of the user message type; if other names are used, +they can be substituted for these names. +-} type alias AppWithTick flags userModel userMsg = App flags ( userModel, HiddenModel userMsg ) (HiddenMsg userMsg) -{- +{-| A GraphicSVG.app with automatic time and keyboard presses passed into the update function. `appWithTick` takes two parameters: one is your own type of `InputHandler` message which will be automatically called each time the browser window is refreshed