Commit cfc38215 authored by David Davó's avatar David Davó

Some updates to 5.0

parent 3dd254a4
...@@ -31,7 +31,6 @@ pattern ViewName = S.SViewName ...@@ -31,7 +31,6 @@ pattern ViewName = S.SViewName
pattern ModelModule = S.SModelModule pattern ModelModule = S.SModelModule
pattern ModelModuleVersion = S.SModelModuleVersion pattern ModelModuleVersion = S.SModelModuleVersion
pattern ModelName = S.SModelName pattern ModelName = S.SModelName
pattern MsgThrottle = S.SMsgThrottle
pattern DisplayHandler = S.SDisplayHandler pattern DisplayHandler = S.SDisplayHandler
pattern Visible = S.SVisible pattern Visible = S.SVisible
pattern CSS = S.SCSS pattern CSS = S.SCSS
......
...@@ -35,7 +35,6 @@ singletons ...@@ -35,7 +35,6 @@ singletons
| ModelModule | ModelModule
| ModelModuleVersion | ModelModuleVersion
| ModelName | ModelName
| MsgThrottle
| DisplayHandler | DisplayHandler
| Visible | Visible
| CSS | CSS
......
...@@ -119,7 +119,7 @@ type (a :++ b) = a ++ b ...@@ -119,7 +119,7 @@ type (a :++ b) = a ++ b
-- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication. -- Classes from IPython's widget hierarchy. Defined as such to reduce code duplication.
type WidgetClass = ['S.ViewModule, 'S.ViewModuleVersion, 'S.ViewName, type WidgetClass = ['S.ViewModule, 'S.ViewModuleVersion, 'S.ViewName,
'S.ModelModule, 'S.ModelModuleVersion, 'S.ModelName, 'S.MsgThrottle, 'S.DisplayHandler] 'S.ModelModule, 'S.ModelModuleVersion, 'S.ModelName, 'S.DisplayHandler]
type DOMWidgetClass = WidgetClass :++ ['S.Visible, 'S.CSS, 'S.DOMClasses, 'S.Width, 'S.Height, 'S.Padding, type DOMWidgetClass = WidgetClass :++ ['S.Visible, 'S.CSS, 'S.DOMClasses, 'S.Width, 'S.Height, 'S.Padding,
'S.Margin, 'S.Color, 'S.BackgroundColor, 'S.BorderColor, 'S.BorderWidth, 'S.Margin, 'S.Color, 'S.BackgroundColor, 'S.BorderColor, 'S.BorderWidth,
...@@ -165,7 +165,6 @@ type family FieldType (f :: Field) :: * where ...@@ -165,7 +165,6 @@ type family FieldType (f :: Field) :: * where
FieldType 'S.ModelModule = Text FieldType 'S.ModelModule = Text
FieldType 'S.ModelModuleVersion = Text FieldType 'S.ModelModuleVersion = Text
FieldType 'S.ModelName = Text FieldType 'S.ModelName = Text
FieldType 'S.MsgThrottle = Integer
FieldType 'S.DisplayHandler = IO () FieldType 'S.DisplayHandler = IO ()
FieldType 'S.Visible = Bool FieldType 'S.Visible = Bool
FieldType 'S.CSS = [(Text, Text, Text)] FieldType 'S.CSS = [(Text, Text, Text)]
...@@ -395,9 +394,6 @@ instance ToPairs (Attr 'S.ModelModuleVersion) where ...@@ -395,9 +394,6 @@ instance ToPairs (Attr 'S.ModelModuleVersion) where
instance ToPairs (Attr 'S.ModelName) where instance ToPairs (Attr 'S.ModelName) where
toPairs x = ["_model_name" .= toJSON x] toPairs x = ["_model_name" .= toJSON x]
instance ToPairs (Attr 'S.MsgThrottle) where
toPairs x = ["msg_throttle" .= toJSON x]
instance ToPairs (Attr 'S.DisplayHandler) where instance ToPairs (Attr 'S.DisplayHandler) where
toPairs _ = [] -- Not sent to the frontend toPairs _ = [] -- Not sent to the frontend
...@@ -657,7 +653,6 @@ defaultControlWidget viewName modelName = (ViewModule =:: "@jupyter-widgets/cont ...@@ -657,7 +653,6 @@ defaultControlWidget viewName modelName = (ViewModule =:: "@jupyter-widgets/cont
:& (ModelModule =:: "@jupyter-widgets/controls") :& (ModelModule =:: "@jupyter-widgets/controls")
:& (ModelModuleVersion =:: "1.4.0") :& (ModelModuleVersion =:: "1.4.0")
:& (ModelName =:: modelName) :& (ModelName =:: modelName)
:& (MsgThrottle =:+ 3)
:& (DisplayHandler =:: return ()) :& (DisplayHandler =:: return ())
:& RNil :& RNil
......
...@@ -580,7 +580,8 @@ instance ToJSON Message where ...@@ -580,7 +580,8 @@ instance ToJSON Message where
toJSON PublishStatus { executionState = executionState } = toJSON PublishStatus { executionState = executionState } =
object ["execution_state" .= executionState] object ["execution_state" .= executionState]
toJSON PublishStream { streamType = streamType, streamContent = content } = toJSON PublishStream { streamType = streamType, streamContent = content } =
object ["data" .= content, "name" .= streamType] -- Since 5.0 "data" key was renamed to "text"
object ["text" .= content, "name" .= streamType, "output_type" .= string "stream"]
toJSON r@PublishDisplayData { displayData = datas } toJSON r@PublishDisplayData { displayData = datas }
= object = object
$ case transient r of $ case transient r of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment