packages feed

miso 1.5.0.0 → 1.5.1.0

raw patch · 8 files changed

+38/−9 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Miso.Event.Decoder: keyInfoDecoder :: Decoder KeyInfo
+ Miso.Event.Types: KeyInfo :: !KeyCode -> !Bool -> KeyInfo
+ Miso.Event.Types: [keyCode] :: KeyInfo -> !KeyCode
+ Miso.Event.Types: [shiftKey, metaKey, ctrlKey, altKey] :: KeyInfo -> !Bool
+ Miso.Event.Types: data KeyInfo
+ Miso.Event.Types: instance GHC.Classes.Eq Miso.Event.Types.KeyInfo
+ Miso.Event.Types: instance GHC.Show.Show Miso.Event.Types.KeyInfo
+ Miso.Html.Event: onKeyDownWithInfo :: (KeyInfo -> action) -> Attribute action

Files

README.md view
@@ -61,6 +61,7 @@ - [Sample Application](#sample-application) - [Transition Application](#transition-application) - [Live reload with JSaddle](#live-reload-with-jsaddle)+- [Docker](#docker) - [Building examples](#building-examples) - [Coverage](#coverage) - [Isomorphic](#isomorphic)@@ -164,7 +165,7 @@  To build the project with `cabal` after entering the `nix-shell` ```-nix-shell -A env --run 'cabal configure --ghcjs && cabal build`+nix-shell -A env --run 'cabal configure --ghcjs && cabal build' ```  For incremental development inside of the `nix-shell` we recommend using a tool like [`entr`](http://eradman.com/entrproject/) to automatically rebuild on file changes, or roll your own solution with `inotify`.@@ -367,6 +368,10 @@ ## Live reload with JSaddle  It is possible to build `miso` applications with `ghcid`, `jsaddle` that allow live reloading of your application in reponse to changes in application code. See the [README](https://github.com/dmjio/miso/blob/master/sample-app-jsaddle/README.md) in the `sample-app-jsaddle` folder for more information.++## Docker++Developing miso applications inside a Docker container is supported (allows applications to be built on Windows). See the [README](https://github.com/dmjio/miso/blob/master/docker/README.md) in the `docker` folder for more information.  ## Building examples 
frontend-src/Miso/String.hs view
@@ -26,8 +26,6 @@  #ifndef JSADDLE import           Data.Aeson-import           Data.Char- #endif import qualified Data.ByteString as B import qualified Data.ByteString.Lazy as BL
jsbits/diff.js view
@@ -101,7 +101,7 @@         node[c] = '';     } else {       /* Already on DOM from previous diff, continue */-      if (newProp === cProps[c]) continue;+      if (newProp === cProps[c] && c !== 'checked' && c !== 'value') continue;       if (isSvg) {         if (c === 'href')           node.setAttributeNS('http://www.w3.org/1999/xlink', 'href', newProp);
miso.cabal view
@@ -1,5 +1,5 @@ name:                miso-version:             1.5.0.0+version:             1.5.1.0 category:            Web, Miso, Data Structures license:             BSD3 license-file:        LICENSE
src/Miso/Event/Decoder.hs view
@@ -17,6 +17,7 @@   -- * Decoders   , emptyDecoder   , keycodeDecoder+  , keyInfoDecoder   , checkedDecoder   , valueDecoder   )@@ -57,6 +58,19 @@     decodeAt = DecodeTarget mempty     decoder = withObject "event" $ \o ->        KeyCode <$> (o .: "keyCode" <|> o .: "which" <|> o .: "charCode")++-- | Retrieves either "keyCode", "which" or "charCode" field in `Decoder`, along with shift, ctrl, meta and alt.+keyInfoDecoder :: Decoder KeyInfo+keyInfoDecoder = Decoder {..}+  where+    decodeAt = DecodeTarget mempty+    decoder =+      withObject "event" $ \o ->+        KeyInfo <$> (o .: "keyCode" <|> o .: "which" <|> o .: "charCode")+                <*> o .: "shiftKey"+                <*> o .: "metaKey"+                <*> o .: "ctrlKey"+                <*> o .: "altKey"  -- | Retrieves "value" field in `Decoder` valueDecoder :: Decoder MisoString
src/Miso/Event/Types.hs view
@@ -17,6 +17,13 @@ import           Miso.String import           Data.Aeson (FromJSON) +-- | Type useful for both KeyCode and additional key press information.+data KeyInfo+  = KeyInfo+  { keyCode :: !KeyCode+  , shiftKey, metaKey, ctrlKey, altKey :: !Bool+  } deriving (Show, Eq)+ -- | Type used for Keyboard events. -- -- See <https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#Browser_compatibility>
src/Miso/Html/Event.hs view
@@ -35,6 +35,7 @@   , onMouseOut   -- * Keyboard events   , onKeyDown+  , onKeyDownWithInfo   , onKeyPress   , onKeyUp   -- * Form events@@ -90,6 +91,10 @@ -- | https://developer.mozilla.org/en-US/docs/Web/Events/change onChange :: (MisoString -> action) -> Attribute action onChange = on "change" valueDecoder++-- | https://developer.mozilla.org/en-US/docs/Web/Events/keydown+onKeyDownWithInfo :: (KeyInfo -> action) -> Attribute action+onKeyDownWithInfo = on "keydown" keyInfoDecoder  -- | https://developer.mozilla.org/en-US/docs/Web/Events/keydown onKeyDown :: (KeyCode -> action) -> Attribute action
src/Miso/Svg/Element.hs view
@@ -126,7 +126,7 @@ circle_ :: [Attribute action] -> [View action] -> View action circle_ = nodeSvg_ "circle" --- | <https__://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse>+-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse> ellipse_ :: [Attribute action] -> [View action] -> View action ellipse_ = nodeSvg_ "ellipse" @@ -134,7 +134,7 @@ image_ :: [Attribute action] -> [View action] -> View action image_ = nodeSvg_ "image" --- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image>+-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line> line_ :: [Attribute action] -> [View action] -> View action line_ = nodeSvg_ "line" @@ -170,7 +170,7 @@ animateMotion_ :: [Attribute action] -> [View action] -> View action animateMotion_ = nodeSvg_ "animateMotion" --- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateMotion>+-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateTransform> animateTransform_ :: [Attribute action] -> [View action] -> View action animateTransform_ = nodeSvg_ "animateTransform" @@ -250,7 +250,7 @@ glyphRef_ :: [Attribute action] -> [View action] -> View action glyphRef_ = nodeSvg_ "glyphRef" --- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyphRef>+-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Element/textPath> textPath_ :: [Attribute action] -> [View action] -> View action textPath_ = nodeSvg_ "textPath"