Commit 71638695 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[reactix] upgraded reactix to 0.4.6

parent 475a69dc
......@@ -3144,7 +3144,7 @@
"unsafe-coerce"
],
"repo": "https://github.com/irresponsible/purescript-reactix",
"version": "v0.4.5"
"version": "v0.4.6"
},
"read": {
"dependencies": [
......
......@@ -768,11 +768,11 @@
};
"reactix" = {
name = "reactix";
version = "v0.4.5";
version = "v0.4.6";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-reactix";
rev = "v0.4.5";
sha256 = "0nzings4ygsrl4ak8x87sns7lgv6fljzhw69l0gk1iihhhazkhan";
rev = "v0.4.6";
sha256 = "0q3cq3d9385jq9dlpjhfqdc4b4nvxxlmjncs3fr4xk8vv24j3kns";
};
};
"read" = {
......
......@@ -109,7 +109,7 @@ let additions =
, "unsafe-coerce"
]
"https://github.com/irresponsible/purescript-reactix"
"v0.4.5"
"v0.4.6"
, tuples-native =
mkPackage
[ "generics-rep", "prelude", "typelevel", "unsafe-coerce" ]
......
......@@ -47,7 +47,7 @@ annotatedField :: Record Props -> R.Element
annotatedField p = R.createElement annotatedFieldComponent p []
annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R2.hooksComponent thisModule "annotatedField" cpt
annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField" cpt
where
cpt {ngrams,setTermList,text} _ = do
mMenu@(_ /\ setMenu) <- R.useState' Nothing
......@@ -98,7 +98,7 @@ addMenu :: Record AddMenuProps -> R.Element
addMenu p = R.createElement addMenuCpt p []
addMenuCpt :: R.Component AddMenuProps
addMenuCpt = R2.hooksComponent thisModule "addMenu" cpt
addMenuCpt = R.hooksComponentWithModule thisModule "addMenu" cpt
where
cpt { menuRef } _ = do
(mMenu /\ setmMenu) <- R.useState' (Nothing :: Maybe AnnotationMenu)
......@@ -113,7 +113,7 @@ addMenuCpt = R2.hooksComponent thisModule "addMenu" cpt
Nothing -> HTML.div {} []
Just menu -> annotationMenu setmMenu menu
-- forall e. IsMouseEvent e => R2.Setter (Maybe AnnotationMenu) -> R2.Setter ? -> ? -> e -> Effect Unit
-- forall e. IsMouseEvent e => R.Setter (Maybe AnnotationMenu) -> R.Setter ? -> ? -> e -> Effect Unit
maybeShowMenu setMenu menuRef setTermList ngrams event = do
s <- Sel.getSelection
log2 "[maybeShowMenu] s" s
......
......@@ -36,14 +36,14 @@ type AnnotationMenu = {
-- | An Annotation Menu is parameterised by a Maybe Termlist of the
-- | TermList the currently selected text belongs to
annotationMenu :: R2.Setter (Maybe AnnotationMenu) -> AnnotationMenu -> R.Element
annotationMenu :: R.Setter (Maybe AnnotationMenu) -> AnnotationMenu -> R.Element
annotationMenu setMenu { x,y,list,menuType, onClose,setList } =
CM.contextMenu { x,y, onClose, setMenu } [
R.createElement annotationMenuCpt {list,menuType,setList} []
]
annotationMenuCpt :: R.Component Props
annotationMenuCpt = R2.hooksComponent thisModule "annotationMenu" cpt
annotationMenuCpt = R.hooksComponentWithModule thisModule "annotationMenu" cpt
where
cpt props _ = pure $ R.fragment $ children props
children props = A.mapMaybe (addToList props) [ MapTerm, CandidateTerm, StopTerm ]
......
......@@ -45,7 +45,7 @@ app :: {} -> R.Element
app props = R.createElement appCpt props []
appCpt :: R.Component ()
appCpt = R2.hooksComponent thisModule "app" cpt where
appCpt = R.hooksComponentWithModule thisModule "app" cpt where
frontends = defaultFrontends
cpt _ _ = do
sessions <- useSessions
......@@ -130,7 +130,7 @@ type ForestLayoutProps =
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R2.Setter Boolean
, showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
)
......@@ -138,7 +138,7 @@ forestLayout :: Record ForestLayoutProps -> R.Element
forestLayout props = R.createElement forestLayoutCpt props []
forestLayoutCpt :: R.Component ForestLayoutProps
forestLayoutCpt = R2.hooksComponent thisModule "forestLayout" cpt
forestLayoutCpt = R.hooksComponentWithModule thisModule "forestLayout" cpt
where
cpt props@{ handed } _ = do
pure $ R.fragment [ topBar { handed }, forestLayoutMain props ]
......@@ -147,7 +147,7 @@ forestLayoutMain :: Record ForestLayoutProps -> R.Element
forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R2.hooksComponent thisModule "forestLayoutMain" cpt
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where
cpt { child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do
let ordering =
......@@ -183,7 +183,7 @@ topBar :: Record TopBarProps -> R.Element
topBar props = R.createElement topBarCpt props []
topBarCpt :: R.Component TopBarProps
topBarCpt = R2.hooksComponent thisModule "topBar" cpt
topBarCpt = R.hooksComponentWithModule thisModule "topBar" cpt
where
cpt { handed } _ = do
pure $ H.div { id: "dafixedtop"
......@@ -225,7 +225,7 @@ handedChooser :: Record HandedChooserProps -> R.Element
handedChooser props = R.createElement handedChooserCpt props []
handedChooserCpt :: R.Component HandedChooserProps
handedChooserCpt = R2.hooksComponent thisModule "handedChooser" cpt
handedChooserCpt = R.hooksComponentWithModule thisModule "handedChooser" cpt
where
cpt { handed } _ = do
pure $ H.li {} [
......@@ -376,7 +376,7 @@ footer :: Record FooterProps -> R.Element
footer props = R.createElement footerCpt props []
footerCpt :: R.Component FooterProps
footerCpt = R2.hooksComponent thisModule "footer" cpt
footerCpt = R.hooksComponentWithModule thisModule "footer" cpt
where
cpt { session } _ = do
pure $ H.div
......
......@@ -49,7 +49,7 @@ autoUpdate :: Record PropsRow -> R.Element
autoUpdate props = R.createElement autoUpdateCpt props []
autoUpdateCpt :: R.Component PropsRow
autoUpdateCpt = R2.hooksComponent thisModule "autoUpdate" cpt
autoUpdateCpt = R.hooksComponentWithModule thisModule "autoUpdate" cpt
where
cpt { duration, effect } _ = do
intervalRef <- R.useRef Nothing
......
......@@ -107,7 +107,7 @@ codeEditor p = R.createElement codeEditorCpt p []
-- The overlay is to provide seamless syntax highlighting on top of the textarea.
-- I took the idea from: https://github.com/satya164/react-simple-code-editor
codeEditorCpt :: R.Component Props
codeEditorCpt = R2.hooksComponent thisModule "codeEditor" cpt
codeEditorCpt = R.hooksComponentWithModule thisModule "codeEditor" cpt
where
cpt {code, defaultCodeType, onChange} _ = do
controls <- initControls code defaultCodeType
......@@ -166,7 +166,7 @@ codeEditorCpt = R2.hooksComponent thisModule "codeEditor" cpt
onEditChange :: forall e. Record Controls -> (CodeType -> Code -> Effect Unit) -> e -> Effect Unit
onEditChange controls@{codeElRef, codeOverlayElRef, codeType: (codeType /\ _), codeS} onChange e = do
let code = R2.unsafeEventValue e
let code = R.unsafeEventValue e
snd codeS $ const code
onChange codeType code
......@@ -204,7 +204,7 @@ toolbar :: Record ToolbarProps -> R.Element
toolbar p = R.createElement toolbarCpt p []
toolbarCpt :: R.Component ToolbarProps
toolbarCpt = R2.hooksComponent thisModule "toolbar" cpt
toolbarCpt = R.hooksComponentWithModule thisModule "toolbar" cpt
where
cpt props@{controls: {codeType, error, viewType}} _ = do
pure $
......@@ -233,7 +233,7 @@ errorComponent :: Record ErrorComponentProps -> R.Element
errorComponent p = R.createElement errorComponentCpt p []
errorComponentCpt :: R.Component ErrorComponentProps
errorComponentCpt = R2.hooksComponent thisModule "errorComponent" cpt
errorComponentCpt = R.hooksComponentWithModule thisModule "errorComponent" cpt
where
cpt {error: (Nothing /\ _)} _ = pure $ H.div {} []
cpt {error: ((Just error) /\ _)} _ = do
......@@ -250,7 +250,7 @@ codeTypeSelector :: Record CodeTypeSelectorProps -> R.Element
codeTypeSelector p = R.createElement codeTypeSelectorCpt p []
codeTypeSelectorCpt :: R.Component CodeTypeSelectorProps
codeTypeSelectorCpt = R2.hooksComponent thisModule "codeTypeSelector" cpt
codeTypeSelectorCpt = R.hooksComponentWithModule thisModule "codeTypeSelector" cpt
where
cpt {codeType, onChange} _ = do
pure $ R2.select { className: "form-control"
......@@ -274,7 +274,7 @@ codeTypeSelectorCpt = R2.hooksComponent thisModule "codeTypeSelector" cpt
setCodeType $ const codeType
onChange codeType
where
value = R2.unsafeEventValue e
value = R.unsafeEventValue e
type ViewTypeSelectorProps =
......@@ -286,7 +286,7 @@ viewTypeSelector :: Record ViewTypeSelectorProps -> R.Element
viewTypeSelector p = R.createElement viewTypeSelectorCpt p []
viewTypeSelectorCpt :: R.Component ViewTypeSelectorProps
viewTypeSelectorCpt = R2.hooksComponent thisModule "viewTypeSelector" cpt
viewTypeSelectorCpt = R.hooksComponentWithModule thisModule "viewTypeSelector" cpt
where
cpt {state} _ =
pure $ H.div { className: "btn-group" } [
......
......@@ -27,14 +27,14 @@ type Props t = (
x :: Number
, y :: Number
, onClose :: Unit -> Effect Unit
, setMenu :: R2.Setter (Maybe t)
, setMenu :: R.Setter (Maybe t)
)
contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element
contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt = R2.hooksComponent thisModule "contextMenu" cpt
contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt
where
cpt menu@{ x, y, onClose, setMenu } children = do
host <- R2.getPortalHost
......@@ -70,7 +70,7 @@ contextMenuCpt = R2.hooksComponent thisModule "contextMenu" cpt
contextMenuEffect
:: forall t.
(Unit -> Effect Unit)
-> R2.Setter (Maybe t)
-> R.Setter (Maybe t)
-> R.Ref (Nullable DOM.Element)
-> Effect (Effect Unit)
contextMenuEffect onClose setMenu rootRef =
......@@ -85,7 +85,7 @@ contextMenuEffect onClose setMenu rootRef =
DOM.removeEventListener document "scroll" onScroll
Nothing -> pure R.nothing
documentClickHandler :: forall t. (Unit -> Effect Unit) -> R2.Setter (Maybe t) -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler :: forall t. (Unit -> Effect Unit) -> R.Setter (Maybe t) -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler onClose hide menu =
R2.named "hideMenuOnClickOutside" $ callback $ \e ->
if Element.contains menu (DE.target e)
......@@ -94,7 +94,7 @@ documentClickHandler onClose hide menu =
hide (const Nothing)
onClose unit
documentScrollHandler :: forall t. R2.Setter (Maybe t) -> Callback DE.MouseEvent
documentScrollHandler :: forall t. R.Setter (Maybe t) -> Callback DE.MouseEvent
documentScrollHandler hide =
R2.named "hideMenuOnScroll" $ callback $ \e -> hide (const Nothing)
......@@ -111,7 +111,7 @@ contextMenuItem :: Array R.Element -> R.Element
contextMenuItem = R.createElement contextMenuItemCpt {}
contextMenuItemCpt :: R.Component ()
contextMenuItemCpt = R2.hooksComponent thisModule "contextMenuItem" cpt
contextMenuItemCpt = R.hooksComponentWithModule thisModule "contextMenuItem" cpt
where
cpt _props children = pure $ HTML.li { className: "context-menu-item" } children
......
......@@ -162,7 +162,7 @@ docViewLayout :: Record LayoutProps -> R.Element
docViewLayout props = R.createElement docViewLayoutCpt props []
docViewLayoutCpt :: R.Component LayoutProps
docViewLayoutCpt = R2.hooksComponent thisModule "docViewLayout" cpt
docViewLayoutCpt = R.hooksComponentWithModule thisModule "docViewLayout" cpt
where
cpt layout _children = do
query <- R.useState' ""
......@@ -179,7 +179,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props
docViewCpt = R2.hooksComponent thisModule "docView" cpt where
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where
cpt { query, params
, layout: { frontends, session, nodeId, tabType, listId
, corpusId, totalRecords, chart, showSearch } } _ = do
......@@ -216,7 +216,7 @@ docViewCpt = R2.hooksComponent thisModule "docView" cpt where
searchBar :: R.State Query -> R.Element
searchBar (query /\ setQuery) = R.createElement el {} []
where
el = R2.hooksComponent thisModule "SearchBar" cpt
el = R.hooksComponentWithModule thisModule "SearchBar" cpt
cpt {} _children = do
queryText <- R.useState' query
......@@ -235,7 +235,7 @@ searchBar (query /\ setQuery) = R.createElement el {} []
onSearchChange :: forall e. R.State Query -> e -> Effect Unit
onSearchChange (_ /\ setQueryText) = \e ->
setQueryText $ const $ R2.unsafeEventValue e
setQueryText $ const $ R.unsafeEventValue e
onSearchKeyup :: R.State Query -> DE.KeyboardEvent -> Effect Unit
onSearchKeyup (queryText /\ _) = \e ->
......@@ -301,7 +301,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt where
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt where
cpt props@{ corpusId, frontends, listId, nodeId, params, query, session, tabType } _ =
useLoaderWithCacheAPI {
cacheEndpoint: getPageHash session
......@@ -337,7 +337,7 @@ page :: T.Params -> Record PageLayoutProps -> Array DocumentsView -> R.Element
page params layout documents = R.createElement pageCpt { documents, layout, params } []
pageCpt :: R.Component PageProps
pageCpt = R2.hooksComponent thisModule "pageCpt" cpt where
pageCpt = R.hooksComponentWithModule thisModule "pageCpt" cpt where
cpt { documents, layout, params } _ = do
paramsS <- R.useState' params
pure $ pagePaint { documents, layout, params: paramsS }
......@@ -352,7 +352,7 @@ pagePaint :: Record PagePaintProps -> R.Element
pagePaint props = R.createElement pagePaintCpt props []
pagePaintCpt :: R.Component PagePaintProps
pagePaintCpt = R2.hooksComponent thisModule "pagePaintCpt" cpt where
pagePaintCpt = R.hooksComponentWithModule thisModule "pagePaintCpt" cpt where
cpt { layout: { corpusId, frontends, listId, nodeId, session, totalRecords }, documents, params } _ = do
localCategories <- R.useState' (mempty :: LocalCategories)
pure $ T.table
......
......@@ -94,7 +94,7 @@ docView :: Record Props -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props
docViewCpt = R2.hooksComponent thisModule "docView" cpt
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions
......@@ -145,7 +145,7 @@ docViewGraph :: Record Props -> R.Element
docViewGraph props = R.createElement docViewCpt props []
docViewGraphCpt :: R.Component Props
docViewGraphCpt = R2.hooksComponent thisModule "docViewGraph" cpt
docViewGraphCpt = R.hooksComponentWithModule thisModule "docViewGraph" cpt
where
cpt {frontends, session, nodeId, listId, query, totalRecords, chart, container} _ = do
deletions <- R.useState' initialDeletions
......@@ -292,7 +292,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt
where
cpt {frontends, totalRecords, deletions, container, session, path} _ = do
useLoader (fst path) loadPage $ \documents ->
......@@ -302,7 +302,7 @@ page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps
pageCpt = R2.hooksComponent thisModule "page" cpt
pageCpt = R.hooksComponentWithModule thisModule "page" cpt
where
cpt {frontends, totalRecords, container, deletions, documents, session, path: path@({nodeId, listId, query} /\ setPath)} _ = do
pure $ T.table { rows, container, colNames, totalRecords, params, wrapColElts }
......
......@@ -25,7 +25,7 @@ type Props =
, reload :: R.State Int
, route :: AppRoute
, sessions :: Sessions
, showLogin :: R2.Setter Boolean
, showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
)
......@@ -33,7 +33,7 @@ forest :: Record Props -> R.Element
forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props
forestCpt = R2.hooksComponent thisModule "forest" cpt where
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
cpt { frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do
-- NOTE: this is a hack to reload the tree view on demand
reload <- R.useState' (0 :: Reload)
......@@ -65,7 +65,7 @@ forestCpt = R2.hooksComponent thisModule "forest" cpt where
, session: s
}
plus :: Handed -> R2.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus :: Handed -> R.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus handed showLogin backend = H.div {className: if handed == RightHanded
then "flex-start" -- TODO we should use lefthanded SASS class here
else "flex-end"
......
......@@ -61,7 +61,7 @@ treeView :: Record Props -> R.Element
treeView props = R.createElement treeViewCpt props []
where
treeViewCpt :: R.Component Props
treeViewCpt = R2.hooksComponent thisModule "treeView" cpt
treeViewCpt = R.hooksComponentWithModule thisModule "treeView" cpt
where
cpt { root
, asyncTasks
......@@ -86,7 +86,7 @@ treeLoadView :: Record Props -> R.Element
treeLoadView p = R.createElement treeLoadViewCpt p []
where
treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R2.hooksComponent thisModule "treeLoadView" cpt
treeLoadViewCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
where
cpt { root
, asyncTasks
......@@ -125,7 +125,7 @@ loadedTreeView :: Record TreeViewProps -> R.Element
loadedTreeView p = R.createElement loadedTreeViewCpt p []
where
loadedTreeViewCpt :: R.Component TreeViewProps
loadedTreeViewCpt = R2.hooksComponent thisModule "loadedTreeView" cpt
loadedTreeViewCpt = R.hooksComponentWithModule thisModule "loadedTreeView" cpt
where
cpt { asyncTasks
, frontends
......@@ -186,7 +186,7 @@ toHtml p@{ asyncTasks
} =
R.createElement el {} []
where
el = R2.hooksComponent thisModule "nodeView" cpt
el = R.hooksComponentWithModule thisModule "nodeView" cpt
commonProps = RecordE.pick p :: Record CommonProps
pAction a = performAction a (RecordE.pick p :: Record PerformActionProps)
......
......@@ -56,7 +56,7 @@ nodeMainSpan :: IsLeaf
-> R.Element
nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p []
where
el = R2.hooksComponent thisModule "nodeMainSpan" cpt
el = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do
-- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
......@@ -222,7 +222,7 @@ nodeActions :: Record NodeActionsProps -> R.Element
nodeActions p = R.createElement nodeActionsCpt p []
nodeActionsCpt :: R.Component NodeActionsProps
nodeActionsCpt = R2.hooksComponent thisModule "nodeActions" cpt
nodeActionsCpt = R.hooksComponentWithModule thisModule "nodeActions" cpt
where
cpt { id
, nodeType: GT.Graph
......
......@@ -64,7 +64,7 @@ addNodeView :: Record CreateNodeProps
-> R.Element
addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
where
el = R2.hooksComponent thisModule "addNodeView" cpt
el = R.hooksComponentWithModule thisModule "addNodeView" cpt
cpt {id, name} _ = do
nodeName@(name' /\ setNodeName) <- R.useState' "Name"
nodeType'@(nt /\ setNodeType) <- R.useState' $ fromMaybe Folder $ head nodeTypes
......
......@@ -41,7 +41,7 @@ textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), params } = R.createElement el p []
where
{firstname, lastname} = params
el = R2.hooksComponent thisModule (boxName <> "Box") cpt
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt {id, params:params'} _ = do
let {firstname, lastname} = params'
stateFirstname <- R.useState' firstname
......@@ -59,7 +59,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para
, defaultValue: default
, on: { input: set
<<< const
<<< R2.unsafeEventValue }
<<< R.unsafeEventValue }
, placeholder: (boxName <> " Node")
, type: "text"
}
......@@ -81,7 +81,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen), para
} []
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where
el = R2.hooksComponent thisModule (boxName <> "Box") cpt
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt {} _ = pure $ H.div {} []
......
......@@ -59,7 +59,7 @@ linkNode :: Record SubTreeParamsIn -> R.Element
linkNode p = R.createElement linkNodeCpt p []
linkNodeCpt :: R.Component SubTreeParamsIn
linkNodeCpt = R2.hooksComponent thisModule "linkNode" cpt
linkNodeCpt = R.hooksComponentWithModule thisModule "linkNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
......
......@@ -26,7 +26,7 @@ mergeNode :: Record SubTreeParamsIn -> R.Element
mergeNode p = R.createElement mergeNodeCpt p []
mergeNodeCpt :: R.Component SubTreeParamsIn
mergeNodeCpt = R2.hooksComponent thisModule "mergeNode" cpt
mergeNodeCpt = R.hooksComponentWithModule thisModule "mergeNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MergeNode {params:Nothing})
......
......@@ -25,7 +25,7 @@ moveNode :: Record SubTreeParamsIn -> R.Element
moveNode p = R.createElement moveNodeCpt p []
moveNodeCpt :: R.Component SubTreeParamsIn
moveNodeCpt = R2.hooksComponent thisModule "moveNode" cpt
moveNodeCpt = R.hooksComponentWithModule thisModule "moveNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (MoveNode {params: Nothing})
......
......@@ -43,7 +43,7 @@ searchIframes :: Record SearchIFramesProps -> R.Element
searchIframes props = R.createElement searchIframesCpt props []
searchIframesCpt :: R.Component SearchIFramesProps
searchIframesCpt = R2.hooksComponent thisModule "searchIframes" cpt
searchIframesCpt = R.hooksComponentWithModule thisModule "searchIframes" cpt
where
cpt { iframeRef, search: search@(search' /\ _) } _ = do
pure $ if isIsTex_Advanced search'.datafield
......@@ -64,7 +64,7 @@ divIframe :: Record IFrameProps -> R.Element
divIframe props = R.createElement divIframeCpt props []
divIframeCpt :: R.Component IFrameProps
divIframeCpt = R2.hooksComponent thisModule "divIframe" cpt
divIframeCpt = R.hooksComponentWithModule thisModule "divIframe" cpt
where
cpt { frameSource, iframeRef, search: search@(search' /\ _) } _ = do
pure $ H.div { className: "frame-search panel panel-default" }
......@@ -79,7 +79,7 @@ iframeWith :: Record IFrameProps -> R.Element
iframeWith props = R.createElement iframeWithCpt props []
iframeWithCpt :: R.Component IFrameProps
iframeWithCpt = R2.hooksComponent thisModule "iframeWith" cpt
iframeWithCpt = R.hooksComponentWithModule thisModule "iframeWith" cpt
where
cpt { frameSource, iframeRef, search: (search /\ setSearch) } _ =
pure $ H.iframe { src: src frameSource search.term
......
......@@ -27,7 +27,7 @@ searchBar :: Record Props -> R.Element
searchBar props = R.createElement searchBarCpt props []
searchBarCpt :: R.Component Props
searchBarCpt = R2.hooksComponent thisModule "searchBar" cpt
searchBarCpt = R.hooksComponentWithModule thisModule "searchBar" cpt
where
cpt {langs, onSearch, search: search@(s /\ _), session} _ = do
--onSearchChange session s
......
......@@ -47,9 +47,9 @@ searchField :: Record Props -> R.Element
searchField p = R.createElement searchFieldComponent p []
--searchFieldComponent :: R.Memo Props
--searchFieldComponent = R.memo (R2.hooksComponent thisModule "searchField" cpt) eqProps
--searchFieldComponent = R.memo (R.hooksComponentWithModule thisModule "searchField" cpt) eqProps
searchFieldComponent :: R.Component Props
searchFieldComponent = R2.hooksComponent thisModule "searchField" cpt
searchFieldComponent = R.hooksComponentWithModule thisModule "searchField" cpt
where
cpt props@{onSearch, search: search@(s /\ _)} _ = do
iframeRef <- R.useRef null
......@@ -290,7 +290,7 @@ databaseInput (search /\ setSearch) dbs =
liItem db' = H.option {className : "text-primary center"} [ H.text (show db') ]
onChange e = do
let value = read $ R2.unsafeEventValue e
let value = read $ R.unsafeEventValue e
setSearch $ _ { datafield = Just $ External value
, databases = fromMaybe Empty value
}
......@@ -308,7 +308,7 @@ orgInput ({datafield} /\ setSearch) orgs =
liItem :: Org -> R.Element
liItem org = H.option {className : "text-primary center"} [ H.text (show org) ]
onChange e = do
let value = R2.unsafeEventValue e
let value = R.unsafeEventValue e
setSearch $ _ { datafield = Just $ External $ Just $ HAL $ read value }
{-
......@@ -318,7 +318,7 @@ filterInput (term /\ setTerm) =
[ H.input { defaultValue: term
, className: "form-control"
, type: "text"
, on: { change: setTerm <<< const <<< R2.unsafeEventValue }
, on: { change: setTerm <<< const <<< R.unsafeEventValue }
, "required pattern": "[[0-9]+[ ]+]*"
-- TODO ^FIXME not sure about the regex comprehension: that should match "123 2334 44545" only (Integers separated by one space)
-- form validation with CSS
......@@ -337,7 +337,7 @@ searchInput :: Record SearchInputProps -> R.Element
searchInput p = R.createElement searchInputComponent p []
searchInputComponent :: R.Component SearchInputProps
searchInputComponent = R2.hooksComponent thisModule "searchInput" cpt
searchInputComponent = R.hooksComponentWithModule thisModule "searchInput" cpt
where
cpt {search: (search /\ setSearch)} _ = do
pure $
......@@ -350,7 +350,7 @@ searchInputComponent = R2.hooksComponent thisModule "searchInput" cpt
}
]
onChange setSearch e = do
let value = R2.unsafeEventValue e
let value = R.unsafeEventValue e
setSearch $ _ { term = value }
type SubmitButtonProps =
......@@ -363,7 +363,7 @@ submitButton :: Record SubmitButtonProps -> R.Element
submitButton p = R.createElement submitButtonComponent p []
submitButtonComponent :: R.Component SubmitButtonProps
submitButtonComponent = R2.hooksComponent thisModule "submitButton" cpt
submitButtonComponent = R.hooksComponentWithModule thisModule "submitButton" cpt
where
cpt {onSearch, search: (mySearch /\ _), session} _ =
pure $
......
......@@ -59,7 +59,7 @@ shareNode :: Record SubTreeParamsIn -> R.Element
shareNode p = R.createElement shareNodeCpt p []
shareNodeCpt :: R.Component SubTreeParamsIn
shareNodeCpt = R2.hooksComponent thisModule "shareNode" cpt
shareNodeCpt = R.hooksComponentWithModule thisModule "shareNode" cpt
where
cpt p@{dispatch, subTreeParams, id, nodeType, session, handed} _ = do
action@(valAction /\ setAction) :: R.State Action <- R.useState' (Action.SharePublic {params: Nothing})
......
......@@ -73,7 +73,7 @@ uploadFileView :: Record Props -> R.Element
uploadFileView props = R.createElement uploadFileViewCpt props []
uploadFileViewCpt :: R.Component Props
uploadFileViewCpt = R2.hooksComponent thisModule "uploadFileView" cpt
uploadFileViewCpt = R.hooksComponentWithModule thisModule "uploadFileView" cpt
where
cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
......@@ -142,7 +142,7 @@ uploadButton :: Record UploadButtonProps -> R.Element
uploadButton props = R.createElement uploadButtonCpt props []
uploadButtonCpt :: R.Component UploadButtonProps
uploadButtonCpt = R2.hooksComponent thisModule "uploadButton" cpt
uploadButtonCpt = R.hooksComponentWithModule thisModule "uploadButton" cpt
where
cpt { dispatch
, fileType: (fileType /\ setFileType)
......@@ -189,7 +189,7 @@ fileTypeView :: Record FileTypeProps -> R.Element
fileTypeView p = R.createElement fileTypeViewCpt p []
fileTypeViewCpt :: R.Component FileTypeProps
fileTypeViewCpt = R2.hooksComponent thisModule "fileTypeView" cpt
fileTypeViewCpt = R.hooksComponentWithModule thisModule "fileTypeView" cpt
where
cpt { dispatch
, droppedFile: Just (DroppedFile {blob, fileType}) /\ setDroppedFile
......@@ -236,8 +236,8 @@ fileTypeViewCpt = R2.hooksComponent thisModule "fileTypeView" cpt
where
onChange e l =
setDroppedFile $ const $ Just $ DroppedFile $ { blob
, fileType: read $ R2.unsafeEventValue e
, lang : fromMaybe EN $ read $ R2.unsafeEventValue l
, fileType: read $ R.unsafeEventValue e
, lang : fromMaybe EN $ read $ R.unsafeEventValue l
}
renderOption opt = H.option {} [ H.text $ show opt ]
......@@ -328,7 +328,7 @@ uploadTermListView :: Record Props -> R.Element
uploadTermListView props = R.createElement uploadTermListViewCpt props []
uploadTermListViewCpt :: R.Component Props
uploadTermListViewCpt = R2.hooksComponent thisModule "uploadTermListView" cpt
uploadTermListViewCpt = R.hooksComponentWithModule thisModule "uploadTermListView" cpt
where
cpt {dispatch, id, nodeType} _ = do
mFile :: R.State (Maybe UploadFile) <- R.useState' Nothing
......@@ -374,7 +374,7 @@ uploadTermButton :: Record UploadTermButtonProps -> R.Element
uploadTermButton props = R.createElement uploadTermButtonCpt props []
uploadTermButtonCpt :: R.Component UploadTermButtonProps
uploadTermButtonCpt = R2.hooksComponent thisModule "uploadTermButton" cpt
uploadTermButtonCpt = R.hooksComponentWithModule thisModule "uploadTermButton" cpt
where
cpt {dispatch, id, mFile: (mFile /\ setMFile), nodeType} _ = do
pure $ H.button {className: "btn btn-primary", disabled, on: {click: onClick}} [ H.text "Upload" ]
......
......@@ -50,7 +50,7 @@ nodePopupView :: Record NodePopupProps -> R.Element
nodePopupView p = R.createElement nodePopupCpt p []
nodePopupCpt :: R.Component NodePopupProps
nodePopupCpt = R2.hooksComponent thisModule "nodePopupView" cpt
nodePopupCpt = R.hooksComponentWithModule thisModule "nodePopupView" cpt
where
cpt p _ = do
isOpen <- R.useState' false
......@@ -114,7 +114,7 @@ nodePopupCpt = R2.hooksComponent thisModule "nodePopupView" cpt
[ H.a { "type" : "button"
, className: glyphicon "window-close"
, on : { click: \e -> p.onPopoverClose
$ R2.unsafeEventTarget e
$ R.unsafeEventTarget e
}
, title : "Close"
} []
......@@ -202,7 +202,7 @@ buttonClick :: Record ButtonClickProps -> R.Element
buttonClick p = R.createElement buttonClickCpt p []
buttonClickCpt :: R.Component ButtonClickProps
buttonClickCpt = R2.hooksComponent thisModule "buttonClick" cpt
buttonClickCpt = R.hooksComponentWithModule thisModule "buttonClick" cpt
where
cpt {action: todo, state: (node@{action} /\ setNodePopup), nodeType} _ = do
pure $ H.div {className: "col-md-1"}
......@@ -262,7 +262,7 @@ panelAction :: Record PanelActionProps -> R.Element
panelAction p = R.createElement panelActionCpt p []
panelActionCpt :: R.Component PanelActionProps
panelActionCpt = R2.hooksComponent thisModule "panelAction" cpt
panelActionCpt = R.hooksComponentWithModule thisModule "panelAction" cpt
where
cpt {action: Documentation nodeType} _ = actionDoc nodeType
cpt {action: Download, id, nodeType, session} _ = actionDownload nodeType id session
......
......@@ -64,7 +64,7 @@ type TextInputBoxProps =
textInputBox :: Record TextInputBoxProps -> R.Element
textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R.createElement el p []
where
el = R2.hooksComponent thisModule (boxName <> "Box") cpt
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt {id, text} _ = do
renameNodeName <- R.useState' text
pure $ H.div {className: "from-group row-no-padding"}
......@@ -91,7 +91,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
-- , className: "form-control"
-- , on: { input: setRenameNodeName
-- <<< const
-- <<< R2.unsafeEventValue }
-- <<< R.unsafeEventValue }
-- }
]
submitBtn (newName /\ _) =
......@@ -111,7 +111,7 @@ textInputBox p@{ boxName, boxAction, dispatch, isOpen: (true /\ setIsOpen) } = R
launchAff_ $ dispatch ( boxAction newName )
textInputBox p@{ boxName, isOpen: (false /\ _) } = R.createElement el p []
where
el = R2.hooksComponent thisModule (boxName <> "Box") cpt
el = R.hooksComponentWithModule thisModule (boxName <> "Box") cpt
cpt {text} _ = pure $ H.div {} []
-- | END Rename Box
......@@ -138,7 +138,7 @@ formEdit defaultValue setter =
, className : "form-control"
, on: { input: setter
<<< const
<<< R2.unsafeEventValue }
<<< R.unsafeEventValue }
}
]
......@@ -174,7 +174,7 @@ formChoice nodeTypes defaultNodeType setNodeType =
<<< const
<<< fromMaybe defaultNodeType
<<< read
<<< R2.unsafeEventValue }
<<< R.unsafeEventValue }
}
(map (\opt -> H.option {} [ H.text $ show opt ]) nodeTypes)
]
......@@ -280,7 +280,7 @@ nodeLink :: Record NodeLinkProps -> R.Element
nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R2.hooksComponent thisModule "nodeLink" cpt
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
where
cpt { frontends, id, isSelected, name, nodeType, session, handed, folderOpen} _ = do
popoverRef <- R.useRef null
......@@ -320,7 +320,7 @@ nodeText :: Record NodeTextProps -> R.Element
nodeText p = R.createElement nodeTextCpt p []
nodeTextCpt :: R.Component NodeTextProps
nodeTextCpt = R2.hooksComponent thisModule "nodeText" cpt
nodeTextCpt = R.hooksComponentWithModule thisModule "nodeText" cpt
where
cpt { isSelected: true, name } _ = do
pure $ H.u {} [
......
......@@ -34,7 +34,7 @@ asyncProgressBar :: Record Props -> R.Element
asyncProgressBar p = R.createElement asyncProgressBarCpt p []
asyncProgressBarCpt :: R.Component Props
asyncProgressBarCpt = R2.hooksComponent thisModule "asyncProgressBar" cpt
asyncProgressBarCpt = R.hooksComponentWithModule thisModule "asyncProgressBar" cpt
where
cpt props@{ asyncTask: (GT.AsyncTaskWithType {task: GT.AsyncTask {id}})
, barType
......@@ -80,7 +80,7 @@ progressIndicator :: Record ProgressIndicatorProps -> R.Element
progressIndicator p = R.createElement progressIndicatorCpt p []
progressIndicatorCpt :: R.Component ProgressIndicatorProps
progressIndicatorCpt = R2.hooksComponent thisModule "progressIndicator" cpt
progressIndicatorCpt = R.hooksComponentWithModule thisModule "progressIndicator" cpt
where
cpt { barType: Bar, label, progress } _ = do
pure $
......
......@@ -39,7 +39,7 @@ subTreeView :: Record SubTreeParamsProps -> R.Element
subTreeView props = R.createElement subTreeViewCpt props []
subTreeViewCpt :: R.Component SubTreeParamsProps
subTreeViewCpt = R2.hooksComponent thisModule "subTreeView" cpt
subTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeView" cpt
where
cpt params@{ action
, dispatch
......@@ -87,7 +87,7 @@ subTreeViewLoaded :: Record CorpusTreeProps -> R.Element
subTreeViewLoaded props = R.createElement subTreeViewLoadedCpt props []
subTreeViewLoadedCpt :: R.Component CorpusTreeProps
subTreeViewLoadedCpt = R2.hooksComponent thisModule "subTreeViewLoadedCpt" cpt
subTreeViewLoadedCpt = R.hooksComponentWithModule thisModule "subTreeViewLoadedCpt" cpt
where
cpt p@{dispatch, id, nodeType, session, tree, handed} _ = do
pure $ H.div {className:"tree"}
......@@ -102,7 +102,7 @@ subTreeTreeView :: Record CorpusTreeProps -> R.Element
subTreeTreeView props = R.createElement subTreeTreeViewCpt props []
subTreeTreeViewCpt :: R.Component CorpusTreeProps
subTreeTreeViewCpt = R2.hooksComponent thisModule "subTreeTreeViewCpt" cpt
subTreeTreeViewCpt = R.hooksComponentWithModule thisModule "subTreeTreeViewCpt" cpt
where
cpt p@{ id
, tree: NTree (LNode { id: targetId
......
......@@ -30,7 +30,7 @@ nodeActionsGraph :: Record NodeActionsGraphProps -> R.Element
nodeActionsGraph p = R.createElement nodeActionsGraphCpt p []
nodeActionsGraphCpt :: R.Component NodeActionsGraphProps
nodeActionsGraphCpt = R2.hooksComponent thisModule "nodeActionsGraph" cpt
nodeActionsGraphCpt = R.hooksComponentWithModule thisModule "nodeActionsGraph" cpt
where
cpt { id, graphVersions, session, triggerRefresh } _ = do
pure $ H.div { className: "node-actions" } [
......@@ -50,7 +50,7 @@ graphUpdateButton :: Record GraphUpdateButtonProps -> R.Element
graphUpdateButton p = R.createElement graphUpdateButtonCpt p []
graphUpdateButtonCpt :: R.Component GraphUpdateButtonProps
graphUpdateButtonCpt = R2.hooksComponent thisModule "graphUpdateButton" cpt
graphUpdateButtonCpt = R.hooksComponentWithModule thisModule "graphUpdateButton" cpt
where
cpt { id, session, triggerRefresh } _ = do
enabled <- R.useState' true
......@@ -86,7 +86,7 @@ nodeActionsNodeList :: Record NodeActionsNodeListProps -> R.Element
nodeActionsNodeList p = R.createElement nodeActionsNodeListCpt p []
nodeActionsNodeListCpt :: R.Component NodeActionsNodeListProps
nodeActionsNodeListCpt = R2.hooksComponent thisModule "nodeActionsNodeList" cpt
nodeActionsNodeListCpt = R.hooksComponentWithModule thisModule "nodeActionsNodeList" cpt
where
cpt props _ = do
pure $ H.div { className: "node-actions" } [
......@@ -105,7 +105,7 @@ nodeListUpdateButton :: Record NodeListUpdateButtonProps -> R.Element
nodeListUpdateButton p = R.createElement nodeListUpdateButtonCpt p []
nodeListUpdateButtonCpt :: R.Component NodeListUpdateButtonProps
nodeListUpdateButtonCpt = R2.hooksComponent thisModule "nodeListUpdateButton" cpt
nodeListUpdateButtonCpt = R.hooksComponentWithModule thisModule "nodeListUpdateButton" cpt
where
cpt { listId, nodeId, nodeType, session, triggerRefresh } _ = do
enabled <- R.useState' true
......
......@@ -47,7 +47,7 @@ graph :: forall s fa2. Record (Props s fa2) -> R.Element
graph props = R.createElement graphCpt props []
graphCpt :: forall s fa2. R.Component (Props s fa2)
graphCpt = R2.hooksComponent thisModule "graph" cpt
graphCpt = R.hooksComponentWithModule thisModule "graph" cpt
where
cpt props _ = do
stageHooks props
......
......@@ -64,7 +64,7 @@ explorerLayout :: Record LayoutProps -> R.Element
explorerLayout props = R.createElement explorerLayoutCpt props []
explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt
explorerLayoutCpt = R.hooksComponentWithModule thisModule "explorerLayout" cpt
where
cpt props _ = do
graphVersion <- R.useState' 0
......@@ -73,7 +73,7 @@ explorerLayoutCpt = R2.hooksComponent thisModule "explorerLayout" cpt
explorerLayoutView :: R.State Int -> Record LayoutProps -> R.Element
explorerLayoutView graphVersion p = R.createElement el p []
where
el = R2.hooksComponent thisModule "explorerLayoutView" cpt
el = R.hooksComponentWithModule thisModule "explorerLayoutView" cpt
cpt props@{ graphId, session } _ = do
useLoader graphId (getNodes session graphVersion) handler
where
......@@ -88,7 +88,7 @@ explorer :: Record Props -> R.Element
explorer props = R.createElement explorerCpt props []
explorerCpt :: R.Component Props
explorerCpt = R2.hooksComponent thisModule "explorer" cpt
explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
where
cpt props@{ frontends
, graph
......@@ -228,7 +228,7 @@ type TreeProps =
, reload :: R.State Int
, sessions :: Sessions
, show :: Boolean
, showLogin :: R2.Setter Boolean
, showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
)
......@@ -259,7 +259,7 @@ graphView :: Record GraphProps -> R.Element
graphView props = R.createElement graphViewCpt props []
graphViewCpt :: R.Component GraphProps
graphViewCpt = R2.hooksComponent thisModule "graphView" cpt
graphViewCpt = R.hooksComponentWithModule thisModule "graphView" cpt
where
cpt { controls
, elRef
......
......@@ -40,7 +40,7 @@ simpleButton :: Record Props -> R.Element
simpleButton props = R.createElement simpleButtonCpt props []
simpleButtonCpt :: R.Component Props
simpleButtonCpt = R2.hooksComponent thisModule "simpleButton" cpt
simpleButtonCpt = R.hooksComponentWithModule thisModule "simpleButton" cpt
where
cpt {onClick, text} _ = do
pure $
......
......@@ -76,7 +76,7 @@ controls :: Record Controls -> R.Element
controls props = R.createElement controlsCpt props []
controlsCpt :: R.Component Controls
controlsCpt = R2.hooksComponent thisModule "controls" cpt
controlsCpt = R.hooksComponentWithModule thisModule "controls" cpt
where
cpt props _ = do
localControls <- initialLocalControls
......
......@@ -17,7 +17,7 @@ controlsToggleButton :: Record Props -> R.Element
controlsToggleButton props = R.createElement controlsToggleButtonCpt props []
controlsToggleButtonCpt :: R.Component Props
controlsToggleButtonCpt = R2.hooksComponent thisModule "graphControlsToggleButton" cpt
controlsToggleButtonCpt = R.hooksComponentWithModule thisModule "graphControlsToggleButton" cpt
where
cpt {state} _ = do
let (open /\ setOpen) = state
......
......@@ -20,7 +20,7 @@ legend :: Record Props -> R.Element
legend props = R.createElement legendCpt props []
legendCpt :: R.Component Props
legendCpt = R2.hooksComponent thisModule "legend" cpt
legendCpt = R.hooksComponentWithModule thisModule "legend" cpt
where
cpt {items} _ = pure $ RH.div {} [foldMap entry items]
......
......@@ -26,7 +26,7 @@ rangeControl :: Record Props -> R.Element
rangeControl props = R.createElement rangeControlCpt props []
rangeControlCpt :: R.Component Props
rangeControlCpt = R2.hooksComponent thisModule "rangeButton" cpt
rangeControlCpt = R.hooksComponentWithModule thisModule "rangeButton" cpt
where
cpt {caption, sliderProps} _ = do
pure $
......
......@@ -37,7 +37,7 @@ nodeSearchControl :: Record Props -> R.Element
nodeSearchControl props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props
sizeButtonCpt = R2.hooksComponent thisModule "nodeSearchControl" cpt
sizeButtonCpt = R.hooksComponentWithModule thisModule "nodeSearchControl" cpt
where
cpt {graph, multiSelectEnabled, selectedNodeIds} _ = do
search@(search' /\ setSearch) <- R.useState' ""
......
......@@ -55,7 +55,7 @@ sidebar :: Record Props -> R.Element
sidebar props = R.createElement sidebarCpt props []
sidebarCpt :: R.Component Props
sidebarCpt = R2.hooksComponent thisModule "sidebar" cpt
sidebarCpt = R.hooksComponentWithModule thisModule "sidebar" cpt
where
cpt {showSidePanel: (GET.Closed /\ _)} _children = do
pure $ RH.div {} []
......
......@@ -30,7 +30,7 @@ sizeButton :: Record Props -> R.Element
sizeButton props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props
sizeButtonCpt = R2.hooksComponent thisModule "sizeButton" cpt
sizeButtonCpt = R.hooksComponentWithModule thisModule "sizeButton" cpt
where
cpt {state, caption, min, max, onChange} _ = do
let (value /\ setValue) = state
......@@ -55,7 +55,7 @@ labelSizeButton sigmaRef state =
, max: 30.0
, onChange: \e -> do
let sigma = R.readRef sigmaRef
let newValue = readFloat $ R2.unsafeEventValue e
let newValue = readFloat $ R.unsafeEventValue e
let (_ /\ setValue) = state
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
......@@ -76,7 +76,7 @@ mouseSelectorSizeButton sigmaRef state =
, onChange: \e -> do
let sigma = R.readRef sigmaRef
let (_ /\ setValue) = state
let newValue = readFloat $ R2.unsafeEventValue e
let newValue = readFloat $ R.unsafeEventValue e
Sigmax.dependOnSigma sigma "[mouseSelectorSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s {
mouseSelectorSize: newValue
......
......@@ -36,7 +36,7 @@ toggleButton :: Record Props -> R.Element
toggleButton props = R.createElement toggleButtonCpt props []
toggleButtonCpt :: R.Component Props
toggleButtonCpt = R2.hooksComponent thisModule "toggleButton" cpt
toggleButtonCpt = R.hooksComponentWithModule thisModule "toggleButton" cpt
where
cpt {state, onMessage, offMessage, onClick} _ = do
let (toggled /\ _) = state
......@@ -67,7 +67,7 @@ edgesToggleButton :: Record EdgesButtonProps -> R.Element
edgesToggleButton props = R.createElement edgesToggleButtonCpt props []
edgesToggleButtonCpt :: R.Component EdgesButtonProps
edgesToggleButtonCpt = R2.hooksComponent thisModule "edgesToggleButton" cpt
edgesToggleButtonCpt = R.hooksComponentWithModule thisModule "edgesToggleButton" cpt
where
cpt {state: (state /\ setState)} _ = do
pure $
......@@ -108,7 +108,7 @@ pauseForceAtlasButton :: Record ForceAtlasProps -> R.Element
pauseForceAtlasButton props = R.createElement pauseForceAtlasButtonCpt props []
pauseForceAtlasButtonCpt :: R.Component ForceAtlasProps
pauseForceAtlasButtonCpt = R2.hooksComponent thisModule "forceAtlasToggleButton" cpt
pauseForceAtlasButtonCpt = R.hooksComponentWithModule thisModule "forceAtlasToggleButton" cpt
where
cpt {state: (state /\ setState)} _ = do
pure $
......@@ -137,7 +137,7 @@ treeToggleButton state =
sidebarToggleButton :: R.State GET.SidePanelState -> R.Element
sidebarToggleButton (state /\ setState) = R.createElement el {} []
where
el = R2.hooksComponent thisModule "sidebarToggleButton" cpt
el = R.hooksComponentWithModule thisModule "sidebarToggleButton" cpt
cpt {} _ = do
pure $
H.span {}
......
......@@ -30,7 +30,7 @@ inputWithAutocomplete :: Record Props -> R.Element
inputWithAutocomplete props = R.createElement inputWithAutocompleteCpt props []
inputWithAutocompleteCpt :: R.Component Props
inputWithAutocompleteCpt = R2.hooksComponent thisModule "inputWithAutocomplete" cpt
inputWithAutocompleteCpt = R.hooksComponentWithModule thisModule "inputWithAutocomplete" cpt
where
cpt props@{autocompleteSearch, onAutocompleteClick, onEnterPress, state: state@(state' /\ setState)} _ = do
inputRef <- R.useRef null
......@@ -65,14 +65,14 @@ inputWithAutocompleteCpt = R2.hooksComponent thisModule "inputWithAutocomplete"
onFocus (_ /\ setCompletions) e = setCompletions $ const $ autocompleteSearch state'
onInput (_ /\ setCompletions) e = do
let val = R2.unsafeEventValue e
let val = R.unsafeEventValue e
setState $ const val
setCompletions $ const $ autocompleteSearch val
onInputKeyUp :: R.Ref (Nullable DOM.Element) -> R.State Completions -> DE.KeyboardEvent -> Effect Unit
onInputKeyUp inputRef (_ /\ setCompletions) e = do
if DE.key e == "Enter" then do
let val = R2.unsafeEventValue e
let val = R.unsafeEventValue e
let mInput = toMaybe $ R.readRef inputRef
setState $ const val
onEnterPress val
......
......@@ -26,7 +26,7 @@ inputWithEnter :: forall a. Record (Props a) -> R.Element
inputWithEnter props = R.createElement inputWithEnterCpt props []
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R2.hooksComponent thisModule "inputWithEnter" cpt
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
where
cpt props@{ onEnter, onValueChanged
, autoFocus, className, defaultValue, placeholder } _ = do
......@@ -40,7 +40,7 @@ inputWithEnterCpt = R2.hooksComponent thisModule "inputWithEnter" cpt
where
onInput e = do
onValueChanged $ R2.unsafeEventValue e
onValueChanged $ R.unsafeEventValue e
onKeyPress e = do
char <- R2.keyCode e
......
......@@ -25,7 +25,7 @@ loader path load paint =
R.createElement loaderCpt {path,load,paint} []
loaderCpt :: forall path loaded. R.Component (Props path loaded)
loaderCpt = R2.hooksComponent thisModule "loader" cpt where
loaderCpt = R.hooksComponentWithModule thisModule "loader" cpt where
cpt {path, load, paint} _ = do
(loaded /\ setLoaded) <- R.useState' Nothing
R.useEffect3 path load paint $ do
......
......@@ -3,8 +3,6 @@ module Gargantext.Components.LoadingSpinner where
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.LoadingSpinner"
......@@ -14,7 +12,7 @@ loadingSpinner :: Record Props -> R.Element
loadingSpinner props = R.createElement loadingSpinnerCpt props []
loadingSpinnerCpt :: R.Component Props
loadingSpinnerCpt = R2.staticComponent thisModule "LoadingSpinner" cpt
loadingSpinnerCpt = R.staticComponentWithModule thisModule "LoadingSpinner" cpt
where
-- cpt _ _ = H.i {className: "spinner fa fa-smile-o fa-spin fa-3x fa-fw"} [H.text ""]
-- cpt _ _ = H.i {className: "fa fa-globe fa-spin fa-3x fa-fw"} [H.text ""]
......
......@@ -48,7 +48,7 @@ login :: Record LoginProps -> R.Element
login props = R.createElement loginCpt props []
loginCpt :: R.Component LoginProps
loginCpt = R2.hooksComponent thisModule "login" cpt
loginCpt = R.hooksComponentWithModule thisModule "login" cpt
where
cpt props@{backends, sessions, visible, backend} _ = do
pure $
......@@ -65,7 +65,7 @@ modal :: Record ModalProps -> R.Element -> R.Element
modal props child = R.createElement modalCpt props [ child ]
modalCpt :: R.Component ModalProps
modalCpt = R2.hooksComponent thisModule "modal" cpt where
modalCpt = R.hooksComponentWithModule thisModule "modal" cpt where
cpt {visible} children = do
R.createPortal elems <$> R2.getPortalHost
where
......@@ -180,7 +180,7 @@ form :: Record FormProps -> R.Element
form props = R.createElement formCpt props []
formCpt :: R.Component FormProps
formCpt = R2.hooksComponent thisModule "form" cpt where
formCpt = R.hooksComponentWithModule thisModule "form" cpt where
cpt :: Record FormProps -> Array R.Element -> R.Hooks R.Element
cpt props@{backend, sessions, visible} _ = do
error <- R.useState' ""
......@@ -256,8 +256,8 @@ usernameInput username =
, placeholder: "username"
, type: "text"
, defaultValue: (fst username)
--, on: {input: \e -> dispatch (SetUserName $ R2.unsafeEventValue e)}
, on: {change: \e -> (snd username) $ const $ R2.unsafeEventValue e} }
--, on: {input: \e -> dispatch (SetUserName $ R.unsafeEventValue e)}
, on: {change: \e -> (snd username) $ const $ R.unsafeEventValue e} }
passwordInput :: R.State String -> R.Element
passwordInput password =
......@@ -267,8 +267,8 @@ passwordInput password =
, placeholder: "password"
, type: "password"
, defaultValue: (fst password)
--, on: {input: \e -> dispatch (SetPassword $ R2.unsafeEventValue e)}
, on: {change: \e -> (snd password) $ const $ R2.unsafeEventValue e} }
--, on: {input: \e -> dispatch (SetPassword $ R.unsafeEventValue e)}
, on: {change: \e -> (snd password) $ const $ R.unsafeEventValue e} }
loginSubmit :: forall e. (e -> Effect Unit) -> R.Element
loginSubmit click =
......
......@@ -19,13 +19,13 @@ import Gargantext.Utils.Reactix as R2
thisModule = "Gargantext.Components.Modal"
type Props = ( setVisible :: R2.Setter Boolean )
type Props = ( setVisible :: R.Setter Boolean )
modal :: Record Props -> Array R.Element -> R.Element
modal = R.createElement modalCpt
modalCpt :: R.Component Props
modalCpt = R2.hooksComponent thisModule "modal" cpt
modalCpt = R.hooksComponentWithModule thisModule "modal" cpt
where
cpt {setVisible} children = do
host <- R2.getPortalHost
......@@ -40,7 +40,7 @@ modalCpt = R2.hooksComponent thisModule "modal" cpt
modalEffect
:: R.Ref (Nullable DOM.Element)
-> R2.Setter Boolean
-> R.Setter Boolean
-> Effect (Effect Unit)
modalEffect rootRef setVisible = maybe (pure R.nothing) withRoot (R.readNullableRef rootRef)
where
......
......@@ -142,7 +142,7 @@ tableContainerCpt { dispatch
, ngramsTable: ngramsTableCache
, path: {searchQuery, termListFilter, termSizeFilter} /\ setPath
, tabNgramType
} = R2.hooksComponent thisModule "tableContainer" cpt
} = R.hooksComponentWithModule thisModule "tableContainer" cpt
where
cpt props _ = do
pure $ H.div {className: "container-fluid"} [
......@@ -169,7 +169,7 @@ tableContainerCpt { dispatch
[ R2.select { id: "picklistmenu"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termListFilter)
, on: {change: setTermListFilter <<< read <<< R2.unsafeEventValue}}
, on: {change: setTermListFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termLists)]
]
, H.div {className: "col-md-2", style: {marginTop : "6px"}}
......@@ -177,7 +177,7 @@ tableContainerCpt { dispatch
[ R2.select {id: "picktermtype"
, className: "form-control custom-select"
, defaultValue: (maybe "" show termSizeFilter)
, on: {change: setTermSizeFilter <<< read <<< R2.unsafeEventValue}}
, on: {change: setTermSizeFilter <<< read <<< R.unsafeEventValue}}
(map optps1 termSizes)]
]
, H.div { className: "col-md-2", style: { marginTop: "6px" } } [
......@@ -290,7 +290,7 @@ loadedNgramsTable :: Record Props -> R.Element
loadedNgramsTable p = R.createElement loadedNgramsTableCpt p []
loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R2.hooksComponent thisModule "loadedNgramsTable" cpt
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
where
cpt { afterSync
, path: path@(path'@{ searchQuery, scoreType, params, termListFilter, termSizeFilter } /\ setPath)
......@@ -454,7 +454,7 @@ syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p []
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R2.hooksComponent thisModule "syncResetButtons" cpt
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
where
cpt { afterSync, ngramsLocalPatch, performAction } _ = do
synchronizing@(s /\ _) <- R.useState' false
......@@ -534,7 +534,7 @@ mainNgramsTable :: Record MainNgramsTableProps -> R.Element
mainNgramsTable props = R.createElement mainNgramsTableCpt props []
mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R2.hooksComponent thisModule "mainNgramsTable" cpt
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
where
cpt props@{ afterSync
, cacheState
......@@ -600,7 +600,7 @@ mainNgramsTablePaint :: Record MainNgramsTablePaintProps -> R.Element
mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p []
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R2.hooksComponent thisModule "mainNgramsTablePaint" cpt
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
where
cpt { afterSync, path, tabNgramType, versioned, withAutoUpdate } _ = do
pathS <- R.useState' path
......
......@@ -36,7 +36,7 @@ searchInput :: Record SearchInputProps -> R.Element
searchInput props = R.createElement searchInputCpt props []
searchInputCpt :: R.Component SearchInputProps
searchInputCpt = R2.hooksComponent thisModule "searchInput" cpt
searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
where
cpt { onSearch, searchQuery } _ = do
pure $ H.div { className: "input-group" } [
......@@ -46,7 +46,7 @@ searchInputCpt = R2.hooksComponent thisModule "searchInput" cpt
, H.input { className: "form-control"
, defaultValue: searchQuery
, name: "search"
, on: { input: onSearch <<< R2.unsafeEventValue }
, on: { input: onSearch <<< R.unsafeEventValue }
, placeholder: "Search"
, type: "value" }
]
......@@ -63,7 +63,7 @@ selectionCheckbox :: Record SelectionCheckboxProps -> R.Element
selectionCheckbox props = R.createElement selectionCheckboxCpt props []
selectionCheckboxCpt :: R.Component SelectionCheckboxProps
selectionCheckboxCpt = R2.hooksComponent thisModule "selectionCheckbox" cpt
selectionCheckboxCpt = R.hooksComponentWithModule thisModule "selectionCheckbox" cpt
where
cpt { allNgramsSelected, dispatch, ngramsSelection } _ = do
ref <- R.useRef null
......@@ -98,7 +98,7 @@ renderNgramsTree :: Record RenderNgramsTree -> R.Element
renderNgramsTree p = R.createElement renderNgramsTreeCpt p []
renderNgramsTreeCpt :: R.Component RenderNgramsTree
renderNgramsTreeCpt = R2.hooksComponent thisModule "renderNgramsTree" cpt
renderNgramsTreeCpt = R.hooksComponentWithModule thisModule "renderNgramsTree" cpt
where
cpt { ngramsTable, ngrams, ngramsStyle, ngramsClick, ngramsEdit } _ =
pure $ H.ul {} [
......@@ -131,7 +131,7 @@ tree :: Record TreeProps -> R.Element
tree p = R.createElement treeCpt p []
treeCpt :: R.Component TreeProps
treeCpt = R2.hooksComponent thisModule "tree" cpt
treeCpt = R.hooksComponentWithModule thisModule "tree" cpt
where
cpt params@{ ngramsClick, ngramsDepth, ngramsEdit, ngramsStyle, ngramsTable } _ =
pure $
......@@ -179,7 +179,7 @@ renderNgramsItem :: Record RenderNgramsItem -> R.Element
renderNgramsItem p = R.createElement renderNgramsItemCpt p []
renderNgramsItemCpt :: R.Component RenderNgramsItem
renderNgramsItemCpt = R2.hooksComponent thisModule "renderNgramsItem" cpt
renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" cpt
where
cpt { dispatch
, ngrams
......
......@@ -49,7 +49,7 @@ annuaireLayout :: Record LayoutProps -> R.Element
annuaireLayout props = R.createElement annuaireLayoutCpt props []
annuaireLayoutCpt :: R.Component LayoutProps
annuaireLayoutCpt = R2.hooksComponent thisModule "annuaireLayout" cpt
annuaireLayoutCpt = R.hooksComponentWithModule thisModule "annuaireLayout" cpt
where
cpt { frontends, nodeId, session } _ = do
let sid = sessionId session
......@@ -65,7 +65,7 @@ annuaireLayoutWithKey :: Record KeyLayoutProps -> R.Element
annuaireLayoutWithKey props = R.createElement annuaireLayoutWithKeyCpt props []
annuaireLayoutWithKeyCpt :: R.Component KeyLayoutProps
annuaireLayoutWithKeyCpt = R2.hooksComponent thisModule "annuaireLayoutWithKey" cpt
annuaireLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "annuaireLayoutWithKey" cpt
where
cpt { frontends, nodeId, session } _ = do
path <- R.useState' nodeId
......@@ -86,7 +86,7 @@ annuaire props = R.createElement annuaireCpt props []
-- Abuses closure to work around the Loader
annuaireCpt :: R.Component AnnuaireProps
annuaireCpt = R2.hooksComponent thisModule "annuaire" cpt
annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt
where
cpt {session, path, info: info@(AnnuaireInfo {name, date: date'}), frontends} _ = do
pagePath <- R.useState' $ initialPagePath (fst path)
......@@ -126,7 +126,7 @@ pageLayout :: Record PageLayoutProps -> R.Element
pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R2.hooksComponent thisModule "pageLayout" cpt
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt
where
cpt {info, frontends, pagePath, session} _ = do
useLoader (fst pagePath) (loadPage session) $
......@@ -144,7 +144,7 @@ page :: Record PageProps -> R.Element
page props = R.createElement pageCpt props []
pageCpt :: R.Component PageProps
pageCpt = R2.hooksComponent thisModule "page" cpt
pageCpt = R.hooksComponentWithModule thisModule "page" cpt
where
cpt { session, pagePath, frontends
, table: ({count: totalRecords, docs})} _ = do
......@@ -177,7 +177,7 @@ contactCells :: Record ContactCellsProps -> R.Element
contactCells p = R.createElement contactCellsCpt p []
contactCellsCpt :: R.Component ContactCellsProps
contactCellsCpt = R2.hooksComponent thisModule "contactCells" cpt
contactCellsCpt = R.hooksComponentWithModule thisModule "contactCells" cpt
where
cpt { annuaireId
, contact: (CT.NodeContact { id, hyperdata: (CT.HyperdataContact {who : Nothing}) })
......
......@@ -84,7 +84,7 @@ contactInfoItem :: Record ContactInfoItemProps -> R.Element
contactInfoItem props = R.createElement contactInfoItemCpt props []
contactInfoItemCpt :: R.Component ContactInfoItemProps
contactInfoItemCpt = R2.hooksComponent thisModule "contactInfoItem" cpt
contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
where
cpt {hyperdata, label, lens, onUpdateHyperdata, placeholder} _ = do
isEditing <- R.useState' false
......@@ -158,7 +158,7 @@ userLayout :: Record LayoutProps -> R.Element
userLayout props = R.createElement userLayoutCpt props []
userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = R2.hooksComponent thisModule "userLayout" cpt
userLayoutCpt = R.hooksComponentWithModule thisModule "userLayout" cpt
where
cpt { frontends, nodeId, session } _ = do
let sid = sessionId session
......@@ -169,7 +169,7 @@ userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
userLayoutWithKeyCpt :: R.Component KeyLayoutProps
userLayoutWithKeyCpt = R2.hooksComponent thisModule "userLayoutWithKey" cpt
userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" cpt
where
cpt { frontends, nodeId, session } _ = do
reload <- R.useState' 0
......@@ -220,7 +220,7 @@ annuaireUserLayout :: Record AnnuaireLayoutProps -> R.Element
annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R2.hooksComponent thisModule "annuaireUserLayout" cpt
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
where
cpt { annuaireId, frontends, nodeId, session } _ = do
cacheState <- R.useState' NT.CacheOn
......
......@@ -55,7 +55,7 @@ tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps
tabsCpt = R2.hooksComponent thisModule "tabs" cpt
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt { cacheState, contactData: {defaultListId}, frontends, nodeId, session} _ = do
active <- R.useState' 0
......
......@@ -48,7 +48,7 @@ corpusLayout :: Record Props -> R.Element
corpusLayout props = R.createElement corpusLayoutCpt props []
corpusLayoutCpt :: R.Component Props
corpusLayoutCpt = R2.hooksComponent thisModule "corpusLayout" cpt
corpusLayoutCpt = R.hooksComponentWithModule thisModule "corpusLayout" cpt
where
cpt { nodeId, session } _ = do
let sid = sessionId session
......@@ -60,7 +60,7 @@ corpusLayoutWithKey :: Record KeyProps -> R.Element
corpusLayoutWithKey props = R.createElement corpusLayoutWithKeyCpt props []
corpusLayoutWithKeyCpt :: R.Component KeyProps
corpusLayoutWithKeyCpt = R2.hooksComponent thisModule "corpusLayoutWithKey" cpt
corpusLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "corpusLayoutWithKey" cpt
where
cpt { nodeId, session } _ = do
reload <- R.useState' 0
......@@ -84,7 +84,7 @@ corpusLayoutView :: Record ViewProps -> R.Element
corpusLayoutView props = R.createElement corpusLayoutViewCpt props []
corpusLayoutViewCpt :: R.Component ViewProps
corpusLayoutViewCpt = R2.hooksComponent thisModule "corpusLayoutView" cpt
corpusLayoutViewCpt = R.hooksComponentWithModule thisModule "corpusLayoutView" cpt
where
cpt {corpus: (NodePoly {hyperdata: Hyperdata {fields}}), nodeId, reload, session} _ = do
let fieldsWithIndex = List.mapWithIndex (\idx -> \t -> Tuple idx t) fields
......@@ -148,7 +148,7 @@ fieldsCodeEditor :: Record FieldsCodeEditorProps -> R.Element
fieldsCodeEditor props = R.createElement fieldsCodeEditorCpt props []
fieldsCodeEditorCpt :: R.Component FieldsCodeEditorProps
fieldsCodeEditorCpt = R2.hooksComponent thisModule "fieldsCodeEditorCpt" cpt
fieldsCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldsCodeEditorCpt" cpt
where
cpt {nodeId, fields: fS@(fields /\ _), session} _ = do
masterKey <- R.useState' 0
......@@ -217,7 +217,7 @@ fieldCodeEditorWrapper :: Record FieldCodeEditorProps -> R.Element
fieldCodeEditorWrapper props = R.createElement fieldCodeEditorWrapperCpt props []
fieldCodeEditorWrapperCpt :: R.Component FieldCodeEditorProps
fieldCodeEditorWrapperCpt = R2.hooksComponent thisModule "fieldCodeEditorWrapperCpt" cpt
fieldCodeEditorWrapperCpt = R.hooksComponentWithModule thisModule "fieldCodeEditorWrapperCpt" cpt
where
cpt props@{canMoveDown, canMoveUp, field: Field {name, typ}, onMoveDown, onMoveUp, onRemove, onRename} _ = do
pure $ H.div { className: "row panel panel-default" } [
......@@ -265,7 +265,7 @@ renameable :: Record RenameableProps -> R.Element
renameable props = R.createElement renameableCpt props []
renameableCpt :: R.Component RenameableProps
renameableCpt = R2.hooksComponent thisModule "renameableCpt" cpt
renameableCpt = R.hooksComponentWithModule thisModule "renameableCpt" cpt
where
cpt {onRename, text} _ = do
isEditing <- R.useState' false
......@@ -295,7 +295,7 @@ renameableText :: Record RenameableTextProps -> R.Element
renameableText props = R.createElement renameableTextCpt props []
renameableTextCpt :: R.Component RenameableTextProps
renameableTextCpt = R2.hooksComponent thisModule "renameableTextCpt" cpt
renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cpt
where
cpt {isEditing: (false /\ setIsEditing), state: (text /\ _)} _ = do
pure $ H.div {} [
......@@ -330,7 +330,7 @@ fieldCodeEditor :: Record FieldCodeEditorProps -> R.Element
fieldCodeEditor props = R.createElement fieldCodeEditorCpt props []
fieldCodeEditorCpt :: R.Component FieldCodeEditorProps
fieldCodeEditorCpt = R2.hooksComponent thisModule "fieldCodeEditorCpt" cpt
fieldCodeEditorCpt = R.hooksComponentWithModule thisModule "fieldCodeEditorCpt" cpt
where
cpt {field: Field {typ: typ@(Haskell {haskell})}, onChange} _ = do
pure $ CE.codeEditor {code: haskell, defaultCodeType: CE.Haskell, onChange: changeCode onChange typ}
......
......@@ -30,7 +30,7 @@ metricsLoadView :: forall a. Record (MetricsLoadViewProps a) -> R.Element
metricsLoadView p = R.createElement metricsLoadViewCpt p []
metricsLoadViewCpt :: forall a. R.Component (MetricsLoadViewProps a)
metricsLoadViewCpt = R2.hooksComponent thisModule "metricsLoadView" cpt
metricsLoadViewCpt = R.hooksComponentWithModule thisModule "metricsLoadView" cpt
where
cpt { getMetrics, loaded, path, reload, session } _ = do
useLoader (fst reload /\ path) (getMetrics session) $ \l ->
......@@ -50,7 +50,7 @@ metricsWithCacheLoadView p = R.createElement metricsWithCacheLoadViewCpt p []
metricsWithCacheLoadViewCpt :: forall res ret. DecodeJson res =>
R.Component (MetricsWithCacheLoadViewProps res ret)
metricsWithCacheLoadViewCpt = R2.hooksComponent thisModule "metricsWithCacheLoadView" cpt
metricsWithCacheLoadViewCpt = R.hooksComponentWithModule thisModule "metricsWithCacheLoadView" cpt
where
cpt { getMetricsHash, handleResponse, loaded, mkRequest, path, reload, session } _ = do
useLoaderWithCacheAPI { cacheEndpoint: (getMetricsHash session)
......
......@@ -85,7 +85,7 @@ histo :: Record Props -> R.Element
histo props = R.createElement histoCpt props []
histoCpt :: R.Component Props
histoCpt = R2.hooksComponent thisModule "histo" cpt
histoCpt = R.hooksComponentWithModule thisModule "histo" cpt
where
cpt { path, session } _ = do
reload <- R.useState' 0
......
......@@ -118,7 +118,7 @@ metrics :: Record Props -> R.Element
metrics props = R.createElement metricsCpt props []
metricsCpt :: R.Component Props
metricsCpt = R2.hooksComponent thisModule "etrics" cpt
metricsCpt = R.hooksComponentWithModule thisModule "etrics" cpt
where
cpt {path, session} _ = do
reload <- R.useState' 0
......
......@@ -104,7 +104,7 @@ pie :: Record Props -> R.Element
pie props = R.createElement pieCpt props []
pieCpt :: R.Component Props
pieCpt = R2.hooksComponent thisModule "pie" cpt
pieCpt = R.hooksComponentWithModule thisModule "pie" cpt
where
cpt { path, session } _ = do
reload <- R.useState' 0
......@@ -132,7 +132,7 @@ bar :: Record Props -> R.Element
bar props = R.createElement barCpt props []
barCpt :: R.Component Props
barCpt = R2.hooksComponent thisModule "bar" cpt
barCpt = R.hooksComponentWithModule thisModule "bar" cpt
where
cpt {path, session} _ = do
reload <- R.useState' 0
......
......@@ -77,7 +77,7 @@ tree :: Record Props -> R.Element
tree props = R.createElement treeCpt props []
treeCpt :: R.Component Props
treeCpt = R2.hooksComponent thisModule "tree" cpt
treeCpt = R.hooksComponentWithModule thisModule "tree" cpt
where
cpt {path, session} _ = do
reload <- R.useState' 0
......
......@@ -52,7 +52,7 @@ chartUpdateButton :: Record ChartUpdateButtonProps -> R.Element
chartUpdateButton p = R.createElement chartUpdateButtonCpt p []
chartUpdateButtonCpt :: R.Component ChartUpdateButtonProps
chartUpdateButtonCpt = R2.hooksComponent thisModule "chartUpdateButton" cpt
chartUpdateButtonCpt = R.hooksComponentWithModule thisModule "chartUpdateButton" cpt
where
cpt { chartType
, path: { corpusId, listId, tabType }
......
......@@ -30,7 +30,7 @@ dashboardLayout :: Record Props -> R.Element
dashboardLayout props = R.createElement dashboardLayoutCpt props []
dashboardLayoutCpt :: R.Component Props
dashboardLayoutCpt = R2.hooksComponent thisModule "dashboardLayout" cpt
dashboardLayoutCpt = R.hooksComponentWithModule thisModule "dashboardLayout" cpt
where
cpt { nodeId, session } _ = do
let sid = sessionId session
......@@ -46,7 +46,7 @@ dashboardLayoutWithKey :: Record KeyProps -> R.Element
dashboardLayoutWithKey props = R.createElement dashboardLayoutWithKeyCpt props []
dashboardLayoutWithKeyCpt :: R.Component KeyProps
dashboardLayoutWithKeyCpt = R2.hooksComponent thisModule "dashboardLayoutWithKey" cpt
dashboardLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "dashboardLayoutWithKey" cpt
where
cpt { nodeId, session } _ = do
reload <- R.useState' 0
......@@ -84,7 +84,7 @@ dashboardLayoutLoaded :: Record LoadedProps -> R.Element
dashboardLayoutLoaded props = R.createElement dashboardLayoutLoadedCpt props []
dashboardLayoutLoadedCpt :: R.Component LoadedProps
dashboardLayoutLoadedCpt = R2.hooksComponent thisModule "dashboardLayoutLoaded" cpt
dashboardLayoutLoadedCpt = R.hooksComponentWithModule thisModule "dashboardLayoutLoaded" cpt
where
cpt props@{ charts, corpusId, defaultListId, onChange, session } _ = do
pure $
......@@ -121,7 +121,7 @@ renderChart :: Record PredefinedChartProps -> R.Element
renderChart props = R.createElement renderChartCpt props []
renderChartCpt :: R.Component PredefinedChartProps
renderChartCpt = R2.hooksComponent thisModule "renderChart" cpt
renderChartCpt = R.hooksComponentWithModule thisModule "renderChart" cpt
where
cpt { chart, corpusId, defaultListId, onChange, onRemove, session } _ = do
pure $ H.div { className: "row" } [
......@@ -141,7 +141,7 @@ renderChartCpt = R2.hooksComponent thisModule "renderChart" cpt
H.option { value: show pc } [ H.text $ show pc ]
onSelectChange e = onChange $ fromMaybe P.CDocsHistogram $ read value
where
value = R2.unsafeEventValue e
value = R.unsafeEventValue e
onRemoveClick _ = onRemove unit
params = { corpusId
, limit: Just 1000
......
......@@ -303,7 +303,7 @@ docViewWrapper :: Record Props -> R.Element
docViewWrapper props = R.createElement docViewWrapperCpt props []
docViewWrapperCpt :: R.Component Props
docViewWrapperCpt = R2.hooksComponent thisModule "docViewWrapper" cpt
docViewWrapperCpt = R.hooksComponentWithModule thisModule "docViewWrapper" cpt
where
cpt { loaded, path } _ = do
state <- R.useState' $ initialState { loaded }
......@@ -319,7 +319,7 @@ docView :: Record DocViewProps -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component DocViewProps
docViewCpt = R2.hooksComponent thisModule "docView" cpt
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where
cpt props@{ loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }, state } _ = do
pure $ H.div {} [
......@@ -389,7 +389,7 @@ documentLayout :: Record LayoutProps -> R.Element
documentLayout props = R.createElement documentLayoutCpt props []
documentLayoutCpt :: R.Component LayoutProps
documentLayoutCpt = R2.hooksComponent thisModule "documentLayout" cpt
documentLayoutCpt = R.hooksComponentWithModule thisModule "documentLayout" cpt
where
cpt { corpusId, listId, nodeId, session } _ = do
let sid = sessionId session
......@@ -409,7 +409,7 @@ documentLayoutWithKey :: Record KeyLayoutProps -> R.Element
documentLayoutWithKey props = R.createElement documentLayoutWithKeyCpt props []
documentLayoutWithKeyCpt :: R.Component KeyLayoutProps
documentLayoutWithKeyCpt = R2.hooksComponent thisModule "documentLayoutWithKey" cpt
documentLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "documentLayoutWithKey" cpt
where
cpt { corpusId, listId, nodeId, session } _ = do
useLoader path loadData $ \loaded ->
......
......@@ -27,7 +27,7 @@ tabs props = R.createElement tabsCpt props []
-- TODO no need for Children here
tabsCpt :: R.Component Props
tabsCpt = R2.hooksComponent thisModule "tabs" cpt
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt {frontends, query, session, sides} _ = do
active <- R.useState' 0
......
......@@ -70,7 +70,7 @@ fileLayout :: Record FileLayoutProps -> R.Element
fileLayout props = R.createElement fileLayoutCpt props []
fileLayoutCpt :: R.Component FileLayoutProps
fileLayoutCpt = R2.hooksComponent thisModule "fileLayout" cpt
fileLayoutCpt = R.hooksComponentWithModule thisModule "fileLayout" cpt
where
cpt { nodeId, session } _ = do
useLoader { nodeId } (loadFile session) $ \loaded ->
......@@ -92,7 +92,7 @@ fileLayoutLoaded :: Record FileLayoutLoadedProps -> R.Element
fileLayoutLoaded props = R.createElement fileLayoutLoadedCpt props []
fileLayoutLoadedCpt :: R.Component FileLayoutLoadedProps
fileLayoutLoadedCpt = R2.hooksComponent thisModule "fileLayoutLoaded" cpt
fileLayoutLoadedCpt = R.hooksComponentWithModule thisModule "fileLayoutLoaded" cpt
where
cpt { loaded: File { hyperdata: HyperdataFile hyperdata }, nodeId, session } _ = do
R.useEffect' $ do
......
......@@ -64,7 +64,7 @@ frameLayout :: Record Props -> R.Element
frameLayout props = R.createElement frameLayoutCpt props []
frameLayoutCpt :: R.Component Props
frameLayoutCpt = R2.hooksComponent thisModule "frameLayout" cpt
frameLayoutCpt = R.hooksComponentWithModule thisModule "frameLayout" cpt
where
cpt {nodeId, session} _ = do
let sid = sessionId session
......@@ -75,7 +75,7 @@ frameLayoutWithKey :: Record KeyProps -> R.Element
frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
frameLayoutWithKeyCpt :: R.Component KeyProps
frameLayoutWithKeyCpt = R2.hooksComponent thisModule "frameLayoutWithKey" cpt
frameLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "frameLayoutWithKey" cpt
where
cpt { nodeId, session } _ = do
reload <- R.useState' 0
......@@ -101,7 +101,7 @@ frameLayoutView :: Record ViewProps -> R.Element
frameLayoutView props = R.createElement frameLayoutViewCpt props []
frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt = R2.hooksComponent thisModule "frameLayoutView" cpt
frameLayoutViewCpt = R.hooksComponentWithModule thisModule "frameLayoutView" cpt
where
cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session} _ = do
pure $ H.div { className : "frame" }
......
......@@ -63,7 +63,7 @@ homeLayout :: Record HomeProps -> R.Element
homeLayout props = R.createElement homeLayoutCpt props []
homeLayoutCpt :: R.Component HomeProps
homeLayoutCpt = R2.hooksComponent thisModule "homeLayout" cpt
homeLayoutCpt = R.hooksComponentWithModule thisModule "homeLayout" cpt
where
cpt {lang, backend, publicBackend, sessions, visible} _ = do
let landingData = langLandingData lang
......
......@@ -93,7 +93,7 @@ renderPublic :: Record PublicProps -> R.Element
renderPublic props = R.createElement renderPublicCpt props []
renderPublicCpt :: R.Component PublicProps
renderPublicCpt = R2.hooksComponent thisModule "renderPublic" cpt
renderPublicCpt = R.hooksComponentWithModule thisModule "renderPublic" cpt
where
cpt {backend, publicBackend, sessions, visible} _ = do
reload <- R.useState' 0
......@@ -108,7 +108,7 @@ publicLayout :: Record PublicDataProps -> R.Element
publicLayout props = R.createElement publicLayoutCpt props []
publicLayoutCpt :: R.Component PublicDataProps
publicLayoutCpt = R2.hooksComponent thisModule "publicLayout" cpt
publicLayoutCpt = R.hooksComponentWithModule thisModule "publicLayout" cpt
where
cpt {publicDatas, visible, backend, publicBackend, sessions} _ = do
pure $ H.span {}
......
......@@ -28,7 +28,7 @@ listsLayout :: Record Props -> R.Element
listsLayout props = R.createElement listsLayoutCpt props []
listsLayoutCpt :: R.Component Props
listsLayoutCpt = R2.hooksComponent thisModule "listsLayout" cpt
listsLayoutCpt = R.hooksComponentWithModule thisModule "listsLayout" cpt
where
cpt path@{ nodeId, session } _ = do
let sid = sessionId session
......@@ -44,7 +44,7 @@ listsLayoutWithKey :: Record KeyProps -> R.Element
listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R2.hooksComponent thisModule "listsLayoutWithKey" cpt
listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt
where
cpt { nodeId, session } _ = do
let path = { nodeId, session }
......
......@@ -37,7 +37,7 @@ tabs :: Record Props -> R.Element
tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component Props
tabsCpt = R2.hooksComponent thisModule "tabs" cpt
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt { cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
(selected /\ setSelected) <- R.useState' 0
......@@ -56,7 +56,7 @@ ngramsView :: Record NgramsViewProps -> R.Element
ngramsView props = R.createElement ngramsViewCpt props []
ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where
cpt { cacheState
, corpusData: { defaultListId }
......@@ -109,7 +109,7 @@ ngramsViewCpt = R2.hooksComponent thisModule "ngramsView" cpt
$ const
$ fromMaybe Histo
$ chartTypeFromString
$ R2.unsafeEventValue e
$ R.unsafeEventValue e
}
, defaultValue: show chartType } [
H.option { value: show Histo } [ H.text $ show Histo ]
......
......@@ -38,7 +38,7 @@ textsLayout props = R.createElement textsLayoutCpt props []
------------------------------------------------------------------------
textsLayoutCpt :: R.Component Props
textsLayoutCpt = R2.hooksComponent thisModule "textsLayout" cpt where
textsLayoutCpt = R.hooksComponentWithModule thisModule "textsLayout" cpt where
cpt { frontends, nodeId, session } _ = do
let sid = sessionId session
......@@ -53,7 +53,7 @@ textsLayoutWithKey :: Record KeyProps -> R.Element
textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props []
textsLayoutWithKeyCpt :: R.Component KeyProps
textsLayoutWithKeyCpt = R2.hooksComponent thisModule "textsLayoutWithKey" cpt
textsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "textsLayoutWithKey" cpt
where
cpt { frontends, nodeId, session } _ = do
cacheState <- R.useState' NT.CacheOn
......@@ -95,7 +95,7 @@ tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps
tabsCpt = R2.hooksComponent thisModule "tabs" cpt
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt {frontends, session, corpusId, corpusData} _ = do
(selected /\ setSelected) <- R.useState' 0
......@@ -123,7 +123,7 @@ docView :: forall a. Record (DocViewProps a) -> R.Element
docView props = R.createElement docViewCpt props []
docViewCpt :: forall a. R.Component (DocViewProps a)
docViewCpt = R2.hooksComponent thisModule "docView" cpt
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where
cpt {frontends, session, corpusId, corpusData: {defaultListId}, tabType} _children = do
pure $ DT.docViewLayout $ params tabType
......
......@@ -55,7 +55,7 @@ data Knob = MinKnob | MaxKnob
data RangeUpdate = SetMin Number | SetMax Number
rangeSliderCpt :: R.Component Props
rangeSliderCpt = R2.hooksComponent thisModule "rangeSlider" cpt
rangeSliderCpt = R.hooksComponentWithModule thisModule "rangeSlider" cpt
where
cpt props _ = do
-- rounding precision (i.e. how many decimal digits are in epsilon)
......@@ -127,7 +127,7 @@ destroyEventHandler name ref = traverse_ destroy $ R.readRef ref
EL.removeEventListener document name handler
R.setRef ref Nothing
setKnob :: Knob -> R2.Setter Range.NumberRange -> Range.NumberRange -> Number -> Effect Unit
setKnob :: Knob -> R.Setter Range.NumberRange -> Range.NumberRange -> Number -> Effect Unit
setKnob knob setValue r val = setValue $ const $ knobSetter knob r val
knobSetter :: Knob -> Range.NumberRange -> Number -> Range.NumberRange
......@@ -165,7 +165,7 @@ renderScaleSel ref props (Range.Closed {min, max}) =
computeWidth = (show $ 100.0 * (percOffsetMax - percOffsetMin)) <> "%"
renderKnob :: Knob -> R.Ref (Nullable DOM.Element) -> Range.NumberRange -> Bounds -> R2.Setter (Maybe Knob) -> Int -> R.Element
renderKnob :: Knob -> R.Ref (Nullable DOM.Element) -> Range.NumberRange -> Bounds -> R.Setter (Maybe Knob) -> Int -> R.Element
renderKnob knob ref (Range.Closed value) bounds set precision =
H.div { ref, tabIndex, className, aria, on: { mouseDown: onMouseDown }, style } [
H.div { className: "button" }
......
......@@ -18,7 +18,7 @@ tabs props = R.createElement tabsCpt props []
-- this is actually just the list of tabs, not the tab contents itself
tabsCpt :: R.Component TabsProps
tabsCpt = R2.hooksComponent thisModule "tabs" cpt
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where
cpt props _ = do
(activeTab /\ setActiveTab) <- R.useState' props.selected
......
......@@ -107,7 +107,7 @@ tableHeaderLayout :: Record TableHeaderLayoutProps -> R.Element
tableHeaderLayout props = R.createElement tableHeaderLayoutCpt props []
tableHeaderLayoutCpt :: R.Component TableHeaderLayoutProps
tableHeaderLayoutCpt = R2.hooksComponent thisModule "tableHeaderLayout" cpt
tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout" cpt
where
cpt { afterCacheStateChange, cacheState, date, desc, query, title, user } _ =
pure $ R.fragment
......@@ -164,7 +164,7 @@ table :: Record Props -> R.Element
table props = R.createElement tableCpt props []
tableCpt :: R.Component Props
tableCpt = R2.hooksComponent thisModule "table" cpt
tableCpt = R.hooksComponentWithModule thisModule "table" cpt
where
cpt {container, colNames, wrapColElts, totalRecords, rows, params} _ = do
let
......@@ -239,7 +239,7 @@ sizeDD :: Record SizeDDProps -> R.Element
sizeDD p = R.createElement sizeDDCpt p []
sizeDDCpt :: R.Component SizeDDProps
sizeDDCpt = R2.hooksComponent thisModule "sizeDD" cpt
sizeDDCpt = R.hooksComponentWithModule thisModule "sizeDD" cpt
where
cpt {params: params /\ setParams} _ = do
pure $ H.span {} [
......@@ -249,7 +249,7 @@ sizeDDCpt = R2.hooksComponent thisModule "sizeDD" cpt
{pageSize} = paramsState params
className = "form-control"
change e = do
let ps = string2PageSize $ R2.unsafeEventValue e
let ps = string2PageSize $ R.unsafeEventValue e
setParams $ \p -> stateParams $ (paramsState p) { pageSize = ps }
sizes = map option pageSizes
option size = H.option {value} [H.text value]
......
......@@ -42,21 +42,8 @@ import Web.HTML (window)
import Web.HTML.Window (localStorage)
import Web.Storage.Storage (Storage, getItem, setItem)
-- TODO Reactix should export this definition
type HooksComponent props = Record props -> Array R.Element -> R.Hooks R.Element
hooksComponent :: forall props. String -> String -> HooksComponent props -> R.Component props
hooksComponent module' name c = R.hooksComponent (module' <> "." <> name) c
type StaticComponent props = Record props -> Array R.Element -> R.Element
staticComponent :: forall props. String -> String -> StaticComponent props -> R.Component props
staticComponent module' name c = R.staticComponent (module' <> "." <> name) c
newtype Point = Point { x :: Number, y :: Number }
-- a setter function, for useState
-- a reducer function living in effector, for useReductor
type Actor s a = (a -> s -> Effect s)
......@@ -125,9 +112,6 @@ menu = createDOM "menu"
effToggler :: forall e. R.State Boolean -> EffectFn1 e Unit
effToggler (value /\ setValue) = mkEffectFn1 $ \_ -> setValue $ const $ not value
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
keyCode :: forall event. event -> Effect Int
keyCode = runEffectFn1 _keyCode
......@@ -160,9 +144,6 @@ readPositionRef el = do
let posRef = R.readRef el
Element.boundingRect <$> toMaybe posRef
unsafeEventTarget :: forall event. event -> DOM.Element
unsafeEventTarget e = (unsafeCoerce e).target
getElementById :: String -> Effect (Maybe DOM.Element)
getElementById = (flip delay) h
where
......
......@@ -12,8 +12,8 @@ import Gargantext.Config.REST as REST
import Gargantext.Ends (toUrl)
import Gargantext.Sessions (Session(..))
import Gargantext.Sessions as Sessions
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Version"
type Version = String
......@@ -33,7 +33,7 @@ versionView :: Record VersionProps -> R.Element
versionView props = R.createElement versionCpt props []
versionCpt :: R.Component VersionProps
versionCpt = R2.hooksComponent thisModule "version" cpt
versionCpt = R.hooksComponentWithModule thisModule "version" cpt
where
cpt { session } _ = do
(versionBack /\ setVer) <- R.useState' "No Backend Version"
......
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