Skip to content

Commit

Permalink
Upgrade to PureScript 0.15.13 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoikin authored Nov 30, 2023
1 parent 34658dd commit cedb02f
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 84 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# purescript-elmish-html

## 0.7.1

### Changed

- Upgraded to PureScript 0.15.13

## 0.7.0

### Added
Expand Down
120 changes: 46 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"elliptic": "^6.5.4",
"lodash": "^4.17.21",
"pulp": "^16.0.0",
"purescript": "^0.15.7",
"purescript": "^0.15.13",
"purescript-psa": "^0.8.2",
"spago": "^0.20.9"
},
Expand Down
2 changes: 1 addition & 1 deletion packages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ let upstream =
sha256:e56fbdf33a5afd2a610c81f8b940b413a638931edb41532164e641bb2a9ec29c

in upstream
with elmish.version = "v0.9.0"
with elmish.version = "v0.10.1"
15 changes: 7 additions & 8 deletions src/Elmish/HTML/Events/Events.purs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import Elmish.HTML.Events.Internal (RKeyboardEvent, RMouseEvent, RSyntheticEvent
import Elmish.HTML.Events.Methods (class IsKeyboardOrMouseEvent, class IsSyntheticEvent)
import Elmish.HTML.Events.Methods (preventDefault, stopPropagation, getModifierState) as MethodsReexport
import Foreign (unsafeToForeign)
import Type.Proxy (Proxy(..))

-- | Type of every `onXyz` property on every HTML tag in this library. This is
-- | the standard shape of all event handlers on React's built-in components
Expand All @@ -38,27 +37,27 @@ type EventHandler a = EffectFn1 a Unit
-- | The most generic event object from React, for events that don't have any
-- | special properties. This type follows React docs at https://reactjs.org/docs/events.html
newtype SyntheticEvent = SyntheticEvent RSyntheticEvent
instance CanReceiveFromJavaScript SyntheticEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript SyntheticEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent SyntheticEvent

-- | Event object for keyboard-related events such as `onKeyDown` or `onKeyPress`. This
-- | type follows React docs at https://reactjs.org/docs/events.html#keyboard-events
newtype KeyboardEvent = KeyboardEvent RKeyboardEvent
instance CanReceiveFromJavaScript KeyboardEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript KeyboardEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent KeyboardEvent
instance IsKeyboardOrMouseEvent KeyboardEvent

-- | Event object for mouse-related events such as `onMouseDown` or `onMouseMove`. This
-- | type follows React docs at https://reactjs.org/docs/events.html#mouse-events
newtype MouseEvent = MouseEvent RMouseEvent
instance CanReceiveFromJavaScript MouseEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript MouseEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent MouseEvent
instance IsKeyboardOrMouseEvent MouseEvent

-- | Event object for touch-related events such as `onTouchStart` or
-- | `onTouchMove`. This type follows React docs at https://reactjs.org/docs/events.html#touch-events
newtype TouchEvent = TouchEvent RTouchEvent
instance CanReceiveFromJavaScript TouchEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript TouchEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent TouchEvent
instance IsKeyboardOrMouseEvent TouchEvent

Expand All @@ -73,7 +72,7 @@ instance IsKeyboardOrMouseEvent TouchEvent
-- | input { type: "checkbox", onChange: dispatch <| MyCheckboxChanged <<< E.inputChecked }
-- |
newtype InputChangeEvent = InputChangeEvent RSyntheticEvent
instance CanReceiveFromJavaScript InputChangeEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript InputChangeEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent InputChangeEvent

-- | Event object specifically for the `onChange` event of the `<textarea>` tag.
Expand All @@ -84,7 +83,7 @@ instance IsSyntheticEvent InputChangeEvent
-- | textarea { onChange: dispatch <| MyTextareaChanged <<< E.textareaText }
-- |
newtype TextAreaChangeEvent = TextAreaChangeEvent RSyntheticEvent
instance CanReceiveFromJavaScript TextAreaChangeEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript TextAreaChangeEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent TextAreaChangeEvent

-- | Event object specifically for the `onChange` event of the `<select>` tag.
Expand All @@ -96,7 +95,7 @@ instance IsSyntheticEvent TextAreaChangeEvent
-- | select { onChange: dispatch <| MyInputChanged <<< E.selectSelectedValue }
-- |
newtype SelectChangeEvent = SelectChangeEvent RSyntheticEvent
instance CanReceiveFromJavaScript SelectChangeEvent where validateForeignType _ = validateForeignType (Proxy :: _ {})
instance CanReceiveFromJavaScript SelectChangeEvent where validateForeignType = validateForeignType @{}
instance IsSyntheticEvent SelectChangeEvent

-- | Convenience accessor for extracting the value of an `<input type=text>` tag
Expand Down

0 comments on commit cedb02f

Please sign in to comment.