Commit e9e44dff authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch 'dev' into dev-highlight-currently-selected-node-in-tree

parents c1227c93 4ed494c7
...@@ -9,16 +9,17 @@ ...@@ -9,16 +9,17 @@
}, },
"ace": { "ace": {
"dependencies": [ "dependencies": [
"effect",
"web-html",
"web-uievents",
"arrays", "arrays",
"effect",
"foreign", "foreign",
"nullable", "nullable",
"prelude" "prelude",
"refs",
"web-html",
"web-uievents"
], ],
"repo": "https://github.com/purescript-contrib/purescript-ace.git", "repo": "https://github.com/purescript-contrib/purescript-ace.git",
"version": "v7.0.0" "version": "v7.1.0"
}, },
"aff": { "aff": {
"dependencies": [ "dependencies": [
...@@ -79,6 +80,7 @@ ...@@ -79,6 +80,7 @@
"aff", "aff",
"argonaut-core", "argonaut-core",
"arraybuffer-types", "arraybuffer-types",
"effect",
"foreign", "foreign",
"form-urlencoded", "form-urlencoded",
"http-methods", "http-methods",
...@@ -91,7 +93,7 @@ ...@@ -91,7 +93,7 @@
"web-xhr" "web-xhr"
], ],
"repo": "https://github.com/slamdata/purescript-affjax.git", "repo": "https://github.com/slamdata/purescript-affjax.git",
"version": "v10.1.0" "version": "v11.0.0"
}, },
"ansi": { "ansi": {
"dependencies": [ "dependencies": [
...@@ -143,7 +145,7 @@ ...@@ -143,7 +145,7 @@
"tailrec" "tailrec"
], ],
"repo": "https://github.com/purescript-contrib/purescript-argonaut-core.git", "repo": "https://github.com/purescript-contrib/purescript-argonaut-core.git",
"version": "v5.0.2" "version": "v5.1.0"
}, },
"argonaut-generic": { "argonaut-generic": {
"dependencies": [ "dependencies": [
...@@ -202,7 +204,7 @@ ...@@ -202,7 +204,7 @@
"arraybuffer" "arraybuffer"
], ],
"repo": "https://github.com/jamesdbrock/purescript-arraybuffer-builder.git", "repo": "https://github.com/jamesdbrock/purescript-arraybuffer-builder.git",
"version": "v1.0.0" "version": "v1.1.0"
}, },
"arraybuffer-class": { "arraybuffer-class": {
"dependencies": [ "dependencies": [
...@@ -215,7 +217,7 @@ ...@@ -215,7 +217,7 @@
"unordered-collections" "unordered-collections"
], ],
"repo": "https://github.com/athanclark/purescript-arraybuffer-class.git", "repo": "https://github.com/athanclark/purescript-arraybuffer-class.git",
"version": "v0.2.5" "version": "v0.2.6"
}, },
"arraybuffer-types": { "arraybuffer-types": {
"dependencies": [], "dependencies": [],
...@@ -242,10 +244,21 @@ ...@@ -242,10 +244,21 @@
}, },
"arrays-zipper": { "arrays-zipper": {
"dependencies": [ "dependencies": [
"arrays" "arrays",
"control",
"quickcheck"
], ],
"repo": "https://github.com/JordanMartinez/purescript-arrays-zipper.git", "repo": "https://github.com/JordanMartinez/purescript-arrays-zipper.git",
"version": "v1.0.0" "version": "v1.1.1"
},
"assert": {
"dependencies": [
"console",
"effect",
"prelude"
],
"repo": "https://github.com/purescript/purescript-assert.git",
"version": "v4.1.0"
}, },
"avar": { "avar": {
"dependencies": [ "dependencies": [
...@@ -259,6 +272,17 @@ ...@@ -259,6 +272,17 @@
"repo": "https://github.com/slamdata/purescript-avar.git", "repo": "https://github.com/slamdata/purescript-avar.git",
"version": "v3.0.0" "version": "v3.0.0"
}, },
"axios": {
"dependencies": [
"effect",
"console",
"foreign-generic",
"aff",
"prelude"
],
"repo": "https://github.com/iarthstar/purescript-axios.git",
"version": "v1.1.2"
},
"b64": { "b64": {
"dependencies": [ "dependencies": [
"arraybuffer-types", "arraybuffer-types",
...@@ -297,6 +321,29 @@ ...@@ -297,6 +321,29 @@
"repo": "https://github.com/paf31/purescript-behaviors.git", "repo": "https://github.com/paf31/purescript-behaviors.git",
"version": "v8.0.0" "version": "v8.0.0"
}, },
"benchotron": {
"dependencies": [
"arrays",
"console",
"datetime",
"effect",
"exceptions",
"exists",
"foldable-traversable",
"identity",
"lcg",
"node-buffer",
"node-fs",
"node-readline",
"now",
"profunctor",
"quickcheck",
"strings",
"transformers"
],
"repo": "https://github.com/hdgarrood/purescript-benchotron.git",
"version": "v7.0.1"
},
"bifunctors": { "bifunctors": {
"dependencies": [ "dependencies": [
"newtype", "newtype",
...@@ -533,6 +580,33 @@ ...@@ -533,6 +580,33 @@
"repo": "https://github.com/purescript-web/purescript-canvas.git", "repo": "https://github.com/purescript-web/purescript-canvas.git",
"version": "v4.0.0" "version": "v4.0.0"
}, },
"canvas-action": {
"dependencies": [
"aff",
"canvas",
"colors",
"console",
"effect",
"exceptions",
"foldable-traversable",
"free",
"lists",
"math",
"maybe",
"newtype",
"partial",
"polymorphic-vectors",
"prelude",
"psci-support",
"run",
"transformers",
"tuples",
"typelevel-prelude",
"web-html"
],
"repo": "https://github.com/3ddyy/purescript-canvas-action.git",
"version": "v5.0.1"
},
"cartesian": { "cartesian": {
"dependencies": [ "dependencies": [
"console", "console",
...@@ -563,7 +637,7 @@ ...@@ -563,7 +637,7 @@
"variant" "variant"
], ],
"repo": "https://github.com/natefaubion/purescript-checked-exceptions.git", "repo": "https://github.com/natefaubion/purescript-checked-exceptions.git",
"version": "v3.1.0" "version": "v3.1.1"
}, },
"cheerio": { "cheerio": {
"dependencies": [ "dependencies": [
...@@ -596,6 +670,14 @@ ...@@ -596,6 +670,14 @@
"repo": "https://github.com/justinwoo/purescript-chocopie.git", "repo": "https://github.com/justinwoo/purescript-chocopie.git",
"version": "v5.0.0" "version": "v5.0.0"
}, },
"classnames": {
"dependencies": [
"record",
"strings"
],
"repo": "https://github.com/dewey92/purescript-classnames",
"version": "v0.1.1"
},
"clipboardy": { "clipboardy": {
"dependencies": [ "dependencies": [
"aff", "aff",
...@@ -611,7 +693,7 @@ ...@@ -611,7 +693,7 @@
"profunctor" "profunctor"
], ],
"repo": "https://github.com/garyb/purescript-codec.git", "repo": "https://github.com/garyb/purescript-codec.git",
"version": "v3.0.0" "version": "v3.1.0"
}, },
"codec-argonaut": { "codec-argonaut": {
"dependencies": [ "dependencies": [
...@@ -721,7 +803,7 @@ ...@@ -721,7 +803,7 @@
"node-buffer" "node-buffer"
], ],
"repo": "https://github.com/oreshinya/purescript-crypto.git", "repo": "https://github.com/oreshinya/purescript-crypto.git",
"version": "v2.0.1" "version": "v2.1.0"
}, },
"css": { "css": {
"dependencies": [ "dependencies": [
...@@ -794,7 +876,15 @@ ...@@ -794,7 +876,15 @@
"prelude" "prelude"
], ],
"repo": "https://github.com/garyb/purescript-debug.git", "repo": "https://github.com/garyb/purescript-debug.git",
"version": "v4.0.0" "version": "v4.0.1"
},
"debuggest": {
"dependencies": [
"prelude",
"unsafe-coerce"
],
"repo": "https://github.com/ursi/purescript-debuggest.git",
"version": "v0.3.1"
}, },
"decimals": { "decimals": {
"dependencies": [ "dependencies": [
...@@ -812,6 +902,18 @@ ...@@ -812,6 +902,18 @@
"repo": "https://github.com/purescript/purescript-distributive.git", "repo": "https://github.com/purescript/purescript-distributive.git",
"version": "v4.0.0" "version": "v4.0.0"
}, },
"dodo-printer": {
"dependencies": [
"ansi",
"foldable-traversable",
"lists",
"maybe",
"prelude",
"strings"
],
"repo": "https://github.com/natefaubion/purescript-dodo-printer/",
"version": "v1.0.8"
},
"dom-filereader": { "dom-filereader": {
"dependencies": [ "dependencies": [
"aff", "aff",
...@@ -861,6 +963,18 @@ ...@@ -861,6 +963,18 @@
"repo": "https://github.com/nsaunders/purescript-dotenv.git", "repo": "https://github.com/nsaunders/purescript-dotenv.git",
"version": "v1.1.0" "version": "v1.1.0"
}, },
"downloadjs": {
"dependencies": [
"arraybuffer-types",
"console",
"effect",
"foreign",
"psci-support",
"web-file"
],
"repo": "https://github.com/chekoopa/purescript-downloadjs.git",
"version": "v1.0.0"
},
"drawing": { "drawing": {
"dependencies": [ "dependencies": [
"canvas", "canvas",
...@@ -873,6 +987,13 @@ ...@@ -873,6 +987,13 @@
"repo": "https://github.com/paf31/purescript-drawing.git", "repo": "https://github.com/paf31/purescript-drawing.git",
"version": "v4.0.0" "version": "v4.0.0"
}, },
"easy-ffi": {
"dependencies": [
"prelude"
],
"repo": "https://github.com/pelotom/purescript-easy-ffi",
"version": "v2.1.2"
},
"effect": { "effect": {
"dependencies": [ "dependencies": [
"prelude" "prelude"
...@@ -997,6 +1118,17 @@ ...@@ -997,6 +1118,17 @@
"repo": "https://github.com/nkly/purescript-express.git", "repo": "https://github.com/nkly/purescript-express.git",
"version": "v0.8.0" "version": "v0.8.0"
}, },
"ffi-foreign": {
"dependencies": [
"console",
"effect",
"foreign",
"prelude",
"psci-support"
],
"repo": "https://github.com/markfarrell/purescript-ffi-foreign.git",
"version": "v0.0.2"
},
"ffi-simple": { "ffi-simple": {
"dependencies": [ "dependencies": [
"prelude", "prelude",
...@@ -1335,6 +1467,43 @@ ...@@ -1335,6 +1467,43 @@
"repo": "https://github.com/citizennet/purescript-fuzzy.git", "repo": "https://github.com/citizennet/purescript-fuzzy.git",
"version": "v0.3.0" "version": "v0.3.0"
}, },
"game": {
"dependencies": [
"aff",
"canvas-action",
"console",
"control",
"datetime",
"effect",
"filterable",
"foldable-traversable",
"fork",
"free",
"functors",
"identity",
"js-timers",
"monad-loops",
"newtype",
"now",
"parallel",
"partial",
"polymorphic-vectors",
"prelude",
"psci-support",
"record",
"record-extra",
"refs",
"run",
"tailrec",
"typelevel-prelude",
"undefined",
"variant",
"web-html",
"web-uievents"
],
"repo": "https://github.com/3ddyy/purescript-game.git",
"version": "v2.0.0"
},
"gen": { "gen": {
"dependencies": [ "dependencies": [
"either", "either",
...@@ -1362,6 +1531,45 @@ ...@@ -1362,6 +1531,45 @@
"repo": "https://github.com/purescript/purescript-generics-rep.git", "repo": "https://github.com/purescript/purescript-generics-rep.git",
"version": "v6.1.1" "version": "v6.1.1"
}, },
"geometry-plane": {
"dependencies": [
"console",
"effect",
"psci-support",
"sparse-polynomials"
],
"repo": "https://github.com/Ebmtranceboy/purescript-geometry-plane.git",
"version": "v1.0.1"
},
"github-actions-toolkit": {
"dependencies": [
"aff",
"aff-promise",
"effect",
"foreign-object",
"node-buffer",
"node-path",
"node-streams",
"nullable",
"transformers"
],
"repo": "https://github.com/purescript-contrib/purescript-github-actions-toolkit",
"version": "v0.2.0"
},
"gl-matrix": {
"dependencies": [
"arrays",
"effect",
"foldable-traversable",
"functions",
"math",
"partial",
"prelude",
"psci-support"
],
"repo": "https://github.com/dirkz/purescript-gl-matrix",
"version": "v2.0.1"
},
"globals": { "globals": {
"dependencies": [ "dependencies": [
"functions", "functions",
...@@ -1386,7 +1594,7 @@ ...@@ -1386,7 +1594,7 @@
"web-html" "web-html"
], ],
"repo": "https://github.com/purescript-grain/purescript-grain.git", "repo": "https://github.com/purescript-grain/purescript-grain.git",
"version": "v0.7.0" "version": "v0.9.0"
}, },
"grain-router": { "grain-router": {
"dependencies": [ "dependencies": [
...@@ -1394,14 +1602,14 @@ ...@@ -1394,14 +1602,14 @@
"profunctor" "profunctor"
], ],
"repo": "https://github.com/purescript-grain/purescript-grain-router.git", "repo": "https://github.com/purescript-grain/purescript-grain-router.git",
"version": "v0.7.0" "version": "v0.9.0"
}, },
"grain-virtualized": { "grain-virtualized": {
"dependencies": [ "dependencies": [
"grain" "grain"
], ],
"repo": "https://github.com/purescript-grain/purescript-grain-virtualized.git", "repo": "https://github.com/purescript-grain/purescript-grain-virtualized.git",
"version": "v0.7.0" "version": "v0.9.0"
}, },
"group": { "group": {
"dependencies": [ "dependencies": [
...@@ -1418,6 +1626,7 @@ ...@@ -1418,6 +1626,7 @@
"const", "const",
"coroutines", "coroutines",
"dom-indexed", "dom-indexed",
"effect",
"foreign", "foreign",
"fork", "fork",
"free", "free",
...@@ -1431,10 +1640,11 @@ ...@@ -1431,10 +1640,11 @@
"transformers", "transformers",
"unsafe-coerce", "unsafe-coerce",
"unsafe-reference", "unsafe-reference",
"web-file",
"web-uievents" "web-uievents"
], ],
"repo": "https://github.com/slamdata/purescript-halogen.git", "repo": "https://github.com/slamdata/purescript-halogen.git",
"version": "v5.0.1" "version": "v5.1.0"
}, },
"halogen-bootstrap": { "halogen-bootstrap": {
"dependencies": [ "dependencies": [
...@@ -1467,7 +1677,7 @@ ...@@ -1467,7 +1677,7 @@
"profunctor-lenses" "profunctor-lenses"
], ],
"repo": "https://github.com/thomashoneyman/purescript-halogen-formless.git", "repo": "https://github.com/thomashoneyman/purescript-halogen-formless.git",
"version": "v1.0.0-rc.2" "version": "v1.0.0"
}, },
"halogen-hooks": { "halogen-hooks": {
"dependencies": [ "dependencies": [
...@@ -1475,7 +1685,7 @@ ...@@ -1475,7 +1685,7 @@
"indexed-monad" "indexed-monad"
], ],
"repo": "https://github.com/thomashoneyman/purescript-halogen-hooks.git", "repo": "https://github.com/thomashoneyman/purescript-halogen-hooks.git",
"version": "v0.4.2" "version": "v0.4.3"
}, },
"halogen-hooks-extra": { "halogen-hooks-extra": {
"dependencies": [ "dependencies": [
...@@ -1511,7 +1721,7 @@ ...@@ -1511,7 +1721,7 @@
"web-uievents" "web-uievents"
], ],
"repo": "https://github.com/JordanMartinez/purescript-halogen-svg-elems.git", "repo": "https://github.com/JordanMartinez/purescript-halogen-svg-elems.git",
"version": "v2.0.1" "version": "v2.0.2"
}, },
"halogen-vdom": { "halogen-vdom": {
"dependencies": [ "dependencies": [
...@@ -1529,6 +1739,18 @@ ...@@ -1529,6 +1739,18 @@
"repo": "https://github.com/slamdata/purescript-halogen-vdom.git", "repo": "https://github.com/slamdata/purescript-halogen-vdom.git",
"version": "v6.1.3" "version": "v6.1.3"
}, },
"heckin": {
"dependencies": [
"arrays",
"console",
"effect",
"foldable-traversable",
"psci-support",
"unicode"
],
"repo": "https://github.com/maxdeviant/purescript-heckin.git",
"version": "v1.1.0"
},
"heterogeneous": { "heterogeneous": {
"dependencies": [ "dependencies": [
"either", "either",
...@@ -1645,6 +1867,7 @@ ...@@ -1645,6 +1867,7 @@
"http-methods", "http-methods",
"indexed-monad", "indexed-monad",
"media-types", "media-types",
"node-buffer",
"node-fs-aff", "node-fs-aff",
"node-http", "node-http",
"ordered-collections", "ordered-collections",
...@@ -1657,7 +1880,7 @@ ...@@ -1657,7 +1880,7 @@
"typelevel-prelude" "typelevel-prelude"
], ],
"repo": "https://github.com/purescript-hyper/hyper.git", "repo": "https://github.com/purescript-hyper/hyper.git",
"version": "v0.11.0" "version": "v0.11.1"
}, },
"hypertrout": { "hypertrout": {
"dependencies": [ "dependencies": [
...@@ -1686,7 +1909,7 @@ ...@@ -1686,7 +1909,7 @@
"simple-json" "simple-json"
], ],
"repo": "https://github.com/oreshinya/purescript-identy.git", "repo": "https://github.com/oreshinya/purescript-identy.git",
"version": "v2.1.0" "version": "v2.2.0"
}, },
"indexed-monad": { "indexed-monad": {
"dependencies": [ "dependencies": [
...@@ -1935,6 +2158,20 @@ ...@@ -1935,6 +2158,20 @@
"repo": "https://github.com/paluh/purescript-logging-journald.git", "repo": "https://github.com/paluh/purescript-logging-journald.git",
"version": "v0.3.2" "version": "v0.3.2"
}, },
"longs": {
"dependencies": [
"effect",
"console",
"prelude",
"strings",
"foreign",
"nullable",
"functions",
"quickcheck"
],
"repo": "https://github.com/zapph/purescript-longs.git",
"version": "v0.1.1"
},
"machines": { "machines": {
"dependencies": [ "dependencies": [
"arrays", "arrays",
...@@ -1975,6 +2212,25 @@ ...@@ -1975,6 +2212,25 @@
"repo": "https://github.com/poorscript/purescript-markdown-smolder", "repo": "https://github.com/poorscript/purescript-markdown-smolder",
"version": "2020-03-04" "version": "2020-03-04"
}, },
"mason-prelude": {
"dependencies": [
"arrays",
"debuggest",
"either",
"functions",
"generics-rep",
"integers",
"lists",
"math",
"parallel",
"point-free",
"prelude",
"tuples",
"unfoldable"
],
"repo": "https://github.com/ursi/purescript-mason-prelude.git",
"version": "v0.3.0"
},
"math": { "math": {
"dependencies": [], "dependencies": [],
"repo": "https://github.com/purescript/purescript-math.git", "repo": "https://github.com/purescript/purescript-math.git",
...@@ -1988,6 +2244,17 @@ ...@@ -1988,6 +2244,17 @@
"repo": "https://github.com/kritzcreek/purescript-matrices.git", "repo": "https://github.com/kritzcreek/purescript-matrices.git",
"version": "v5.0.1" "version": "v5.0.1"
}, },
"matryoshka": {
"dependencies": [
"free",
"fixed-points",
"profunctor",
"prelude",
"transformers"
],
"repo": "https://github.com/purescript-contrib/purescript-matryoshka.git",
"version": "v0.4.0"
},
"maybe": { "maybe": {
"dependencies": [ "dependencies": [
"control", "control",
...@@ -2177,6 +2444,14 @@ ...@@ -2177,6 +2444,14 @@
"repo": "https://github.com/LiamGoodacre/purescript-naturals.git", "repo": "https://github.com/LiamGoodacre/purescript-naturals.git",
"version": "v3.0.0" "version": "v3.0.0"
}, },
"nested-functor": {
"dependencies": [
"prelude",
"type-equality"
],
"repo": "https://github.com/acple/purescript-nested-functor.git",
"version": "v0.2.1"
},
"newtype": { "newtype": {
"dependencies": [ "dependencies": [
"prelude" "prelude"
...@@ -2427,6 +2702,16 @@ ...@@ -2427,6 +2702,16 @@
"repo": "https://github.com/purescript-contrib/purescript-now.git", "repo": "https://github.com/purescript-contrib/purescript-now.git",
"version": "v4.0.0" "version": "v4.0.0"
}, },
"npm-package-json": {
"dependencies": [
"argonaut",
"console",
"effect",
"psci-support"
],
"repo": "https://github.com/maxdeviant/purescript-npm-package-json.git",
"version": "v1.2.0"
},
"nullable": { "nullable": {
"dependencies": [ "dependencies": [
"functions", "functions",
...@@ -2444,6 +2729,29 @@ ...@@ -2444,6 +2729,29 @@
"repo": "https://github.com/sharkdp/purescript-numbers.git", "repo": "https://github.com/sharkdp/purescript-numbers.git",
"version": "v7.0.0" "version": "v7.0.0"
}, },
"option": {
"dependencies": [
"argonaut-codecs",
"argonaut-core",
"codec",
"codec-argonaut",
"either",
"foreign",
"foreign-object",
"lists",
"maybe",
"profunctor",
"prelude",
"record",
"simple-json",
"transformers",
"tuples",
"type-equality",
"unsafe-coerce"
],
"repo": "https://github.com/joneshf/purescript-option.git",
"version": "v6.0.1"
},
"options": { "options": {
"dependencies": [ "dependencies": [
"contravariant", "contravariant",
...@@ -2579,7 +2887,7 @@ ...@@ -2579,7 +2887,7 @@
"unicode" "unicode"
], ],
"repo": "https://github.com/purescript-contrib/purescript-parsing.git", "repo": "https://github.com/purescript-contrib/purescript-parsing.git",
"version": "v5.0.3" "version": "v5.1.0"
}, },
"parsing-dataview": { "parsing-dataview": {
"dependencies": [ "dependencies": [
...@@ -2590,6 +2898,81 @@ ...@@ -2590,6 +2898,81 @@
"repo": "https://github.com/jamesdbrock/purescript-parsing-dataview.git", "repo": "https://github.com/jamesdbrock/purescript-parsing-dataview.git",
"version": "v1.1.1" "version": "v1.1.1"
}, },
"parsing-expect": {
"dependencies": [
"console",
"effect",
"parsing",
"prelude",
"psci-support"
],
"repo": "https://github.com/markfarrell/purescript-parsing-expect.git",
"version": "v0.0.3"
},
"parsing-foreign": {
"dependencies": [
"console",
"effect",
"foreign",
"ffi-foreign",
"parsing",
"prelude",
"psci-support",
"parsing-expect",
"parsing-validation"
],
"repo": "https://github.com/markfarrell/purescript-parsing-foreign.git",
"version": "v0.0.2"
},
"parsing-hexadecimal": {
"dependencies": [
"console",
"effect",
"parsing",
"prelude",
"psci-support",
"parsing-expect"
],
"repo": "https://github.com/markfarrell/purescript-parsing-hexadecimal.git",
"version": "v0.0.2"
},
"parsing-repetition": {
"dependencies": [
"console",
"effect",
"parsing",
"prelude",
"psci-support",
"parsing-expect"
],
"repo": "https://github.com/markfarrell/purescript-parsing-repetition.git",
"version": "v0.0.6"
},
"parsing-uuid": {
"dependencies": [
"console",
"effect",
"parsing",
"prelude",
"psci-support",
"parsing-expect",
"parsing-repetition",
"parsing-hexadecimal"
],
"repo": "https://github.com/markfarrell/purescript-parsing-uuid.git",
"version": "v0.0.3"
},
"parsing-validation": {
"dependencies": [
"console",
"effect",
"parsing",
"prelude",
"psci-support"
],
"repo": "https://github.com/markfarrell/purescript-parsing-validation.git",
"version": "v0.1.2"
},
"partial": { "partial": {
"dependencies": [], "dependencies": [],
"repo": "https://github.com/purescript/purescript-partial.git", "repo": "https://github.com/purescript/purescript-partial.git",
...@@ -2611,6 +2994,28 @@ ...@@ -2611,6 +2994,28 @@
"repo": "https://github.com/slamdata/purescript-pathy.git", "repo": "https://github.com/slamdata/purescript-pathy.git",
"version": "v7.0.1" "version": "v7.0.1"
}, },
"payload": {
"dependencies": [
"aff",
"affjax",
"console",
"debug",
"effect",
"foreign-generic",
"node-fs",
"node-fs-aff",
"node-http",
"prelude",
"psci-support",
"record",
"simple-json",
"stringutils",
"test-unit",
"typelevel-prelude"
],
"repo": "https://github.com/hoodunit/purescript-payload",
"version": "v0.3.1"
},
"phoenix": { "phoenix": {
"dependencies": [ "dependencies": [
"options" "options"
...@@ -2631,6 +3036,24 @@ ...@@ -2631,6 +3036,24 @@
"repo": "https://github.com/felixSchl/purescript-pipes.git", "repo": "https://github.com/felixSchl/purescript-pipes.git",
"version": "v6.0.0" "version": "v6.0.0"
}, },
"point-free": {
"dependencies": [
"prelude"
],
"repo": "https://github.com/ursi/purescript-point-free.git",
"version": "v0.1.1"
},
"pointed": {
"dependencies": [
"bifunctors",
"foldable-traversable",
"generics-rep",
"lists",
"maybe"
],
"repo": "https://github.com/vladciobanu/purescript-pointed.git",
"version": "v0.1.1"
},
"pointed-list": { "pointed-list": {
"dependencies": [ "dependencies": [
"lists", "lists",
...@@ -2657,6 +3080,20 @@ ...@@ -2657,6 +3080,20 @@
"repo": "https://github.com/paluh/purescript-polyform.git", "repo": "https://github.com/paluh/purescript-polyform.git",
"version": "v0.8.2" "version": "v0.8.2"
}, },
"polymorphic-vectors": {
"dependencies": [
"canvas",
"console",
"distributive",
"effect",
"foldable-traversable",
"math",
"prelude",
"psci-support"
],
"repo": "https://github.com/3ddyy/purescript-polymorphic-vectors.git",
"version": "v2.0.0"
},
"posix-types": { "posix-types": {
"dependencies": [ "dependencies": [
"maybe", "maybe",
...@@ -2762,6 +3199,24 @@ ...@@ -2762,6 +3199,24 @@
"repo": "https://github.com/thimoteus/purescript-promises.git", "repo": "https://github.com/thimoteus/purescript-promises.git",
"version": "v3.1.1" "version": "v3.1.1"
}, },
"protobuf": {
"dependencies": [
"parsing",
"arraybuffer-types",
"arraybuffer",
"uint",
"text-encoding",
"longs",
"node-streams",
"node-process",
"node-buffer",
"node-path",
"arraybuffer-builder",
"parsing-dataview"
],
"repo": "https://github.com/xc-jp/purescript-protobuf.git",
"version": "v1.4.0"
},
"proxy": { "proxy": {
"dependencies": [ "dependencies": [
"prelude" "prelude"
...@@ -3043,7 +3498,7 @@ ...@@ -3043,7 +3498,7 @@
"web-html" "web-html"
], ],
"repo": "https://github.com/lumihq/purescript-react-basic-dom.git", "repo": "https://github.com/lumihq/purescript-react-basic-dom.git",
"version": "v2.0.0" "version": "v3.2.0"
}, },
"react-basic-emotion": { "react-basic-emotion": {
"dependencies": [ "dependencies": [
...@@ -3057,7 +3512,7 @@ ...@@ -3057,7 +3512,7 @@
"web-html" "web-html"
], ],
"repo": "https://github.com/lumihq/purescript-react-basic-emotion.git", "repo": "https://github.com/lumihq/purescript-react-basic-emotion.git",
"version": "v4.2.2" "version": "v5.0.0"
}, },
"react-basic-hooks": { "react-basic-hooks": {
"dependencies": [ "dependencies": [
...@@ -3079,7 +3534,7 @@ ...@@ -3079,7 +3534,7 @@
"web-html" "web-html"
], ],
"repo": "https://github.com/spicydonuts/purescript-react-basic-hooks.git", "repo": "https://github.com/spicydonuts/purescript-react-basic-hooks.git",
"version": "v6.0.0" "version": "v6.2.0"
}, },
"react-basic-native": { "react-basic-native": {
"dependencies": [ "dependencies": [
...@@ -3497,7 +3952,7 @@ ...@@ -3497,7 +3952,7 @@
"affjax" "affjax"
], ],
"repo": "https://github.com/dariooddenino/purescript-simple-ajax.git", "repo": "https://github.com/dariooddenino/purescript-simple-ajax.git",
"version": "v2.0.0" "version": "v3.0.0"
}, },
"simple-emitter": { "simple-emitter": {
"dependencies": [ "dependencies": [
...@@ -3817,7 +4272,7 @@ ...@@ -3817,7 +4272,7 @@
"unicode" "unicode"
], ],
"repo": "https://github.com/purescript-contrib/purescript-strings-extra.git", "repo": "https://github.com/purescript-contrib/purescript-strings-extra.git",
"version": "v2.1.0" "version": "v2.2.1"
}, },
"stringutils": { "stringutils": {
"dependencies": [ "dependencies": [
...@@ -4271,9 +4726,30 @@ ...@@ -4271,9 +4726,30 @@
"version": "v4.0.0" "version": "v4.0.0"
}, },
"unsafe-reference": { "unsafe-reference": {
"dependencies": [], "dependencies": [
"effect",
"exceptions"
],
"repo": "https://github.com/purescript-contrib/purescript-unsafe-reference.git", "repo": "https://github.com/purescript-contrib/purescript-unsafe-reference.git",
"version": "v3.0.1" "version": "v3.1.0"
},
"untagged-union": {
"dependencies": [
"assert",
"console",
"effect",
"foreign",
"foreign-object",
"literals",
"maybe",
"newtype",
"proxy",
"psci-support",
"tuples",
"unsafe-coerce"
],
"repo": "https://github.com/jvliwanag/purescript-untagged-union.git",
"version": "v0.1.1"
}, },
"uri": { "uri": {
"dependencies": [ "dependencies": [
...@@ -4298,7 +4774,7 @@ ...@@ -4298,7 +4774,7 @@
"spec" "spec"
], ],
"repo": "https://github.com/spicydonuts/purescript-uuid.git", "repo": "https://github.com/spicydonuts/purescript-uuid.git",
"version": "v6.1.0" "version": "v7.0.0"
}, },
"validated-molecule": { "validated-molecule": {
"dependencies": [ "dependencies": [
...@@ -4464,6 +4940,17 @@ ...@@ -4464,6 +4940,17 @@
"repo": "https://github.com/athanclark/purescript-websocket-moderate.git", "repo": "https://github.com/athanclark/purescript-websocket-moderate.git",
"version": "v7.0.2" "version": "v7.0.2"
}, },
"which": {
"dependencies": [
"arrays",
"console",
"effect",
"nullable",
"psci-support"
],
"repo": "https://github.com/maxdeviant/purescript-which.git",
"version": "v0.1.0"
},
"xiaomian": { "xiaomian": {
"dependencies": [ "dependencies": [
"naporitan" "naporitan"
......
{ {
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.1.91.3", "version": "0.0.1.91.7",
"scripts": { "scripts": {
"rebase-set": "spago package-set-upgrade && spago psc-package-insdhall", "rebase-set": "spago package-set-upgrade && spago psc-package-insdhall",
"rebuild-set": "spago psc-package-insdhall", "rebuild-set": "spago psc-package-insdhall",
......
{ abides =
{ dependencies = [ "enums", "foldable-traversable" ]
, repo = "https://github.com/athanclark/purescript-abides.git"
, version = "v0.0.1"
}
, ace =
{ dependencies =
[ "effect"
, "web-html"
, "web-uievents"
, "arrays"
, "foreign"
, "nullable"
, "prelude"
]
, repo = "https://github.com/purescript-contrib/purescript-ace.git"
, version = "v7.0.0"
}
, aff =
{ dependencies =
[ "datetime"
, "effect"
, "exceptions"
, "functions"
, "parallel"
, "transformers"
, "unsafe-coerce"
]
, repo = "https://github.com/slamdata/purescript-aff.git"
, version = "v5.1.2"
}
, aff-bus =
{ dependencies = [ "avar", "prelude" ]
, repo = "https://github.com/slamdata/purescript-aff-bus.git"
, version = "v4.0.0"
}
, aff-coroutines =
{ dependencies = [ "aff", "avar", "console", "coroutines" ]
, repo = "https://github.com/purescript-contrib/purescript-aff-coroutines.git"
, version = "v7.0.0"
}
, aff-promise =
{ dependencies = [ "aff", "foreign" ]
, repo = "https://github.com/nwolverson/purescript-aff-promise.git"
, version = "v2.1.0"
}
, aff-retry =
{ dependencies =
[ "psci-support"
, "console"
, "aff"
, "datetime"
, "prelude"
, "random"
, "transformers"
, "exceptions"
, "test-unit"
]
, repo = "https://github.com/Unisay/purescript-aff-retry.git"
, version = "v1.2.1"
}
, affjax =
{ dependencies =
[ "aff"
, "argonaut-core"
, "arraybuffer-types"
, "foreign"
, "form-urlencoded"
, "http-methods"
, "integers"
, "math"
, "media-types"
, "nullable"
, "refs"
, "unsafe-coerce"
, "web-xhr"
]
, repo = "https://github.com/slamdata/purescript-affjax.git"
, version = "v10.1.0"
}
, ansi =
{ dependencies = [ "foldable-traversable", "lists", "strings" ]
, repo = "https://github.com/hdgarrood/purescript-ansi.git"
, version = "v5.0.0"
}
, argonaut =
{ dependencies = [ "argonaut-codecs", "argonaut-core", "argonaut-traversals" ]
, repo = "https://github.com/purescript-contrib/purescript-argonaut.git"
, version = "v7.0.0"
}
, argonaut-codecs =
{ dependencies =
[ "argonaut-core"
, "arrays"
, "effect"
, "foreign-object"
, "generics-rep"
, "identity"
, "integers"
, "maybe"
, "nonempty"
, "ordered-collections"
, "record"
]
, repo =
"https://github.com/purescript-contrib/purescript-argonaut-codecs.git"
, version = "v7.0.0"
}
, argonaut-core =
{ dependencies =
[ "arrays"
, "control"
, "either"
, "foreign-object"
, "functions"
, "gen"
, "maybe"
, "nonempty"
, "prelude"
, "strings"
, "tailrec"
]
, repo = "https://github.com/purescript-contrib/purescript-argonaut-core.git"
, version = "v5.0.2"
}
, argonaut-generic =
{ dependencies =
[ "argonaut-codecs", "argonaut-core", "generics-rep", "record" ]
, repo =
"https://github.com/purescript-contrib/purescript-argonaut-generic.git"
, version = "v6.0.0"
}
, argonaut-traversals =
{ dependencies = [ "argonaut-codecs", "argonaut-core", "profunctor-lenses" ]
, repo =
"https://github.com/purescript-contrib/purescript-argonaut-traversals.git"
, version = "v8.0.0"
}
, array-views =
{ dependencies =
[ "arrays"
, "control"
, "foldable-traversable"
, "generics-rep"
, "maybe"
, "nonempty"
, "prelude"
, "profunctor"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/klntsky/purescript-array-views.git"
, version = "v0.0.2"
}
, arraybuffer =
{ dependencies =
[ "arraybuffer-types"
, "effect"
, "float32"
, "functions"
, "maybe"
, "nullable"
, "partial"
, "sized-vectors"
, "typelevel"
, "uint"
]
, repo = "https://github.com/jacereda/purescript-arraybuffer.git"
, version = "v10.0.2"
}
, arraybuffer-builder =
{ dependencies = [ "arraybuffer-types", "arraybuffer" ]
, repo = "https://github.com/jamesdbrock/purescript-arraybuffer-builder.git"
, version = "v1.0.0"
}
, arraybuffer-class =
{ dependencies =
[ "arraybuffer"
, "exceptions"
, "foreign-object"
, "ordered-collections"
, "sized-vectors"
, "strings"
, "unordered-collections"
]
, repo = "https://github.com/athanclark/purescript-arraybuffer-class.git"
, version = "v0.2.5"
}
, arraybuffer-types =
{ dependencies = [] : List Text
, repo =
"https://github.com/purescript-contrib/purescript-arraybuffer-types.git"
, version = "v2.0.0"
}
, arrays =
{ dependencies =
[ "bifunctors"
, "control"
, "foldable-traversable"
, "maybe"
, "nonempty"
, "partial"
, "prelude"
, "st"
, "tailrec"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript/purescript-arrays.git"
, version = "v5.3.1"
}
, arrays-zipper =
{ dependencies = [ "arrays" ]
, repo = "https://github.com/JordanMartinez/purescript-arrays-zipper.git"
, version = "v1.0.0"
}
--, assert =
-- { dependencies = [ "console", "effect", "prelude" ]
-- , repo = "https://github.com/purescript/purescript-assert.git"
-- , version = "v4.1.0"
-- }
, avar =
{ dependencies =
[ "aff", "effect", "either", "exceptions", "functions", "maybe" ]
, repo = "https://github.com/slamdata/purescript-avar.git"
, version = "v3.0.0"
}
, b64 =
{ dependencies =
[ "arraybuffer-types"
, "either"
, "encoding"
, "enums"
, "exceptions"
, "functions"
, "partial"
, "prelude"
, "strings"
]
, repo = "https://github.com/menelaos/purescript-b64.git"
, version = "v0.0.6"
}
, basic-auth =
{ dependencies = [ "crypto", "node-http" ]
, repo = "https://github.com/oreshinya/purescript-basic-auth.git"
, version = "v1.0.3"
}
, behaviors =
{ dependencies =
[ "effect"
, "event"
, "filterable"
, "nullable"
, "ordered-collections"
, "prelude"
, "web-events"
, "web-html"
, "web-uievents"
]
, repo = "https://github.com/paf31/purescript-behaviors.git"
, version = "v8.0.0"
}
, bifunctors =
{ dependencies = [ "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-bifunctors.git"
, version = "v4.0.0"
}
, bigints =
{ dependencies = [ "integers", "maybe", "strings" ]
, repo = "https://github.com/sharkdp/purescript-bigints.git"
, version = "v4.0.0"
}
, bip39 =
{ dependencies = [ "arraybuffer-types", "nullable" ]
, repo = "https://github.com/athanclark/purescript-bip39.git"
, version = "v1.0.1"
}
, biscotti-cookie =
{ dependencies =
[ "datetime"
, "effect"
, "either"
, "foldable-traversable"
, "formatters"
, "gen"
, "newtype"
, "now"
, "prelude"
, "profunctor-lenses"
, "psci-support"
, "quickcheck"
, "record"
, "string-parsers"
, "strings"
, "test-unit"
]
, repo = "https://github.com/drewolson/purescript-biscotti-cookie.git"
, version = "v0.2.0"
}
, biscotti-session =
{ dependencies =
[ "aff"
, "argonaut"
, "biscotti-cookie"
, "effect"
, "newtype"
, "ordered-collections"
, "prelude"
, "profunctor-lenses"
, "psci-support"
, "refs"
, "test-unit"
, "uuid"
]
, repo = "https://github.com/drewolson/purescript-biscotti-session.git"
, version = "v0.1.2"
}
, bower-json =
{ dependencies =
[ "prelude"
, "generics-rep"
, "maybe"
, "arrays"
, "either"
, "newtype"
, "tuples"
, "foldable-traversable"
, "argonaut-codecs"
, "foreign-object"
]
, repo = "https://github.com/klntsky/purescript-bower-json.git"
, version = "v2.0.0"
}
, bucketchain =
{ dependencies =
[ "aff", "console", "node-http", "node-streams", "transformers" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain.git"
, version = "v0.3.0"
}
, bucketchain-basic-auth =
{ dependencies = [ "basic-auth", "bucketchain" ]
, repo =
"https://github.com/Bucketchain/purescript-bucketchain-basic-auth.git"
, version = "v0.2.0"
}
, bucketchain-conditional =
{ dependencies = [ "bucketchain", "js-date" ]
, repo =
"https://github.com/Bucketchain/purescript-bucketchain-conditional.git"
, version = "v0.2.0"
}
, bucketchain-cors =
{ dependencies = [ "bucketchain", "bucketchain-header-utils", "http-methods" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-cors.git"
, version = "v0.3.0"
}
, bucketchain-csrf =
{ dependencies = [ "bucketchain" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-csrf.git"
, version = "v0.1.0"
}
, bucketchain-header-utils =
{ dependencies = [ "bucketchain" ]
, repo =
"https://github.com/Bucketchain/purescript-bucketchain-header-utils.git"
, version = "v0.3.0"
}
, bucketchain-health =
{ dependencies = [ "bucketchain" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-health.git"
, version = "v0.2.0"
}
, bucketchain-history-api-fallback =
{ dependencies = [ "bucketchain" ]
, repo =
"https://github.com/Bucketchain/purescript-bucketchain-history-api-fallback.git"
, version = "v0.3.0"
}
, bucketchain-logger =
{ dependencies = [ "bucketchain", "js-date", "node-process" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-logger.git"
, version = "v0.3.0"
}
, bucketchain-secure =
{ dependencies = [ "bucketchain" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-secure.git"
, version = "v0.1.0"
}
, bucketchain-simple-api =
{ dependencies = [ "bucketchain", "media-types", "simple-json", "freet" ]
, repo =
"https://github.com/Bucketchain/purescript-bucketchain-simple-api.git"
, version = "v3.0.0"
}
, bucketchain-sslify =
{ dependencies = [ "bucketchain" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-sslify.git"
, version = "v0.2.0"
}
, bucketchain-static =
{ dependencies = [ "bucketchain", "node-fs-aff" ]
, repo = "https://github.com/Bucketchain/purescript-bucketchain-static.git"
, version = "v0.3.0"
}
, byte-codec =
{ dependencies = [ "generics-rep", "integers", "sized-vectors" ]
, repo = "https://github.com/athanclark/purescript-byte-codec.git"
, version = "v0.0.1"
}
, bytestrings =
{ dependencies =
[ "arrays"
, "effect"
, "exceptions"
, "foldable-traversable"
, "integers"
, "leibniz"
, "maybe"
, "newtype"
, "node-buffer"
, "prelude"
, "quickcheck"
, "quotient"
, "unsafe-coerce"
]
, repo = "https://github.com/rightfold/purescript-bytestrings.git"
, version = "v8.0.0"
}
, call-by-name =
{ dependencies = [ "unsafe-coerce", "lazy", "maybe", "either", "control" ]
, repo = "https://github.com/natefaubion/purescript-call-by-name.git"
, version = "v2.0.0"
}
, canvas =
{ dependencies =
[ "arraybuffer-types", "effect", "exceptions", "functions", "maybe" ]
, repo = "https://github.com/purescript-web/purescript-canvas.git"
, version = "v4.0.0"
}
, cartesian =
{ dependencies = [ "console", "effect", "integers", "psci-support" ]
, repo = "https://github.com/Ebmtranceboy/purescript-cartesian.git"
, version = "v1.0.4"
}
, catenable-lists =
{ dependencies =
[ "control"
, "foldable-traversable"
, "lists"
, "maybe"
, "prelude"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-catenable-lists.git"
, version = "v5.0.1"
}
, checked-exceptions =
{ dependencies = [ "prelude", "transformers", "variant" ]
, repo = "https://github.com/natefaubion/purescript-checked-exceptions.git"
, version = "v3.1.0"
}
, cheerio =
{ dependencies = [ "console", "effect", "functions", "prelude", "test-unit" ]
, repo = "https://github.com/icyrockcom/purescript-cheerio.git"
, version = "v0.2.3"
}
, chirashi =
{ dependencies = [ "exceptions", "prelude", "typelevel-prelude", "variant" ]
, repo = "https://github.com/justinwoo/purescript-chirashi.git"
, version = "v1.0.0"
}
, choco-pie =
{ dependencies = [ "event", "prelude", "record", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-chocopie.git"
, version = "v5.0.0"
}
, clipboardy =
{ dependencies = [ "aff", "aff-promise", "effect" ]
, repo = "https://github.com/hrajchert/purescript-clipboardy.git"
, version = "v1.0.3"
}
, codec =
{ dependencies = [ "transformers", "profunctor" ]
, repo = "https://github.com/garyb/purescript-codec.git"
, version = "v3.0.0"
}
, codec-argonaut =
{ dependencies =
[ "argonaut-core"
, "codec"
, "generics-rep"
, "ordered-collections"
, "type-equality"
, "variant"
]
, repo = "https://github.com/garyb/purescript-codec-argonaut.git"
, version = "v7.1.0"
}
, colors =
{ dependencies = [ "arrays", "integers", "lists", "partial", "strings" ]
, repo = "https://github.com/sharkdp/purescript-colors.git"
, version = "v5.0.0"
}
, concur-core =
{ dependencies =
[ "aff"
, "arrays"
, "avar"
, "console"
, "foldable-traversable"
, "free"
, "nonempty"
, "profunctor-lenses"
, "tailrec"
]
, repo = "https://github.com/purescript-concur/purescript-concur-core.git"
, version = "v0.4.2"
}
, concur-react =
{ dependencies =
[ "aff"
, "arrays"
, "avar"
, "concur-core"
, "console"
, "foldable-traversable"
, "free"
, "nonempty"
, "react"
, "react-dom"
, "tailrec"
, "web-dom"
, "web-html"
]
, repo = "https://github.com/purescript-concur/purescript-concur-react.git"
, version = "v0.4.2"
}
, console =
{ dependencies = [ "effect", "prelude" ]
, repo = "https://github.com/purescript/purescript-console.git"
, version = "v4.4.0"
}
, const =
{ dependencies =
[ "contravariant"
, "foldable-traversable"
, "invariant"
, "newtype"
, "prelude"
]
, repo = "https://github.com/purescript/purescript-const.git"
, version = "v4.1.0"
}
, contravariant =
{ dependencies = [ "either", "newtype", "prelude", "tuples" ]
, repo = "https://github.com/purescript/purescript-contravariant.git"
, version = "v4.0.1"
}
, control =
{ dependencies = [ "prelude", "newtype" ]
, repo = "https://github.com/purescript/purescript-control.git"
, version = "v4.2.0"
}
, coroutines =
{ dependencies = [ "freet", "parallel", "profunctor" ]
, repo = "https://github.com/purescript-contrib/purescript-coroutines.git"
, version = "v5.0.1"
}
, crypto =
{ dependencies = [ "node-buffer" ]
, repo = "https://github.com/oreshinya/purescript-crypto.git"
, version = "v2.0.1"
}
, css =
{ dependencies =
[ "colors"
, "console"
, "generics-rep"
, "nonempty"
, "profunctor"
, "strings"
, "these"
, "transformers"
]
, repo = "https://github.com/slamdata/purescript-css.git"
, version = "v4.0.0"
}
, cssom =
{ dependencies = [ "effect" ]
, repo = "https://github.com/danieljharvey/purescript-cssom.git"
, version = "v0.0.2"
}
, data-algebrae =
{ dependencies =
[ "arrays"
, "foreign-object"
, "generics-rep"
, "maybe"
, "ordered-collections"
, "prelude"
, "spec"
, "spec-quickcheck"
]
, repo = "https://github.com/i-am-tom/purescript-data-algebrae.git"
, version = "v4.0.0"
}
, data-default =
{ dependencies = [ "maybe", "record", "lists" ]
, repo = "https://github.com/thought2/purescript-data-default.git"
, version = "v0.3.2"
}
, datetime =
{ dependencies =
[ "bifunctors"
, "control"
, "either"
, "enums"
, "foldable-traversable"
, "functions"
, "gen"
, "integers"
, "lists"
, "math"
, "maybe"
, "newtype"
, "ordered-collections"
, "partial"
, "prelude"
, "tuples"
]
, repo = "https://github.com/purescript/purescript-datetime.git"
, version = "v4.1.1"
}
, debug =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/garyb/purescript-debug.git"
, version = "v4.0.0"
}
, decimals =
{ dependencies = [ "maybe" ]
, repo = "https://github.com/sharkdp/purescript-decimals.git"
, version = "v5.0.0"
}
, distributive =
{ dependencies = [ "identity", "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-distributive.git"
, version = "v4.0.0"
}
, dom-filereader =
{ dependencies = [ "aff", "arraybuffer-types", "web-file", "web-html" ]
, repo = "https://github.com/nwolverson/purescript-dom-filereader.git"
, version = "v5.0.0"
}
, dom-indexed =
{ dependencies =
[ "media-types", "prelude", "web-clipboard", "web-touchevents" ]
, repo = "https://github.com/slamdata/purescript-dom-indexed.git"
, version = "v7.0.0"
}
, dotenv =
{ dependencies =
[ "console"
, "node-fs-aff"
, "node-process"
, "parsing"
, "prelude"
, "psci-support"
, "run"
, "spec"
, "sunde"
]
, repo = "https://github.com/nsaunders/purescript-dotenv.git"
, version = "v1.1.0"
}
, drawing =
{ dependencies =
[ "canvas", "colors", "integers", "lists", "math", "prelude" ]
, repo = "https://github.com/paf31/purescript-drawing.git"
, version = "v4.0.0"
}
, effect =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/purescript/purescript-effect.git"
, version = "v2.0.1"
}
, either =
{ dependencies =
[ "bifunctors"
, "control"
, "foldable-traversable"
, "invariant"
, "maybe"
, "prelude"
]
, repo = "https://github.com/purescript/purescript-either.git"
, version = "v4.1.1"
}
, email-validate =
{ dependencies = [ "aff", "generics-rep", "string-parsers", "transformers" ]
, repo = "https://github.com/cdepillabout/purescript-email-validate.git"
, version = "v5.0.0"
}
, encoding =
{ dependencies =
[ "arraybuffer-types", "either", "exceptions", "functions", "prelude" ]
, repo = "https://github.com/menelaos/purescript-encoding.git"
, version = "v0.0.6"
}
, enums =
{ dependencies =
[ "control"
, "either"
, "gen"
, "maybe"
, "newtype"
, "nonempty"
, "partial"
, "prelude"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-enums.git"
, version = "v4.0.1"
}
, errors =
{ dependencies = [ "control", "effect", "either", "maybe", "transformers" ]
, repo = "https://github.com/passy/purescript-errors.git"
, version = "v4.1.0"
}
, event =
{ dependencies =
[ "console"
, "effect"
, "filterable"
, "js-timers"
, "now"
, "nullable"
, "prelude"
, "unsafe-reference"
]
, repo = "https://github.com/paf31/purescript-event.git"
, version = "v1.3.0"
}
, exceptions =
{ dependencies = [ "effect", "either", "maybe", "prelude" ]
, repo = "https://github.com/purescript/purescript-exceptions.git"
, version = "v4.0.0"
}
, exists =
{ dependencies = [ "unsafe-coerce" ]
, repo = "https://github.com/purescript/purescript-exists.git"
, version = "v4.0.0"
}
, exitcodes =
{ dependencies = [ "enums" ]
, repo = "https://github.com/Risto-Stevcev/purescript-exitcodes.git"
, version = "v4.0.0"
}
, expect-inferred =
{ dependencies = [ "prelude", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-expect-inferred.git"
, version = "v2.0.0"
}
, express =
{ dependencies =
[ "aff", "foreign", "foreign-generic", "node-http", "test-unit" ]
, repo = "https://github.com/nkly/purescript-express.git"
, version = "v0.8.0"
}
, filterable =
{ dependencies =
[ "arrays"
, "either"
, "foldable-traversable"
, "identity"
, "lists"
, "ordered-collections"
]
, repo = "https://github.com/LiamGoodacre/purescript-filterable.git"
, version = "v3.0.2"
}
, fixed-points =
{ dependencies = [ "exists", "newtype", "prelude", "transformers" ]
, repo = "https://github.com/slamdata/purescript-fixed-points.git"
, version = "v5.1.0"
}
, fixed-precision =
{ dependencies = [ "integers", "maybe", "bigints", "strings", "math" ]
, repo = "https://github.com/lumihq/purescript-fixed-precision.git"
, version = "v4.3.1"
}
, flare =
{ dependencies =
[ "canvas"
, "datetime"
, "drawing"
, "foldable-traversable"
, "nonempty"
, "prelude"
, "signal"
, "smolder"
, "tuples"
, "web-dom"
]
, repo = "https://github.com/sharkdp/purescript-flare.git"
, version = "v6.0.0"
}
, float32 =
{ dependencies = [ "generics-rep", "prelude" ]
, repo = "https://github.com/athanclark/purescript-float32.git"
, version = "v0.2.0"
}
, flow-id =
{ dependencies = [ "prelude", "simple-json" ]
, repo = "https://github.com/i-am-the-slime/purescript-flow-id.git"
, version = "v1.0.0"
}
, foldable-traversable =
{ dependencies =
[ "bifunctors", "control", "maybe", "newtype", "orders", "prelude" ]
, repo = "https://github.com/purescript/purescript-foldable-traversable.git"
, version = "v4.1.1"
}
, folds =
{ dependencies = [ "control", "ordered-collections", "profunctor" ]
, repo = "https://github.com/paf31/purescript-folds.git"
, version = "v5.2.0"
}
, foreign =
{ dependencies =
[ "either"
, "functions"
, "identity"
, "integers"
, "lists"
, "maybe"
, "prelude"
, "strings"
, "transformers"
]
, repo = "https://github.com/purescript/purescript-foreign.git"
, version = "v5.0.0"
}
, foreign-generic =
{ dependencies =
[ "effect"
, "exceptions"
, "foreign"
, "foreign-object"
, "generics-rep"
, "identity"
, "ordered-collections"
, "proxy"
, "record"
]
, repo = "https://github.com/paf31/purescript-foreign-generic.git"
, version = "v10.0.0"
}
, foreign-object =
{ dependencies =
[ "arrays"
, "foldable-traversable"
, "functions"
, "gen"
, "lists"
, "maybe"
, "prelude"
, "st"
, "tailrec"
, "tuples"
, "typelevel-prelude"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-foreign-object.git"
, version = "v2.0.3"
}
, fork =
{ dependencies = [ "aff" ]
, repo = "https://github.com/slamdata/purescript-fork.git"
, version = "v4.0.0"
}
, form-urlencoded =
{ dependencies =
[ "globals", "maybe", "newtype", "prelude", "strings", "tuples" ]
, repo =
"https://github.com/purescript-contrib/purescript-form-urlencoded.git"
, version = "v5.0.0"
}
, format =
{ dependencies =
[ "arrays"
, "effect"
, "integers"
, "math"
, "prelude"
, "strings"
, "unfoldable"
]
, repo = "https://github.com/sharkdp/purescript-format.git"
, version = "v4.0.0"
}
, format-nix =
{ dependencies = [ "generics-rep", "motsunabe", "prelude" ]
, repo = "https://github.com/justinwoo/format-nix.git"
, version = "v0.3.0"
}
, formatters =
{ dependencies =
[ "datetime"
, "fixed-points"
, "generics-rep"
, "lists"
, "parsing"
, "prelude"
, "transformers"
]
, repo = "https://github.com/slamdata/purescript-formatters.git"
, version = "v4.0.1"
}
, free =
{ dependencies =
[ "catenable-lists"
, "control"
, "distributive"
, "either"
, "exists"
, "foldable-traversable"
, "invariant"
, "lazy"
, "maybe"
, "prelude"
, "tailrec"
, "transformers"
, "tuples"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript/purescript-free.git"
, version = "v5.2.0"
}
, freeap =
{ dependencies = [ "const", "exists", "gen", "lists" ]
, repo = "https://github.com/ethul/purescript-freeap.git"
, version = "v5.0.1"
}
, freedom =
{ dependencies =
[ "console", "foreign-object", "safely", "simple-emitter", "web-html" ]
, repo = "https://github.com/purescript-freedom/purescript-freedom.git"
, version = "v2.2.0"
}
, freedom-now =
{ dependencies = [ "freedom", "js-timers" ]
, repo = "https://github.com/purescript-freedom/purescript-freedom-now.git"
, version = "v3.0.0"
}
, freedom-portal =
{ dependencies = [ "freedom" ]
, repo = "https://github.com/purescript-freedom/purescript-freedom-portal.git"
, version = "v2.0.0"
}
, freedom-router =
{ dependencies = [ "freedom", "profunctor" ]
, repo = "https://github.com/purescript-freedom/purescript-freedom-router.git"
, version = "v2.0.0"
}
, freedom-transition =
{ dependencies = [ "freedom", "js-timers" ]
, repo =
"https://github.com/purescript-freedom/purescript-freedom-transition.git"
, version = "v2.0.0"
}
, freedom-virtualized =
{ dependencies = [ "freedom" ]
, repo =
"https://github.com/purescript-freedom/purescript-freedom-virtualized.git"
, version = "v3.0.1"
}
, freedom-window-resize =
{ dependencies = [ "freedom" ]
, repo =
"https://github.com/purescript-freedom/purescript-freedom-window-resize.git"
, version = "v2.0.0"
}
, freet =
{ dependencies =
[ "bifunctors"
, "effect"
, "either"
, "exists"
, "prelude"
, "tailrec"
, "transformers"
, "aff"
]
, repo = "https://github.com/purescript-contrib/purescript-freet.git"
, version = "v5.0.0"
}
, functions =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/purescript/purescript-functions.git"
, version = "v4.0.0"
}
, functors =
{ dependencies =
[ "bifunctors"
, "const"
, "control"
, "either"
, "foldable-traversable"
, "maybe"
, "newtype"
, "prelude"
, "tuples"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript/purescript-functors.git"
, version = "v3.1.1"
}
, fuzzy =
{ dependencies =
[ "foldable-traversable"
, "foreign-object"
, "generics-rep"
, "newtype"
, "ordered-collections"
, "prelude"
, "rationals"
, "strings"
, "tuples"
]
, repo = "https://github.com/citizennet/purescript-fuzzy.git"
, version = "v0.3.0"
}
, gen =
{ dependencies =
[ "either"
, "foldable-traversable"
, "identity"
, "maybe"
, "newtype"
, "nonempty"
, "prelude"
, "tailrec"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-gen.git"
, version = "v2.1.1"
}
, generics-rep =
{ dependencies =
[ "enums", "foldable-traversable", "maybe", "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-generics-rep.git"
, version = "v6.1.1"
}
, globals =
{ dependencies = [ "functions", "maybe" ]
, repo = "https://github.com/purescript/purescript-globals.git"
, version = "v4.1.0"
}
, gomtang-basic =
{ dependencies = [ "console", "effect", "prelude", "record", "web-html" ]
, repo = "https://github.com/justinwoo/purescript-gomtang-basic.git"
, version = "v0.2.0"
}
, grain =
{ dependencies = [ "web-html" ]
, repo = "https://github.com/purescript-grain/purescript-grain.git"
, version = "v0.7.0"
}
, grain-router =
{ dependencies = [ "grain", "profunctor" ]
, repo = "https://github.com/purescript-grain/purescript-grain-router.git"
, version = "v0.7.0"
}
, grain-virtualized =
{ dependencies = [ "grain" ]
, repo =
"https://github.com/purescript-grain/purescript-grain-virtualized.git"
, version = "v0.7.0"
}
, group =
{ dependencies = [ "lists" ]
, repo = "https://github.com/morganthomas/purescript-group.git"
, version = "v4.1.1"
}
, halogen =
{ dependencies =
[ "aff"
, "avar"
, "console"
, "const"
, "coroutines"
, "dom-indexed"
, "foreign"
, "fork"
, "free"
, "freeap"
, "halogen-vdom"
, "media-types"
, "nullable"
, "ordered-collections"
, "parallel"
, "profunctor"
, "transformers"
, "unsafe-coerce"
, "unsafe-reference"
, "web-uievents"
]
, repo = "https://github.com/slamdata/purescript-halogen.git"
, version = "v5.0.1"
}
, halogen-bootstrap =
{ dependencies = [ "halogen" ]
, repo = "https://github.com/slamdata/purescript-halogen-bootstrap.git"
, version = "v8.0.0"
}
, halogen-bootstrap4 =
{ dependencies = [ "halogen" ]
, repo = "https://github.com/mschristiansen/purescript-halogen-bootstrap4.git"
, version = "v0.1.4"
}
, halogen-css =
{ dependencies = [ "css", "halogen" ]
, repo = "https://github.com/slamdata/purescript-halogen-css.git"
, version = "v8.0.0"
}
, halogen-formless =
{ dependencies =
[ "halogen"
, "variant"
, "heterogeneous"
, "generics-rep"
, "profunctor-lenses"
]
, repo = "https://github.com/thomashoneyman/purescript-halogen-formless.git"
, version = "v1.0.0-rc.2"
}
, halogen-hooks =
{ dependencies = [ "halogen", "indexed-monad" ]
, repo = "https://github.com/thomashoneyman/purescript-halogen-hooks.git"
, version = "v0.4.2"
}
, halogen-hooks-extra =
{ dependencies = [ "halogen-hooks" ]
, repo =
"https://github.com/jordanmartinez/purescript-halogen-hooks-extra.git"
, version = "v0.7.1"
}
, halogen-select =
{ dependencies = [ "halogen", "record" ]
, repo = "https://github.com/citizennet/purescript-halogen-select.git"
, version = "v5.0.0"
}
, halogen-storybook =
{ dependencies = [ "halogen", "prelude", "routing", "foreign-object" ]
, repo = "https://github.com/rnons/purescript-halogen-storybook.git"
, version = "v1.0.0-rc.1"
}
, halogen-svg-elems =
{ dependencies = [ "effect", "halogen", "prelude", "strings", "web-uievents" ]
, repo = "https://github.com/JordanMartinez/purescript-halogen-svg-elems.git"
, version = "v2.0.1"
}
, halogen-vdom =
{ dependencies =
[ "bifunctors"
, "effect"
, "foreign"
, "foreign-object"
, "maybe"
, "prelude"
, "refs"
, "tuples"
, "unsafe-coerce"
, "web-html"
]
, repo = "https://github.com/slamdata/purescript-halogen-vdom.git"
, version = "v6.1.3"
}
, heterogeneous =
{ dependencies =
[ "either", "functors", "prelude", "record", "tuples", "variant" ]
, repo = "https://github.com/natefaubion/purescript-heterogeneous.git"
, version = "v0.4.1"
}
, higher-order =
{ dependencies =
[ "catenable-lists"
, "const"
, "effect"
, "errors"
, "generics-rep"
, "lists"
, "ordered-collections"
, "orders"
, "profunctor"
]
, repo = "https://github.com/matthew-hilty/purescript-higher-order.git"
, version = "v0.2.0"
}
, html-parser-halogen =
{ dependencies = [ "generics-rep", "halogen", "prelude", "string-parsers" ]
, repo = "https://github.com/rnons/purescript-html-parser-halogen.git"
, version = "v1.0.0-rc.2"
}
, http-methods =
{ dependencies = [ "either", "prelude", "strings" ]
, repo = "https://github.com/purescript-contrib/purescript-http-methods.git"
, version = "v4.0.2"
}
, httpure =
{ dependencies =
[ "aff"
, "arrays"
, "bifunctors"
, "console"
, "control"
, "effect"
, "either"
, "exceptions"
, "foldable-traversable"
, "foreign"
, "lists"
, "maybe"
, "newtype"
, "node-buffer"
, "node-child-process"
, "node-fs"
, "node-fs-aff"
, "node-http"
, "node-streams"
, "nullable"
, "options"
, "ordered-collections"
, "prelude"
, "psci-support"
, "refs"
, "spec"
, "strings"
, "tuples"
, "type-equality"
, "unsafe-coerce"
]
, repo = "https://github.com/cprussin/purescript-httpure.git"
, version = "v0.10.0"
}
, httpure-contrib-biscotti =
{ dependencies =
[ "aff"
, "argonaut"
, "biscotti-cookie"
, "biscotti-session"
, "effect"
, "either"
, "generics-rep"
, "httpure"
, "maybe"
, "profunctor-lenses"
, "psci-support"
, "test-unit"
, "tuples"
, "type-equality"
]
, repo =
"https://github.com/drewolson/purescript-httpure-contrib-biscotti.git"
, version = "v0.1.2"
}
, hyper =
{ dependencies =
[ "aff"
, "avar"
, "argonaut"
, "arrays"
, "console"
, "control"
, "effect"
, "foldable-traversable"
, "generics-rep"
, "http-methods"
, "indexed-monad"
, "media-types"
, "node-fs-aff"
, "node-http"
, "ordered-collections"
, "proxy"
, "random"
, "smolder"
, "strings"
, "transformers"
, "record-extra"
, "typelevel-prelude"
]
, repo = "https://github.com/purescript-hyper/hyper.git"
, version = "v0.11.0"
}
, hypertrout =
{ dependencies =
[ "argonaut-generic", "console", "hyper", "prelude", "trout" ]
, repo = "https://github.com/purescript-hyper/purescript-hypertrout.git"
, version = "v0.11.1"
}
, identity =
{ dependencies =
[ "control", "foldable-traversable", "invariant", "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-identity.git"
, version = "v4.1.0"
}
, identy =
{ dependencies = [ "simple-json" ]
, repo = "https://github.com/oreshinya/purescript-identy.git"
, version = "v2.1.0"
}
, indexed-monad =
{ dependencies = [ "control", "newtype" ]
, repo = "https://github.com/garyb/purescript-indexed-monad.git"
, version = "v1.2.0"
}
, inflection =
{ dependencies = [ "functions" ]
, repo = "https://github.com/athanclark/purescript-inflection.git"
, version = "v1.0.1"
}
, int-53 =
{ dependencies = [ "integers", "math", "strings" ]
, repo = "https://github.com/rgrempel/purescript-int-53.git"
, version = "v4.0.0"
}
, integers =
{ dependencies = [ "globals", "math", "maybe", "prelude" ]
, repo = "https://github.com/purescript/purescript-integers.git"
, version = "v4.0.0"
}
, interpolate =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/jordanmartinez/purescript-interpolate.git"
, version = "v2.0.1"
}
, intmap =
{ dependencies = [ "arraybuffer-class", "parseint" ]
, repo = "https://github.com/openchronology/purescript-intmap.git"
, version = "v0.0.0"
}
, invariant =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/purescript/purescript-invariant.git"
, version = "v4.1.0"
}
, jajanmen =
{ dependencies = [ "node-sqlite3", "prelude", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-jajanmen.git"
, version = "v1.0.0"
}
, jquery =
{ dependencies = [ "console", "effect", "foreign", "web-dom" ]
, repo = "https://github.com/purescript-contrib/purescript-jquery.git"
, version = "v5.0.0"
}
, js-date =
{ dependencies = [ "datetime", "exceptions", "foreign", "integers", "now" ]
, repo = "https://github.com/purescript-contrib/purescript-js-date.git"
, version = "v6.0.0"
}
, js-timers =
{ dependencies = [ "effect" ]
, repo = "https://github.com/purescript-contrib/purescript-js-timers.git"
, version = "v4.0.1"
}
, json-pointer =
{ dependencies =
[ "console"
, "effect"
, "foreign"
, "generics-rep"
, "prelude"
, "psci-support"
, "spec-quickcheck"
, "strings"
]
, repo = "https://github.com/reactormonk/purescript-json-pointer.git"
, version = "v1.1.0"
}
, json-schema =
{ dependencies = [ "generics-rep", "prelude", "simple-json" ]
, repo = "https://github.com/felixmulder/purescript-json-schema.git"
, version = "v0.0.1"
}
, jwt =
{ dependencies =
[ "argonaut-core"
, "arrays"
, "b64"
, "either"
, "errors"
, "exceptions"
, "prelude"
, "profunctor-lenses"
, "strings"
]
, repo = "https://github.com/menelaos/purescript-jwt.git"
, version = "v0.0.7"
}
, kancho =
{ dependencies = [ "foreign", "newtype", "strings", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-kancho.git"
, version = "v2.0.0"
}
, kishimen =
{ dependencies = [ "generics-rep", "prelude", "typelevel-prelude", "variant" ]
, repo = "https://github.com/justinwoo/purescript-kishimen.git"
, version = "v1.0.1"
}
, lazy =
{ dependencies = [ "control", "foldable-traversable", "invariant", "prelude" ]
, repo = "https://github.com/purescript/purescript-lazy.git"
, version = "v4.0.0"
}
, lcg =
{ dependencies =
[ "effect", "integers", "math", "maybe", "partial", "prelude", "random" ]
, repo = "https://github.com/purescript/purescript-lcg.git"
, version = "v2.0.0"
}
, leibniz =
{ dependencies = [ "prelude", "unsafe-coerce" ]
, repo = "https://github.com/paf31/purescript-leibniz.git"
, version = "v5.0.0"
}
, lenient-html-parser =
{ dependencies = [ "console", "generics-rep", "prelude", "string-parsers" ]
, repo = "https://github.com/justinwoo/purescript-lenient-html-parser.git"
, version = "v4.0.0"
}
, lists =
{ dependencies =
[ "bifunctors"
, "control"
, "foldable-traversable"
, "lazy"
, "maybe"
, "newtype"
, "nonempty"
, "partial"
, "prelude"
, "tailrec"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-lists.git"
, version = "v5.4.1"
}
, literals =
{ dependencies =
[ "assert"
, "effect"
, "console"
, "integers"
, "numbers"
, "partial"
, "psci-support"
, "unsafe-coerce"
, "typelevel-prelude"
]
, repo = "https://github.com/jvliwanag/purescript-literals.git"
, version = "v0.1.1"
}
, logging =
{ dependencies =
[ "prelude"
, "contravariant"
, "console"
, "effect"
, "transformers"
, "tuples"
, "either"
]
, repo = "https://github.com/rightfold/purescript-logging.git"
, version = "v3.0.0"
}
, logging-journald =
{ dependencies = [ "generics-rep", "logging", "systemd-journald" ]
, repo = "https://github.com/paluh/purescript-logging-journald.git"
, version = "v0.3.2"
}
, machines =
{ dependencies =
[ "arrays"
, "control"
, "effect"
, "lists"
, "maybe"
, "prelude"
, "profunctor"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript-contrib/purescript-machines.git"
, version = "v5.1.0"
}
, makkori =
{ dependencies = [ "functions", "node-http", "prelude", "record" ]
, repo = "https://github.com/justinwoo/purescript-makkori.git"
, version = "v1.0.0"
}
, math =
{ dependencies = [] : List Text
, repo = "https://github.com/purescript/purescript-math.git"
, version = "v2.1.1"
}
, matrices =
{ dependencies = [ "arrays", "strings" ]
, repo = "https://github.com/kritzcreek/purescript-matrices.git"
, version = "v5.0.1"
}
, maybe =
{ dependencies = [ "control", "invariant", "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-maybe.git"
, version = "v4.0.1"
}
, media-types =
{ dependencies = [ "newtype", "prelude" ]
, repo = "https://github.com/purescript-contrib/purescript-media-types.git"
, version = "v4.0.1"
}
, memoize =
{ dependencies =
[ "either"
, "generics-rep"
, "integers"
, "lazy"
, "lists"
, "maybe"
, "strings"
, "tuples"
]
, repo = "https://github.com/paf31/purescript-memoize.git"
, version = "v5.0.0"
}
, metadata =
{ dependencies = [] : List Text
, repo = "https://github.com/spacchetti/purescript-metadata.git"
, version = "v0.13.8"
}
, milkis =
{ dependencies =
[ "aff-promise"
, "arraybuffer-types"
, "foreign-object"
, "prelude"
, "typelevel-prelude"
]
, repo = "https://github.com/justinwoo/purescript-milkis.git"
, version = "v7.4.0"
}
, minibench =
{ dependencies =
[ "console"
, "effect"
, "globals"
, "integers"
, "math"
, "partial"
, "prelude"
, "refs"
]
, repo = "https://github.com/purescript/purescript-minibench.git"
, version = "v2.0.0"
}
, mmorph =
{ dependencies = [ "free", "functors", "transformers" ]
, repo = "https://github.com/thimoteus/purescript-mmorph.git"
, version = "v5.1.0"
}
, mol-draw =
{ dependencies =
[ "arrays"
, "console"
, "effect"
, "either"
, "integers"
, "math"
, "numbers"
, "ordered-collections"
, "strings"
, "stringutils"
, "validated-molecule"
]
, repo = "https://github.com/lukasturcani/mol-draw.git"
, version = "v1.0.16"
}
, monad-control =
{ dependencies = [ "aff", "freet", "identity", "lists" ]
, repo = "https://github.com/athanclark/purescript-monad-control.git"
, version = "v5.0.0"
}
, monad-logger =
{ dependencies =
[ "aff"
, "ansi"
, "argonaut"
, "arrays"
, "console"
, "control"
, "effect"
, "foldable-traversable"
, "foreign-object"
, "integers"
, "js-date"
, "maybe"
, "newtype"
, "ordered-collections"
, "prelude"
, "strings"
, "transformers"
, "tuples"
]
, repo = "https://github.com/cprussin/purescript-monad-logger.git"
, version = "v1.3.1"
}
, monad-loops =
{ dependencies = [ "maybe", "tailrec", "prelude", "tuples", "lists" ]
, repo = "https://github.com/mlang/purescript-monad-loops.git"
, version = "v0.5.0"
}
, monad-unlift =
{ dependencies = [ "monad-control" ]
, repo = "https://github.com/athanclark/purescript-monad-unlift.git"
, version = "v1.0.1"
}
, money =
{ dependencies =
[ "foldable-traversable"
, "globals"
, "integers"
, "lists"
, "math"
, "prelude"
, "ring-modules"
, "newtype"
, "rationals"
]
, repo = "https://github.com/i-am-tom/purescript-money.git"
, version = "v8.0.0"
}
, motsunabe =
{ dependencies = [ "lists", "strings" ]
, repo = "https://github.com/justinwoo/purescript-motsunabe.git"
, version = "v2.0.0"
}
, mysql =
{ dependencies = [ "aff", "js-date", "simple-json" ]
, repo = "https://github.com/oreshinya/purescript-mysql.git"
, version = "v4.1.1"
}
, naporitan =
{ dependencies = [ "record", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-naporitan.git"
, version = "v1.0.0"
}
, naturals =
{ dependencies = [ "maybe", "prelude", "enums" ]
, repo = "https://github.com/LiamGoodacre/purescript-naturals.git"
, version = "v3.0.0"
}
, newtype =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/purescript/purescript-newtype.git"
, version = "v3.0.0"
}
, node-buffer =
{ dependencies =
[ "arraybuffer-types", "effect", "maybe", "st", "unsafe-coerce" ]
, repo = "https://github.com/purescript-node/purescript-node-buffer.git"
, version = "v6.0.0"
}
, node-child-process =
{ dependencies =
[ "exceptions"
, "foreign"
, "foreign-object"
, "functions"
, "node-fs"
, "node-streams"
, "nullable"
, "posix-types"
, "unsafe-coerce"
]
, repo =
"https://github.com/purescript-node/purescript-node-child-process.git"
, version = "v6.0.0"
}
, node-electron =
{ dependencies =
[ "effect"
, "foreign"
, "halogen"
, "maybe"
, "options"
, "prelude"
, "transformers"
, "unsafe-coerce"
, "web-dom"
, "web-events"
, "web-html"
]
, repo = "https://github.com/cprussin/purescript-node-electron.git"
, version = "v0.0.2"
}
, node-fs =
{ dependencies =
[ "datetime"
, "effect"
, "either"
, "enums"
, "exceptions"
, "functions"
, "globals"
, "integers"
, "js-date"
, "maybe"
, "node-buffer"
, "node-path"
, "node-streams"
, "nullable"
, "partial"
, "prelude"
, "strings"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript-node/purescript-node-fs.git"
, version = "v5.0.1"
}
, node-fs-aff =
{ dependencies = [ "aff", "either", "node-fs", "node-path" ]
, repo = "https://github.com/purescript-node/purescript-node-fs-aff.git"
, version = "v6.0.0"
}
, node-he =
{ dependencies = [] : List Text
, repo = "https://github.com/justinwoo/purescript-node-he.git"
, version = "v0.2.0"
}
, node-http =
{ dependencies =
[ "arraybuffer-types"
, "contravariant"
, "effect"
, "foreign"
, "foreign-object"
, "maybe"
, "node-buffer"
, "node-streams"
, "node-url"
, "nullable"
, "options"
, "prelude"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript-node/purescript-node-http.git"
, version = "v5.0.2"
}
, node-net =
{ dependencies =
[ "effect"
, "either"
, "exceptions"
, "foreign"
, "maybe"
, "node-buffer"
, "node-fs"
, "nullable"
, "options"
, "prelude"
, "transformers"
]
, repo = "https://github.com/purescript-node/purescript-node-net.git"
, version = "v1.0.0"
}
, node-path =
{ dependencies = [ "effect" ]
, repo = "https://github.com/purescript-node/purescript-node-path.git"
, version = "v3.0.0"
}
, node-postgres =
{ dependencies =
[ "aff"
, "arrays"
, "datetime"
, "either"
, "foldable-traversable"
, "foreign"
, "integers"
, "nullable"
, "prelude"
, "transformers"
, "unsafe-coerce"
]
, repo = "https://github.com/epost/purescript-node-postgres.git"
, version = "v5.0.0"
}
, node-process =
{ dependencies =
[ "effect"
, "foreign-object"
, "maybe"
, "node-streams"
, "posix-types"
, "prelude"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript-node/purescript-node-process.git"
, version = "v7.0.0"
}
, node-readline =
{ dependencies =
[ "effect"
, "foreign"
, "node-process"
, "node-streams"
, "options"
, "prelude"
]
, repo = "https://github.com/purescript-node/purescript-node-readline.git"
, version = "v4.0.1"
}
, node-sqlite3 =
{ dependencies = [ "aff", "foreign" ]
, repo = "https://github.com/justinwoo/purescript-node-sqlite3.git"
, version = "v6.0.0"
}
, node-streams =
{ dependencies =
[ "effect", "either", "exceptions", "node-buffer", "prelude" ]
, repo = "https://github.com/purescript-node/purescript-node-streams.git"
, version = "v4.0.1"
}
, node-telegram-bot-api =
{ dependencies = [ "aff", "foreign", "simple-json", "strings" ]
, repo = "https://github.com/justinwoo/purescript-node-telegram-bot-api.git"
, version = "v4.0.0"
}
, node-url =
{ dependencies = [ "nullable" ]
, repo = "https://github.com/purescript-node/purescript-node-url.git"
, version = "v4.0.0"
}
, nodemailer =
{ dependencies = [ "aff", "node-streams", "simple-json" ]
, repo = "https://github.com/oreshinya/purescript-nodemailer.git"
, version = "v2.0.2"
}
, nodetrout =
{ dependencies =
[ "effect", "form-urlencoded", "http-methods", "node-http", "trout" ]
, repo = "https://github.com/nsaunders/purescript-nodetrout.git"
, version = "v0.0.1"
}
, nonempty =
{ dependencies =
[ "control"
, "foldable-traversable"
, "maybe"
, "prelude"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-nonempty.git"
, version = "v5.0.0"
}
, now =
{ dependencies = [ "datetime", "effect" ]
, repo = "https://github.com/purescript-contrib/purescript-now.git"
, version = "v4.0.0"
}
, nullable =
{ dependencies = [ "functions", "maybe" ]
, repo = "https://github.com/purescript-contrib/purescript-nullable.git"
, version = "v4.1.1"
}
, numbers =
{ dependencies = [ "globals", "math", "maybe" ]
, repo = "https://github.com/sharkdp/purescript-numbers.git"
, version = "v7.0.0"
}
, options =
{ dependencies =
[ "contravariant", "foreign", "foreign-object", "maybe", "tuples" ]
, repo = "https://github.com/purescript-contrib/purescript-options.git"
, version = "v5.0.0"
}
, optlicative =
{ dependencies =
[ "console", "foreign", "node-process", "record", "validation" ]
, repo = "https://github.com/thimoteus/purescript-optlicative.git"
, version = "v6.0.1"
}
, optparse =
{ dependencies =
[ "arrays"
, "console"
, "effect"
, "exists"
, "exitcodes"
, "free"
, "memoize"
, "node-process"
, "ordered-collections"
, "prelude"
, "strings"
, "transformers"
]
, repo = "https://github.com/f-o-a-m/purescript-optparse.git"
, version = "v3.0.1"
}
, ordered-collections =
{ dependencies =
[ "arrays"
, "foldable-traversable"
, "gen"
, "lists"
, "maybe"
, "partial"
, "prelude"
, "st"
, "tailrec"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript/purescript-ordered-collections.git"
, version = "v1.6.1"
}
, ordered-set =
{ dependencies =
[ "argonaut-codecs", "arrays", "partial", "prelude", "unfoldable" ]
, repo = "https://github.com/flip111/purescript-ordered-set.git"
, version = "v0.4.0"
}
, orders =
{ dependencies = [ "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-orders.git"
, version = "v4.0.0"
}
, pairing =
{ dependencies = [ "free", "functors", "transformers" ]
, repo = "https://github.com/paf31/purescript-pairing.git"
, version = "v5.1.0"
}
, pairs =
{ dependencies =
[ "console", "distributive", "foldable-traversable", "quickcheck" ]
, repo = "https://github.com/sharkdp/purescript-pairs.git"
, version = "v7.0.0"
}
, parallel =
{ dependencies =
[ "control"
, "effect"
, "either"
, "foldable-traversable"
, "functors"
, "maybe"
, "newtype"
, "prelude"
, "refs"
, "transformers"
]
, repo = "https://github.com/purescript/purescript-parallel.git"
, version = "v4.0.0"
}
, parseint =
{ dependencies = [ "functions", "globals", "integers" ]
, repo = "https://github.com/athanclark/purescript-parseint.git"
, version = "v1.1.1"
}
, parsing =
{ dependencies =
[ "arrays"
, "either"
, "foldable-traversable"
, "identity"
, "integers"
, "lists"
, "maybe"
, "strings"
, "transformers"
, "unicode"
]
, repo = "https://github.com/purescript-contrib/purescript-parsing.git"
, version = "v5.0.3"
}
, parsing-dataview =
{ dependencies = [ "parsing", "arraybuffer-types", "arraybuffer" ]
, repo = "https://github.com/jamesdbrock/purescript-parsing-dataview.git"
, version = "v1.1.1"
}
, partial =
{ dependencies = [] : List Text
, repo = "https://github.com/purescript/purescript-partial.git"
, version = "v2.0.1"
}
, pathy =
{ dependencies =
[ "console"
, "exceptions"
, "lists"
, "partial"
, "profunctor"
, "quickcheck"
, "strings"
, "transformers"
, "unsafe-coerce"
, "typelevel-prelude"
]
, repo = "https://github.com/slamdata/purescript-pathy.git"
, version = "v7.0.1"
}
, phoenix =
{ dependencies = [ "options" ]
, repo = "https://github.com/brandonhamilton/purescript-phoenix.git"
, version = "v4.0.0"
}
, pipes =
{ dependencies =
[ "aff", "lists", "mmorph", "prelude", "tailrec", "transformers", "tuples" ]
, repo = "https://github.com/felixSchl/purescript-pipes.git"
, version = "v6.0.0"
}
, pointed-list =
{ dependencies = [ "lists", "prelude" ]
, repo = "https://github.com/paluh/purescript-pointed-list.git"
, version = "v0.4.0"
}
, polyform =
{ dependencies =
[ "foreign"
, "foreign-object"
, "generics-rep"
, "invariant"
, "newtype"
, "ordered-collections"
, "profunctor"
, "quickcheck-laws"
, "run"
, "transformers"
, "validation"
, "variant"
]
, repo = "https://github.com/paluh/purescript-polyform.git"
, version = "v0.8.2"
}
, posix-types =
{ dependencies = [ "maybe", "prelude" ]
, repo = "https://github.com/purescript-node/purescript-posix-types.git"
, version = "v4.0.0"
}
, precise-datetime =
{ dependencies =
[ "arrays"
, "console"
, "datetime"
, "either"
, "enums"
, "foldable-traversable"
, "formatters"
, "integers"
, "js-date"
, "lists"
, "maybe"
, "newtype"
, "prelude"
, "strings"
, "tuples"
, "unicode"
, "numbers"
, "decimals"
]
, repo = "https://github.com/awakesecurity/purescript-precise-datetime.git"
, version = "v5.1.1"
}
, prelude =
{ dependencies = [] : List Text
, repo = "https://github.com/purescript/purescript-prelude.git"
, version = "v4.1.1"
}
, prettier =
{ dependencies = [ "maybe", "prelude" ]
, repo = "https://github.com/gcanti/purescript-prettier.git"
, version = "v0.3.0"
}
, profunctor =
{ dependencies =
[ "contravariant"
, "control"
, "distributive"
, "either"
, "exists"
, "invariant"
, "newtype"
, "prelude"
, "tuples"
]
, repo = "https://github.com/purescript/purescript-profunctor.git"
, version = "v4.1.0"
}
, profunctor-lenses =
{ dependencies =
[ "arrays"
, "bifunctors"
, "const"
, "control"
, "distributive"
, "either"
, "foldable-traversable"
, "foreign-object"
, "functors"
, "identity"
, "lists"
, "maybe"
, "newtype"
, "ordered-collections"
, "partial"
, "prelude"
, "profunctor"
, "record"
, "transformers"
, "tuples"
]
, repo =
"https://github.com/purescript-contrib/purescript-profunctor-lenses.git"
, version = "v6.3.0"
}
, promises =
{ dependencies =
[ "console"
, "datetime"
, "exceptions"
, "functions"
, "prelude"
, "transformers"
]
, repo = "https://github.com/thimoteus/purescript-promises.git"
, version = "v3.1.1"
}
, proxy =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/purescript/purescript-proxy.git"
, version = "v3.0.0"
}
, proxying =
{ dependencies = [ "effect", "generics-rep", "prelude", "typelevel-prelude" ]
, repo = "https://github.com/matthew-hilty/purescript-proxying.git"
, version = "v1.1.0"
}
, psa-utils =
{ dependencies =
[ "ansi"
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "console"
, "control"
, "effect"
, "either"
, "foldable-traversable"
, "maybe"
, "node-path"
, "ordered-collections"
, "prelude"
, "strings"
, "tuples"
, "unsafe-coerce"
]
, repo = "https://github.com/natefaubion/purescript-psa-utils.git"
, version = "v7.0.0"
}
, psc-ide =
{ dependencies =
[ "aff"
, "argonaut"
, "arrays"
, "console"
, "maybe"
, "node-child-process"
, "node-fs"
, "parallel"
, "random"
]
, repo = "https://github.com/kRITZCREEK/purescript-psc-ide.git"
, version = "v16.0.0"
}
, psci-support =
{ dependencies = [ "console", "effect", "prelude" ]
, repo = "https://github.com/purescript/purescript-psci-support.git"
, version = "v4.0.0"
}
, quantities =
{ dependencies =
[ "lists", "foldable-traversable", "numbers", "pairs", "decimals" ]
, repo = "https://github.com/sharkdp/purescript-quantities.git"
, version = "v10.0.0"
}
, querydsl =
{ dependencies =
[ "prelude"
, "effect"
, "arrays"
, "lists"
, "record"
, "strings"
, "tuples"
, "typelevel-prelude"
, "either"
, "transformers"
, "node-sqlite3"
, "datetime"
, "formatters"
, "node-buffer"
, "nullable"
]
, repo = "https://github.com/Dretch/purescript-querydsl.git"
, version = "v0.10.1"
}
, queue =
{ dependencies = [ "refs", "aff", "foreign-object", "avar" ]
, repo = "https://github.com/athanclark/purescript-queue.git"
, version = "v8.0.2"
}
, quickcheck =
{ dependencies =
[ "arrays"
, "console"
, "control"
, "effect"
, "either"
, "enums"
, "exceptions"
, "foldable-traversable"
, "gen"
, "generics-rep"
, "identity"
, "integers"
, "lazy"
, "lcg"
, "lists"
, "math"
, "maybe"
, "newtype"
, "nonempty"
, "partial"
, "prelude"
, "record"
, "st"
, "strings"
, "tailrec"
, "transformers"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-quickcheck.git"
, version = "v6.1.0"
}
, quickcheck-combinators =
{ dependencies = [ "quickcheck", "typelevel" ]
, repo = "https://github.com/athanclark/purescript-quickcheck-combinators.git"
, version = "v0.1.3"
}
, quickcheck-laws =
{ dependencies = [ "enums", "proxy", "quickcheck" ]
, repo = "https://github.com/garyb/purescript-quickcheck-laws.git"
, version = "v5.1.0"
}
, quickcheck-utf8 =
{ dependencies = [ "quickcheck" ]
, repo = "https://github.com/openchronology/purescript-quickcheck-utf8.git"
, version = "v0.0.0"
}
, quotient =
{ dependencies = [ "prelude", "proxy", "quickcheck" ]
, repo = "https://github.com/rightfold/purescript-quotient.git"
, version = "v3.0.0"
}
, radox =
{ dependencies = [ "prelude", "effect", "variant", "refs", "aff" ]
, repo = "https://github.com/danieljharvey/purescript-radox.git"
, version = "v1.0.0"
}
, random =
{ dependencies = [ "effect", "integers", "math" ]
, repo = "https://github.com/purescript/purescript-random.git"
, version = "v4.0.0"
}
, rationals =
{ dependencies = [ "integers", "prelude" ]
, repo = "https://github.com/anttih/purescript-rationals.git"
, version = "v5.0.0"
}
, rave =
{ dependencies =
[ "aff"
, "checked-exceptions"
, "console"
, "effect"
, "exceptions"
, "prelude"
, "record"
, "variant"
]
, repo = "https://github.com/reactormonk/purescript-rave.git"
, version = "v0.1.1"
}
, react =
{ dependencies =
[ "effect"
, "exceptions"
, "maybe"
, "nullable"
, "prelude"
, "typelevel-prelude"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript-contrib/purescript-react.git"
, version = "v8.0.0"
}
, react-basic =
{ dependencies = [ "prelude", "effect", "record" ]
, repo = "https://github.com/lumihq/purescript-react-basic.git"
, version = "v15.0.0"
}
, react-basic-classic =
{ dependencies =
[ "prelude"
, "aff"
, "effect"
, "functions"
, "maybe"
, "nullable"
, "react-basic"
]
, repo = "https://github.com/lumihq/purescript-react-basic-classic.git"
, version = "v1.0.1"
}
, react-basic-compat =
{ dependencies = [ "effect", "react-basic-classic" ]
, repo = "https://github.com/lumihq/purescript-react-basic-compat.git"
, version = "v1.0.1"
}
, react-basic-dnd =
{ dependencies =
[ "prelude", "react-basic-hooks", "nullable", "promises", "web-dom" ]
, repo = "https://github.com/lumihq/purescript-react-dnd-basic.git"
, version = "v7.0.0"
}
, react-basic-dom =
{ dependencies =
[ "prelude"
, "effect"
, "foreign-object"
, "react-basic"
, "unsafe-coerce"
, "web-dom"
, "web-events"
, "web-file"
, "web-html"
]
, repo = "https://github.com/lumihq/purescript-react-basic-dom.git"
, version = "v2.0.0"
}
, react-basic-emotion =
{ dependencies =
[ "prelude"
, "colors"
, "foreign"
, "numbers"
, "react-basic"
, "typelevel-prelude"
, "unsafe-reference"
, "web-html"
]
, repo = "https://github.com/lumihq/purescript-react-basic-emotion.git"
, version = "v4.2.2"
}
, react-basic-hooks =
{ dependencies =
[ "prelude"
, "aff-promise"
, "aff"
, "console"
, "datetime"
, "effect"
, "either"
, "indexed-monad"
, "maybe"
, "newtype"
, "numbers"
, "react-basic"
, "type-equality"
, "unsafe-coerce"
, "unsafe-reference"
, "web-html"
]
, repo = "https://github.com/spicydonuts/purescript-react-basic-hooks.git"
, version = "v6.0.0"
}
, react-basic-native =
{ dependencies =
[ "effect"
, "foreign-object"
, "js-date"
, "react-basic"
, "react-basic-dom"
, "undefinable"
]
, repo = "https://github.com/dwhitney/purescript-react-basic-native.git"
, version = "v0.1.3"
}
, react-dom =
{ dependencies = [ "effect", "react", "web-dom" ]
, repo = "https://github.com/purescript-contrib/purescript-react-dom.git"
, version = "v6.1.0"
}
, react-queue =
{ dependencies = [ "exceptions", "queue", "react", "zeta" ]
, repo = "https://github.com/athanclark/purescript-react-queue.git"
, version = "v1.3.2"
}
, react-radox =
{ dependencies = [ "prelude", "effect", "radox", "react" ]
, repo = "https://github.com/danieljharvey/purescript-react-radox.git"
, version = "v0.0.5"
}
, react-stylesheet =
{ dependencies = [ "effect", "react", "cssom", "stylesheet" ]
, repo = "https://github.com/danieljharvey/purescript-react-stylesheet.git"
, version = "v0.0.2"
}
, read =
{ dependencies = [ "maybe", "prelude", "strings" ]
, repo = "https://github.com/truqu/purescript-read.git"
, version = "v1.0.1"
}
, record =
{ dependencies = [ "functions", "prelude", "st", "unsafe-coerce" ]
, repo = "https://github.com/purescript/purescript-record.git"
, version = "v2.0.2"
}
, record-extra =
{ dependencies =
[ "arrays", "functions", "lists", "record", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-record-extra.git"
, version = "v3.0.1"
}
, record-format =
{ dependencies = [ "record", "strings", "typelevel-prelude" ]
, repo = "https://github.com/kcsongor/purescript-record-format.git"
, version = "v2.0.0"
}
, redis-client =
{ dependencies =
[ "aff"
, "arrays"
, "bytestrings"
, "console"
, "effect"
, "either"
, "int-53"
, "maybe"
, "nullable"
, "prelude"
, "psci-support"
, "test-unit"
, "transformers"
]
, repo = "https://github.com/paluh/purescript-redis-client.git"
, version = "v1.0.1"
}
, redis-hotqueue =
{ dependencies =
[ "console"
, "debug"
, "effect"
, "prelude"
, "psci-support"
, "redis-client"
, "simple-json"
, "sunde"
]
, repo = "https://github.com/paluh/purescript-redis-hotqueue.git"
, version = "v0.2.1"
}
, redux-devtools =
{ dependencies = [ "effect", "foreign", "nullable", "prelude" ]
, repo = "https://github.com/justinwoo/purescript-redux-devtools.git"
, version = "v0.1.0"
}
, refined =
{ dependencies =
[ "argonaut"
, "effect"
, "generics-rep"
, "prelude"
, "quickcheck"
, "typelevel"
]
, repo = "https://github.com/danieljharvey/purescript-refined.git"
, version = "v1.0.0"
}
, refs =
{ dependencies = [ "effect", "prelude" ]
, repo = "https://github.com/purescript/purescript-refs.git"
, version = "v4.1.0"
}
, remotedata =
{ dependencies =
[ "bifunctors", "either", "generics-rep", "profunctor-lenses" ]
, repo = "https://github.com/krisajenkins/purescript-remotedata.git"
, version = "v4.2.0"
}
, result =
{ dependencies = [ "either", "foldable-traversable", "prelude" ]
, repo = "https://github.com/ad-si/purescript-result.git"
, version = "v1.0.3"
}
, ring-modules =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/f-o-a-m/purescript-ring-modules.git"
, version = "v5.0.1"
}
, routing =
{ dependencies =
[ "aff"
, "console"
, "control"
, "effect"
, "either"
, "foldable-traversable"
, "globals"
, "integers"
, "lists"
, "maybe"
, "prelude"
, "semirings"
, "tuples"
, "validation"
, "web-html"
]
, repo = "https://github.com/slamdata/purescript-routing.git"
, version = "v9.0.1"
}
, routing-duplex =
{ dependencies =
[ "arrays"
, "control"
, "either"
, "generics-rep"
, "globals"
, "lazy"
, "prelude"
, "profunctor"
, "record"
, "strings"
, "typelevel-prelude"
]
, repo = "https://github.com/natefaubion/purescript-routing-duplex.git"
, version = "v0.4.1"
}
, row-extra =
{ dependencies = [] : List Text
, repo = "https://github.com/athanclark/purescript-row-extra.git"
, version = "v0.0.1"
}
, run =
{ dependencies =
[ "aff"
, "effect"
, "either"
, "free"
, "maybe"
, "newtype"
, "prelude"
, "profunctor"
, "tailrec"
, "tuples"
, "type-equality"
, "unsafe-coerce"
, "variant"
]
, repo = "https://github.com/natefaubion/purescript-run.git"
, version = "v3.0.1"
}
, run-halogen =
{ dependencies = [ "effect", "console", "psci-support", "halogen", "run" ]
, repo = "https://github.com/sigilion/purescript-run-halogen.git"
, version = "v0.1.0"
}
, run-profunctor-lenses =
{ dependencies =
[ "effect", "console", "psci-support", "run", "profunctor-lenses" ]
, repo = "https://github.com/sigilion/purescript-run-profunctor-lenses.git"
, version = "v0.1.0"
}
, run-streaming =
{ dependencies = [ "prelude", "run" ]
, repo = "https://github.com/natefaubion/purescript-run-streaming.git"
, version = "v2.0.0"
}
, safely =
{ dependencies = [ "freet", "lists" ]
, repo = "https://github.com/paf31/purescript-safely.git"
, version = "v4.0.1"
}
, scrypt =
{ dependencies = [ "aff", "arraybuffer-types" ]
, repo = "https://github.com/athanclark/purescript-scrypt.git"
, version = "v1.0.1"
}
, search-trie =
{ dependencies =
[ "prelude"
, "arrays"
, "ordered-collections"
, "lists"
, "foldable-traversable"
, "bifunctors"
]
, repo = "https://github.com/klntsky/purescript-search-trie.git"
, version = "v1.0.0"
}
, selection-foldable =
{ dependencies = [ "filterable", "foldable-traversable", "maybe", "prelude" ]
, repo = "https://github.com/jamieyung/purescript-selection-foldable.git"
, version = "v0.2.0"
}
, selective =
{ dependencies =
[ "generics-rep"
, "validation"
, "psci-support"
, "effect"
, "either"
, "prelude"
]
, repo = "https://github.com/anttih/purescript-selective.git"
, version = "v0.1.1"
}
, semirings =
{ dependencies = [ "foldable-traversable", "lists", "newtype", "prelude" ]
, repo = "https://github.com/purescript/purescript-semirings.git"
, version = "v5.0.0"
}
, server-sent-events =
{ dependencies =
[ "effect", "functions", "generics-rep", "maybe", "prelude", "web-events" ]
, repo = "https://github.com/MichaelXavier/purescript-server-sent-events.git"
, version = "v0.2.0"
}
, setimmediate =
{ dependencies = [ "effect", "functions" ]
, repo = "https://github.com/athanclark/purescript-setimmediate.git"
, version = "v1.0.2"
}
, shoronpo =
{ dependencies = [ "prelude", "record-format" ]
, repo = "https://github.com/justinwoo/purescript-shoronpo.git"
, version = "v0.3.0"
}
, signal =
{ dependencies =
[ "aff", "foldable-traversable", "js-timers", "maybe", "prelude" ]
, repo = "https://github.com/bodil/purescript-signal.git"
, version = "v10.1.0"
}
, sijidou =
{ dependencies = [ "prelude", "record", "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-sijidou.git"
, version = "v1.0.0"
}
, simple-ajax =
{ dependencies = [ "prelude", "simple-json", "affjax" ]
, repo = "https://github.com/dariooddenino/purescript-simple-ajax.git"
, version = "v2.0.0"
}
, simple-emitter =
{ dependencies = [ "ordered-collections", "refs" ]
, repo = "https://github.com/oreshinya/purescript-simple-emitter.git"
, version = "v1.0.0"
}
, simple-i18n =
{ dependencies = [ "record-extra", "foreign-object" ]
, repo = "https://github.com/oreshinya/purescript-simple-i18n.git"
, version = "v0.1.2"
}
, simple-json =
{ dependencies =
[ "arrays"
, "exceptions"
, "foreign"
, "foreign-object"
, "globals"
, "nullable"
, "prelude"
, "record"
, "typelevel-prelude"
, "variant"
]
, repo = "https://github.com/justinwoo/purescript-simple-json.git"
, version = "v7.0.0"
}
, simple-json-generics =
{ dependencies = [ "generics-rep", "simple-json" ]
, repo = "https://github.com/justinwoo/purescript-simple-json-generics.git"
, version = "v0.1.0"
}
, simple-json-utils =
{ dependencies = [ "motsunabe", "simple-json" ]
, repo = "https://github.com/justinwoo/purescript-simple-json-utils.git"
, version = "v0.1.0"
}
, simple-jwt =
{ dependencies = [ "crypto", "simple-json", "strings" ]
, repo = "https://github.com/oreshinya/purescript-simple-jwt.git"
, version = "v2.0.0"
}
, simple-timestamp =
{ dependencies =
[ "console"
, "datetime"
, "effect"
, "foreign"
, "formatters"
, "prelude"
, "psci-support"
, "simple-json"
, "spec"
]
, repo = "https://github.com/reactormonk/purescript-simple-timestamp.git"
, version = "v3.0.0"
}
, sized-matrices =
{ dependencies =
[ "sized-vectors"
, "prelude"
, "foldable-traversable"
, "maybe"
, "arrays"
, "unfoldable"
, "typelevel"
, "distributive"
, "vectorfield"
, "strings"
]
, repo = "https://github.com/csicar/purescript-sized-matrices"
, version = "v1.0.0"
}
, sized-vectors =
{ dependencies =
[ "argonaut"
, "arrays"
, "distributive"
, "foldable-traversable"
, "maybe"
, "prelude"
, "quickcheck"
, "typelevel"
, "unfoldable"
]
, repo = "https://github.com/bodil/purescript-sized-vectors.git"
, version = "v5.0.1"
}
, sjcl =
{ dependencies =
[ "arraybuffer-types"
, "exceptions"
, "nullable"
, "sized-vectors"
, "tuples-native"
]
, repo = "https://github.com/athanclark/purescript-sjcl.git"
, version = "v0.0.1"
}
, slug =
{ dependencies =
[ "prelude"
, "maybe"
, "strings"
, "unicode"
, "generics-rep"
, "argonaut-codecs"
]
, repo = "https://github.com/thomashoneyman/purescript-slug.git"
, version = "v2.0.0"
}
, smolder =
{ dependencies =
[ "bifunctors"
, "catenable-lists"
, "free"
, "globals"
, "ordered-collections"
, "strings"
, "transformers"
, "tuples"
]
, repo = "https://github.com/bodil/purescript-smolder.git"
, version = "v12.3.0"
}
, snabbdom =
{ dependencies = [ "ordered-collections", "prelude", "web-dom", "web-html" ]
, repo = "https://github.com/LukaJCB/purescript-snabbdom.git"
, version = "v1.0.1"
}
, sodium =
{ dependencies =
[ "aff", "nullable", "numbers", "quickcheck-laws", "test-unit" ]
, repo = "https://github.com/SodiumFRP/purescript-sodium.git"
, version = "v2.1.0"
}
, sparse-matrices =
{ dependencies = [ "prelude", "console", "effect", "sparse-polynomials" ]
, repo = "https://github.com/Ebmtranceboy/purescript-sparse-matrices.git"
, version = "v1.1.0"
}
, sparse-polynomials =
{ dependencies =
[ "prelude"
, "console"
, "effect"
, "ordered-collections"
, "tuples"
, "rationals"
, "cartesian"
]
, repo = "https://github.com/Ebmtranceboy/purescript-sparse-polynomials.git"
, version = "v1.0.3"
}
, spec =
{ dependencies =
[ "aff"
, "ansi"
, "avar"
, "console"
, "exceptions"
, "foldable-traversable"
, "fork"
, "generics-rep"
, "now"
, "pipes"
, "prelude"
, "strings"
, "transformers"
]
, repo = "https://github.com/purescript-spec/purescript-spec.git"
, version = "v4.0.1"
}
, spec-discovery =
{ dependencies = [ "arrays", "effect", "node-fs", "prelude", "spec" ]
, repo = "https://github.com/owickstrom/purescript-spec-discovery.git"
, version = "v4.0.0"
}
, spec-quickcheck =
{ dependencies = [ "aff", "prelude", "quickcheck", "random", "spec" ]
, repo = "https://github.com/owickstrom/purescript-spec-quickcheck.git"
, version = "v3.1.0"
}
, spork =
{ dependencies =
[ "prelude"
, "console"
, "tailrec"
, "arrays"
, "refs"
, "foldable-traversable"
, "maybe"
, "aff"
, "halogen-vdom"
, "dom-indexed"
, "unsafe-reference"
, "web-dom"
, "web-html"
, "web-events"
, "web-uievents"
, "effect"
, "foreign"
, "ordered-collections"
]
, repo = "https://github.com/natefaubion/purescript-spork.git"
, version = "v1.0.0"
}
, st =
{ dependencies = [ "partial", "prelude", "tailrec", "unsafe-coerce" ]
, repo = "https://github.com/purescript/purescript-st.git"
, version = "v4.1.1"
}
, string-parsers =
{ dependencies =
[ "arrays"
, "bifunctors"
, "control"
, "either"
, "foldable-traversable"
, "lists"
, "maybe"
, "prelude"
, "strings"
, "tailrec"
]
, repo = "https://github.com/paf31/purescript-string-parsers.git"
, version = "v5.0.1"
}
, strings =
{ dependencies =
[ "arrays"
, "control"
, "either"
, "enums"
, "foldable-traversable"
, "gen"
, "integers"
, "maybe"
, "newtype"
, "nonempty"
, "partial"
, "prelude"
, "tailrec"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
]
, repo = "https://github.com/purescript/purescript-strings.git"
, version = "v4.0.2"
}
, strings-extra =
{ dependencies =
[ "arrays"
, "either"
, "foldable-traversable"
, "maybe"
, "partial"
, "prelude"
, "strings"
, "unicode"
]
, repo = "https://github.com/purescript-contrib/purescript-strings-extra.git"
, version = "v2.1.0"
}
, stringutils =
{ dependencies =
[ "arrays", "either", "integers", "maybe", "partial", "prelude", "strings" ]
, repo = "https://github.com/menelaos/purescript-stringutils.git"
, version = "v0.0.10"
}
, struct =
{ dependencies =
[ "argonaut"
, "argonaut-codecs"
, "effect"
, "proxying"
, "record"
, "record-extra"
, "subcategory"
, "variant"
]
, repo = "https://github.com/matthew-hilty/purescript-struct.git"
, version = "v1.1.0"
}
, stylesheet =
{ dependencies =
[ "effect"
, "foreign"
, "generics-rep"
, "ordered-collections"
, "prelude"
, "refs"
, "unordered-collections"
, "cssom"
]
, repo = "https://github.com/danieljharvey/purescript-stylesheet.git"
, version = "v0.0.3"
}
, subcategory =
{ dependencies =
[ "prelude", "profunctor", "record", "proxy", "typelevel-prelude" ]
, repo = "https://github.com/matthew-hilty/purescript-subcategory.git"
, version = "v0.2.0"
}
, subtlecrypto =
{ dependencies = [ "aff", "arraybuffer-types", "foreign", "promises" ]
, repo = "https://github.com/athanclark/purescript-subtlecrypto.git"
, version = "v0.0.1"
}
, suggest =
{ dependencies =
[ "console"
, "node-buffer"
, "node-fs"
, "node-process"
, "node-streams"
, "psa-utils"
, "refs"
]
, repo = "https://github.com/nwolverson/purescript-suggest.git"
, version = "v5.0.0"
}
, sunde =
{ dependencies = [ "aff", "effect", "node-child-process", "prelude" ]
, repo = "https://github.com/justinwoo/purescript-sunde.git"
, version = "v2.0.0"
}
, svg-parser =
{ dependencies = [ "generics-rep", "prelude", "string-parsers" ]
, repo = "https://github.com/rnons/purescript-svg-parser.git"
, version = "v1.0.0"
}
, svg-parser-halogen =
{ dependencies = [ "halogen", "prelude", "svg-parser" ]
, repo = "https://github.com/rnons/purescript-svg-parser-halogen.git"
, version = "v2.0.0-rc.1"
}
, systemd-journald =
{ dependencies = [ "console", "functions", "prelude" ]
, repo = "https://github.com/paluh/purescript-systemd-journald.git"
, version = "v0.2.1"
}
, tailrec =
{ dependencies =
[ "bifunctors"
, "effect"
, "either"
, "identity"
, "maybe"
, "partial"
, "prelude"
, "refs"
]
, repo = "https://github.com/purescript/purescript-tailrec.git"
, version = "v4.1.1"
}
, test-unit =
{ dependencies =
[ "aff"
, "avar"
, "effect"
, "either"
, "free"
, "js-timers"
, "lists"
, "prelude"
, "quickcheck"
, "strings"
]
, repo = "https://github.com/bodil/purescript-test-unit.git"
, version = "v15.0.0"
}
, text-encoding =
{ dependencies =
[ "arraybuffer-types", "either", "exceptions", "functions", "strings" ]
, repo = "https://github.com/AlexaDeWit/purescript-text-encoding.git"
, version = "v1.0.0"
}
, thermite =
{ dependencies =
[ "aff", "coroutines", "freet", "profunctor-lenses", "react" ]
, repo = "https://github.com/paf31/purescript-thermite.git"
, version = "v6.3.1"
}
, thermite-dom =
{ dependencies = [ "thermite", "react", "react-dom", "web-html" ]
, repo = "https://github.com/athanclark/purescript-thermite-dom.git"
, version = "v0.3.1"
}
, these =
{ dependencies = [ "gen", "tuples" ]
, repo = "https://github.com/purescript-contrib/purescript-these.git"
, version = "v4.0.0"
}
, tolerant-argonaut =
{ dependencies =
[ "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "effect"
, "higher-order"
, "lists"
, "record"
, "struct"
, "typelevel-prelude"
]
, repo = "https://github.com/matthew-hilty/purescript-tolerant-argonaut.git"
, version = "v2.0.0"
}
, toppokki =
{ dependencies =
[ "aff-promise"
, "functions"
, "node-buffer"
, "node-http"
, "prelude"
, "record"
]
, repo = "https://github.com/justinwoo/purescript-toppokki.git"
, version = "v2.4.0"
}
, tortellini =
{ dependencies =
[ "foreign-object"
, "integers"
, "lists"
, "motsunabe"
, "numbers"
, "prelude"
, "record"
, "string-parsers"
, "strings"
, "transformers"
, "typelevel-prelude"
]
, repo = "https://github.com/justinwoo/purescript-tortellini.git"
, version = "v5.1.0"
}
, transformers =
{ dependencies =
[ "control"
, "distributive"
, "effect"
, "either"
, "exceptions"
, "foldable-traversable"
, "identity"
, "lazy"
, "maybe"
, "newtype"
, "prelude"
, "tailrec"
, "tuples"
, "unfoldable"
]
, repo = "https://github.com/purescript/purescript-transformers.git"
, version = "v4.2.0"
}
, tree-rose =
{ dependencies = [ "prelude", "lists", "free" ]
, repo = "https://github.com/jordanmartinez/purescript-tree-rose.git"
, version = "v2.0.0"
}
, trout =
{ dependencies = [ "argonaut", "media-types", "prelude", "smolder", "uri" ]
, repo = "https://github.com/purescript-hyper/purescript-trout.git"
, version = "v0.12.3"
}
, trout-client =
{ dependencies = [ "affjax", "argonaut-generic", "prelude", "trout" ]
, repo = "https://github.com/purescript-hyper/purescript-trout-client.git"
, version = "v0.13.0"
}
, tuples =
{ dependencies =
[ "bifunctors"
, "control"
, "distributive"
, "foldable-traversable"
, "invariant"
, "maybe"
, "newtype"
, "prelude"
, "type-equality"
]
, repo = "https://github.com/purescript/purescript-tuples.git"
, version = "v5.1.0"
}
, tuples-native =
{ dependencies = [ "generics-rep", "typelevel", "unsafe-coerce" ]
, repo = "https://github.com/athanclark/purescript-tuples-native.git"
, version = "v2.1.0"
}
, type-equality =
{ dependencies = [] : List Text
, repo = "https://github.com/purescript/purescript-type-equality.git"
, version = "v3.0.0"
}
, type-isequal =
{ dependencies = [ "typelevel-prelude" ]
, repo = "https://github.com/justinwoo/purescript-type-isequal.git"
, version = "v0.1.0"
}
, typedenv =
{ dependencies =
[ "foreign-object"
, "generics-rep"
, "integers"
, "numbers"
, "record"
, "strings"
, "typelevel-prelude"
]
, repo = "https://github.com/nsaunders/purescript-typedenv.git"
, version = "v0.0.1"
}
, typelevel =
{ dependencies =
[ "partial", "prelude", "tuples", "typelevel-prelude", "unsafe-coerce" ]
, repo = "https://github.com/bodil/purescript-typelevel.git"
, version = "v6.0.0"
}
, typelevel-peano =
{ dependencies =
[ "unsafe-coerce"
, "arrays"
, "console"
, "effect"
, "typelevel-prelude"
, "prelude"
, "psci-support"
]
, repo = "https://github.com/csicar/purescript-typelevel-peano.git"
, version = "v0.1.8"
}
, typelevel-prelude =
{ dependencies = [ "prelude", "proxy", "type-equality" ]
, repo = "https://github.com/purescript/purescript-typelevel-prelude.git"
, version = "v5.0.2"
}
, typelevel-rowlist-limits =
{ dependencies = [ "typelevel-peano" ]
, repo =
"https://github.com/mwalkerwells/purescript-typelevel-rowlist-limits.git"
, version = "v0.0.6"
}
, uint =
{ dependencies = [ "generics-rep", "math", "maybe", "quickcheck" ]
, repo = "https://github.com/zaquest/purescript-uint.git"
, version = "v5.1.4"
}
, uint-instances =
{ dependencies = [ "uint", "unordered-collections", "argonaut", "quickcheck" ]
, repo = "https://github.com/athanclark/purescript-uint-instances.git"
, version = "v0.0.2"
}
, undefinable =
{ dependencies = [ "functions", "maybe" ]
, repo = "https://github.com/ethul/purescript-undefinable.git"
, version = "v4.0.0"
}
, undefined =
{ dependencies = [] : List Text
, repo = "https://github.com/bklaric/purescript-undefined.git"
, version = "v1.0.2"
}
, undefined-or =
{ dependencies = [ "maybe" ]
, repo = "https://github.com/d86leader/purescript-undefined-or.git"
, version = "v1.0.1"
}
, unfoldable =
{ dependencies =
[ "foldable-traversable", "maybe", "partial", "prelude", "tuples" ]
, repo = "https://github.com/purescript/purescript-unfoldable.git"
, version = "v4.1.0"
}
, unicode =
{ dependencies = [ "foldable-traversable", "maybe", "strings" ]
, repo = "https://github.com/purescript-contrib/purescript-unicode.git"
, version = "v4.0.1"
}
, unordered-collections =
{ dependencies =
[ "enums"
, "functions"
, "integers"
, "lists"
, "prelude"
, "record"
, "tuples"
, "typelevel-prelude"
]
, repo = "https://github.com/fehrenbach/purescript-unordered-collections.git"
, version = "v1.8.3"
}
, unorm =
{ dependencies = [] : List Text
, repo = "https://github.com/athanclark/purescript-unorm.git"
, version = "v1.0.1"
}
, unsafe-coerce =
{ dependencies = [] : List Text
, repo = "https://github.com/purescript/purescript-unsafe-coerce.git"
, version = "v4.0.0"
}
, unsafe-reference =
{ dependencies = [] : List Text
, repo =
"https://github.com/purescript-contrib/purescript-unsafe-reference.git"
, version = "v3.0.1"
}
, uri =
{ dependencies =
[ "arrays"
, "generics-rep"
, "globals"
, "integers"
, "parsing"
, "profunctor-lenses"
, "quickcheck"
, "spec"
, "unfoldable"
, "these"
]
, repo = "https://github.com/slamdata/purescript-uri.git"
, version = "v7.0.0"
}
, uuid =
{ dependencies = [ "effect", "maybe", "foreign-generic", "console", "spec" ]
, repo = "https://github.com/spicydonuts/purescript-uuid.git"
, version = "v6.1.0"
}
, validated-molecule =
{ dependencies = [ "arrays", "console", "effect", "lists", "psci-support" ]
, repo = "https://github.com/lukasturcani/validated-molecule.git"
, version = "v1.0.5"
}
, validation =
{ dependencies =
[ "bifunctors"
, "control"
, "either"
, "foldable-traversable"
, "newtype"
, "prelude"
]
, repo = "https://github.com/purescript/purescript-validation.git"
, version = "v4.2.0"
}
, variant =
{ dependencies =
[ "enums"
, "lists"
, "maybe"
, "partial"
, "prelude"
, "proxy"
, "record"
, "tuples"
, "unsafe-coerce"
]
, repo = "https://github.com/natefaubion/purescript-variant.git"
, version = "v6.0.1"
}
, vectorfield =
{ dependencies = [ "console", "effect", "group", "prelude", "psci-support" ]
, repo = "https://github.com/csicar/purescript-vectorfield.git"
, version = "v1.0.1"
}
, web-clipboard =
{ dependencies = [ "web-html" ]
, repo = "https://github.com/purescript-web/purescript-web-clipboard.git"
, version = "v2.0.0"
}
, web-dom =
{ dependencies = [ "web-events" ]
, repo = "https://github.com/purescript-web/purescript-web-dom.git"
, version = "v4.1.0"
}
, web-events =
{ dependencies = [ "datetime", "enums", "nullable" ]
, repo = "https://github.com/purescript-web/purescript-web-events.git"
, version = "v2.0.1"
}
, web-file =
{ dependencies = [ "foreign", "media-types", "web-dom" ]
, repo = "https://github.com/purescript-web/purescript-web-file.git"
, version = "v2.3.0"
}
, web-html =
{ dependencies = [ "js-date", "web-dom", "web-file", "web-storage" ]
, repo = "https://github.com/purescript-web/purescript-web-html.git"
, version = "v2.3.0"
}
, web-socket =
{ dependencies = [ "arraybuffer-types", "web-file" ]
, repo = "https://github.com/purescript-web/purescript-web-socket.git"
, version = "v2.0.0"
}
, web-storage =
{ dependencies = [ "nullable", "web-events" ]
, repo = "https://github.com/purescript-web/purescript-web-storage.git"
, version = "v3.0.0"
}
, web-touchevents =
{ dependencies = [ "web-uievents" ]
, repo = "https://github.com/purescript-web/purescript-web-touchevents.git"
, version = "v2.0.0"
}
, web-uievents =
{ dependencies = [ "web-html" ]
, repo = "https://github.com/purescript-web/purescript-web-uievents.git"
, version = "v2.0.0"
}
, web-url =
{ dependencies =
[ "maybe", "partial", "prelude", "psci-support", "spec", "tuples" ]
, repo = "https://github.com/mjepronk/purescript-web-url.git"
, version = "v1.0.2"
}
, web-xhr =
{ dependencies =
[ "arraybuffer-types", "datetime", "http-methods", "web-dom", "web-file" ]
, repo = "https://github.com/purescript-web/purescript-web-xhr.git"
, version = "v3.0.2"
}
, websocket-moderate =
{ dependencies =
[ "argonaut"
, "arraybuffer"
, "exceptions"
, "monad-control"
, "nullable"
, "text-encoding"
, "web-file"
]
, repo = "https://github.com/athanclark/purescript-websocket-moderate.git"
, version = "v7.0.2"
}
, xiaomian =
{ dependencies = [ "naporitan" ]
, repo = "https://github.com/justinwoo/purescript-xiaomian.git"
, version = "v0.1.0"
}
, yargs =
{ dependencies =
[ "console", "either", "exceptions", "foreign", "unsafe-coerce" ]
, repo = "https://github.com/paf31/purescript-yargs.git"
, version = "v4.0.0"
}
, z85 =
{ dependencies = [ "arraybuffer", "sized-vectors", "numbers", "stringutils" ]
, repo = "https://github.com/athanclark/purescript-z85.git"
, version = "v0.0.2"
}
, zeta =
{ dependencies = [ "refs", "aff", "foreign-object", "arrays" ]
, repo = "https://github.com/athanclark/purescript-zeta.git"
, version = "v6.0.0"
}
, zeta-extra =
{ dependencies = [ "js-timers", "web-html", "zeta" ]
, repo = "https://github.com/athanclark/purescript-zeta-extra.git"
, version = "v0.0.1"
}
}
let upstream = let upstream =
./packages-0.13.8-20200822.dhall https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20201021/packages.dhall
let overrides = let overrides =
{ thermite = { thermite =
......
...@@ -5,9 +5,11 @@ import Data.Argonaut.Parser (jsonParser) ...@@ -5,9 +5,11 @@ import Data.Argonaut.Parser (jsonParser)
import Data.Array as A import Data.Array as A
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Tuple (snd)
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Web.Storage.Storage as WSS import Web.Storage.Storage as WSS
import Gargantext.Prelude import Gargantext.Prelude
...@@ -19,7 +21,9 @@ import Gargantext.Utils.Reactix as R2 ...@@ -19,7 +21,9 @@ import Gargantext.Utils.Reactix as R2
localStorageKey :: String localStorageKey :: String
localStorageKey = "garg-async-tasks" localStorageKey = "garg-async-tasks"
type Storage = Map.Map Int (Array GT.AsyncTaskWithType)
type NodeId = Int
type Storage = Map.Map NodeId (Array GT.AsyncTaskWithType)
empty :: Storage empty :: Storage
empty = Map.empty empty = Map.empty
...@@ -37,6 +41,39 @@ getAsyncTasks = R2.getls >>= WSS.getItem localStorageKey >>= handleMaybe ...@@ -37,6 +41,39 @@ getAsyncTasks = R2.getls >>= WSS.getItem localStorageKey >>= handleMaybe
parse s = GU.mapLeft (log2 "Error parsing serialised sessions:") (jsonParser s) parse s = GU.mapLeft (log2 "Error parsing serialised sessions:") (jsonParser s)
decode j = GU.mapLeft (log2 "Error decoding serialised sessions:") (decodeJson j) decode j = GU.mapLeft (log2 "Error decoding serialised sessions:") (decodeJson j)
getTasks :: Record ReductorProps -> NodeId -> Array GT.AsyncTaskWithType
getTasks { storage } nodeId = fromMaybe [] $ Map.lookup nodeId storage
removeTaskFromList :: Array GT.AsyncTaskWithType -> GT.AsyncTaskWithType -> Array GT.AsyncTaskWithType removeTaskFromList :: Array GT.AsyncTaskWithType -> GT.AsyncTaskWithType -> Array GT.AsyncTaskWithType
removeTaskFromList ts (GT.AsyncTaskWithType { task: GT.AsyncTask { id: id' } }) = removeTaskFromList ts (GT.AsyncTaskWithType { task: GT.AsyncTask { id: id' } }) =
A.filter (\(GT.AsyncTaskWithType { task: GT.AsyncTask { id: id'' } }) -> id' /= id'') ts A.filter (\(GT.AsyncTaskWithType { task: GT.AsyncTask { id: id'' } }) -> id' /= id'') ts
type ReductorProps = (
reload :: R.State Int
, storage :: Storage
)
type Reductor = R2.Reductor (Record ReductorProps) Action
useTasks :: R.State Int -> R.Hooks Reductor
useTasks reload = R2.useReductor act initializer unit
where
act :: R2.Actor (Record ReductorProps) Action
act a s = action s a
initializer _ = do
storage <- getAsyncTasks
pure { reload, storage }
data Action =
Insert NodeId GT.AsyncTaskWithType
| Remove NodeId GT.AsyncTaskWithType
action :: Record ReductorProps -> Action -> Effect (Record ReductorProps)
action { reload, storage } (Insert nodeId t) = do
_ <- snd reload $ (_ + 1)
let newStorage = Map.alter (maybe (Just [t]) (\ts -> Just $ A.cons t ts)) nodeId storage
pure { reload, storage: newStorage }
action { reload, storage } (Remove nodeId t) = do
_ <- snd reload $ (_ + 1)
let newStorage = Map.alter (maybe Nothing $ (\ts -> Just $ removeTaskFromList ts t)) nodeId storage
pure { reload, storage: newStorage }
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
module Gargantext.Components.Annotation.AnnotatedField where module Gargantext.Components.Annotation.AnnotatedField where
import Prelude import Prelude
import Data.Maybe ( Maybe(..), maybe, isJust, isNothing ) import Data.Maybe ( Maybe(..), maybe )
import Data.Tuple ( Tuple(..) ) import Data.Tuple ( Tuple )
import Data.Tuple.Nested ( (/\) ) import Data.Tuple.Nested ( (/\) )
import DOM.Simple.Console (log, log2) --import DOM.Simple.Console (log2)
import DOM.Simple.Event as DE import DOM.Simple.Event as DE
import Effect ( Effect ) import Effect ( Effect )
import Reactix as R import Reactix as R
...@@ -25,9 +25,8 @@ import Reactix.SyntheticEvent as E ...@@ -25,9 +25,8 @@ import Reactix.SyntheticEvent as E
import Gargantext.Types (CTabNgramType(..), TermList) import Gargantext.Types (CTabNgramType(..), TermList)
import Gargantext.Components.Annotation.Utils ( termBootstrapClass ) import Gargantext.Components.Annotation.Utils ( termBootstrapClass )
import Gargantext.Components.NgramsTable.Core (NgramsTable, NgramsTerm, findNgramTermList, highlightNgrams, normNgram) import Gargantext.Components.NgramsTable.Core (NgramsTable, NgramsTerm, findNgramTermList, highlightNgrams, normNgram)
import Gargantext.Components.Annotation.Menu ( AnnotationMenu, annotationMenu, MenuType(..) ) import Gargantext.Components.Annotation.Menu ( annotationMenu, MenuType(..) )
import Gargantext.Utils.Selection as Sel import Gargantext.Utils.Selection as Sel
import Gargantext.Utils.Reactix as R2
thisModule :: String thisModule :: String
thisModule = "Gargantext.Components.Annotation.AnnotatedField" thisModule = "Gargantext.Components.Annotation.AnnotatedField"
...@@ -49,110 +48,65 @@ annotatedField p = R.createElement annotatedFieldComponent p [] ...@@ -49,110 +48,65 @@ annotatedField p = R.createElement annotatedFieldComponent p []
annotatedFieldComponent :: R.Component Props annotatedFieldComponent :: R.Component Props
annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField" cpt annotatedFieldComponent = R.hooksComponentWithModule thisModule "annotatedField" cpt
where where
cpt {ngrams,setTermList,text} _ = do cpt {ngrams,setTermList,text: fieldText} _ = do
mMenu@(_ /\ setMenu) <- R.useState' Nothing (_ /\ setRedrawMenu) <- R.useState' false
menuRef <- R.useRef Nothing menuRef <- R.useRef Nothing
let wrapperProps = { className: "annotated-field-wrapper" } let wrapperProps = { className: "annotated-field-wrapper" }
onSelect :: String -> Maybe TermList -> MouseEvent -> Effect Unit redrawMenu = setRedrawMenu not
onSelect text' Nothing event = do
log2 "[onSelect] text'" text' hideMenu = do
maybeShowMenu setMenu menuRef setTermList ngrams event R.setRef menuRef Nothing
onSelect text' (Just list) event = do redrawMenu
log2 "[onSelect] text'" text'
log2 "[onSelect] list" list showMenu { event, text, getList, menuType } = do
let x = E.clientX event let x = E.clientX event
y = E.clientY event y = E.clientY event
n = normNgram CTabTerms text
list = getList n
setList t = do setList t = do
R.setRef menuRef Nothing setTermList n list t
setTermList (normNgram CTabTerms text') (Just list) t hideMenu
--setMenu (const Nothing) E.preventDefault event
menu = Just { --range <- Sel.getRange sel 0
x --log2 "[showMenu] selection range" $ Sel.rangeToTuple range
let menu = Just
{ x
, y , y
, list: Just list , list
, menuType: SetTermListItem , menuType
, onClose: \_ -> R.setRef menuRef Nothing , onClose: hideMenu
, setList , setList
} }
--setMenu (const $ menu)
R.setRef menuRef menu R.setRef menuRef menu
redrawMenu
mapCompile (Tuple t l) = {text: t, list: l, onSelect} onSelect :: String -> Maybe TermList -> MouseEvent -> Effect Unit
compiled = map mapCompile $ compile ngrams text onSelect text mList event =
case mList of
runs = Just list ->
HTML.div { className: "annotated-field-runs" } $ map annotateRun compiled showMenu { event, text, getList: const (Just list), menuType: SetTermListItem }
--pure $ HTML.div wrapperProps [maybeAddMenu mMenu runs] Nothing -> do
pure $ HTML.div wrapperProps [ addMenu { menuRef }, runs ]
type AddMenuProps = (
menuRef :: R.Ref (Maybe AnnotationMenu)
)
addMenu :: Record AddMenuProps -> R.Element
addMenu p = R.createElement addMenuCpt p []
addMenuCpt :: R.Component AddMenuProps
addMenuCpt = R.hooksComponentWithModule thisModule "addMenu" cpt
where
cpt { menuRef } _ = do
(mMenu /\ setmMenu) <- R.useState' (Nothing :: Maybe AnnotationMenu)
R.useEffect' $ do
let m = R.readRef menuRef
log2 "[addMenu] menuRef" m
log2 "[addMenu] mMenu" mMenu
setmMenu $ const m
pure $ case mMenu of
Nothing -> HTML.div {} []
Just menu -> annotationMenu setmMenu menu
-- forall e. IsMouseEvent e => R.Setter (Maybe AnnotationMenu) -> R.Setter ? -> ? -> e -> Effect Unit
maybeShowMenu setMenu menuRef setTermList ngrams event = do
s <- Sel.getSelection s <- Sel.getSelection
log2 "[maybeShowMenu] s" s
case s of case s of
Just sel -> do Just sel -> do
case Sel.selectionToString sel of case Sel.selectionToString sel of
"" -> pure unit "" -> hideMenu
sel' -> do sel' -> do
let x = E.clientX event showMenu { event, text: sel', getList: findNgramTermList ngrams, menuType: NewNgram }
y = E.clientY event Nothing -> hideMenu
n = normNgram CTabTerms sel'
list = findNgramTermList ngrams n
setList t = do
setTermList n list t
--setMenu (const Nothing)
R.setRef menuRef Nothing
E.preventDefault event
range <- Sel.getRange sel 0
log2 "[maybeShowMenu] selection range" $ Sel.rangeToTuple range
let menu = Just {
x
, y
, list
, menuType: NewNgram
, onClose: \_ -> R.setRef menuRef Nothing
, setList
}
--setMenu (const $ menu)
R.setRef menuRef menu
Nothing -> pure unit
-- Nothing -> do
-- R.setRef menuRef Nothing
maybeAddMenu wrap (text /\ list) = {text, list, onSelect}
:: R.State (Maybe AnnotationMenu)
-> R.Element pure $ HTML.div wrapperProps
-> R.Element [ maybe (HTML.div {} []) annotationMenu $ R.readRef menuRef
maybeAddMenu (Just props /\ setMenu) e = annotationMenu setMenu props <> e , HTML.div { className: "annotated-field-runs" }
maybeAddMenu _ e = e $ annotateRun
<$> wrap
<$> compile ngrams fieldText
]
compile :: NgramsTable -> Maybe String -> Array (Tuple String (Maybe TermList)) compile :: NgramsTable -> Maybe String -> Array (Tuple String (Maybe TermList))
compile ngrams = maybe [] (highlightNgrams CTabTerms ngrams) compile ngrams = maybe [] (highlightNgrams CTabTerms ngrams)
...@@ -171,13 +125,11 @@ annotateRun p = R.createElement annotatedRunComponent p [] ...@@ -171,13 +125,11 @@ annotateRun p = R.createElement annotatedRunComponent p []
annotatedRunComponent :: R.Component Run annotatedRunComponent :: R.Component Run
annotatedRunComponent = R.staticComponent "AnnotatedRun" cpt annotatedRunComponent = R.staticComponent "AnnotatedRun" cpt
where where
cpt { list: Nothing, onSelect, text } _ = cpt { list, onSelect, text } _ = elt [ HTML.text text ]
HTML.span { on: { mouseUp: \e -> onSelect text Nothing e } } [ HTML.text text ]
cpt { list: (Just list), onSelect, text } _ =
HTML.span { className: className list
, on: { click: \e -> onSelect text (Just list) e } } [ HTML.text text ]
where where
className list' = "annotation-run bg-" <> termBootstrapClass list' cb = onSelect text list
elt =
case list of
Nothing -> HTML.span { on: { mouseUp: cb } }
Just l -> HTML.span { className: "annotation-run bg-" <> termBootstrapClass l
, on: { click: cb } }
\ No newline at end of file
...@@ -30,16 +30,16 @@ type Props = ...@@ -30,16 +30,16 @@ type Props =
type AnnotationMenu = { type AnnotationMenu = {
x :: Number x :: Number
, y :: Number , y :: Number
, onClose :: Unit -> Effect Unit , onClose :: Effect Unit
| Props | Props
} }
-- | An Annotation Menu is parameterised by a Maybe Termlist of the -- | An Annotation Menu is parameterised by a Maybe Termlist of the
-- | TermList the currently selected text belongs to -- | TermList the currently selected text belongs to
annotationMenu :: R.Setter (Maybe AnnotationMenu) -> AnnotationMenu -> R.Element annotationMenu :: AnnotationMenu -> R.Element
annotationMenu setMenu { x,y,list,menuType, onClose,setList } = annotationMenu {x, y, list, menuType, onClose, setList} =
CM.contextMenu { x,y, onClose, setMenu } [ CM.contextMenu {x, y, onClose} [
R.createElement annotationMenuCpt {list,menuType,setList} [] R.createElement annotationMenuCpt {list, menuType, setList} []
] ]
annotationMenuCpt :: R.Component Props annotationMenuCpt :: R.Component Props
......
...@@ -10,7 +10,7 @@ import Reactix.DOM.HTML as H ...@@ -10,7 +10,7 @@ import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Config (publicBackend) import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest (forest) import Gargantext.Components.Forest (forest)
import Gargantext.Components.GraphExplorer (explorerLayout) import Gargantext.Components.GraphExplorer (explorerLayout)
import Gargantext.Components.Lang (LandingLang(..)) import Gargantext.Components.Lang (LandingLang(..))
...@@ -25,7 +25,7 @@ import Gargantext.Components.Nodes.Frame (frameLayout) ...@@ -25,7 +25,7 @@ import Gargantext.Components.Nodes.Frame (frameLayout)
import Gargantext.Components.Nodes.Home (homeLayout) import Gargantext.Components.Nodes.Home (homeLayout)
import Gargantext.Components.Nodes.Lists (listsLayout) import Gargantext.Components.Nodes.Lists (listsLayout)
import Gargantext.Components.Nodes.Texts (textsLayout) import Gargantext.Components.Nodes.Texts (textsLayout)
import Gargantext.Config (defaultFrontends, defaultBackends) import Gargantext.Config (defaultFrontends, defaultBackends, publicBackend)
import Gargantext.Ends (Frontends, Backend) import Gargantext.Ends (Frontends, Backend)
import Gargantext.Hooks.Router (useHashRouter) import Gargantext.Hooks.Router (useHashRouter)
import Gargantext.License (license) import Gargantext.License (license)
...@@ -36,6 +36,7 @@ import Gargantext.Sessions as Sessions ...@@ -36,6 +36,7 @@ import Gargantext.Sessions as Sessions
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.App" thisModule = "Gargantext.Components.App"
-- TODO (what does this mean?) -- TODO (what does this mean?)
...@@ -54,15 +55,18 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -54,15 +55,18 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
showLogin <- R.useState' false showLogin <- R.useState' false
backend <- R.useState' Nothing backend <- R.useState' Nothing
showCorpus <- R.useState' false
treeReload <- R.useState' 0 treeReload <- R.useState' 0
asyncTasks <- GAT.useTasks treeReload
showCorpus <- R.useState' false
handed <- R.useState' GT.RightHanded handed <- R.useState' GT.RightHanded
let backends = fromFoldable defaultBackends let backends = fromFoldable defaultBackends
let ff f session = R.fragment [ f session, footer { session } ] let ff f session = R.fragment [ f session, footer { session } ]
let forested child = forestLayout { child let forested child = forestLayout { asyncTasks
, child
, frontends , frontends
, handed , handed
, reload: treeReload , reload: treeReload
...@@ -71,67 +75,69 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where ...@@ -71,67 +75,69 @@ appCpt = R.hooksComponentWithModule thisModule "app" cpt where
, showLogin: snd showLogin , showLogin: snd showLogin
, backend , backend
} }
let mCurrentRoute = fst route let defaultView _ = forested $ homeLayout { backend
let withSession sid f = maybe' ( const $ forested , lang: LL_EN
$ homeLayout { lang: LL_EN
, backend
, publicBackend , publicBackend
, sessions , sessions
, visible:showLogin , visible: showLogin
} }
) let mCurrentRoute = fst route
(ff f) let withSession sid f = maybe' defaultView (ff f) (Sessions.lookup sid (fst sessions))
(Sessions.lookup sid (fst sessions))
let sessionUpdate s = snd sessions $ Sessions.Update s
pure $ case fst showLogin of pure $ case fst showLogin of
true -> forested $ login { backend, backends, sessions, visible: showLogin } true -> forested $ login { backend, backends, sessions, visible: showLogin }
false -> false ->
case fst route of case fst route of
Home -> forested $ homeLayout {lang:LL_EN, backend, publicBackend, sessions, visible:showLogin}
Login -> login { backends, sessions, visible: showLogin, backend}
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested $ frameLayout { nodeId, session }
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested $ frameLayout { nodeId, session }
RouteFile sid nodeId -> withSession sid $ \session -> forested $ fileLayout { nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { nodeId, session, frontends }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout { nodeId, session }
Dashboard sid nodeId -> withSession sid $ \session -> forested $ dashboardLayout { nodeId, session }
Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session } Annuaire sid nodeId -> withSession sid $ \session -> forested $ annuaireLayout { frontends, nodeId, session }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { frontends, nodeId, session } ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId, asyncTasks, frontends, nodeId, session }
ContactPage sid aId nodeId -> withSession sid $ \session -> forested $ annuaireUserLayout { annuaireId: aId, frontends, nodeId, session } Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId } CorpusDocument sid corpusId listId nodeId -> withSession sid $ \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Just corpusId }
Dashboard sid nodeId -> withSession sid $ \session -> forested $ dashboardLayout { nodeId, session }
Document sid listId nodeId -> Document sid listId nodeId ->
withSession sid $ withSession sid $
\session -> forested $ documentLayout { nodeId, listId, session, corpusId: Nothing } \session -> forested $ documentLayout { nodeId, listId, session, corpusId: Nothing }
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Home -> forested $ homeLayout { backend, lang:LL_EN, publicBackend, sessions, visible: showLogin }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout { asyncTasks, nodeId, session, sessionUpdate }
Login -> login { backend, backends, sessions, visible: showLogin }
PGraphExplorer sid graphId -> PGraphExplorer sid graphId ->
withSession sid $ withSession sid $
\session -> \session ->
simpleLayout handed $ simpleLayout handed $
explorerLayout { frontends explorerLayout { asyncTasks
, backend
, frontends
, graphId , graphId
, handed: fst handed , handed: fst handed
, mCurrentRoute , mCurrentRoute
, session , session
, sessions: (fst sessions) , sessions: (fst sessions)
, showLogin , showLogin
, backend
--, treeReload --, treeReload
} }
RouteFile sid nodeId -> withSession sid $ \session -> forested $ fileLayout { nodeId, session }
RouteFrameCalc sid nodeId -> withSession sid $ \session -> forested $ frameLayout { nodeId, session, nodeType: GT.NodeFrameCalc }
RouteFrameWrite sid nodeId -> withSession sid $ \session -> forested $ frameLayout { nodeId, session, nodeType: GT.NodeFrameWrite }
RouteFrameCode sid nodeId -> withSession sid $ \session -> forested $ frameLayout { nodeId, session, nodeType: GT.NodeFrameNotebook }
Team sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { frontends, nodeId, session, sessionUpdate }
UserPage sid nodeId -> withSession sid $ \session -> forested $ userLayout { asyncTasks, frontends, nodeId, session }
type ForestLayoutProps = type ForestLayoutProps =
( child :: R.Element ( asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, child :: R.Element
, frontends :: Frontends , frontends :: Frontends
, handed :: R.State GT.Handed , handed :: R.State GT.Handed
, reload :: R.State Int , reload :: R.State Int
, route :: AppRoute , route :: AppRoute
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.Setter Boolean , showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
) )
forestLayout :: Record ForestLayoutProps -> R.Element forestLayout :: Record ForestLayoutProps -> R.Element
...@@ -149,7 +155,7 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props [] ...@@ -149,7 +155,7 @@ forestLayoutMain props = R.createElement forestLayoutMainCpt props []
forestLayoutMainCpt :: R.Component ForestLayoutProps forestLayoutMainCpt :: R.Component ForestLayoutProps
forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" cpt
where where
cpt { child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do cpt { asyncTasks, child, frontends, handed, reload, route, sessions, showLogin, backend} _ = do
let ordering = let ordering =
case fst handed of case fst handed of
GT.LeftHanded -> reverse GT.LeftHanded -> reverse
...@@ -157,7 +163,7 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c ...@@ -157,7 +163,7 @@ forestLayoutMainCpt = R.hooksComponentWithModule thisModule "forestLayoutMain" c
pure $ R2.row $ ordering [ pure $ R2.row $ ordering [
H.div { className: "col-md-2", style: { paddingTop: "60px" } } H.div { className: "col-md-2", style: { paddingTop: "60px" } }
[ forest { frontends, handed: fst handed, reload, route, sessions, showLogin, backend} ] [ forest { asyncTasks, backend, frontends, handed: fst handed, reload, route, sessions, showLogin } ]
, mainPage child , mainPage child
] ]
......
...@@ -26,8 +26,7 @@ thisModule = "Gargantext.Components.ContextMenu.ContextMenu" ...@@ -26,8 +26,7 @@ thisModule = "Gargantext.Components.ContextMenu.ContextMenu"
type Props t = ( type Props t = (
x :: Number x :: Number
, y :: Number , y :: Number
, onClose :: Unit -> Effect Unit , onClose :: Effect Unit
, setMenu :: R.Setter (Maybe t)
) )
contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element contextMenu :: forall t. Record (Props t) -> Array R.Element -> R.Element
...@@ -36,7 +35,7 @@ contextMenu = R.createElement contextMenuCpt ...@@ -36,7 +35,7 @@ contextMenu = R.createElement contextMenuCpt
contextMenuCpt :: forall t. R.Component (Props t) contextMenuCpt :: forall t. R.Component (Props t)
contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt
where where
cpt menu@{ x, y, onClose, setMenu } children = do cpt menu@{ x, y, onClose } children = do
host <- R2.getPortalHost host <- R2.getPortalHost
root <- R.useRef null root <- R.useRef null
rect /\ setRect <- R.useState $ \_ -> Nothing rect /\ setRect <- R.useState $ \_ -> Nothing
...@@ -45,7 +44,7 @@ contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt ...@@ -45,7 +44,7 @@ contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt
(\r -> setRect (\_ -> Just (Element.boundingRect r))) (\r -> setRect (\_ -> Just (Element.boundingRect r)))
(toMaybe $ R.readRef root) (toMaybe $ R.readRef root)
pure $ pure unit pure $ pure unit
R.useLayoutEffect2 root rect (contextMenuEffect onClose setMenu root) R.useLayoutEffect2 root rect (contextMenuEffect onClose root)
let cs = [ let cs = [
HTML.div { className: "popover-content" } HTML.div { className: "popover-content" }
[ HTML.div { className: "panel panel-default" } [ HTML.div { className: "panel panel-default" }
...@@ -57,27 +56,28 @@ contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt ...@@ -57,27 +56,28 @@ contextMenuCpt = R.hooksComponentWithModule thisModule "contextMenu" cpt
pure $ R.createPortal [ elems root menu rect $ cs ] host pure $ R.createPortal [ elems root menu rect $ cs ] host
elems ref menu (Just rect) = HTML.div elems ref menu (Just rect) = HTML.div
{ ref { ref
, key: "context-menu"
, className: "context-menu" , className: "context-menu"
, style: position menu rect , style: position menu rect
, data: {toggle: "popover", placement: "right"} , data: {toggle: "popover", placement: "right"}
} }
elems ref _ _ = HTML.div elems ref _ _ = HTML.div
{ ref { ref
, key: "context-menu"
, className: "context-menu" , className: "context-menu"
, data: {toggle: "popover", placement: "right"} , data: {toggle: "popover", placement: "right"}
} }
contextMenuEffect contextMenuEffect
:: forall t. :: forall t.
(Unit -> Effect Unit) Effect Unit
-> R.Setter (Maybe t)
-> R.Ref (Nullable DOM.Element) -> R.Ref (Nullable DOM.Element)
-> Effect (Effect Unit) -> Effect (Effect Unit)
contextMenuEffect onClose setMenu rootRef = contextMenuEffect onClose rootRef =
case R.readNullableRef rootRef of case R.readNullableRef rootRef of
Just root -> do Just root -> do
let onClick = documentClickHandler onClose setMenu root let onClick = documentClickHandler onClose root
let onScroll = documentScrollHandler setMenu let onScroll = documentScrollHandler onClose
DOM.addEventListener document "click" onClick DOM.addEventListener document "click" onClick
DOM.addEventListener document "scroll" onScroll DOM.addEventListener document "scroll" onScroll
pure $ do pure $ do
...@@ -85,18 +85,14 @@ contextMenuEffect onClose setMenu rootRef = ...@@ -85,18 +85,14 @@ contextMenuEffect onClose setMenu rootRef =
DOM.removeEventListener document "scroll" onScroll DOM.removeEventListener document "scroll" onScroll
Nothing -> pure R.nothing Nothing -> pure R.nothing
documentClickHandler :: forall t. (Unit -> Effect Unit) -> R.Setter (Maybe t) -> DOM.Element -> Callback DE.MouseEvent documentClickHandler :: Effect Unit -> DOM.Element -> Callback DE.MouseEvent
documentClickHandler onClose hide menu = documentClickHandler onClose menu =
R2.named "hideMenuOnClickOutside" $ callback $ \e -> R2.named "hideMenuOnClickOutside" $ callback $ \e ->
if Element.contains menu (DE.target e) when (Element.contains menu (DE.target e)) onClose
then pure unit
else do documentScrollHandler :: Effect Unit -> Callback DE.MouseEvent
hide (const Nothing) documentScrollHandler onClose =
onClose unit R2.named "hideMenuOnScroll" $ callback $ \e -> onClose
documentScrollHandler :: forall t. R.Setter (Maybe t) -> Callback DE.MouseEvent
documentScrollHandler hide =
R2.named "hideMenuOnScroll" $ callback $ \e -> hide (const Nothing)
position :: forall t. Record (Props t) -> DOMRect -> { left :: Number, top :: Number } position :: forall t. Record (Props t) -> DOMRect -> { left :: Number, top :: Number }
position mouse {width: menuWidth, height: menuHeight} = {left, top} position mouse {width: menuWidth, height: menuHeight} = {left, top}
......
-- TODO: this module should be replaced by FacetsTable -- TODO: this module should be replaced by FacetsTable
module Gargantext.Components.DocsTable where module Gargantext.Components.DocsTable where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>), encodeJson) import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.:), (:=), (~>))
import Data.Array as A import Data.Array as A
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Data.Lens ((^.)) import Data.Lens ((^.))
import Data.Lens.At (at) import Data.Lens.At (at)
import Data.Lens.Record (prop) import Data.Lens.Record (prop)
import Data.Map (Map) import Data.Map (Map)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe, isJust) import Data.Maybe (Maybe(..), fromMaybe, isJust)
import Data.Ord.Down (Down(..)) import Data.Ord.Down (Down(..))
import Data.Sequence as Seq
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.String as Str import Data.String as Str
...@@ -22,53 +17,68 @@ import Data.Tuple (Tuple(..), fst) ...@@ -22,53 +17,68 @@ import Data.Tuple (Tuple(..), fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple.Event as DE import DOM.Simple.Event as DE
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff, launchAff) import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
------------------------------------------------------------------------ ------------------------------------------------------------------------
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.Category import Gargantext.Components.Category (Category(..), caroussel, decodeCategory)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
import Gargantext.Ends (Frontends, url) import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoaderWithCacheAPI, HashedResponse(..)) import Gargantext.Hooks.Loader (useLoader, useLoaderWithCacheAPI, HashedResponse(..))
import Gargantext.Utils.Seq (sortWith) as Seq
import Gargantext.Utils.Reactix as R2
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Routes (SessionRoute(NodeAPI))
import Gargantext.Sessions (Session, sessionId, get, delete, put) import Gargantext.Sessions (Session, sessionId, get, delete)
import Gargantext.Types (NodeType(..), OrderBy(..), TableResult, TabType, showTabType') import Gargantext.Types (NodeType(..), OrderBy(..), TableResult, TabSubType, TabType, showTabType')
import Gargantext.Utils (sortWith)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.QueryString (joinQueryStrings, mQueryParamS, queryParam, queryParamS)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.DocsTable" thisModule = "Gargantext.Components.DocsTable"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type TotalRecords = Int type TotalRecords = Int
type LayoutProps = type Path a = (
( nodeId :: Int corpusId :: Int
, totalRecords :: Int
, chart :: R.Element
, tabType :: TabType
, listId :: Int , listId :: Int
, frontends :: Frontends
, session :: Session
, tabType :: TabSubType a
)
type LayoutProps = (
cacheState :: R.State NT.CacheState
, corpusId :: Maybe Int , corpusId :: Maybe Int
, showSearch :: Boolean
, frontends :: Frontends , frontends :: Frontends
, session :: Session ) , chart :: R.Element
, listId :: Int
, nodeId :: Int
-- , path :: Record (Path a)
, session :: Session
, showSearch :: Boolean
, tabType :: TabType
-- ^ tabType is not ideal here since it is too much entangled with tabs and -- ^ tabType is not ideal here since it is too much entangled with tabs and
-- ngramtable. Let's see how this evolves. ) -- ngramtable. Let's see how this evolves. )
type PageLayoutProps =
( nodeId :: Int
, totalRecords :: Int , totalRecords :: Int
, tabType :: TabType )
, listId :: Int
type PageLayoutProps = (
cacheState :: R.State NT.CacheState
, corpusId :: Maybe Int , corpusId :: Maybe Int
, frontends :: Frontends
, key :: String -- NOTE Necessary to clear the component when cache state changes
, listId :: Int
, nodeId :: Int
, params :: T.Params
, query :: Query , query :: Query
, session :: Session , session :: Session
, frontends :: Frontends , tabType :: TabType
, params :: T.Params ) , totalRecords :: Int
)
type LocalCategories = Map Int Category type LocalCategories = Map Int Category
type Query = String type Query = String
...@@ -150,14 +160,13 @@ instance decodeHyperdata :: DecodeJson Hyperdata where ...@@ -150,14 +160,13 @@ instance decodeHyperdata :: DecodeJson Hyperdata where
instance decodeResponse :: DecodeJson Response where instance decodeResponse :: DecodeJson Response where
decodeJson json = do decodeJson json = do
obj <- decodeJson json obj <- decodeJson json
cid <- obj .: "id"
category <- obj .: "category" category <- obj .: "category"
cid <- obj .: "id"
hyperdata <- obj .: "hyperdata"
ngramCount <- obj .: "id" ngramCount <- obj .: "id"
title <- obj .: "title" title <- obj .: "title"
hyperdata <- obj .: "hyperdata"
pure $ Response { cid, title, category: decodeCategory category, ngramCount, hyperdata } pure $ Response { cid, title, category: decodeCategory category, ngramCount, hyperdata }
docViewLayout :: Record LayoutProps -> R.Element docViewLayout :: Record LayoutProps -> R.Element
docViewLayout props = R.createElement docViewLayoutCpt props [] docViewLayout props = R.createElement docViewLayoutCpt props []
...@@ -167,7 +176,7 @@ docViewLayoutCpt = R.hooksComponentWithModule thisModule "docViewLayout" cpt ...@@ -167,7 +176,7 @@ docViewLayoutCpt = R.hooksComponentWithModule thisModule "docViewLayout" cpt
cpt layout _children = do cpt layout _children = do
query <- R.useState' "" query <- R.useState' ""
let params = T.initialParams let params = T.initialParams
pure $ docView {query, params, layout} pure $ docView { layout, params, query }
type Props = ( type Props = (
layout :: Record LayoutProps layout :: Record LayoutProps
...@@ -180,16 +189,29 @@ docView props = R.createElement docViewCpt props [] ...@@ -180,16 +189,29 @@ docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component Props docViewCpt :: R.Component Props
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where
cpt { query, params cpt { layout: { cacheState
, layout: { frontends, session, nodeId, tabType, listId , chart
, corpusId, totalRecords, chart, showSearch } } _ = do , corpusId
, frontends
, listId
, nodeId
, session
, showSearch
, tabType
, totalRecords
}
, params
, query
} _ = do
pure $ H.div {className: "container1"} pure $ H.div {className: "container1"}
[ R2.row [ R2.row
[ chart [ chart
, if showSearch then searchBar query else H.div {} [] , if showSearch then searchBar query else H.div {} []
, H.div {className: "col-md-12"} , H.div {className: "col-md-12"}
[ pageLayout { corpusId [ pageLayout { cacheState
, corpusId
, frontends , frontends
, key: "docView-" <> (show $ fst cacheState)
, listId , listId
, nodeId , nodeId
, params , params
...@@ -198,20 +220,6 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where ...@@ -198,20 +220,6 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt where
, tabType , tabType
, totalRecords , totalRecords
} ] ] ] } ] ] ]
-- onClickTrashAll nodeId _ = do
-- launchAff $ deleteAllDocuments p.session nodeId
{-, H.div {className: "col-md-1 col-md-offset-11"}
[ pageLayout p.session params {nodeId, totalRecords, tabType, listId, corpusId, query: fst query} ]
, H.div {className: "col-md-1 col-md-offset-11"}
[ H.button { className: "btn"
, style: {backgroundColor: "peru", color : "white", border : "white"}
, on: { click: onClickTrashAll nodeId } }
[ H.i {className: "glyphitem glyphicon glyphicon-trash"} []
, H.text "Trash all"
]
]
-}
searchBar :: R.State Query -> R.Element searchBar :: R.State Query -> R.Element
searchBar (query /\ setQuery) = R.createElement el {} [] searchBar (query /\ setQuery) = R.createElement el {} []
...@@ -259,9 +267,9 @@ mock :: Boolean ...@@ -259,9 +267,9 @@ mock :: Boolean
mock = false mock = false
type PageParams = type PageParams =
{ nodeId :: Int { corpusId :: Maybe Int
, listId :: Int , listId :: Int
, corpusId :: Maybe Int , nodeId :: Int
, tabType :: TabType , tabType :: TabType
, query :: Query , query :: Query
, params :: T.Params} , params :: T.Params}
...@@ -270,7 +278,7 @@ getPageHash :: Session -> PageParams -> Aff String ...@@ -270,7 +278,7 @@ getPageHash :: Session -> PageParams -> Aff String
getPageHash session { corpusId, listId, nodeId, query, tabType } = do getPageHash session { corpusId, listId, nodeId, query, tabType } = do
(get session $ tableHashRoute nodeId tabType) :: Aff String (get session $ tableHashRoute nodeId tabType) :: Aff String
convOrderBy :: Maybe (T.OrderByDirection T.ColumnName) -> Maybe OrderBy
convOrderBy (Just (T.ASC (T.ColumnName "Date"))) = Just DateAsc convOrderBy (Just (T.ASC (T.ColumnName "Date"))) = Just DateAsc
convOrderBy (Just (T.DESC (T.ColumnName "Date"))) = Just DateDesc convOrderBy (Just (T.DESC (T.ColumnName "Date"))) = Just DateDesc
convOrderBy (Just (T.ASC (T.ColumnName "Title"))) = Just TitleAsc convOrderBy (Just (T.ASC (T.ColumnName "Title"))) = Just TitleAsc
...@@ -302,21 +310,8 @@ pageLayout props = R.createElement pageLayoutCpt props [] ...@@ -302,21 +310,8 @@ pageLayout props = R.createElement pageLayoutCpt props []
pageLayoutCpt :: R.Component PageLayoutProps pageLayoutCpt :: R.Component PageLayoutProps
pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt where pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt where
cpt props@{ corpusId, frontends, listId, nodeId, params, query, session, tabType } _ = cpt props@{ cacheState, corpusId, frontends, listId, nodeId, params, query, session, tabType } _ = do
useLoaderWithCacheAPI { let path = { corpusId, listId, nodeId, params, query, tabType }
cacheEndpoint: getPageHash session
, handleResponse
, mkRequest
, path
, renderer: paint
}
where
path = { corpusId, listId, nodeId, params, query, tabType }
paint (Tuple count docs) = page params (props { totalRecords = count }) docs
mkRequest :: PageParams -> GUC.Request
mkRequest p@{ listId, nodeId, tabType } =
GUC.makeGetRequest session $ tableRoute nodeId tabType listId
handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView) handleResponse :: HashedResponse (TableResult Response) -> Tuple Int (Array DocumentsView)
handleResponse (HashedResponse { hash, value: res }) = ret handleResponse (HashedResponse { hash, value: res }) = ret
where where
...@@ -325,7 +320,32 @@ pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt where ...@@ -325,7 +320,32 @@ pageLayoutCpt = R.hooksComponentWithModule thisModule "pageLayout" cpt where
--Tuple 0 (take limit $ drop offset sampleData) --Tuple 0 (take limit $ drop offset sampleData)
Tuple 0 sampleData Tuple 0 sampleData
else else
Tuple (A.length docs) docs Tuple res.count docs
case cacheState of
(NT.CacheOn /\ _) -> do
let paint (Tuple count docs) = page params (props { totalRecords = count }) docs
mkRequest :: PageParams -> GUC.Request
mkRequest p = GUC.makeGetRequest session $ tableRoute p
useLoaderWithCacheAPI {
cacheEndpoint: getPageHash session
, handleResponse
, mkRequest
, path
, renderer: paint
}
(NT.CacheOff /\ _) -> do
localCategories <- R.useState' (mempty :: LocalCategories)
paramsS <- R.useState' params
let loader p = do
res <- get session $ tableRouteWithPage (p { params = fst paramsS, query = query })
pure $ handleResponse res
render (Tuple count documents) = pagePaintRaw { documents
, layout: props { params = fst paramsS
, totalRecords = count }
, localCategories
, params: paramsS }
useLoader (path { params = fst paramsS }) loader render
type PageProps = ( type PageProps = (
documents :: Array DocumentsView documents :: Array DocumentsView
...@@ -353,8 +373,38 @@ pagePaint props = R.createElement pagePaintCpt props [] ...@@ -353,8 +373,38 @@ pagePaint props = R.createElement pagePaintCpt props []
pagePaintCpt :: R.Component PagePaintProps pagePaintCpt :: R.Component PagePaintProps
pagePaintCpt = R.hooksComponentWithModule thisModule "pagePaintCpt" cpt where pagePaintCpt = R.hooksComponentWithModule thisModule "pagePaintCpt" cpt where
cpt { layout: { corpusId, frontends, listId, nodeId, session, totalRecords }, documents, params } _ = do cpt { documents, layout, params } _ = do
localCategories <- R.useState' (mempty :: LocalCategories) localCategories <- R.useState' (mempty :: LocalCategories)
pure $ pagePaintRaw { documents: A.fromFoldable filteredRows, layout, localCategories, params }
where
orderWith =
case convOrderBy (fst params).orderBy of
Just DateAsc -> sortWith \(DocumentsView { date }) -> date
Just DateDesc -> sortWith \(DocumentsView { date }) -> Down date
Just SourceAsc -> sortWith \(DocumentsView { source }) -> Str.toLower source
Just SourceDesc -> sortWith \(DocumentsView { source }) -> Down $ Str.toLower source
Just TitleAsc -> sortWith \(DocumentsView { title }) -> Str.toLower title
Just TitleDesc -> sortWith \(DocumentsView { title }) -> Down $ Str.toLower title
_ -> identity -- the server ordering is enough here
filteredRows = T.filterRows { params: fst params } $ orderWith $ A.toUnfoldable documents
type PagePaintRawProps = (
documents :: Array DocumentsView
, layout :: Record PageLayoutProps
, localCategories :: R.State LocalCategories
, params :: R.State T.Params
)
pagePaintRaw :: Record PagePaintRawProps -> R.Element
pagePaintRaw props = R.createElement pagePaintRawCpt props []
pagePaintRawCpt :: R.Component PagePaintRawProps
pagePaintRawCpt = R.hooksComponentWithModule thisModule "pagePaintRawCpt" cpt where
cpt { documents
, layout: { corpusId, frontends, listId, nodeId, session, totalRecords }
, localCategories
, params } _ = do
pure $ T.table pure $ T.table
{ colNames { colNames
, container: T.defaultContainer { title: "Documents" } , container: T.defaultContainer { title: "Documents" }
...@@ -375,17 +425,7 @@ pagePaintCpt = R.hooksComponentWithModule thisModule "pagePaintCpt" cpt where ...@@ -375,17 +425,7 @@ pagePaintCpt = R.hooksComponentWithModule thisModule "pagePaintCpt" cpt where
colNames = T.ColumnName <$> [ "Tag", "Date", "Title", "Source"] colNames = T.ColumnName <$> [ "Tag", "Date", "Title", "Source"]
wrapColElts = const identity wrapColElts = const identity
getCategory (localCategories /\ _) {_id, category} = fromMaybe category (localCategories ^. at _id) getCategory (localCategories /\ _) {_id, category} = fromMaybe category (localCategories ^. at _id)
orderWith = rows localCategories = row <$> A.toUnfoldable documents
case convOrderBy (fst params).orderBy of
Just DateAsc -> Seq.sortWith \(DocumentsView { date }) -> date
Just DateDesc -> Seq.sortWith \(DocumentsView { date }) -> Down date
Just SourceAsc -> Seq.sortWith \(DocumentsView { source }) -> Str.toLower source
Just SourceDesc -> Seq.sortWith \(DocumentsView { source }) -> Down $ Str.toLower source
Just TitleAsc -> Seq.sortWith \(DocumentsView { title }) -> Str.toLower title
Just TitleDesc -> Seq.sortWith \(DocumentsView { title }) -> Down $ Str.toLower title
_ -> identity -- the server ordering is enough here
filteredRows = T.filterRows { params: fst params } $ orderWith $ A.toUnfoldable documents
rows localCategories = row <$> filteredRows
where where
row (DocumentsView r) = row (DocumentsView r) =
{ row: { row:
...@@ -445,12 +485,30 @@ instance encodeJsonSQuery :: EncodeJson SearchQuery where ...@@ -445,12 +485,30 @@ instance encodeJsonSQuery :: EncodeJson SearchQuery where
documentsRoute :: Int -> SessionRoute documentsRoute :: Int -> SessionRoute
documentsRoute nodeId = NodeAPI Node (Just nodeId) "documents" documentsRoute nodeId = NodeAPI Node (Just nodeId) "documents"
tableRoute :: Int -> TabType -> Int -> SessionRoute tableRoute :: forall row. {nodeId :: Int, tabType :: TabType, listId :: Int | row} -> SessionRoute
tableRoute nodeId tabType listId = NodeAPI Node (Just nodeId) $ "table" <> "?tabType=" <> (showTabType' tabType) <> "&list=" <> (show listId) tableRoute {nodeId, tabType, listId} = NodeAPI Node (Just nodeId) $ "table" <> "?tabType=" <> (showTabType' tabType) <> "&list=" <> (show listId)
tableHashRoute :: Int -> TabType -> SessionRoute tableHashRoute :: Int -> TabType -> SessionRoute
tableHashRoute nodeId tabType = NodeAPI Node (Just nodeId) $ "table/hash" <> "?tabType=" <> (showTabType' tabType) tableHashRoute nodeId tabType = NodeAPI Node (Just nodeId) $ "table/hash" <> "?tabType=" <> (showTabType' tabType)
tableRouteWithPage :: forall row.
{ listId :: Int
, nodeId :: Int
, params :: T.Params
, query :: Query
, tabType :: TabType
| row } -> SessionRoute
tableRouteWithPage { listId, nodeId, params: { limit, offset, orderBy, searchType }, query, tabType } =
NodeAPI Node (Just nodeId) $ "table" <> joinQueryStrings [tt, lst, lmt, odb, ofs, st, q]
where
lmt = queryParam "limit" limit
lst = queryParam "list" listId
ofs = queryParam "offset" offset
odb = mQueryParamS "orderBy" T.orderByToForm orderBy
st = queryParam "searchType" searchType
tt = queryParamS "tabType" (showTabType' tabType)
q = queryParamS "query" query
deleteAllDocuments :: Session -> Int -> Aff (Array Int) deleteAllDocuments :: Session -> Int -> Aff (Array Int)
deleteAllDocuments session = delete session <<< documentsRoute deleteAllDocuments session = delete session <<< documentsRoute
......
...@@ -6,6 +6,9 @@ import Data.Maybe (Maybe(..)) ...@@ -6,6 +6,9 @@ import Data.Maybe (Maybe(..))
import Data.Set as Set import Data.Set as Set
import Data.Tuple (fst, snd) import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
import Gargantext.AsyncTasks as GAT import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest.Tree (treeView) import Gargantext.Components.Forest.Tree (treeView)
import Gargantext.Ends (Frontends, Backend(..)) import Gargantext.Ends (Frontends, Backend(..))
...@@ -14,19 +17,19 @@ import Gargantext.Routes (AppRoute) ...@@ -14,19 +17,19 @@ import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions) import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Reload, Handed(..)) import Gargantext.Types (Reload, Handed(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
thisModule :: String
thisModule = "Gargantext.Components.Forest" thisModule = "Gargantext.Components.Forest"
type Props = type Props =
( frontends :: Frontends ( asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, handed :: Handed , handed :: Handed
, reload :: R.State Int , reload :: R.State Int
, route :: AppRoute , route :: AppRoute
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.Setter Boolean , showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
) )
forest :: Record Props -> R.Element forest :: Record Props -> R.Element
...@@ -34,11 +37,10 @@ forest props = R.createElement forestCpt props [] ...@@ -34,11 +37,10 @@ forest props = R.createElement forestCpt props []
forestCpt :: R.Component Props forestCpt :: R.Component Props
forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
cpt { frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do cpt { asyncTasks, frontends, handed, reload: extReload, route, sessions, showLogin, backend} _ = do
-- NOTE: this is a hack to reload the tree view on demand -- NOTE: this is a hack to reload the tree view on demand
reload <- R.useState' (0 :: Reload) reload <- R.useState' (0 :: Reload)
openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: OpenNodes) openNodes <- R2.useLocalStorageState R2.openNodesKey (Set.empty :: OpenNodes)
asyncTasks <- R2.useLocalStorageState GAT.localStorageKey GAT.empty
R2.useCache R2.useCache
( frontends ( frontends
/\ route /\ route
...@@ -46,7 +48,7 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where ...@@ -46,7 +48,7 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
/\ fst openNodes /\ fst openNodes
/\ fst extReload /\ fst extReload
/\ fst reload /\ fst reload
/\ fst asyncTasks /\ (fst asyncTasks).storage
/\ handed /\ handed
) )
(cpt' openNodes asyncTasks reload showLogin backend) (cpt' openNodes asyncTasks reload showLogin backend)
...@@ -55,21 +57,18 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where ...@@ -55,21 +57,18 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
where where
trees = tree <$> unSessions sessions trees = tree <$> unSessions sessions
tree s@(Session {treeId}) = tree s@(Session {treeId}) =
treeView { root: treeId treeView { asyncTasks
, asyncTasks
, frontends , frontends
, handed , handed
, mCurrentRoute: Just route , mCurrentRoute: Just route
, openNodes , openNodes
, reload , reload
, root: treeId
, session: s , session: s
} }
plus :: Handed -> R.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 plus handed showLogin backend = H.div { className: handedClass } [
then "flex-start" -- TODO we should use lefthanded SASS class here
else "flex-end"
} [
H.button { title: "Add or remove connections to the server(s)." H.button { title: "Add or remove connections to the server(s)."
, on: {click} , on: {click}
, className: "btn btn-default" , className: "btn btn-default"
...@@ -85,5 +84,10 @@ plus handed showLogin backend = H.div {className: if handed == RightHanded ...@@ -85,5 +84,10 @@ plus handed showLogin backend = H.div {className: if handed == RightHanded
-- TODO same as the one in the Login Modal (same CSS) -- TODO same as the one in the Login Modal (same CSS)
-- [ H.i { className: "material-icons md-36"} [] ] -- [ H.i { className: "material-icons md-36"} [] ]
where where
handedClass = if handed == RightHanded then
"flex-start" -- TODO we should use lefthanded SASS class here
else
"flex-end"
click _ = (snd backend) (const Nothing) click _ = (snd backend) (const Nothing)
*> showLogin (const true) *> showLogin (const true)
...@@ -28,7 +28,6 @@ import Gargantext.Components.Forest.Tree.Node.Action.Contact as Contact ...@@ -28,7 +28,6 @@ import Gargantext.Components.Forest.Tree.Node.Action.Contact as Contact
import Gargantext.Components.Forest.Tree.Node.Action.Update (updateRequest) import Gargantext.Components.Forest.Tree.Node.Action.Update (updateRequest)
import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFile, uploadArbitraryFile) import Gargantext.Components.Forest.Tree.Node.Action.Upload (uploadFile, uploadArbitraryFile)
import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..)) import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTree(..))
import Gargantext.Components.Forest.Tree.Node.Tools.Task (Tasks, tasksStruct)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==), (<<<), not) import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==), (<<<), not)
...@@ -44,16 +43,16 @@ thisModule = "Gargantext.Components.Forest.Tree" ...@@ -44,16 +43,16 @@ thisModule = "Gargantext.Components.Forest.Tree"
------------------------------------------------------------------------ ------------------------------------------------------------------------
type CommonProps = type CommonProps =
( frontends :: Frontends ( frontends :: Frontends
, handed :: GT.Handed
, mCurrentRoute :: Maybe AppRoute , mCurrentRoute :: Maybe AppRoute
, openNodes :: R.State OpenNodes , openNodes :: R.State OpenNodes
, reload :: R.State Reload , reload :: R.State Reload
, session :: Session , session :: Session
, handed :: GT.Handed
) )
------------------------------------------------------------------------ ------------------------------------------------------------------------
type Props = ( root :: ID type Props = ( asyncTasks :: GAT.Reductor
, asyncTasks :: R.State GAT.Storage , root :: ID
| CommonProps | CommonProps
) )
...@@ -63,22 +62,22 @@ treeView props = R.createElement treeViewCpt props [] ...@@ -63,22 +62,22 @@ treeView props = R.createElement treeViewCpt props []
treeViewCpt :: R.Component Props treeViewCpt :: R.Component Props
treeViewCpt = R.hooksComponentWithModule thisModule "treeView" cpt treeViewCpt = R.hooksComponentWithModule thisModule "treeView" cpt
where where
cpt { root cpt { asyncTasks
, asyncTasks
, frontends , frontends
, handed , handed
, mCurrentRoute , mCurrentRoute
, openNodes , openNodes
, reload , reload
, root
, session , session
} _children = pure } _children = pure
$ treeLoadView { root $ treeLoadView { asyncTasks
, asyncTasks
, frontends , frontends
, handed , handed
, mCurrentRoute , mCurrentRoute
, openNodes , openNodes
, reload , reload
, root
, session , session
} }
...@@ -88,13 +87,13 @@ treeLoadView p = R.createElement treeLoadViewCpt p [] ...@@ -88,13 +87,13 @@ treeLoadView p = R.createElement treeLoadViewCpt p []
treeLoadViewCpt :: R.Component Props treeLoadViewCpt :: R.Component Props
treeLoadViewCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt treeLoadViewCpt = R.hooksComponentWithModule thisModule "treeLoadView" cpt
where where
cpt { root cpt { asyncTasks
, asyncTasks
, frontends , frontends
, handed , handed
, mCurrentRoute , mCurrentRoute
, openNodes , openNodes
, reload , reload
, root
, session , session
} _children = do } _children = do
let fetch _ = getNodeTree session root let fetch _ = getNodeTree session root
...@@ -105,7 +104,7 @@ treeLoadView p = R.createElement treeLoadViewCpt p [] ...@@ -105,7 +104,7 @@ treeLoadView p = R.createElement treeLoadViewCpt p []
, openNodes , openNodes
, reload , reload
, session , session
, tasks: tasksStruct root asyncTasks reload -- , tasks: tasksStruct root asyncTasks reload
, tree: loaded , tree: loaded
} }
useLoader { root, counter: fst reload } fetch paint useLoader { root, counter: fst reload } fetch paint
...@@ -115,9 +114,8 @@ getNodeTree :: Session -> GT.ID -> Aff FTree ...@@ -115,9 +114,8 @@ getNodeTree :: Session -> GT.ID -> Aff FTree
getNodeTree session nodeId = get session $ GR.NodeAPI GT.Tree (Just nodeId) "" getNodeTree session nodeId = get session $ GR.NodeAPI GT.Tree (Just nodeId) ""
-------------- --------------
type TreeViewProps = ( asyncTasks :: R.State GAT.Storage type TreeViewProps = ( asyncTasks :: GAT.Reductor
, tree :: FTree , tree :: FTree
, tasks :: Record Tasks
| CommonProps | CommonProps
) )
...@@ -134,7 +132,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -134,7 +132,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, openNodes , openNodes
, reload , reload
, session , session
, tasks -- , tasks
, tree , tree
} _ = pure $ H.ul { className: "tree" } _ = pure $ H.ul { className: "tree"
} }
...@@ -149,7 +147,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -149,7 +147,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
, openNodes , openNodes
, reload , reload
, session , session
, tasks -- , tasks
, tree , tree
} }
] ]
...@@ -159,8 +157,8 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p [] ...@@ -159,8 +157,8 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
type ToHtmlProps = type ToHtmlProps =
( asyncTasks :: R.State GAT.Storage ( asyncTasks :: GAT.Reductor
, tasks :: Record Tasks -- , tasks :: Record Tasks
, tree :: FTree , tree :: FTree
| CommonProps | CommonProps
) )
...@@ -173,22 +171,25 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt ...@@ -173,22 +171,25 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt
where where
cpt p@{ asyncTasks cpt p@{ asyncTasks
, frontends , frontends
, handed
, mCurrentRoute , mCurrentRoute
, openNodes , openNodes
, reload: reload@(_ /\ setReload) , reload: reload@(_ /\ setReload)
, session , session
, tasks: tasks@{ onTaskAdd -- , tasks: tasks@{ onTaskAdd
, onTaskFinish -- , onTaskFinish
, tasks: tasks' -- , tasks: tasks'
} -- }
, tree: tree@(NTree (LNode { id , tree: tree@(NTree (LNode { id
, name , name
, nodeType , nodeType
} }
) ary ) ary
) )
, handed
} _ = do } _ = do
let commonProps = RecordE.pick p :: Record CommonProps
let pAction a = performAction a (RecordE.pick p :: Record PerformActionProps)
let nodeId = mkNodeId session id let nodeId = mkNodeId session id
let folderIsOpen = Set.member nodeId (fst openNodes) let folderIsOpen = Set.member nodeId (fst openNodes)
let setFn = if folderIsOpen then Set.delete else Set.insert let setFn = if folderIsOpen then Set.delete else Set.insert
...@@ -198,17 +199,19 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt ...@@ -198,17 +199,19 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt
let withId (NTree (LNode {id: id'}) _) = id' let withId (NTree (LNode {id: id'}) _) = id'
pure $ H.li { className: if A.null ary then "no-children" else "with-children" } $ pure $ H.li { className: if A.null ary then "no-children" else "with-children" } $
[ nodeMainSpan (A.null ary) [ nodeMainSpan
{ id { asyncTasks
, dispatch: pAction , dispatch: pAction
, folderOpen , folderOpen
, frontends , frontends
, handed , handed
, id
, isLeaf: A.null ary
, mCurrentRoute , mCurrentRoute
, name , name
, nodeType , nodeType
, session , session
, tasks -- , tasks
} ] } ]
<> childNodes ( Record.merge commonProps <> childNodes ( Record.merge commonProps
{ asyncTasks { asyncTasks
...@@ -228,7 +231,7 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt ...@@ -228,7 +231,7 @@ toHtmlCpt = R.hooksComponentWithModule thisModule "toHtml" cpt
type ChildNodesProps = type ChildNodesProps =
( asyncTasks :: R.State GAT.Storage ( asyncTasks :: GAT.Reductor
, children :: Array FTree , children :: Array FTree
, folderOpen :: R.State Boolean , folderOpen :: R.State Boolean
| CommonProps | CommonProps
...@@ -241,7 +244,7 @@ childNodes props@{ asyncTasks, children, reload, handed } = ...@@ -241,7 +244,7 @@ childNodes props@{ asyncTasks, children, reload, handed } =
map (\ctree@(NTree (LNode {id}) _) -> H.ul {} [ map (\ctree@(NTree (LNode {id}) _) -> H.ul {} [
toHtml (Record.merge commonProps { asyncTasks toHtml (Record.merge commonProps { asyncTasks
, handed , handed
, tasks: tasksStruct id asyncTasks reload -- , tasks: tasksStruct id asyncTasks reload
, tree: ctree , tree: ctree
} }
)] )]
...@@ -252,10 +255,11 @@ childNodes props@{ asyncTasks, children, reload, handed } = ...@@ -252,10 +255,11 @@ childNodes props@{ asyncTasks, children, reload, handed } =
sorted = A.sortWith (\(NTree (LNode {id}) _) -> id) sorted = A.sortWith (\(NTree (LNode {id}) _) -> id)
type PerformActionProps = type PerformActionProps =
( openNodes :: R.State OpenNodes ( asyncTasks :: GAT.Reductor
, openNodes :: R.State OpenNodes
, reload :: R.State Reload , reload :: R.State Reload
, session :: Session , session :: Session
, tasks :: Record Tasks -- , tasks :: Record Tasks
, tree :: FTree , tree :: FTree
) )
...@@ -278,24 +282,23 @@ performAction (DeleteNode nt) p@{ openNodes: (_ /\ setOpenNodes) ...@@ -278,24 +282,23 @@ performAction (DeleteNode nt) p@{ openNodes: (_ /\ setOpenNodes)
performAction RefreshTree p performAction RefreshTree p
------- -------
performAction (DoSearch task) { reload: (_ /\ setReload) performAction (DoSearch task) { asyncTasks: (_ /\ dispatch)
, session , session
, tasks: { onTaskAdd }
, tree: (NTree (LNode {id}) _) , tree: (NTree (LNode {id}) _)
} = } =
do do
liftEffect $ onTaskAdd task liftEffect $ dispatch $ GAT.Insert id task
liftEffect $ log2 "[performAction] DoSearch task:" task liftEffect $ log2 "[performAction] DoSearch task:" task
------- -------
performAction (UpdateNode params) { reload: (_ /\ setReload) performAction (UpdateNode params) { asyncTasks: (_ /\ dispatch)
, session , session
, tasks: {onTaskAdd} -- , tasks: {onTaskAdd}
, tree: (NTree (LNode {id}) _) , tree: (NTree (LNode {id}) _)
} = } =
do do
task <- updateRequest params session id task <- updateRequest params session id
liftEffect $ onTaskAdd task liftEffect $ dispatch $ GAT.Insert id task
liftEffect $ log2 "[performAction] UpdateNode task:" task liftEffect $ log2 "[performAction] UpdateNode task:" task
...@@ -348,22 +351,22 @@ performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes) ...@@ -348,22 +351,22 @@ performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes)
performAction RefreshTree p performAction RefreshTree p
------- -------
performAction (UploadFile nodeType fileType mName blob) { session performAction (UploadFile nodeType fileType mName blob) { asyncTasks: (_ /\ dispatch)
, tasks: { onTaskAdd } , session
, tree: (NTree (LNode {id}) _) , tree: (NTree (LNode {id}) _)
} = } =
do do
task <- uploadFile session nodeType id fileType {mName, blob} task <- uploadFile session nodeType id fileType {mName, blob}
liftEffect $ onTaskAdd task liftEffect $ dispatch $ GAT.Insert id task
liftEffect $ log2 "Uploaded, task:" task liftEffect $ log2 "Uploaded, task:" task
performAction (UploadArbitraryFile mName blob) { session performAction (UploadArbitraryFile mName blob) { asyncTasks: (_ /\ dispatch)
, tasks: { onTaskAdd } , session
, tree: (NTree (LNode {id}) _) , tree: (NTree (LNode {id}) _)
} = } =
do do
task <- uploadArbitraryFile session id { blob, mName } task <- uploadArbitraryFile session id { blob, mName }
liftEffect $ onTaskAdd task liftEffect $ dispatch $ GAT.Insert id task
liftEffect $ log2 "Uploaded, task:" task liftEffect $ log2 "Uploaded, task:" task
------- -------
......
...@@ -10,6 +10,9 @@ import React.SyntheticEvent as E ...@@ -10,6 +10,9 @@ import React.SyntheticEvent as E
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox) import Gargantext.Components.Forest.Tree.Node.Settings (SettingsBox(..), settingsBox)
import Gargantext.Components.Forest.Tree.Node.Action (Action(..)) import Gargantext.Components.Forest.Tree.Node.Action (Action(..))
import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..), UploadFileBlob(..)) import Gargantext.Components.Forest.Tree.Node.Action.Upload.Types (FileType(..), UploadFileBlob(..))
...@@ -17,7 +20,6 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (DroppedFile(..), fi ...@@ -17,7 +20,6 @@ import Gargantext.Components.Forest.Tree.Node.Action.Upload (DroppedFile(..), fi
import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView) import Gargantext.Components.Forest.Tree.Node.Box (nodePopupView)
import Gargantext.Components.Forest.Tree.Node.Box.Types (CommonProps) import Gargantext.Components.Forest.Tree.Node.Box.Types (CommonProps)
import Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar (asyncProgressBar, BarType(..)) import Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar (asyncProgressBar, BarType(..))
import Gargantext.Components.Forest.Tree.Node.Tools.Task (Tasks)
import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList) import Gargantext.Components.Forest.Tree.Node.Tools.Sync (nodeActionsGraph, nodeActionsNodeList)
import Gargantext.Components.Forest.Tree.Node.Tools (nodeLink) import Gargantext.Components.Forest.Tree.Node.Tools (nodeLink)
import Gargantext.Components.GraphExplorer.API as GraphAPI import Gargantext.Components.GraphExplorer.API as GraphAPI
...@@ -25,7 +27,6 @@ import Gargantext.Components.Lang (Lang(EN)) ...@@ -25,7 +27,6 @@ import Gargantext.Components.Lang (Lang(EN))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild) import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (Unit, bind, const, discard, map, pure, show, unit, void, ($), (<>), (==), identity)
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Version as GV import Gargantext.Version as GV
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, sessionId)
...@@ -34,30 +35,44 @@ import Gargantext.Types as GT ...@@ -34,30 +35,44 @@ import Gargantext.Types as GT
import Gargantext.Utils.Popover as Popover import Gargantext.Utils.Popover as Popover
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node" thisModule = "Gargantext.Components.Forest.Tree.Node"
-- Main Node -- Main Node
type NodeMainSpanProps = type NodeMainSpanProps =
( id :: ID ( asyncTasks :: GAT.Reductor
, folderOpen :: R.State Boolean , folderOpen :: R.State Boolean
, frontends :: Frontends , frontends :: Frontends
, id :: ID
, isLeaf :: IsLeaf
, mCurrentRoute :: Maybe Routes.AppRoute , mCurrentRoute :: Maybe Routes.AppRoute
, name :: Name , name :: Name
, nodeType :: GT.NodeType , nodeType :: GT.NodeType
, tasks :: Record Tasks
| CommonProps | CommonProps
) )
type IsLeaf = Boolean type IsLeaf = Boolean
nodeMainSpan :: IsLeaf nodeMainSpan :: Record NodeMainSpanProps
-> Record NodeMainSpanProps
-> R.Element -> R.Element
nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p [] nodeMainSpan p = R.createElement nodeMainSpanCpt p []
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
where where
el = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt cpt props@{ asyncTasks: (asyncTasks /\ dispatchAsyncTasks)
cpt props@{ id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks } } _ = do , dispatch
, folderOpen
, frontends
, handed
, id
, isLeaf
, mCurrentRoute
, name
, nodeType
, session
} _ = do
-- only 1 popup at a time is allowed to be opened -- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile) droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
isDragOver <- R.useState' false isDragOver <- R.useState' false
...@@ -69,28 +84,30 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c ...@@ -69,28 +84,30 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
GT.LeftHanded -> reverse GT.LeftHanded -> reverse
GT.RightHanded -> identity GT.RightHanded -> identity
let isSelected = mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id
pure $ H.span (dropProps droppedFile isDragOver) pure $ H.span (dropProps droppedFile isDragOver)
$ ordering $ ordering
[ folderIcon nodeType folderOpen [ folderIcon nodeType folderOpen
, chevronIcon isLeaf handed nodeType folderOpen , chevronIcon isLeaf handed nodeType folderOpen
, nodeLink { frontends , nodeLink { frontends
, id , handed
, folderOpen , folderOpen
, isSelected: mCurrentRoute == Routes.nodeTypeAppRoute nodeType (sessionId session) id , id
, isSelected
, name: name' props , name: name' props
, nodeType , nodeType
, session , session
, handed
} }
, fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType } , fileTypeView { dispatch, droppedFile, id, isDragOver, nodeType }
, H.div {} (map (\t -> asyncProgressBar { asyncTask: t , H.div {} (map (\t -> asyncProgressBar { asyncTask: t
, barType: Pie , barType: Pie
, corpusId: id , nodeId: id
, onFinish: const $ onTaskFinish t , onFinish: const $ dispatchAsyncTasks $ GAT.Remove id t
, session , session
} }
) tasks ) $ GAT.getTasks asyncTasks id
) )
, if nodeType == GT.NodeUser , if nodeType == GT.NodeUser
then GV.versionView {session} then GV.versionView {session}
...@@ -120,16 +137,24 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c ...@@ -120,16 +137,24 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
SettingsBox {show: showBox} = settingsBox nodeType SettingsBox {show: showBox} = settingsBox nodeType
onPopoverClose popoverRef _ = Popover.setOpen popoverRef false onPopoverClose popoverRef _ = Popover.setOpen popoverRef false
name' {name, nodeType} = if nodeType == GT.NodeUser name' {name, nodeType} = if nodeType == GT.NodeUser then show session else name
then show session
else name
chevronIcon isLeaf handed' nodeType folderOpen'@(open /\ _) = mNodePopupView props@{id, nodeType} onPopoverClose =
nodePopupView { dispatch
, handed : props.handed
, id
, name: name' props
, nodeType
, onPopoverClose
, session
}
chevronIcon isLeaf handed' nodeType (open /\ setOpen) =
if isLeaf if isLeaf
then H.div {} [] then H.div {} []
else else
H.a { className: "chevron-icon" H.a { className: "chevron-icon"
, onClick: R2.effToggler folderOpen' , on: { click: \_ -> setOpen $ not }
} }
[ H.i { [ H.i {
className: if open className: if open
...@@ -139,9 +164,9 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c ...@@ -139,9 +164,9 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
else "fa fa-chevron-left" else "fa fa-chevron-left"
} [] ] } [] ]
folderIcon nodeType folderOpen'@(open /\ _) = folderIcon nodeType (open /\ setOpen) =
H.a { className: "folder-icon" H.a { className: "folder-icon"
, onClick: R2.effToggler folderOpen' , on: { click: \_ -> setOpen $ not }
} [ } [
H.i {className: GT.fldr nodeType open} [] H.i {className: GT.fldr nodeType open} []
] ]
...@@ -151,16 +176,6 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c ...@@ -151,16 +176,6 @@ nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.c
<> "Click here to execute one of them." <> "Click here to execute one of them."
} [] } []
mNodePopupView props@{id, nodeType} onPopoverClose =
nodePopupView { id
, dispatch
, name: name' props
, nodeType
, onPopoverClose
, session
, handed : props.handed
}
dropProps droppedFile isDragOver = dropProps droppedFile isDragOver =
{ className: "leaf " <> (dropClass droppedFile isDragOver) { className: "leaf " <> (dropClass droppedFile isDragOver)
, on: { drop: dropHandler droppedFile , on: { drop: dropHandler droppedFile
......
...@@ -126,6 +126,7 @@ settingsBox Team = ...@@ -126,6 +126,7 @@ settingsBox Team =
, Annuaire , Annuaire
, NodeFrameWrite , NodeFrameWrite
, NodeFrameCalc , NodeFrameCalc
, NodeFrameNotebook
] ]
, Share , Share
, Delete , Delete
...@@ -316,6 +317,22 @@ settingsBox NodeFrameCalc = ...@@ -316,6 +317,22 @@ settingsBox NodeFrameCalc =
] ]
} }
settingsBox NodeFrameNotebook =
SettingsBox { show : true
, edit : true
, doc : Documentation NodeFrameNotebook
, buttons : [ Add [ NodeFrameCalc
, NodeFrameWrite
, NodeFrameNotebook
]
, Move moveFrameParameters
, Delete
]
}
settingsBox NodeFile = settingsBox NodeFile =
SettingsBox { show: true SettingsBox { show: true
......
...@@ -283,7 +283,15 @@ nodeLink p = R.createElement nodeLinkCpt p [] ...@@ -283,7 +283,15 @@ nodeLink p = R.createElement nodeLinkCpt p []
nodeLinkCpt :: R.Component NodeLinkProps nodeLinkCpt :: R.Component NodeLinkProps
nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt nodeLinkCpt = R.hooksComponentWithModule thisModule "nodeLink" cpt
where where
cpt { frontends, id, isSelected, name, nodeType, session, handed, folderOpen} _ = do cpt { folderOpen: (_ /\ setFolderOpen)
, frontends
, handed
, id
, isSelected
, name
, nodeType
, session
} _ = do
popoverRef <- R.useRef null popoverRef <- R.useRef null
pure $ pure $
......
...@@ -16,15 +16,16 @@ import Gargantext.Sessions (Session, get) ...@@ -16,15 +16,16 @@ import Gargantext.Sessions (Session, get)
import Gargantext.Types as GT import Gargantext.Types as GT
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar" thisModule = "Gargantext.Components.Forest.Tree.Node.Tools.ProgressBar"
data BarType = Bar | Pie data BarType = Bar | Pie
type Props = type Props = (
( asyncTask :: GT.AsyncTaskWithType asyncTask :: GT.AsyncTaskWithType
, barType :: BarType , barType :: BarType
, corpusId :: GT.ID , nodeId :: GT.ID
, onFinish :: Unit -> Effect Unit , onFinish :: Unit -> Effect Unit
, session :: Session , session :: Session
) )
...@@ -38,7 +39,7 @@ asyncProgressBarCpt = R.hooksComponentWithModule thisModule "asyncProgressBar" c ...@@ -38,7 +39,7 @@ asyncProgressBarCpt = R.hooksComponentWithModule thisModule "asyncProgressBar" c
where where
cpt props@{ asyncTask: (GT.AsyncTaskWithType {task: GT.AsyncTask {id}}) cpt props@{ asyncTask: (GT.AsyncTaskWithType {task: GT.AsyncTask {id}})
, barType , barType
, corpusId , nodeId
, onFinish , onFinish
} _ = do } _ = do
(progress /\ setProgress) <- R.useState' 0.0 (progress /\ setProgress) <- R.useState' 0.0
...@@ -104,13 +105,14 @@ queryProgress :: Record Props -> Aff GT.AsyncProgress ...@@ -104,13 +105,14 @@ queryProgress :: Record Props -> Aff GT.AsyncProgress
queryProgress { asyncTask: GT.AsyncTaskWithType { task: GT.AsyncTask {id} queryProgress { asyncTask: GT.AsyncTaskWithType { task: GT.AsyncTask {id}
, typ , typ
} }
, corpusId , nodeId
, session , session
} = get session (p typ) } = get session (p typ)
where where
-- TODO refactor path -- TODO refactor path
p GT.UpdateNode = NodeAPI GT.Node (Just corpusId) $ path <> id <> "/poll?limit=1" p GT.UpdateNode = NodeAPI GT.Node (Just nodeId) $ path <> id <> "/poll?limit=1"
p _ = NodeAPI GT.Corpus (Just corpusId) $ path <> id <> "/poll?limit=1" p GT.UpdateNgramsCharts = NodeAPI GT.Node (Just nodeId) $ path <> id <> "/poll?limit=1"
p _ = NodeAPI GT.Corpus (Just nodeId) $ path <> id <> "/poll?limit=1"
path = GT.asyncTaskTypePath typ path = GT.asyncTaskTypePath typ
-- TODO wait route: take the result if failure then message -- TODO wait route: take the result if failure then message
...@@ -6,11 +6,12 @@ import Data.Map as Map ...@@ -6,11 +6,12 @@ import Data.Map as Map
import Data.Maybe (Maybe(..), maybe) import Data.Maybe (Maybe(..), maybe)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect (Effect) import Effect (Effect)
import Reactix as R
import Gargantext.AsyncTasks as GAT import Gargantext.AsyncTasks as GAT
import Gargantext.Prelude (Unit, discard, identity, ($), (+)) import Gargantext.Prelude (Unit, discard, identity, ($), (+))
import Gargantext.Types (Reload) import Gargantext.Types (Reload)
import Gargantext.Types as GT import Gargantext.Types as GT
import Reactix as R
type Tasks = type Tasks =
...@@ -20,19 +21,14 @@ type Tasks = ...@@ -20,19 +21,14 @@ type Tasks =
) )
tasksStruct :: Int tasksStruct :: Int
-> R.State GAT.Storage -> GAT.Reductor
-> R.State Reload -> R.State Reload
-> Record Tasks -> Record Tasks
tasksStruct id (asyncTasks /\ setAsyncTasks) (_ /\ setReload) = tasksStruct id ({ storage } /\ dispatch) (_ /\ setReload) =
{ onTaskAdd, onTaskFinish, tasks } { onTaskAdd, onTaskFinish, tasks }
where where
tasks = maybe [] identity $ Map.lookup id asyncTasks tasks = maybe [] identity $ Map.lookup id storage
onTaskAdd t = do onTaskAdd t = dispatch $ GAT.Insert id t
setReload (_ + 1)
setAsyncTasks $ Map.alter (maybe (Just [t])
$ (\ts -> Just $ A.cons t ts)) id
onTaskFinish t = do onTaskFinish t = dispatch $ GAT.Remove id t
setReload (_ + 1)
setAsyncTasks $ Map.alter (maybe Nothing $ (\ts -> Just $ GAT.removeTaskFromList ts t)) id
...@@ -235,7 +235,7 @@ sigmaSettings = ...@@ -235,7 +235,7 @@ sigmaSettings =
, defaultHoverLabelBGColor: "#fff" , defaultHoverLabelBGColor: "#fff"
, defaultHoverLabelColor: "#000" , defaultHoverLabelColor: "#000"
, defaultLabelColor: "#000" -- labels text color , defaultLabelColor: "#000" -- labels text color
, defaultLabelSize: 8.0 -- (old tina: showLabelsIfZoom) , defaultLabelSize: 15.0 -- (old tina: showLabelsIfZoom)
, defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default' , defaultNodeBorderColor : "#000" -- <- if nodeBorderColor = 'default'
, defaultNodeColor: "#FFF" , defaultNodeColor: "#FFF"
, doubleClickEnabled: false -- indicates whether or not the graph can be zoomed on double-click , doubleClickEnabled: false -- indicates whether or not the graph can be zoomed on double-click
......
...@@ -20,6 +20,7 @@ import Reactix as R ...@@ -20,6 +20,7 @@ import Reactix as R
import Reactix.DOM.HTML as RH import Reactix.DOM.HTML as RH
import Record as Record import Record as Record
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Forest (forest) import Gargantext.Components.Forest (forest)
import Gargantext.Components.Graph as Graph import Gargantext.Components.Graph as Graph
import Gargantext.Components.GraphExplorer.Controls as Controls import Gargantext.Components.GraphExplorer.Controls as Controls
...@@ -40,15 +41,16 @@ import Gargantext.Utils.Reactix as R2 ...@@ -40,15 +41,16 @@ import Gargantext.Utils.Reactix as R2
thisModule :: String thisModule :: String
thisModule = "Gargantext.Components.GraphExplorer" thisModule = "Gargantext.Components.GraphExplorer"
type LayoutProps = type LayoutProps = (
( frontends :: Frontends asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, graphId :: GET.GraphId , graphId :: GET.GraphId
, handed :: Types.Handed , handed :: Types.Handed
, mCurrentRoute :: AppRoute , mCurrentRoute :: AppRoute
, session :: Session , session :: Session
, sessions :: Sessions , sessions :: Sessions
, showLogin :: R.State Boolean , showLogin :: R.State Boolean
, backend :: R.State (Maybe Backend)
) )
type Props = type Props =
...@@ -90,7 +92,8 @@ explorer props = R.createElement explorerCpt props [] ...@@ -90,7 +92,8 @@ explorer props = R.createElement explorerCpt props []
explorerCpt :: R.Component Props explorerCpt :: R.Component Props
explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
where where
cpt props@{ frontends cpt props@{ asyncTasks
, frontends
, graph , graph
, graphId , graphId
, graphVersion , graphVersion
...@@ -154,14 +157,15 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -154,14 +157,15 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
[ inner handed [ inner handed
[ rowControls [ Controls.controls controls ] [ rowControls [ Controls.controls controls ]
, R2.row $ mainLayout handed $ , R2.row $ mainLayout handed $
tree { frontends tree { asyncTasks
, backend
, frontends
, handed , handed
, mCurrentRoute , mCurrentRoute
, reload: treeReload , reload: treeReload
, sessions , sessions
, show: fst controls.showTree , show: fst controls.showTree
, showLogin: snd showLogin , showLogin: snd showLogin }
, backend}
/\ /\
RH.div { ref: graphRef, id: "graph-view", className: "col-md-12" } [] RH.div { ref: graphRef, id: "graph-view", className: "col-md-12" } []
/\ /\
...@@ -208,9 +212,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -208,9 +212,9 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
tree :: Record TreeProps -> R.Element tree :: Record TreeProps -> R.Element
tree { show: false } = RH.div { id: "tree" } [] tree { show: false } = RH.div { id: "tree" } []
tree { frontends, handed, mCurrentRoute: route, reload, sessions, showLogin, backend} = tree { asyncTasks, backend, frontends, handed, mCurrentRoute: route, reload, sessions, showLogin } =
RH.div {className: "col-md-2 graph-tree"} [ RH.div {className: "col-md-2 graph-tree"} [
forest { frontends, handed, reload, route, sessions, showLogin, backend} forest { asyncTasks, backend, frontends, handed, reload, route, sessions, showLogin }
] ]
mSidebar :: Maybe GET.MetaData mSidebar :: Maybe GET.MetaData
...@@ -222,14 +226,15 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt ...@@ -222,14 +226,15 @@ explorerCpt = R.hooksComponentWithModule thisModule "explorer" cpt
type TreeProps = type TreeProps =
( (
frontends :: Frontends asyncTasks :: GAT.Reductor
, backend :: R.State (Maybe Backend)
, frontends :: Frontends
, handed :: Types.Handed , handed :: Types.Handed
, mCurrentRoute :: AppRoute , mCurrentRoute :: AppRoute
, reload :: R.State Int , reload :: R.State Int
, sessions :: Sessions , sessions :: Sessions
, show :: Boolean , show :: Boolean
, showLogin :: R.Setter Boolean , showLogin :: R.Setter Boolean
, backend :: R.State (Maybe Backend)
) )
type MSidebarProps = type MSidebarProps =
......
...@@ -223,7 +223,10 @@ deleteNode :: TermList ...@@ -223,7 +223,10 @@ deleteNode :: TermList
-> GET.MetaData -> GET.MetaData
-> Record SigmaxT.Node -> Record SigmaxT.Node
-> Aff NTC.VersionedNgramsPatches -> Aff NTC.VersionedNgramsPatches
deleteNode termList session (GET.MetaData metaData) node = NTC.putNgramsPatches coreParams versioned deleteNode termList session (GET.MetaData metaData) node = do
ret <- NTC.putNgramsPatches coreParams versioned
task <- NTC.postNgramsChartsAsync coreParams -- TODO add task
pure ret
where where
nodeId :: Int nodeId :: Int
nodeId = unsafePartial $ fromJust $ fromString node.id nodeId = unsafePartial $ fromJust $ fromString node.id
......
...@@ -38,10 +38,10 @@ thisModule = "Gargantext.Components.Login" ...@@ -38,10 +38,10 @@ thisModule = "Gargantext.Components.Login"
-- if not logged user can not save his work -- if not logged user can not save his work
type LoginProps = type LoginProps =
( backends :: Array Backend ( backend :: R.State (Maybe Backend)
, backends :: Array Backend
, sessions :: R2.Reductor Sessions Sessions.Action , sessions :: R2.Reductor Sessions Sessions.Action
, visible :: R.State Boolean , visible :: R.State Boolean
, backend :: R.State (Maybe Backend)
) )
login :: Record LoginProps -> R.Element login :: Record LoginProps -> R.Element
...@@ -104,7 +104,7 @@ chooser props = R.createElement chooserCpt props [] ...@@ -104,7 +104,7 @@ chooser props = R.createElement chooserCpt props []
chooserCpt :: R.Component LoginProps chooserCpt :: R.Component LoginProps
chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where
cpt :: Record LoginProps -> Array R.Element -> R.Element cpt :: Record LoginProps -> Array R.Element -> R.Element
cpt {backend, backends, sessions} _ = cpt { backend, backends, sessions } _ =
R.fragment $ title <> active <> new <> search R.fragment $ title <> active <> new <> search
where where
title = [H.h2 { className: "center modal-title" } [H.text "Instances manager"]] title = [H.h2 { className: "center modal-title" } [H.text "Instances manager"]]
...@@ -152,7 +152,7 @@ renderSessions sessions = R.fragment (renderSession sessions <$> unSessions (fst ...@@ -152,7 +152,7 @@ renderSessions sessions = R.fragment (renderSession sessions <$> unSessions (fst
GHL.clearCache unit GHL.clearCache unit
NTL.clearCache unit NTL.clearCache unit
liftEffect $ log "[renderSessions] cache cleared" liftEffect $ log "[renderSessions] cache cleared"
logOutClick _ = (snd sessions') (Sessions.Logout session) logOutClick _ = snd sessions' $ Sessions.Logout session
renderBackend :: R.State (Maybe Backend) -> Backend -> R.Element renderBackend :: R.State (Maybe Backend) -> Backend -> R.Element
renderBackend state backend@(Backend {name}) = renderBackend state backend@(Backend {name}) =
......
...@@ -16,21 +16,22 @@ import Data.Map as Map ...@@ -16,21 +16,22 @@ import Data.Map as Map
import Data.Maybe (Maybe(..), isNothing, maybe) import Data.Maybe (Maybe(..), isNothing, maybe)
import Data.Monoid.Additive (Additive(..)) import Data.Monoid.Additive (Additive(..))
import Data.Ord.Down (Down(..)) import Data.Ord.Down (Down(..))
import Data.Sequence as Seq import Data.Sequence (Seq, length) as Seq
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.Symbol (SProxy(..)) import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..), fst, snd)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log) import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff) import Effect.Aff (Aff, launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import FFI.Simple (delay)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Record as Record
import Unsafe.Coerce (unsafeCoerce) import Unsafe.Coerce (unsafeCoerce)
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.AutoUpdate (autoUpdateElt) import Gargantext.Components.AutoUpdate (autoUpdateElt)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Components.NgramsTable.Components as NTC import Gargantext.Components.NgramsTable.Components as NTC
...@@ -42,11 +43,12 @@ import Gargantext.Prelude (class Show, Unit, bind, const, discard, identity, map ...@@ -42,11 +43,12 @@ import Gargantext.Prelude (class Show, Unit, bind, const, discard, identity, map
import Gargantext.Routes (SessionRoute(..)) as R import Gargantext.Routes (SessionRoute(..)) as R
import Gargantext.Sessions (Session, get) import Gargantext.Sessions (Session, get)
import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize, termLists, termSizes) import Gargantext.Types (CTabNgramType, OrderBy(..), SearchQuery, TabType, TermList(..), TermSize, termLists, termSizes)
import Gargantext.Utils (queryMatchesLabel, toggleSet) import Gargantext.Utils (queryMatchesLabel, toggleSet, sortWith)
import Gargantext.Utils.CacheAPI as GUC import Gargantext.Utils.CacheAPI as GUC
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Seq as Seq import Gargantext.Utils.Seq (mapMaybe) as Seq
thisModule :: String
thisModule = "Gargantext.Components.NgramsTable" thisModule = "Gargantext.Components.NgramsTable"
type State' = type State' =
...@@ -103,7 +105,7 @@ initialState (Versioned {version}) = { ...@@ -103,7 +105,7 @@ initialState (Versioned {version}) = {
setTermListSetA :: NgramsTable -> Set NgramsTerm -> TermList -> Action setTermListSetA :: NgramsTable -> Set NgramsTerm -> TermList -> Action
setTermListSetA ngramsTable ns new_list = setTermListSetA ngramsTable ns new_list =
CommitPatch $ fromNgramsPatches $ PatchMap $ mapWithIndex f $ toMap ns CoreAction $ CommitPatch $ fromNgramsPatches $ PatchMap $ mapWithIndex f $ toMap ns
where where
f :: NgramsTerm -> Unit -> NgramsPatch f :: NgramsTerm -> Unit -> NgramsPatch
f n unit = NgramsPatch { patch_list, patch_children: mempty } f n unit = NgramsPatch { patch_list, patch_children: mempty }
...@@ -116,9 +118,6 @@ setTermListSetA ngramsTable ns new_list = ...@@ -116,9 +118,6 @@ setTermListSetA ngramsTable ns new_list =
-- https://github.com/purescript/purescript-ordered-collections/pull/31 -- https://github.com/purescript/purescript-ordered-collections/pull/31
-- toMap = Map.fromFoldable -- toMap = Map.fromFoldable
addNewNgramA :: NgramsTerm -> Action
addNewNgramA ngram = CommitPatch $ addNewNgram ngram CandidateTerm
type PreConversionRows = Seq.Seq NgramsElement type PreConversionRows = Seq.Seq NgramsElement
type TableContainerProps = type TableContainerProps =
...@@ -157,8 +156,10 @@ tableContainerCpt { dispatch ...@@ -157,8 +156,10 @@ tableContainerCpt { dispatch
H.li { className: "list-group-item" } [ H.li { className: "list-group-item" } [
H.button { className: "btn btn-primary" H.button { className: "btn btn-primary"
, on: { click: const $ dispatch , on: { click: const $ dispatch
$ CoreAction
$ addNewNgramA $ addNewNgramA
$ normNgram tabNgramType searchQuery (normNgram tabNgramType searchQuery)
CandidateTerm
} }
} }
[ H.text ("Add " <> searchQuery) ] [ H.text ("Add " <> searchQuery) ]
...@@ -277,8 +278,9 @@ tableContainerCpt { dispatch ...@@ -277,8 +278,9 @@ tableContainerCpt { dispatch
] ]
-- NEXT -- NEXT
type Props = type Props = (
( afterSync :: Unit -> Aff Unit afterSync :: Unit -> Aff Unit
, asyncTasks :: GAT.Reductor
, path :: R.State PageParams , path :: R.State PageParams
, state :: R.State State , state :: R.State State
, tabNgramType :: CTabNgramType , tabNgramType :: CTabNgramType
...@@ -293,7 +295,8 @@ loadedNgramsTableCpt :: R.Component Props ...@@ -293,7 +295,8 @@ loadedNgramsTableCpt :: R.Component Props
loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" cpt
where where
cpt { afterSync cpt { afterSync
, path: path@(path'@{ searchQuery, scoreType, params, termListFilter, termSizeFilter } /\ setPath) , asyncTasks
, path: path@(path'@{ listIds, nodeId, params, searchQuery, scoreType, termListFilter, termSizeFilter } /\ setPath)
, state: (state@{ ngramsChildren , state: (state@{ ngramsChildren
, ngramsLocalPatch , ngramsLocalPatch
, ngramsParent , ngramsParent
...@@ -303,8 +306,13 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -303,8 +306,13 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
, versioned: Versioned { data: initTable } , versioned: Versioned { data: initTable }
, withAutoUpdate } _ = do , withAutoUpdate } _ = do
let syncResetBtns = [syncResetButtons { afterSync: chartsAfterSync
, ngramsLocalPatch
, performAction: performAction <<< CoreAction
}]
pure $ R.fragment $ pure $ R.fragment $
autoUpdate <> [syncResetButtons { afterSync, ngramsLocalPatch, performAction }] <> [ autoUpdate <> syncResetBtns <> [
H.h4 {style: {textAlign : "center"}} [ H.h4 {style: {textAlign : "center"}} [
H.span {className: "glyphicon glyphicon-hand-down"} [] H.span {className: "glyphicon glyphicon-hand-down"} []
, H.text "Extracted Terms" , H.text "Extracted Terms"
...@@ -327,13 +335,19 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -327,13 +335,19 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
, ngramsSelection , ngramsSelection
} }
} }
] <> [syncResetButtons { afterSync, ngramsLocalPatch, performAction }] ] <> syncResetBtns
where where
chartsAfterSync _ = do
task <- postNgramsChartsAsync path'
liftEffect $ do
log2 "[performAction] Synchronize task" task
snd asyncTasks $ GAT.Insert nodeId task
autoUpdate :: Array R.Element autoUpdate :: Array R.Element
autoUpdate = if withAutoUpdate then autoUpdate = if withAutoUpdate then
[ R2.buff $ autoUpdateElt { [ R2.buff $ autoUpdateElt {
duration: 5000 duration: 5000
, effect: performAction $ Synchronize { afterSync } , effect: performAction $ CoreAction $ Synchronize { afterSync: chartsAfterSync }
} ] } ]
else [] else []
...@@ -357,11 +371,6 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -357,11 +371,6 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
s { ngramsSelection = Set.empty :: Set NgramsTerm } s { ngramsSelection = Set.empty :: Set NgramsTerm }
else else
s { ngramsSelection = selectNgramsOnFirstPage filteredRows } s { ngramsSelection = selectNgramsOnFirstPage filteredRows }
performAction (Synchronize { afterSync }) = syncPatches path' (state /\ setState) afterSync
performAction (CommitPatch pt) =
commitPatch (Versioned {version: ngramsVersion, data: pt}) (state /\ setState)
performAction ResetPatches =
setState $ \s -> s { ngramsLocalPatch = { ngramsPatches: mempty } }
performAction AddTermChildren = performAction AddTermChildren =
case ngramsParent of case ngramsParent of
Nothing -> Nothing ->
...@@ -373,6 +382,7 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -373,6 +382,7 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
pt = singletonNgramsTablePatch parent pe pt = singletonNgramsTablePatch parent pe
setState $ setParentResetChildren Nothing setState $ setParentResetChildren Nothing
commitPatch (Versioned {version: ngramsVersion, data: pt}) (state /\ setState) commitPatch (Versioned {version: ngramsVersion, data: pt}) (state /\ setState)
performAction (CoreAction a) = coreDispatch path' (state /\ setState) a
totalRecords = Seq.length rows totalRecords = Seq.length rows
filteredConvertedRows :: T.Rows filteredConvertedRows :: T.Rows
...@@ -423,10 +433,10 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -423,10 +433,10 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
} }
orderWith = orderWith =
case convOrderBy <$> params.orderBy of case convOrderBy <$> params.orderBy of
Just ScoreAsc -> Seq.sortWith \x -> x ^. _NgramsElement <<< _occurrences Just ScoreAsc -> sortWith \x -> x ^. _NgramsElement <<< _occurrences
Just ScoreDesc -> Seq.sortWith \x -> Down $ x ^. _NgramsElement <<< _occurrences Just ScoreDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _occurrences
Just TermAsc -> Seq.sortWith \x -> x ^. _NgramsElement <<< _ngrams Just TermAsc -> sortWith \x -> x ^. _NgramsElement <<< _ngrams
Just TermDesc -> Seq.sortWith \x -> Down $ x ^. _NgramsElement <<< _ngrams Just TermDesc -> sortWith \x -> Down $ x ^. _NgramsElement <<< _ngrams
_ -> identity -- the server ordering is enough here _ -> identity -- the server ordering is enough here
colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy colNames = T.ColumnName <$> ["Select", "Map", "Stop", "Terms", "Score"] -- see convOrderBy
...@@ -444,41 +454,6 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable" ...@@ -444,41 +454,6 @@ loadedNgramsTableCpt = R.hooksComponentWithModule thisModule "loadedNgramsTable"
setSearchQuery x = setPath $ _ { searchQuery = x } setSearchQuery x = setPath $ _ { searchQuery = x }
type SyncResetButtonsProps = (
afterSync :: Unit -> Aff Unit
, ngramsLocalPatch :: NgramsTablePatch
, performAction :: Action -> Effect Unit
)
syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p []
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
where
cpt { afterSync, ngramsLocalPatch, performAction } _ = do
synchronizing@(s /\ _) <- R.useState' false
let hasChanges = ngramsLocalPatch /= mempty
pure $ H.div {} [
H.button { className: "btn btn-danger " <> if hasChanges then "" else " disabled"
, on: { click: \_ -> performAction ResetPatches }
} [ H.text "Reset" ]
, H.button { className: "btn btn-primary " <> (if s || (not hasChanges) then "disabled" else "")
, on: { click: synchronize synchronizing }
} [ H.text "Sync" ]
]
where
synchronize (_ /\ setSynchronizing) _ = delay unit $ \_ -> do
setSynchronizing $ const true
performAction $ Synchronize { afterSync: newAfterSync }
where
newAfterSync x = do
afterSync x
liftEffect $ setSynchronizing $ const false
displayRow :: State -> SearchQuery -> NgramsTable -> Maybe NgramsTerm -> Maybe TermList -> Maybe TermSize -> NgramsElement -> Boolean displayRow :: State -> SearchQuery -> NgramsTable -> Maybe NgramsTerm -> Maybe TermList -> Maybe TermSize -> NgramsElement -> Boolean
displayRow state@{ ngramsChildren displayRow state@{ ngramsChildren
, ngramsLocalPatch , ngramsLocalPatch
...@@ -518,8 +493,9 @@ selectNgramsOnFirstPage :: PreConversionRows -> Set NgramsTerm ...@@ -518,8 +493,9 @@ selectNgramsOnFirstPage :: PreConversionRows -> Set NgramsTerm
selectNgramsOnFirstPage rows = Set.fromFoldable $ (view $ _NgramsElement <<< _ngrams) <$> rows selectNgramsOnFirstPage rows = Set.fromFoldable $ (view $ _NgramsElement <<< _ngrams) <$> rows
type MainNgramsTableProps = type MainNgramsTableProps = (
( afterSync :: Unit -> Aff Unit afterSync :: Unit -> Aff Unit
, asyncTasks :: GAT.Reductor
, cacheState :: R.State NT.CacheState , cacheState :: R.State NT.CacheState
, defaultListId :: Int , defaultListId :: Int
, nodeId :: Int , nodeId :: Int
...@@ -537,6 +513,7 @@ mainNgramsTableCpt :: R.Component MainNgramsTableProps ...@@ -537,6 +513,7 @@ mainNgramsTableCpt :: R.Component MainNgramsTableProps
mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
where where
cpt props@{ afterSync cpt props@{ afterSync
, asyncTasks
, cacheState , cacheState
, defaultListId , defaultListId
, nodeId , nodeId
...@@ -545,11 +522,15 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt ...@@ -545,11 +522,15 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, tabType , tabType
, withAutoUpdate } _ = do , withAutoUpdate } _ = do
let path = initialPageParams session nodeId [defaultListId] tabType let path = initialPageParams session nodeId [defaultListId] tabType
let render versioned = mainNgramsTablePaint { afterSync
let render versioned = mainNgramsTablePaint { afterSync, path, tabNgramType, versioned, withAutoUpdate } , asyncTasks
, path
, tabNgramType
, versioned
, withAutoUpdate }
case cacheState of case cacheState of
(NT.CacheOn /\ _) -> (NT.CacheOn /\ _) -> do
useLoaderWithCacheAPI { useLoaderWithCacheAPI {
cacheEndpoint: versionEndpoint props cacheEndpoint: versionEndpoint props
, handleResponse , handleResponse
...@@ -557,16 +538,36 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt ...@@ -557,16 +538,36 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
, path , path
, renderer: render , renderer: render
} }
(NT.CacheOff /\ _) -> (NT.CacheOff /\ _) -> do
useLoader path loader render useLoader path loader render
versionEndpoint :: Record MainNgramsTableProps -> PageParams -> Aff Version versionEndpoint :: Record MainNgramsTableProps -> PageParams -> Aff Version
versionEndpoint { defaultListId, nodeId, session, tabType } _ = get session $ R.GetNgramsTableVersion { listId: defaultListId, tabType } (Just nodeId) versionEndpoint { defaultListId, nodeId, session, tabType } _ = get session $ R.GetNgramsTableVersion { listId: defaultListId, tabType } (Just nodeId)
-- NOTE With cache off
loader :: PageParams -> Aff VersionedNgramsTable loader :: PageParams -> Aff VersionedNgramsTable
loader path@{ listIds, nodeId, session, tabType } = loader path@{ listIds
get session $ R.GetNgramsTableAll { listIds, tabType } (Just nodeId) , nodeId
, params: { limit, offset, orderBy }
, searchQuery
, session
, tabType
, termListFilter
, termSizeFilter
} =
get session $ R.GetNgrams params (Just nodeId)
where
params = { limit
, listIds
, offset: Just offset
, orderBy: Nothing -- TODO
, searchQuery
, tabType
, termListFilter
, termSizeFilter
}
-- NOTE With cache on
mkRequest :: PageParams -> GUC.Request mkRequest :: PageParams -> GUC.Request
mkRequest path@{ session } = GUC.makeGetRequest session $ url path mkRequest path@{ session } = GUC.makeGetRequest session $ url path
where where
...@@ -584,12 +585,9 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt ...@@ -584,12 +585,9 @@ mainNgramsTableCpt = R.hooksComponentWithModule thisModule "mainNgramsTable" cpt
handleResponse :: VersionedNgramsTable -> VersionedNgramsTable handleResponse :: VersionedNgramsTable -> VersionedNgramsTable
handleResponse v = v handleResponse v = v
pathNoLimit :: PageParams -> PageParams type MainNgramsTablePaintProps = (
pathNoLimit path@{ params } = path { params = params { limit = 100000 } afterSync :: Unit -> Aff Unit
, termListFilter = Nothing } , asyncTasks :: GAT.Reductor
type MainNgramsTablePaintProps =
( afterSync :: Unit -> Aff Unit
, path :: PageParams , path :: PageParams
, tabNgramType :: CTabNgramType , tabNgramType :: CTabNgramType
, versioned :: VersionedNgramsTable , versioned :: VersionedNgramsTable
...@@ -602,12 +600,13 @@ mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p [] ...@@ -602,12 +600,13 @@ mainNgramsTablePaint p = R.createElement mainNgramsTablePaintCpt p []
mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps mainNgramsTablePaintCpt :: R.Component MainNgramsTablePaintProps
mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaint" cpt
where where
cpt { afterSync, path, tabNgramType, versioned, withAutoUpdate } _ = do cpt props@{ afterSync, asyncTasks, path, tabNgramType, versioned, withAutoUpdate } _ = do
pathS <- R.useState' path pathS <- R.useState' path
state <- R.useState' $ initialState versioned state <- R.useState' $ initialState versioned
pure $ loadedNgramsTable { pure $ loadedNgramsTable {
afterSync afterSync
, asyncTasks
, path: pathS , path: pathS
, state , state
, tabNgramType , tabNgramType
...@@ -615,6 +614,34 @@ mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTable ...@@ -615,6 +614,34 @@ mainNgramsTablePaintCpt = R.hooksComponentWithModule thisModule "mainNgramsTable
, withAutoUpdate , withAutoUpdate
} }
type MainNgramsTablePaintWithStateProps = (
afterSync :: Unit -> Aff Unit
, asyncTasks :: GAT.Reductor
, path :: R.State PageParams
, tabNgramType :: CTabNgramType
, versioned :: VersionedNgramsTable
, withAutoUpdate :: Boolean
)
mainNgramsTablePaintWithState :: Record MainNgramsTablePaintWithStateProps -> R.Element
mainNgramsTablePaintWithState p = R.createElement mainNgramsTablePaintWithStateCpt p []
mainNgramsTablePaintWithStateCpt :: R.Component MainNgramsTablePaintWithStateProps
mainNgramsTablePaintWithStateCpt = R.hooksComponentWithModule thisModule "mainNgramsTablePaintWithState" cpt
where
cpt { afterSync, asyncTasks, path, tabNgramType, versioned, withAutoUpdate } _ = do
state <- R.useState' $ initialState versioned
pure $ loadedNgramsTable {
afterSync
, asyncTasks
, path
, state
, tabNgramType
, versioned
, withAutoUpdate
}
type NgramsOcc = { occurrences :: Additive Int, children :: Set NgramsTerm } type NgramsOcc = { occurrences :: Additive Int, children :: Set NgramsTerm }
ngramsElementToNgramsOcc :: NgramsElement -> NgramsOcc ngramsElementToNgramsOcc :: NgramsElement -> NgramsOcc
......
...@@ -17,7 +17,12 @@ import Reactix as R ...@@ -17,7 +17,12 @@ import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.NgramsTable.Core (Action(..), Dispatch, NgramsElement, NgramsPatch(..), NgramsTable, NgramsTablePatch, NgramsTerm, Replace, _NgramsElement, _NgramsRepoElement, _PatchMap, _children, _list, _ngrams, _occurrences, ngramsTermText, replace, singletonNgramsTablePatch) import Gargantext.Components.NgramsTable.Core ( Action(..), Dispatch, NgramsElement, NgramsPatch(..)
, NgramsTable, NgramsTablePatch, NgramsTerm, Replace
, _NgramsElement, _NgramsRepoElement, _PatchMap, _children
, _list, _ngrams, _occurrences, ngramsTermText, replace
, singletonNgramsTablePatch, setTermListA
)
import Gargantext.Components.Table as Tbl import Gargantext.Components.Table as Tbl
import Gargantext.Types as T import Gargantext.Types as T
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
...@@ -207,7 +212,7 @@ renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" c ...@@ -207,7 +212,7 @@ renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" c
ngramsStyle = [termStyle termList ngramsOpacity] ngramsStyle = [termStyle termList ngramsOpacity]
ngramsEdit = Just <<< dispatch <<< SetParentResetChildren <<< Just <<< view _ngrams ngramsEdit = Just <<< dispatch <<< SetParentResetChildren <<< Just <<< view _ngrams
ngramsClick ngramsClick
= Just <<< dispatch <<< cycleTermListItem <<< view _ngrams = Just <<< dispatch <<< CoreAction <<< cycleTermListItem <<< view _ngrams
-- ^ This is the old behavior it is nicer to use since one can -- ^ This is the old behavior it is nicer to use since one can
-- rapidly change the ngram list without waiting for confirmation. -- rapidly change the ngram list without waiting for confirmation.
-- However this might expose bugs. One of them can be reproduced -- However this might expose bugs. One of them can be reproduced
...@@ -226,7 +231,7 @@ renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" c ...@@ -226,7 +231,7 @@ renderNgramsItemCpt = R.hooksComponentWithModule thisModule "renderNgramsItem" c
in in
H.input { checked: chkd H.input { checked: chkd
, className: "checkbox" , className: "checkbox"
, on: { change: const $ dispatch $ , on: { change: const $ dispatch $ CoreAction $
setTermListA ngrams (replace termList termList'') } setTermListA ngrams (replace termList termList'') }
, readOnly: ngramsTransient , readOnly: ngramsTransient
, type: "checkbox" } , type: "checkbox" }
...@@ -245,13 +250,6 @@ termStyle T.StopTerm opacity = DOM.style { color: "red", opacity ...@@ -245,13 +250,6 @@ termStyle T.StopTerm opacity = DOM.style { color: "red", opacity
, textDecoration: "line-through" } , textDecoration: "line-through" }
termStyle T.CandidateTerm opacity = DOM.style { color: "black", opacity } termStyle T.CandidateTerm opacity = DOM.style { color: "black", opacity }
setTermListA :: NgramsTerm -> Replace T.TermList -> Action
setTermListA n patch_list =
CommitPatch $
singletonNgramsTablePatch n $
NgramsPatch { patch_list, patch_children: mempty }
tablePatchHasNgrams :: NgramsTablePatch -> NgramsTerm -> Boolean tablePatchHasNgrams :: NgramsTablePatch -> NgramsTerm -> Boolean
tablePatchHasNgrams ngramsTablePatch ngrams = tablePatchHasNgrams ngramsTablePatch ngrams =
isJust $ ngramsTablePatch.ngramsPatches ^. _PatchMap <<< at ngrams isJust $ ngramsTablePatch.ngramsPatches ^. _PatchMap <<< at ngrams
......
...@@ -15,10 +15,12 @@ module Gargantext.Components.NgramsTable.Core ...@@ -15,10 +15,12 @@ module Gargantext.Components.NgramsTable.Core
, NgramsTerm , NgramsTerm
, normNgram , normNgram
, ngramsTermText , ngramsTermText
, findNgramRoot
, findNgramTermList , findNgramTermList
, Version , Version
, Versioned(..) , Versioned(..)
, VersionedNgramsPatches , VersionedNgramsPatches
, AsyncNgramsChartsUpdate
, VersionedNgramsTable , VersionedNgramsTable
, CoreState , CoreState
, highlightNgrams , highlightNgrams
...@@ -33,7 +35,7 @@ module Gargantext.Components.NgramsTable.Core ...@@ -33,7 +35,7 @@ module Gargantext.Components.NgramsTable.Core
, _PatchMap , _PatchMap
, patchSetFromMap , patchSetFromMap
, applyPatchSet , applyPatchSet
, applyNgramsTablePatch --, applyNgramsTablePatch -- re-export only if we have a good reason not to use applyNgramsPatches
, applyNgramsPatches , applyNgramsPatches
, rootsOf , rootsOf
, singletonPatchMap , singletonPatchMap
...@@ -50,12 +52,22 @@ module Gargantext.Components.NgramsTable.Core ...@@ -50,12 +52,22 @@ module Gargantext.Components.NgramsTable.Core
, _ngrams_scores , _ngrams_scores
, commitPatch , commitPatch
, putNgramsPatches , putNgramsPatches
, postNgramsChartsAsync
, syncPatches , syncPatches
, addNewNgram , addNewNgramP
, addNewNgramA
, setTermListP
, setTermListA
, CoreAction(..)
, CoreDispatch
, Action(..) , Action(..)
, Dispatch , Dispatch
, coreDispatch
, isSingleNgramsTerm , isSingleNgramsTerm
, filterTermSize , filterTermSize
, SyncResetButtonsProps
, syncResetButtons
, syncResetButtonsCpt
) )
where where
...@@ -99,7 +111,7 @@ import Data.Symbol (SProxy(..)) ...@@ -99,7 +111,7 @@ import Data.Symbol (SProxy(..))
import Data.These (These(..)) import Data.These (These(..))
import Data.Traversable (for, traverse_) import Data.Traversable (for, traverse_)
import Data.TraversableWithIndex (traverseWithIndex) import Data.TraversableWithIndex (traverseWithIndex)
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..), snd)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2) import DOM.Simple.Console (log2)
import Effect.Aff (Aff, launchAff_) import Effect.Aff (Aff, launchAff_)
...@@ -107,17 +119,23 @@ import Effect (Effect) ...@@ -107,17 +119,23 @@ import Effect (Effect)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Effect.Exception.Unsafe (unsafeThrow) import Effect.Exception.Unsafe (unsafeThrow)
import Foreign.Object as FO import Foreign.Object as FO
import Reactix (State) as R import FFI.Simple.Functions (delay)
import Reactix as R
import Reactix.DOM.HTML as H
import Partial (crashWith) import Partial (crashWith)
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
import Gargantext.Prelude import Gargantext.AsyncTasks as GAT
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get, put) import Gargantext.Sessions (Session, get, post, put)
import Gargantext.Types (CTabNgramType(..), OrderBy(..), ScoreType(..), TabSubType(..), TabType(..), TermList(..), TermSize(..)) import Gargantext.Types (AsyncTaskType(..), AsyncTaskWithType(..), CTabNgramType(..), ListId, OrderBy(..), ScoreType(..), TabSubType(..), TabType(..), TermList(..), TermSize(..))
import Gargantext.Utils.KarpRabin (indicesOfAny) import Gargantext.Utils.KarpRabin (indicesOfAny)
thisModule :: String
thisModule = "Gargantext.Components.NgramsTable.Core"
type Endo a = a -> a type Endo a = a -> a
type CoreParams s = type CoreParams s =
...@@ -430,7 +448,7 @@ highlightNgrams ntype table@(NgramsTable {ngrams_repo_elements: elts}) input0 = ...@@ -430,7 +448,7 @@ highlightNgrams ntype table@(NgramsTable {ngrams_repo_elements: elts}) input0 =
where where
spR x = " " <> R.replace wordBoundaryReg "$1$1" x <> " " spR x = " " <> R.replace wordBoundaryReg "$1$1" x <> " "
reR = R.replace wordBoundaryReg " " reR = R.replace wordBoundaryReg " "
db = S.replace (S.Pattern " ") (S.Replacement " ") db = S.replaceAll (S.Pattern " ") (S.Replacement " ")
sp x = " " <> db x <> " " sp x = " " <> db x <> " "
undb = R.replace wordBoundaryReg2 "$1" undb = R.replace wordBoundaryReg2 "$1"
init x = S.take (S.length x - 1) x init x = S.take (S.length x - 1) x
...@@ -501,7 +519,7 @@ derive instance eqReplace :: Eq a => Eq (Replace a) ...@@ -501,7 +519,7 @@ derive instance eqReplace :: Eq a => Eq (Replace a)
instance semigroupReplace :: Eq a => Semigroup (Replace a) where instance semigroupReplace :: Eq a => Semigroup (Replace a) where
append Keep p = p append Keep p = p
append p Keep = p append p Keep = p
-- append (Replace { old }) (Replace { new }) | old /= new = unsafeThrow "old != new" append (Replace { old }) (Replace { new }) | old /= new = unsafeThrow "old != new"
append (Replace { new }) (Replace { old }) = replace old new append (Replace { new }) (Replace { old }) = replace old new
instance semigroupMonoid :: Eq a => Monoid (Replace a) where instance semigroupMonoid :: Eq a => Monoid (Replace a) where
...@@ -597,7 +615,9 @@ invert :: forall a. a -> a ...@@ -597,7 +615,9 @@ invert :: forall a. a -> a
invert _ = unsafeThrow "invert: TODO" invert _ = unsafeThrow "invert: TODO"
instance semigroupNgramsPatch :: Semigroup NgramsPatch where instance semigroupNgramsPatch :: Semigroup NgramsPatch where
append (NgramsReplace p) (NgramsReplace q) = ngramsReplace q.patch_old p.patch_new append (NgramsReplace p) (NgramsReplace q)
| p.patch_old /= q.patch_new = unsafeThrow "append/NgramsPatch: old != new"
| otherwise = ngramsReplace q.patch_old p.patch_new
append (NgramsPatch p) (NgramsPatch q) = NgramsPatch append (NgramsPatch p) (NgramsPatch q) = NgramsPatch
{ patch_children: p.patch_children <> q.patch_children { patch_children: p.patch_children <> q.patch_children
, patch_list: p.patch_list <> q.patch_list , patch_list: p.patch_list <> q.patch_list
...@@ -732,6 +752,15 @@ applyPatchMap applyPatchValue (PatchMap pm) m = mergeMap f pm m ...@@ -732,6 +752,15 @@ applyPatchMap applyPatchValue (PatchMap pm) m = mergeMap f pm m
type NgramsPatches = PatchMap NgramsTerm NgramsPatch type NgramsPatches = PatchMap NgramsTerm NgramsPatch
type VersionedNgramsPatches = Versioned NgramsPatches type VersionedNgramsPatches = Versioned NgramsPatches
newtype AsyncNgramsChartsUpdate = AsyncNgramsChartsUpdate {
listId :: Maybe ListId
, tabType :: TabType
}
instance encodeAsyncNgramsChartsUpdate :: EncodeJson AsyncNgramsChartsUpdate where
encodeJson (AsyncNgramsChartsUpdate { listId, tabType }) = do
"list_id" := listId
~> "tab_type" := tabType
~> jsonEmptyObject
type NewElems = Map NgramsTerm TermList type NewElems = Map NgramsTerm TermList
...@@ -744,8 +773,14 @@ isEmptyNgramsTablePatch {ngramsPatches} = isEmptyPatchMap ngramsPatches ...@@ -744,8 +773,14 @@ isEmptyNgramsTablePatch {ngramsPatches} = isEmptyPatchMap ngramsPatches
fromNgramsPatches :: NgramsPatches -> NgramsTablePatch fromNgramsPatches :: NgramsPatches -> NgramsTablePatch
fromNgramsPatches ngramsPatches = {ngramsPatches} fromNgramsPatches ngramsPatches = {ngramsPatches}
findNgramRoot :: NgramsTable -> NgramsTerm -> NgramsTerm
findNgramRoot (NgramsTable m) n =
fromMaybe n (m.ngrams_repo_elements ^? at n <<< _Just <<< _NgramsRepoElement <<< _root <<< _Just)
findNgramTermList :: NgramsTable -> NgramsTerm -> Maybe TermList findNgramTermList :: NgramsTable -> NgramsTerm -> Maybe TermList
findNgramTermList (NgramsTable m) n = m.ngrams_repo_elements ^? at n <<< _Just <<< _NgramsRepoElement <<< _list findNgramTermList (NgramsTable m) n = m.ngrams_repo_elements ^? at r <<< _Just <<< _NgramsRepoElement <<< _list
where
r = findNgramRoot (NgramsTable m) n
singletonNgramsTablePatch :: NgramsTerm -> NgramsPatch -> NgramsTablePatch singletonNgramsTablePatch :: NgramsTerm -> NgramsPatch -> NgramsTablePatch
singletonNgramsTablePatch n p = fromNgramsPatches $ singletonPatchMap n p singletonNgramsTablePatch n p = fromNgramsPatches $ singletonPatchMap n p
...@@ -862,14 +897,34 @@ newNgramPatch list = ...@@ -862,14 +897,34 @@ newNgramPatch list =
} }
} }
addNewNgram :: NgramsTerm -> TermList -> NgramsTablePatch addNewNgramP :: NgramsTerm -> TermList -> NgramsTablePatch
addNewNgram ngrams list = addNewNgramP ngrams list =
{ ngramsPatches: singletonPatchMap ngrams (newNgramPatch list) } { ngramsPatches: singletonPatchMap ngrams (newNgramPatch list) }
addNewNgramA :: NgramsTerm -> TermList -> CoreAction
addNewNgramA ngrams list = CommitPatch $ addNewNgramP ngrams list
setTermListP :: NgramsTerm -> Replace TermList -> NgramsTablePatch
setTermListP ngram patch_list = singletonNgramsTablePatch ngram pe
where
pe = NgramsPatch { patch_list, patch_children: mempty }
setTermListA :: NgramsTerm -> Replace TermList -> CoreAction
setTermListA ngram termList = CommitPatch $ setTermListP ngram termList
putNgramsPatches :: forall s. CoreParams s -> VersionedNgramsPatches -> Aff VersionedNgramsPatches putNgramsPatches :: forall s. CoreParams s -> VersionedNgramsPatches -> Aff VersionedNgramsPatches
putNgramsPatches {session, nodeId, listIds, tabType} = put session putNgrams putNgramsPatches { listIds, nodeId, session, tabType } = put session putNgrams
where putNgrams = PutNgrams tabType (head listIds) Nothing (Just nodeId) where putNgrams = PutNgrams tabType (head listIds) Nothing (Just nodeId)
postNgramsChartsAsync :: forall s. CoreParams s -> Aff AsyncTaskWithType
postNgramsChartsAsync { listIds, nodeId, session, tabType } = do
task <- post session putNgramsAsync acu
pure $ AsyncTaskWithType { task, typ: UpdateNgramsCharts }
where
acu = AsyncNgramsChartsUpdate { listId: head listIds
, tabType }
putNgramsAsync = PostNgramsChartsAsync (Just nodeId)
syncPatches :: forall p s. CoreParams p -> R.State (CoreState s) -> (Unit -> Aff Unit) -> Effect Unit syncPatches :: forall p s. CoreParams p -> R.State (CoreState s) -> (Unit -> Aff Unit) -> Effect Unit
syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches } syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches }
, ngramsStagePatch , ngramsStagePatch
...@@ -885,6 +940,7 @@ syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches } ...@@ -885,6 +940,7 @@ syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches }
launchAff_ $ do launchAff_ $ do
Versioned { data: newPatch, version: newVersion } <- putNgramsPatches props pt Versioned { data: newPatch, version: newVersion } <- putNgramsPatches props pt
callback unit callback unit
-- task <- postNgramsChartsAsync props
liftEffect $ do liftEffect $ do
log2 "[syncPatches] setting state, newVersion" newVersion log2 "[syncPatches] setting state, newVersion" newVersion
setState $ \s -> setState $ \s ->
...@@ -899,6 +955,33 @@ syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches } ...@@ -899,6 +955,33 @@ syncPatches props ({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches }
, ngramsVersion = newVersion , ngramsVersion = newVersion
} }
log2 "[syncPatches] ngramsVersion" newVersion log2 "[syncPatches] ngramsVersion" newVersion
pure unit
{-
syncPatchesAsync :: forall p s. CoreParams p -> R.State (CoreState s) -> (Unit -> Aff Unit) -> Effect Unit
syncPatchesAsync props@{ listIds, tabType }
({ ngramsLocalPatch: ngramsLocalPatch@{ ngramsPatches }
, ngramsStagePatch
, ngramsValidPatch
, ngramsVersion
} /\ setState) callback = do
when (isEmptyNgramsTablePatch ngramsStagePatch) $ do
let patch = Versioned { data: ngramsPatches, version: ngramsVersion }
launchAff_ $ do
Versioned { data: newPatch, version: newVersion } <- postNgramsPatchesAsync props patch
callback unit
liftEffect $ do
log2 "[syncPatches] setting state, newVersion" newVersion
setState $ \s ->
s {
ngramsLocalPatch = fromNgramsPatches mempty
, ngramsStagePatch = fromNgramsPatches mempty
, ngramsValidPatch = fromNgramsPatches newPatch <> ngramsLocalPatch <> s.ngramsValidPatch
-- First the already valid patch, then the local patch, then the newly received newPatch.
, ngramsVersion = newVersion
}
log2 "[syncPatches] ngramsVersion" newVersion
-}
commitPatch :: forall s. Versioned NgramsTablePatch -> R.State (CoreState s) -> Effect Unit commitPatch :: forall s. Versioned NgramsTablePatch -> R.State (CoreState s) -> Effect Unit
commitPatch (Versioned {version, data: tablePatch}) (_ /\ setState) = do commitPatch (Versioned {version, data: tablePatch}) (_ /\ setState) = do
...@@ -947,9 +1030,13 @@ convOrderBy (T.DESC (T.ColumnName "Score")) = ScoreDesc ...@@ -947,9 +1030,13 @@ convOrderBy (T.DESC (T.ColumnName "Score")) = ScoreDesc
convOrderBy (T.ASC _) = TermAsc convOrderBy (T.ASC _) = TermAsc
convOrderBy (T.DESC _) = TermDesc convOrderBy (T.DESC _) = TermDesc
data CoreAction
= CommitPatch NgramsTablePatch
| Synchronize { afterSync :: Unit -> Aff Unit }
| ResetPatches
data Action data Action
= CommitPatch NgramsTablePatch = CoreAction CoreAction
| SetParentResetChildren (Maybe NgramsTerm) | SetParentResetChildren (Maybe NgramsTerm)
-- ^ This sets `ngramsParent` and resets `ngramsChildren`. -- ^ This sets `ngramsParent` and resets `ngramsChildren`.
| ToggleChild Boolean NgramsTerm | ToggleChild Boolean NgramsTerm
...@@ -957,15 +1044,22 @@ data Action ...@@ -957,15 +1044,22 @@ data Action
-- If the `Boolean` is `true` it means we want to add it if it is not here, -- If the `Boolean` is `true` it means we want to add it if it is not here,
-- if it is `false` it is meant to be removed if not here. -- if it is `false` it is meant to be removed if not here.
| AddTermChildren | AddTermChildren
| Synchronize { afterSync :: Unit -> Aff Unit }
| ToggleSelect NgramsTerm | ToggleSelect NgramsTerm
-- ^ Toggles the NgramsTerm in the `Set` `ngramsSelection`. -- ^ Toggles the NgramsTerm in the `Set` `ngramsSelection`.
| ToggleSelectAll | ToggleSelectAll
| ResetPatches
type CoreDispatch = CoreAction -> Effect Unit
type Dispatch = Action -> Effect Unit type Dispatch = Action -> Effect Unit
coreDispatch :: forall p s. CoreParams p -> R.State (CoreState s) -> CoreDispatch
coreDispatch path state (Synchronize { afterSync }) =
syncPatches path state afterSync
coreDispatch _ state@({ngramsVersion} /\ _) (CommitPatch pt) =
commitPatch (Versioned {version: ngramsVersion, data: pt}) state
coreDispatch _ (_ /\ setState) ResetPatches =
setState $ \s -> s { ngramsLocalPatch = { ngramsPatches: mempty } }
isSingleNgramsTerm :: NgramsTerm -> Boolean isSingleNgramsTerm :: NgramsTerm -> Boolean
isSingleNgramsTerm nt = isSingleTerm $ ngramsTermText nt isSingleNgramsTerm nt = isSingleTerm $ ngramsTermText nt
where where
...@@ -978,3 +1072,38 @@ filterTermSize :: Maybe TermSize -> NgramsTerm -> Boolean ...@@ -978,3 +1072,38 @@ filterTermSize :: Maybe TermSize -> NgramsTerm -> Boolean
filterTermSize (Just MonoTerm) nt = isSingleNgramsTerm nt filterTermSize (Just MonoTerm) nt = isSingleNgramsTerm nt
filterTermSize (Just MultiTerm) nt = not $ isSingleNgramsTerm nt filterTermSize (Just MultiTerm) nt = not $ isSingleNgramsTerm nt
filterTermSize _ _ = true filterTermSize _ _ = true
type SyncResetButtonsProps =
( afterSync :: Unit -> Aff Unit
, ngramsLocalPatch :: NgramsTablePatch
, performAction :: CoreDispatch
)
syncResetButtons :: Record SyncResetButtonsProps -> R.Element
syncResetButtons p = R.createElement syncResetButtonsCpt p []
syncResetButtonsCpt :: R.Component SyncResetButtonsProps
syncResetButtonsCpt = R.hooksComponentWithModule thisModule "syncResetButtons" cpt
where
cpt { afterSync, ngramsLocalPatch, performAction } _ = do
synchronizing@(s /\ setSynchronizing) <- R.useState' false
let
hasChanges = ngramsLocalPatch /= mempty
newAfterSync x = do
afterSync x
liftEffect $ setSynchronizing $ const false
synchronizeClick _ = delay unit $ \_ -> do
setSynchronizing $ const true
performAction $ Synchronize { afterSync: newAfterSync }
pure $ H.div {} [
H.button { className: "btn btn-danger " <> if hasChanges then "" else " disabled"
, on: { click: \_ -> performAction ResetPatches }
} [ H.text "Reset" ]
, H.button { className: "btn btn-primary " <> (if s || (not hasChanges) then "disabled" else "")
, on: { click: synchronizeClick }
} [ H.text "Sync" ]
]
...@@ -91,13 +91,14 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt ...@@ -91,13 +91,14 @@ annuaireCpt = R.hooksComponentWithModule thisModule "annuaire" cpt
cpt {session, path, info: info@(AnnuaireInfo {name, date: date'}), frontends} _ = do cpt {session, path, info: info@(AnnuaireInfo {name, date: date'}), frontends} _ = do
pagePath <- R.useState' $ initialPagePath (fst path) pagePath <- R.useState' $ initialPagePath (fst path)
cacheState <- R.useState' NT.CacheOn cacheState <- R.useState' NT.CacheOff
pure $ R.fragment pure $ R.fragment
[ T.tableHeaderLayout { afterCacheStateChange: \_ -> launchAff_ $ clearCache unit [ T.tableHeaderLayout { afterCacheStateChange: \_ -> launchAff_ $ clearCache unit
, cacheState , cacheState
, date , date
, desc: name , desc: name
, key: "annuaire-" <> (show $ fst cacheState)
, query: "" , query: ""
, title: name , title: name
, user: "" } , user: "" }
......
...@@ -15,6 +15,7 @@ import Effect.Class (liftEffect) ...@@ -15,6 +15,7 @@ import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.InputWithEnter (inputWithEnter) import Gargantext.Components.InputWithEnter (inputWithEnter)
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs as Tabs import Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs as Tabs
import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser) import Gargantext.Components.Nodes.Annuaire.User.Contacts.Types (Contact(..), ContactData, ContactTouch(..), ContactWhere(..), ContactWho(..), HyperdataContact(..), HyperdataUser(..), _city, _country, _firstName, _labTeamDeptsJoinComma, _lastName, _mail, _office, _organizationJoinComma, _ouFirst, _phone, _role, _shared, _touch, _who, defaultContactTouch, defaultContactWhere, defaultContactWho, defaultHyperdataContact, defaultHyperdataUser)
...@@ -25,8 +26,8 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+ ...@@ -25,8 +26,8 @@ import Gargantext.Prelude (Unit, bind, const, discard, pure, show, unit, ($), (+
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, get, put, sessionId) import Gargantext.Sessions (Session, get, put, sessionId)
import Gargantext.Types (NodeType(..)) import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts" thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts"
display :: String -> Array R.Element -> R.Element display :: String -> Array R.Element -> R.Element
...@@ -144,7 +145,8 @@ infoRender (Tuple title content) = ...@@ -144,7 +145,8 @@ infoRender (Tuple title content) =
, H.span {} [H.text content] ] , H.span {} [H.text content] ]
type LayoutProps = ( type LayoutProps = (
frontends :: Frontends asyncTasks :: GAT.Reductor
, frontends :: Frontends
, nodeId :: Int , nodeId :: Int
, session :: Session , session :: Session
) )
...@@ -160,10 +162,10 @@ userLayout props = R.createElement userLayoutCpt props [] ...@@ -160,10 +162,10 @@ userLayout props = R.createElement userLayoutCpt props []
userLayoutCpt :: R.Component LayoutProps userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = R.hooksComponentWithModule thisModule "userLayout" cpt userLayoutCpt = R.hooksComponentWithModule thisModule "userLayout" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { asyncTasks, frontends, nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
pure $ userLayoutWithKey { frontends, key: show sid <> "-" <> show nodeId, nodeId, session } pure $ userLayoutWithKey { asyncTasks, frontends, key: show sid <> "-" <> show nodeId, nodeId, session }
userLayoutWithKey :: Record KeyLayoutProps -> R.Element userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props [] userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
...@@ -171,7 +173,7 @@ userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props [] ...@@ -171,7 +173,7 @@ userLayoutWithKey props = R.createElement userLayoutWithKeyCpt props []
userLayoutWithKeyCpt :: R.Component KeyLayoutProps userLayoutWithKeyCpt :: R.Component KeyLayoutProps
userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" cpt userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { asyncTasks, frontends, nodeId, session } _ = do
reload <- R.useState' 0 reload <- R.useState' 0
cacheState <- R.useState' NT.CacheOn cacheState <- R.useState' NT.CacheOn
...@@ -180,7 +182,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey" ...@@ -180,7 +182,7 @@ userLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "userLayoutWithKey"
\contactData@{contactNode: Contact {name, hyperdata}} -> \contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } [ H.ul { className: "col-md-12 list-group" } [
display (fromMaybe "no name" name) (contactInfos hyperdata (onUpdateHyperdata reload)) display (fromMaybe "no name" name) (contactInfos hyperdata (onUpdateHyperdata reload))
, Tabs.tabs { cacheState, contactData, frontends, nodeId, session } , Tabs.tabs { asyncTasks, cacheState, contactData, frontends, nodeId, session }
] ]
where where
onUpdateHyperdata :: R.State Int -> HyperdataUser -> Effect Unit onUpdateHyperdata :: R.State Int -> HyperdataUser -> Effect Unit
...@@ -211,8 +213,8 @@ saveContactHyperdata session id h = do ...@@ -211,8 +213,8 @@ saveContactHyperdata session id h = do
put session (Routes.NodeAPI Node (Just id) "") h put session (Routes.NodeAPI Node (Just id) "") h
type AnnuaireLayoutProps = type AnnuaireLayoutProps = (
( annuaireId :: Int annuaireId :: Int
| LayoutProps ) | LayoutProps )
...@@ -222,14 +224,14 @@ annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props [] ...@@ -222,14 +224,14 @@ annuaireUserLayout props = R.createElement annuaireUserLayoutCpt props []
annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps annuaireUserLayoutCpt :: R.Component AnnuaireLayoutProps
annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt annuaireUserLayoutCpt = R.hooksComponentWithModule thisModule "annuaireUserLayout" cpt
where where
cpt { annuaireId, frontends, nodeId, session } _ = do cpt { annuaireId, asyncTasks, frontends, nodeId, session } _ = do
cacheState <- R.useState' NT.CacheOn cacheState <- R.useState' NT.CacheOn
useLoader nodeId (getAnnuaireContact session annuaireId) $ useLoader nodeId (getAnnuaireContact session annuaireId) $
\contactData@{contactNode: Contact {name, hyperdata}} -> \contactData@{contactNode: Contact {name, hyperdata}} ->
H.ul { className: "col-md-12 list-group" } H.ul { className: "col-md-12 list-group" }
[ display (fromMaybe "no name" name) (contactInfos hyperdata onUpdateHyperdata) [ display (fromMaybe "no name" name) (contactInfos hyperdata onUpdateHyperdata)
, Tabs.tabs { cacheState, contactData, frontends, nodeId, session } ] , Tabs.tabs { asyncTasks, cacheState, contactData, frontends, nodeId, session } ]
where where
onUpdateHyperdata :: HyperdataUser -> Effect Unit onUpdateHyperdata :: HyperdataUser -> Effect Unit
......
...@@ -9,6 +9,7 @@ import Data.Tuple (fst) ...@@ -9,6 +9,7 @@ import Data.Tuple (fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Reactix as R import Reactix as R
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.DocsTable as DT import Gargantext.Components.DocsTable as DT
import Gargantext.Components.NgramsTable as NT import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.Tab as Tab import Gargantext.Components.Tab as Tab
...@@ -17,7 +18,6 @@ import Gargantext.Components.Nodes.Lists.Types as NTypes ...@@ -17,7 +18,6 @@ import Gargantext.Components.Nodes.Lists.Types as NTypes
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session)
import Gargantext.Types (TabType(..), TabSubType(..), CTabNgramType(..), PTabNgramType(..)) import Gargantext.Types (TabType(..), TabSubType(..), CTabNgramType(..), PTabNgramType(..))
import Gargantext.Utils.Reactix as R2
thisModule :: String thisModule :: String
thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs" thisModule = "Gargantext.Components.Nodes.Annuaire.User.Contacts.Tabs"
...@@ -43,8 +43,9 @@ modeTabType' Patents = CTabAuthors ...@@ -43,8 +43,9 @@ modeTabType' Patents = CTabAuthors
modeTabType' Books = CTabAuthors modeTabType' Books = CTabAuthors
modeTabType' Communication = CTabAuthors modeTabType' Communication = CTabAuthors
type TabsProps = type TabsProps = (
( cacheState :: R.State NTypes.CacheState asyncTasks :: GAT.Reductor
, cacheState :: R.State NTypes.CacheState
, contactData :: ContactData , contactData :: ContactData
, frontends :: Frontends , frontends :: Frontends
, nodeId :: Int , nodeId :: Int
...@@ -57,7 +58,7 @@ tabs props = R.createElement tabsCpt props [] ...@@ -57,7 +58,7 @@ tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where where
cpt { cacheState, contactData: {defaultListId}, frontends, nodeId, session} _ = do cpt { asyncTasks, cacheState, contactData: {defaultListId}, frontends, nodeId, session} _ = do
active <- R.useState' 0 active <- R.useState' 0
pure $ pure $
Tab.tabs { selected: fst active, tabs: tabs' } Tab.tabs { selected: fst active, tabs: tabs' }
...@@ -70,21 +71,28 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt ...@@ -70,21 +71,28 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, "Trash" /\ docs -- TODO pass-in trash mode , "Trash" /\ docs -- TODO pass-in trash mode
] ]
where where
patentsView = { cacheState, defaultListId, mode: Patents, nodeId, session } patentsView = { asyncTasks, cacheState, defaultListId, mode: Patents, nodeId, session }
booksView = { cacheState, defaultListId, mode: Books, nodeId, session } booksView = { asyncTasks, cacheState, defaultListId, mode: Books, nodeId, session }
commView = { cacheState, defaultListId, mode: Communication, nodeId, session } commView = { asyncTasks, cacheState, defaultListId, mode: Communication, nodeId, session }
chart = mempty chart = mempty
totalRecords = 4736 -- TODO totalRecords = 4736 -- TODO
docs = DT.docViewLayout docs = DT.docViewLayout
{ frontends, session, nodeId, chart, totalRecords { cacheState
, tabType: TabPairing TabDocs , chart
, listId: defaultListId
, corpusId: Nothing , corpusId: Nothing
, showSearch: true } , frontends
, listId: defaultListId
, nodeId
, session
, showSearch: true
, tabType: TabPairing TabDocs
, totalRecords
}
type NgramsViewTabsProps = type NgramsViewTabsProps = (
( cacheState :: R.State NTypes.CacheState asyncTasks :: GAT.Reductor
, cacheState :: R.State NTypes.CacheState
, defaultListId :: Int , defaultListId :: Int
, mode :: Mode , mode :: Mode
, nodeId :: Int , nodeId :: Int
...@@ -92,9 +100,10 @@ type NgramsViewTabsProps = ...@@ -92,9 +100,10 @@ type NgramsViewTabsProps =
) )
ngramsView :: Record NgramsViewTabsProps -> R.Element ngramsView :: Record NgramsViewTabsProps -> R.Element
ngramsView { cacheState, defaultListId, mode, nodeId, session } = ngramsView { asyncTasks, cacheState, defaultListId, mode, nodeId, session } =
NT.mainNgramsTable { NT.mainNgramsTable {
afterSync: \_ -> pure unit afterSync: \_ -> pure unit
, asyncTasks
, cacheState , cacheState
, defaultListId , defaultListId
, nodeId , nodeId
......
...@@ -428,7 +428,7 @@ loadCorpus {nodeId, session} = do ...@@ -428,7 +428,7 @@ loadCorpus {nodeId, session} = do
loadCorpusWithChild :: Record LoadProps -> Aff CorpusData loadCorpusWithChild :: Record LoadProps -> Aff CorpusData
loadCorpusWithChild {nodeId:childId, session} = do loadCorpusWithChild { nodeId: childId, session } = do
-- fetch corpus via lists parentId -- fetch corpus via lists parentId
(NodePoly {parentId: corpusId} :: NodePoly {}) <- get session $ listNodeRoute childId "" (NodePoly {parentId: corpusId} :: NodePoly {}) <- get session $ listNodeRoute childId ""
corpusNode <- get session $ corpusNodeRoute corpusId "" corpusNode <- get session $ corpusNodeRoute corpusId ""
...@@ -436,7 +436,7 @@ loadCorpusWithChild {nodeId:childId, session} = do ...@@ -436,7 +436,7 @@ loadCorpusWithChild {nodeId:childId, session} = do
:: forall a. DecodeJson a => AffTableResult (NodePoly a) :: forall a. DecodeJson a => AffTableResult (NodePoly a)
case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of case (A.head defaultListIds.docs :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) -> Just (NodePoly { id: defaultListId }) ->
pure {corpusId, corpusNode, defaultListId} pure { corpusId, corpusNode, defaultListId }
Nothing -> Nothing ->
throwError $ error "Missing default list" throwError $ error "Missing default list"
where where
......
...@@ -88,8 +88,8 @@ dashboardLayoutLoadedCpt = R.hooksComponentWithModule thisModule "dashboardLayou ...@@ -88,8 +88,8 @@ dashboardLayoutLoadedCpt = R.hooksComponentWithModule thisModule "dashboardLayou
where where
cpt props@{ charts, corpusId, defaultListId, onChange, session } _ = do cpt props@{ charts, corpusId, defaultListId, onChange, session } _ = do
pure $ pure $
H.div {} ([ H.div {} ([ H.h1 {} [ H.text "Board" ]
H.h1 {} [ H.text "DashBoard" ] , H.p {} [ H.text "Summary of all your charts here" ]
] <> chartsEls <> [addNew]) ] <> chartsEls <> [addNew])
where where
addNew = H.div { className: "row" } [ addNew = H.div { className: "row" } [
......
module Gargantext.Components.Nodes.Corpus.Document where module Gargantext.Components.Nodes.Corpus.Document where
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:?)) --import Data.Argonaut (encodeJson) -- DEBUG
import Data.Generic.Rep (class Generic) --import Data.Argonaut.Core (stringifyWithIndent) -- DEBUG
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..), fromMaybe) import Data.Maybe (Maybe(..), fromMaybe)
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude (bind, pure, show, unit, ($), (<>), (<<<))
import Gargantext.Components.AutoUpdate ( autoUpdate) import Gargantext.Components.AutoUpdate (autoUpdate)
import Gargantext.Components.Search (SearchType(..)) import Gargantext.Components.Search (SearchType(..))
import Gargantext.Components.Node (NodePoly(..)) import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus.Document.Types (DocPath, Document(..), LoadedData, NodeDocument, Props, State, initialState)
import Gargantext.Components.NgramsTable.Core import Gargantext.Components.NgramsTable.Core
( CoreState, NgramsPatch(..), NgramsTerm, Replace, Versioned(..) ( CoreAction(..), Versioned(..), addNewNgramA, applyNgramsPatches, coreDispatch, loadNgramsTable
, VersionedNgramsTable, addNewNgram, applyNgramsTablePatch, commitPatch , replace, setTermListA, syncResetButtons, findNgramRoot )
, loadNgramsTable, replace, singletonNgramsTablePatch, syncPatches )
import Gargantext.Components.Annotation.AnnotatedField as AnnotatedField import Gargantext.Components.Annotation.AnnotatedField as AnnotatedField
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session, get, sessionId) import Gargantext.Sessions (Session, get, sessionId)
import Gargantext.Types (CTabNgramType(..), NodeType(..), TabSubType(..), TabType(..), TermList, ScoreType(..)) import Gargantext.Types (CTabNgramType(..), NodeType(..), TabSubType(..), TabType(..), ScoreType(..))
import Gargantext.Utils as U import Gargantext.Utils as U
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Corpus.Document" thisModule = "Gargantext.Components.Nodes.Corpus.Document"
type DocPath =
{
corpusId :: Maybe Int
, listIds :: Array Int
, nodeId :: Int
, session :: Session
, tabType :: TabType
}
type NodeDocument = NodePoly Document
type LoadedData =
{ document :: NodeDocument
, ngramsTable :: VersionedNgramsTable
}
type Props = (
loaded :: LoadedData
, path :: DocPath
)
-- This is a subpart of NgramsTable.State.
type State = CoreState ()
initialState
:: forall props others
. { loaded :: { ngramsTable :: VersionedNgramsTable | others }
| props }
-> State
initialState {loaded: {ngramsTable: Versioned {version}}} =
{ ngramsLocalPatch: mempty
, ngramsStagePatch: mempty
, ngramsValidPatch: mempty
, ngramsVersion: version
}
-- This is a subset of NgramsTable.Action.
data Action
= SetTermListItem NgramsTerm (Replace TermList)
| AddNewNgram NgramsTerm TermList
| Synchronize
newtype Status = Status { failed :: Int
, succeeded :: Int
, remaining :: Int
}
newtype DocumentV3 =
DocumentV3 { abstract :: Maybe String
, authors :: Maybe String
--, error :: Maybe String
, language_iso2 :: Maybe String
, language_iso3 :: Maybe String
, language_name :: Maybe String
, publication_date :: Maybe String
, publication_day :: Maybe Int
, publication_hour :: Maybe Int
, publication_minute :: Maybe Int
, publication_month :: Maybe Int
, publication_second :: Maybe Int
, publication_year :: Maybe Int
, realdate_full_ :: Maybe String
, source :: Maybe String
, statuses :: Maybe (Array Status)
, title :: Maybe String
}
defaultNodeDocumentV3 :: NodePoly DocumentV3
defaultNodeDocumentV3 =
NodePoly { id : 0
, typename : 0
, userId : 0
, parentId : 0
, name : "Default name"
, date : "Default date"
, hyperdata : defaultDocumentV3
}
defaultDocumentV3 :: DocumentV3
defaultDocumentV3 =
DocumentV3 { abstract : Nothing
, authors : Nothing
--, error : Nothing
, language_iso2 : Nothing
, language_iso3 : Nothing
, language_name : Nothing
, publication_date : Nothing
, publication_day : Nothing
, publication_hour : Nothing
, publication_minute : Nothing
, publication_month : Nothing
, publication_second : Nothing
, publication_year : Nothing
, realdate_full_ : Nothing
, source : Nothing
, statuses : Nothing
, title : Nothing
}
data Document
= Document
{ abstract :: Maybe String
, authors :: Maybe String
, bdd :: Maybe String
, doi :: Maybe String
, language_iso2 :: Maybe String
-- , page :: Maybe Int
, publication_date :: Maybe String
--, publication_second :: Maybe Int
--, publication_minute :: Maybe Int
--, publication_hour :: Maybe Int
, publication_day :: Maybe Int
, publication_month :: Maybe Int
, publication_year :: Maybe Int
, source :: Maybe String
, institutes :: Maybe String
, title :: Maybe String
, uniqId :: Maybe String
--, url :: Maybe String
--, text :: Maybe String
}
publicationDate :: Document -> String publicationDate :: Document -> String
publicationDate (Document doc@{publication_year: Nothing}) = "" publicationDate (Document doc@{publication_year: Nothing}) = ""
publicationDate (Document doc@{publication_year: Just py, publication_month: Nothing}) = U.zeroPad 2 py publicationDate (Document doc@{publication_year: Just py, publication_month: Nothing}) = U.zeroPad 2 py
publicationDate (Document doc@{publication_year: Just py, publication_month: Just pm, publication_day: Nothing}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm) publicationDate (Document doc@{publication_year: Just py, publication_month: Just pm, publication_day: Nothing}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm)
publicationDate (Document doc@{publication_year: Just py, publication_month: Just pm, publication_day: Just pd}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm) <> "-" <> (U.zeroPad 2 pd) publicationDate (Document doc@{publication_year: Just py, publication_month: Just pm, publication_day: Just pd}) = (U.zeroPad 2 py) <> "-" <> (U.zeroPad 2 pm) <> "-" <> (U.zeroPad 2 pd)
defaultNodeDocument :: NodeDocument
defaultNodeDocument =
NodePoly { id : 0
, typename : 0
, userId : 0
, parentId : 0
, name : "Default name"
, date : "Default date"
, hyperdata : defaultDocument
}
-- TODO: BUG if DOI does not exist, page is not shown
defaultDocument :: Document
defaultDocument =
Document { abstract : Nothing
, authors : Nothing
, bdd : Nothing
, doi : Nothing
, language_iso2 : Nothing
--, page : Nothing
, publication_date : Nothing
--, publication_second : Nothing
--, publication_minute : Nothing
--, publication_hour : Nothing
, publication_day : Nothing
, publication_month : Nothing
, publication_year : Nothing
, source : Nothing
, institutes : Nothing
, title : Nothing
, uniqId : Nothing
--, url : Nothing
--, text : Nothing
}
derive instance genericDocument :: Generic Document _
derive instance genericDocumentV3 :: Generic DocumentV3 _
derive instance genericStatus :: Generic Status _
instance showDocument :: Show Document where
show = genericShow
instance showDocumentV3 :: Show DocumentV3 where
show = genericShow
instance showStatus :: Show Status where
show = genericShow
instance decodeStatus :: DecodeJson Status
where
decodeJson json = do
obj <- decodeJson json
failed <- obj .: "failed"
succeeded <- obj .: "succeeded"
remaining <- obj .: "remaining"
pure $ Status {failed, succeeded, remaining}
instance decodeDocumentV3 :: DecodeJson DocumentV3
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .:? "abstract"
authors <- obj .: "authors"
--error <- obj .: "error"
language_iso2 <- obj .: "language_iso2"
language_iso3 <- obj .: "language_iso3"
language_name <- obj .: "language_name"
publication_date <- obj .: "publication_date"
publication_day <- obj .: "publication_day"
publication_hour <- obj .: "publication_hour"
publication_minute <- obj .: "publication_minute"
publication_month <- obj .: "publication_month"
publication_second <- obj .: "publication_second"
publication_year <- obj .: "publication_year"
realdate_full_ <- obj .: "realdate_full_"
source <- obj .: "source"
statuses <- obj .: "statuses"
title <- obj .: "title"
pure $ DocumentV3 { abstract
, authors
--, error
, language_iso2
, language_iso3
, language_name
, publication_date
, publication_day
, publication_hour
, publication_minute
, publication_month
, publication_second
, publication_year
, realdate_full_
, source
, statuses
, title
}
instance decodeDocument :: DecodeJson Document
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .:? "abstract"
authors <- obj .:? "authors"
bdd <- obj .:? "bdd"
doi <- obj .:? "doi"
language_iso2 <- obj .:? "language_iso2"
-- page <- obj .:? "page"
publication_date <- obj .:? "publication_date"
--publication_second <- obj .:? "publication_second"
--publication_minute <- obj .:? "publication_minute"
--publication_hour <- obj .:? "publication_hour"
publication_day <- obj .:? "publication_day"
publication_month <- obj .:? "publication_month"
publication_year <- obj .:? "publication_year"
source <- obj .:? "sources"
institutes <- obj .:? "institutes"
title <- obj .:? "title"
uniqId <- obj .:? "uniqId"
--url <- obj .: "url"
--text <- obj .: "text"
pure $ Document { abstract
, authors
, bdd
, doi
, language_iso2
-- , page
, publication_date
--, publication_second
--, publication_minute
--, publication_hour
, publication_day
, publication_month
, publication_year
, source
, institutes
, title
, uniqId
--, url
--, text
}
docViewWrapper :: Record Props -> R.Element docViewWrapper :: Record Props -> R.Element
docViewWrapper props = R.createElement docViewWrapperCpt props [] docViewWrapper props = R.createElement docViewWrapperCpt props []
...@@ -321,15 +57,38 @@ docView props = R.createElement docViewCpt props [] ...@@ -321,15 +57,38 @@ docView props = R.createElement docViewCpt props []
docViewCpt :: R.Component DocViewProps docViewCpt :: R.Component DocViewProps
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where where
cpt props@{ loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }, state } _ = do cpt { path
pure $ H.div {} [ , loaded: loaded@{ ngramsTable: Versioned { data: initTable }, document }
autoUpdate { duration: 3000, effect: dispatch Synchronize } , state: state@({ ngramsVersion: version, ngramsLocalPatch } /\ _)
, H.div { className: "container1" } } _children = do
let
afterSync = \_ -> pure unit
syncResetBtns = [syncResetButtons { afterSync, ngramsLocalPatch
, performAction: dispatch
}]
withAutoUpdate = false
autoUpd :: Array R.Element
autoUpd = if withAutoUpdate then
[ autoUpdate { duration: 5000
, effect: dispatch $ Synchronize { afterSync }
}
]
else []
pure $ H.div {} $
autoUpd <> syncResetBtns <>
--DEBUG
--[ H.pre { rows: 30 } [
-- H.text (stringifyWithIndent 2 (encodeJson (fst state)))
-- ] ] <>
[
H.div { className: "container1" }
[ [
R2.row R2.row
[ [
R2.col 8 R2.col 8
[ H.h4 {} [ annotate state doc.title ] [ H.h4 {} [ annotate doc.title ]
, H.ul { className: "list-group" } , H.ul { className: "list-group" }
[ li' [ H.span {} [ text' doc.source ] [ li' [ H.span {} [ text' doc.source ]
, badge "source" , badge "source"
...@@ -343,7 +102,7 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -343,7 +102,7 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
] ]
] ]
, badge "abstract" , badge "abstract"
, annotate state doc.abstract , annotate doc.abstract
, H.div { className: "jumbotron" } , H.div { className: "jumbotron" }
[ H.p {} [ H.text "Empty Full Text" ] [ H.p {} [ H.text "Empty Full Text" ]
] ]
...@@ -352,31 +111,19 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -352,31 +111,19 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
] ]
] ]
where where
dispatch :: Action -> Effect Unit dispatch = coreDispatch path state
dispatch (AddNewNgram ngram termList) = do ngrams = applyNgramsPatches (fst state) initTable
commitPatch (Versioned {version, data: pt}) state annotate text = AnnotatedField.annotatedField { ngrams
where , setTermList
({ ngramsVersion: version } /\ _) = state
pt = addNewNgram ngram termList
dispatch (SetTermListItem ngram termList) = do
commitPatch (Versioned {version, data: pt}) state
where
({ ngramsVersion: version } /\ _) = state
pe = NgramsPatch { patch_list: termList, patch_children: mempty }
pt = singletonNgramsTablePatch ngram pe
dispatch Synchronize = do
syncPatches props.path props.state (\_ -> pure unit)
annotate state text = AnnotatedField.annotatedField { ngrams: ngramsTable state
, setTermList: setTermList state
, text } , text }
badge s = H.span { className: "badge badge-default badge-pill" } [ H.text s ] badge s = H.span { className: "badge badge-default badge-pill" } [ H.text s ]
li' = H.li { className: "list-group-item justify-content-between" } li' = H.li { className: "list-group-item justify-content-between" }
ngramsTable ({ ngramsLocalPatch, ngramsValidPatch } /\ _) = applyNgramsTablePatch (ngramsLocalPatch <> ngramsValidPatch) initTable setTermListOrAddA ngram Nothing = addNewNgramA ngram
setTermList state ngram Nothing newList = dispatch (AddNewNgram ngram newList) setTermListOrAddA ngram (Just oldList) = setTermListA ngram <<< replace oldList
setTermList state ngram (Just oldList) newList = dispatch (SetTermListItem ngram (replace oldList newList)) setTermList ngram mOldList = dispatch <<< setTermListOrAddA (findNgramRoot ngrams ngram) mOldList
-- Here the use of findNgramRoot makes that we always target the root of an ngram group.
text' x = H.text $ fromMaybe "Nothing" x text' x = H.text $ fromMaybe "Nothing" x
NodePoly {hyperdata : Document doc} = document NodePoly {hyperdata: Document doc} = document
type LayoutProps = ( type LayoutProps = (
corpusId :: Maybe Int corpusId :: Maybe Int
......
module Gargantext.Components.Nodes.Corpus.Document.Types where
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.:?))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.NgramsTable.Core (CoreState, Versioned(..) , VersionedNgramsTable)
import Gargantext.Sessions (Session)
import Gargantext.Types (TabType)
type DocPath =
{ corpusId :: Maybe Int
, listIds :: Array Int
, nodeId :: Int
, session :: Session
, tabType :: TabType
}
type NodeDocument = NodePoly Document
type LoadedData =
{ document :: NodeDocument
, ngramsTable :: VersionedNgramsTable
}
type Props = (
loaded :: LoadedData
, path :: DocPath
)
-- This is a subpart of NgramsTable.State.
type State = CoreState ()
initialState
:: forall props others
. { loaded :: { ngramsTable :: VersionedNgramsTable | others }
| props }
-> State
initialState {loaded: {ngramsTable: Versioned {version}}} =
{ ngramsLocalPatch: mempty
, ngramsStagePatch: mempty
, ngramsValidPatch: mempty
, ngramsVersion: version
}
newtype Status = Status { failed :: Int
, succeeded :: Int
, remaining :: Int
}
newtype DocumentV3 =
DocumentV3 { abstract :: Maybe String
, authors :: Maybe String
--, error :: Maybe String
, language_iso2 :: Maybe String
, language_iso3 :: Maybe String
, language_name :: Maybe String
, publication_date :: Maybe String
, publication_day :: Maybe Int
, publication_hour :: Maybe Int
, publication_minute :: Maybe Int
, publication_month :: Maybe Int
, publication_second :: Maybe Int
, publication_year :: Maybe Int
, realdate_full_ :: Maybe String
, source :: Maybe String
, statuses :: Maybe (Array Status)
, title :: Maybe String
}
defaultNodeDocumentV3 :: NodePoly DocumentV3
defaultNodeDocumentV3 =
NodePoly { id : 0
, typename : 0
, userId : 0
, parentId : 0
, name : "Default name"
, date : "Default date"
, hyperdata : defaultDocumentV3
}
defaultDocumentV3 :: DocumentV3
defaultDocumentV3 =
DocumentV3 { abstract : Nothing
, authors : Nothing
--, error : Nothing
, language_iso2 : Nothing
, language_iso3 : Nothing
, language_name : Nothing
, publication_date : Nothing
, publication_day : Nothing
, publication_hour : Nothing
, publication_minute : Nothing
, publication_month : Nothing
, publication_second : Nothing
, publication_year : Nothing
, realdate_full_ : Nothing
, source : Nothing
, statuses : Nothing
, title : Nothing
}
data Document
= Document
{ abstract :: Maybe String
, authors :: Maybe String
, bdd :: Maybe String
, doi :: Maybe String
, language_iso2 :: Maybe String
-- , page :: Maybe Int
, publication_date :: Maybe String
--, publication_second :: Maybe Int
--, publication_minute :: Maybe Int
--, publication_hour :: Maybe Int
, publication_day :: Maybe Int
, publication_month :: Maybe Int
, publication_year :: Maybe Int
, source :: Maybe String
, institutes :: Maybe String
, title :: Maybe String
, uniqId :: Maybe String
--, url :: Maybe String
--, text :: Maybe String
}
defaultNodeDocument :: NodeDocument
defaultNodeDocument =
NodePoly { id : 0
, typename : 0
, userId : 0
, parentId : 0
, name : "Default name"
, date : "Default date"
, hyperdata : defaultDocument
}
-- TODO: BUG if DOI does not exist, page is not shown
defaultDocument :: Document
defaultDocument =
Document { abstract : Nothing
, authors : Nothing
, bdd : Nothing
, doi : Nothing
, language_iso2 : Nothing
--, page : Nothing
, publication_date : Nothing
--, publication_second : Nothing
--, publication_minute : Nothing
--, publication_hour : Nothing
, publication_day : Nothing
, publication_month : Nothing
, publication_year : Nothing
, source : Nothing
, institutes : Nothing
, title : Nothing
, uniqId : Nothing
--, url : Nothing
--, text : Nothing
}
derive instance genericDocument :: Generic Document _
derive instance genericDocumentV3 :: Generic DocumentV3 _
derive instance genericStatus :: Generic Status _
instance showDocument :: Show Document where
show = genericShow
instance showDocumentV3 :: Show DocumentV3 where
show = genericShow
instance showStatus :: Show Status where
show = genericShow
instance decodeStatus :: DecodeJson Status
where
decodeJson json = do
obj <- decodeJson json
failed <- obj .: "failed"
succeeded <- obj .: "succeeded"
remaining <- obj .: "remaining"
pure $ Status {failed, succeeded, remaining}
instance decodeDocumentV3 :: DecodeJson DocumentV3
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .:? "abstract"
authors <- obj .: "authors"
--error <- obj .: "error"
language_iso2 <- obj .: "language_iso2"
language_iso3 <- obj .: "language_iso3"
language_name <- obj .: "language_name"
publication_date <- obj .: "publication_date"
publication_day <- obj .: "publication_day"
publication_hour <- obj .: "publication_hour"
publication_minute <- obj .: "publication_minute"
publication_month <- obj .: "publication_month"
publication_second <- obj .: "publication_second"
publication_year <- obj .: "publication_year"
realdate_full_ <- obj .: "realdate_full_"
source <- obj .: "source"
statuses <- obj .: "statuses"
title <- obj .: "title"
pure $ DocumentV3 { abstract
, authors
--, error
, language_iso2
, language_iso3
, language_name
, publication_date
, publication_day
, publication_hour
, publication_minute
, publication_month
, publication_second
, publication_year
, realdate_full_
, source
, statuses
, title
}
instance decodeDocument :: DecodeJson Document
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .:? "abstract"
authors <- obj .:? "authors"
bdd <- obj .:? "bdd"
doi <- obj .:? "doi"
language_iso2 <- obj .:? "language_iso2"
-- page <- obj .:? "page"
publication_date <- obj .:? "publication_date"
--publication_second <- obj .:? "publication_second"
--publication_minute <- obj .:? "publication_minute"
--publication_hour <- obj .:? "publication_hour"
publication_day <- obj .:? "publication_day"
publication_month <- obj .:? "publication_month"
publication_year <- obj .:? "publication_year"
source <- obj .:? "sources"
institutes <- obj .:? "institutes"
title <- obj .:? "title"
uniqId <- obj .:? "uniqId"
--url <- obj .: "url"
--text <- obj .: "text"
pure $ Document { abstract
, authors
, bdd
, doi
, language_iso2
-- , page
, publication_date
--, publication_second
--, publication_minute
--, publication_hour
, publication_day
, publication_month
, publication_year
, source
, institutes
, title
, uniqId
--, url
--, text
}
...@@ -8,6 +8,7 @@ import Data.Generic.Rep (class Generic) ...@@ -8,6 +8,7 @@ import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq) import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow) import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Gargantext.Components.Node (NodePoly) import Gargantext.Components.Node (NodePoly)
import Gargantext.Prelude import Gargantext.Prelude
......
...@@ -51,6 +51,7 @@ instance encodeJsonHyperdata :: Argonaut.EncodeJson Hyperdata where ...@@ -51,6 +51,7 @@ instance encodeJsonHyperdata :: Argonaut.EncodeJson Hyperdata where
type Props = type Props =
( nodeId :: Int ( nodeId :: Int
, session :: Session , session :: Session
, nodeType :: NodeType
) )
type Reload = R.State Int type Reload = R.State Int
...@@ -66,10 +67,10 @@ frameLayout props = R.createElement frameLayoutCpt props [] ...@@ -66,10 +67,10 @@ frameLayout props = R.createElement frameLayoutCpt props []
frameLayoutCpt :: R.Component Props frameLayoutCpt :: R.Component Props
frameLayoutCpt = R.hooksComponentWithModule thisModule "frameLayout" cpt frameLayoutCpt = R.hooksComponentWithModule thisModule "frameLayout" cpt
where where
cpt {nodeId, session} _ = do cpt {nodeId, session, nodeType} _ = do
let sid = sessionId session let sid = sessionId session
pure $ frameLayoutWithKey { key: show sid <> "-" <> show nodeId, nodeId, session } pure $ frameLayoutWithKey { key: show sid <> "-" <> show nodeId, nodeId, session, nodeType}
frameLayoutWithKey :: Record KeyProps -> R.Element frameLayoutWithKey :: Record KeyProps -> R.Element
frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props [] frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
...@@ -77,11 +78,11 @@ frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props [] ...@@ -77,11 +78,11 @@ frameLayoutWithKey props = R.createElement frameLayoutWithKeyCpt props []
frameLayoutWithKeyCpt :: R.Component KeyProps frameLayoutWithKeyCpt :: R.Component KeyProps
frameLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "frameLayoutWithKey" cpt frameLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "frameLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { nodeId, session, nodeType} _ = do
reload <- R.useState' 0 reload <- R.useState' 0
useLoader {nodeId, reload: fst reload, session} loadframeWithReload $ useLoader {nodeId, reload: fst reload, session} loadframeWithReload $
\frame -> frameLayoutView {frame, nodeId, reload, session} \frame -> frameLayoutView {frame, nodeId, reload, session, nodeType}
type ViewProps = type ViewProps =
( frame :: NodePoly Hyperdata ( frame :: NodePoly Hyperdata
...@@ -90,12 +91,12 @@ type ViewProps = ...@@ -90,12 +91,12 @@ type ViewProps =
) )
data FrameType = Calc | Write
type Base = String type Base = String
type FrameId = String type FrameId = String
hframeUrl :: Base -> FrameId -> String hframeUrl :: NodeType -> Base -> FrameId -> String
hframeUrl base frame_id = base <> "/" <> frame_id <> "?both" hframeUrl NodeFrameNotebook _ frame_id = frame_id -- Temp fix : frame_id is currently the whole url created
hframeUrl _ base frame_id = base <> "/" <> frame_id <> "?both"
frameLayoutView :: Record ViewProps -> R.Element frameLayoutView :: Record ViewProps -> R.Element
frameLayoutView props = R.createElement frameLayoutViewCpt props [] frameLayoutView props = R.createElement frameLayoutViewCpt props []
...@@ -103,9 +104,9 @@ frameLayoutView props = R.createElement frameLayoutViewCpt props [] ...@@ -103,9 +104,9 @@ frameLayoutView props = R.createElement frameLayoutViewCpt props []
frameLayoutViewCpt :: R.Component ViewProps frameLayoutViewCpt :: R.Component ViewProps
frameLayoutViewCpt = R.hooksComponentWithModule thisModule "frameLayoutView" cpt frameLayoutViewCpt = R.hooksComponentWithModule thisModule "frameLayoutView" cpt
where where
cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session} _ = do cpt {frame: (NodePoly {hyperdata: Hyperdata {base, frame_id}}), nodeId, reload, session, nodeType} _ = do
pure $ H.div { className : "frame" } pure $ H.div { className : "frame" }
[ H.iframe { src: hframeUrl base frame_id [ H.iframe { src: hframeUrl nodeType base frame_id
, width: "100%" , width: "100%"
, height: "100%" , height: "100%"
} [] } []
......
module Gargantext.Components.Nodes.Lists where module Gargantext.Components.Nodes.Lists where
import Data.Tuple (fst)
import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Reactix as R import Reactix as R
import Record as Record
------------------------------------------------------------------------ ------------------------------------------------------------------------
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.NgramsTable.Loader (clearCache) import Gargantext.Components.NgramsTable.Loader (clearCache)
import Gargantext.Components.Node (NodePoly(..)) import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild) import Gargantext.Components.Nodes.Corpus (loadCorpusWithChild)
...@@ -12,16 +16,19 @@ import Gargantext.Components.Nodes.Lists.Types as NT ...@@ -12,16 +16,19 @@ import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Table as Table import Gargantext.Components.Table as Table
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, sessionId, getCacheState, setCacheState)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Lists" thisModule = "Gargantext.Components.Nodes.Lists"
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
type Props = ( type Props = (
nodeId :: Int asyncTasks :: GAT.Reductor
, nodeId :: Int
, session :: Session , session :: Session
, sessionUpdate :: Session -> Effect Unit
) )
listsLayout :: Record Props -> R.Element listsLayout :: Record Props -> R.Element
...@@ -33,7 +40,7 @@ listsLayoutCpt = R.hooksComponentWithModule thisModule "listsLayout" cpt ...@@ -33,7 +40,7 @@ listsLayoutCpt = R.hooksComponentWithModule thisModule "listsLayout" cpt
cpt path@{ nodeId, session } _ = do cpt path@{ nodeId, session } _ = do
let sid = sessionId session let sid = sessionId session
pure $ listsLayoutWithKey { key: show sid <> "-" <> show nodeId, nodeId, session } pure $ listsLayoutWithKey $ Record.merge path { key: show sid <> "-" <> show nodeId }
type KeyProps = ( type KeyProps = (
key :: String key :: String
...@@ -46,29 +53,36 @@ listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props [] ...@@ -46,29 +53,36 @@ listsLayoutWithKey props = R.createElement listsLayoutWithKeyCpt props []
listsLayoutWithKeyCpt :: R.Component KeyProps listsLayoutWithKeyCpt :: R.Component KeyProps
listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt listsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "listsLayoutWithKey" cpt
where where
cpt { nodeId, session } _ = do cpt { asyncTasks, nodeId, session, sessionUpdate } _ = do
let path = { nodeId, session } let path = { nodeId, session }
cacheState <- R.useState' NT.CacheOn cacheState <- R.useState' $ getCacheState NT.CacheOn session nodeId
useLoader path loadCorpusWithChild $ useLoader path loadCorpusWithChild $
\corpusData@{ corpusId, corpusNode: NodePoly poly, defaultListId } -> \corpusData@{ corpusId, corpusNode: NodePoly poly, defaultListId } ->
let { date, hyperdata : Hyperdata h, name } = poly let { date, hyperdata : Hyperdata h, name } = poly
CorpusInfo {desc,query,authors} = getCorpusInfo h.fields CorpusInfo { authors, desc, query } = getCorpusInfo h.fields
in in
R.fragment [ R.fragment [
Table.tableHeaderLayout { Table.tableHeaderLayout {
afterCacheStateChange: \_ -> launchAff_ $ clearCache unit afterCacheStateChange
, cacheState , cacheState
, date , date
, desc , desc
, key: "listsLayoutWithKey-header-" <> (show $ fst cacheState)
, query , query
, title: "Corpus " <> name , title: "Corpus " <> name
, user: authors } , user: authors }
, Tabs.tabs { , Tabs.tabs {
cacheState asyncTasks
, cacheState
, corpusData , corpusData
, corpusId , corpusId
, key: "listsLayoutWithKey-tabs-" <> (show $ fst cacheState)
, session } , session }
] ]
where
afterCacheStateChange cacheState = do
launchAff_ $ clearCache unit
sessionUpdate $ setCacheState session nodeId cacheState
------------------------------------------------------------------------ ------------------------------------------------------------------------
module Gargantext.Components.Nodes.Lists.Tabs where module Gargantext.Components.Nodes.Lists.Tabs where
import Data.Maybe (Maybe(..), fromMaybe) import Data.Maybe (Maybe(..), fromMaybe)
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log2)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.AsyncTasks as GAT
import Gargantext.Components.NgramsTable as NT import Gargantext.Components.NgramsTable as NT
import Gargantext.Components.Nodes.Corpus.Types (CorpusData) import Gargantext.Components.Nodes.Corpus.Types (CorpusData)
import Gargantext.Components.Nodes.Corpus.Chart.Metrics (metrics) import Gargantext.Components.Nodes.Corpus.Chart.Metrics (metrics)
...@@ -27,19 +25,26 @@ import Gargantext.Utils.Reactix as R2 ...@@ -27,19 +25,26 @@ import Gargantext.Utils.Reactix as R2
thisModule :: String thisModule :: String
thisModule = "Gargantext.Components.Nodes.Lists.Tabs" thisModule = "Gargantext.Components.Nodes.Lists.Tabs"
type Props = ( cacheState :: R.State NTypes.CacheState type Props = (
asyncTasks :: GAT.Reductor
, cacheState :: R.State NTypes.CacheState
, corpusData :: CorpusData , corpusData :: CorpusData
, corpusId :: Int , corpusId :: Int
, session :: Session , session :: Session
) )
tabs :: Record Props -> R.Element type PropsWithKey = (
key :: String
| Props
)
tabs :: Record PropsWithKey -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component Props tabsCpt :: R.Component PropsWithKey
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where where
cpt { cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do cpt { asyncTasks, cacheState, corpusData: corpusData@{ defaultListId }, corpusId, session } _ = do
(selected /\ setSelected) <- R.useState' 0 (selected /\ setSelected) <- R.useState' 0
pure $ Tab.tabs { selected, tabs: tabs' } pure $ Tab.tabs { selected, tabs: tabs' }
...@@ -48,7 +53,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt ...@@ -48,7 +53,7 @@ tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
, "Institutes" /\ view Institutes , "Institutes" /\ view Institutes
, "Sources" /\ view Sources , "Sources" /\ view Sources
, "Terms" /\ view Terms ] , "Terms" /\ view Terms ]
view mode = ngramsView { cacheState, corpusData, corpusId, mode, session } view mode = ngramsView { asyncTasks, cacheState, corpusData, corpusId, mode, session }
type NgramsViewProps = ( mode :: Mode | Props ) type NgramsViewProps = ( mode :: Mode | Props )
...@@ -58,7 +63,8 @@ ngramsView props = R.createElement ngramsViewCpt props [] ...@@ -58,7 +63,8 @@ ngramsView props = R.createElement ngramsViewCpt props []
ngramsViewCpt :: R.Component NgramsViewProps ngramsViewCpt :: R.Component NgramsViewProps
ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
where where
cpt { cacheState cpt { asyncTasks
, cacheState
, corpusData: { defaultListId } , corpusData: { defaultListId }
, corpusId , corpusId
, mode , mode
...@@ -70,6 +76,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt ...@@ -70,6 +76,7 @@ ngramsViewCpt = R.hooksComponentWithModule thisModule "ngramsView" cpt
pure $ R.fragment pure $ R.fragment
( charts tabNgramType chartType chartsReload ( charts tabNgramType chartType chartsReload
<> [ NT.mainNgramsTable { afterSync: afterSync chartsReload <> [ NT.mainNgramsTable { afterSync: afterSync chartsReload
, asyncTasks
, cacheState , cacheState
, defaultListId , defaultListId
, nodeId: corpusId , nodeId: corpusId
......
module Gargantext.Components.Nodes.Lists.Types where module Gargantext.Components.Nodes.Lists.Types where
import Data.Argonaut (class DecodeJson, decodeJson, class EncodeJson, encodeJson, (~>), (:=))
import Data.Argonaut.Decode.Error (JsonDecodeError(..))
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq) import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Show (genericShow)
import Gargantext.Prelude import Gargantext.Prelude
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Lists.Types" thisModule = "Gargantext.Components.Nodes.Lists.Types"
data CacheState = CacheOn | CacheOff data CacheState = CacheOn | CacheOff
...@@ -12,3 +17,15 @@ data CacheState = CacheOn | CacheOff ...@@ -12,3 +17,15 @@ data CacheState = CacheOn | CacheOff
derive instance genericCacheState :: Generic CacheState _ derive instance genericCacheState :: Generic CacheState _
instance eqCacheState :: Eq CacheState where instance eqCacheState :: Eq CacheState where
eq = genericEq eq = genericEq
instance decodeJsonCacheState :: DecodeJson CacheState where
decodeJson json = do
obj <- decodeJson json
case obj of
"CacheOn" -> pure CacheOn
"CacheOff" -> pure CacheOff
s -> Left $ AtKey s $ TypeMismatch $ "Unknown cache value"
instance encodeJsonCacheState :: EncodeJson CacheState where
encodeJson CacheOn = encodeJson "CacheOn"
encodeJson CacheOff = encodeJson "CacheOff"
instance showCacheState :: Show CacheState where
show = genericShow
...@@ -4,7 +4,9 @@ import Prelude ...@@ -4,7 +4,9 @@ import Prelude
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow) import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (launchAff_) import Effect.Aff (launchAff_)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
...@@ -20,10 +22,10 @@ import Gargantext.Components.Nodes.Lists.Types as NT ...@@ -20,10 +22,10 @@ import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Tab as Tab import Gargantext.Components.Tab as Tab
import Gargantext.Components.Table as Table import Gargantext.Components.Table as Table
import Gargantext.Ends (Frontends) import Gargantext.Ends (Frontends)
import Gargantext.Sessions (Session, sessionId) import Gargantext.Sessions (Session, Sessions, sessionId, getCacheState, setCacheState)
import Gargantext.Types (CTabNgramType(..), TabSubType(..), TabType(..)) import Gargantext.Types (CTabNgramType(..), TabSubType(..), TabType(..))
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Nodes.Texts" thisModule = "Gargantext.Components.Nodes.Texts"
-------------------------------------------------------- --------------------------------------------------------
...@@ -31,6 +33,7 @@ type Props = ( ...@@ -31,6 +33,7 @@ type Props = (
frontends :: Frontends frontends :: Frontends
, nodeId :: Int , nodeId :: Int
, session :: Session , session :: Session
, sessionUpdate :: Session -> Effect Unit
) )
textsLayout :: Record Props -> R.Element textsLayout :: Record Props -> R.Element
...@@ -39,10 +42,14 @@ textsLayout props = R.createElement textsLayoutCpt props [] ...@@ -39,10 +42,14 @@ textsLayout props = R.createElement textsLayoutCpt props []
------------------------------------------------------------------------ ------------------------------------------------------------------------
textsLayoutCpt :: R.Component Props textsLayoutCpt :: R.Component Props
textsLayoutCpt = R.hooksComponentWithModule thisModule "textsLayout" cpt where textsLayoutCpt = R.hooksComponentWithModule thisModule "textsLayout" cpt where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session, sessionUpdate } _ = do
let sid = sessionId session let sid = sessionId session
pure $ textsLayoutWithKey { frontends, key: show sid <> "-" <> show nodeId, nodeId, session } pure $ textsLayoutWithKey { frontends
, key: show sid <> "-" <> show nodeId
, nodeId
, session
, sessionUpdate }
type KeyProps = ( type KeyProps = (
key :: String key :: String
...@@ -55,26 +62,30 @@ textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props [] ...@@ -55,26 +62,30 @@ textsLayoutWithKey props = R.createElement textsLayoutWithKeyCpt props []
textsLayoutWithKeyCpt :: R.Component KeyProps textsLayoutWithKeyCpt :: R.Component KeyProps
textsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "textsLayoutWithKey" cpt textsLayoutWithKeyCpt = R.hooksComponentWithModule thisModule "textsLayoutWithKey" cpt
where where
cpt { frontends, nodeId, session } _ = do cpt { frontends, nodeId, session, sessionUpdate } _ = do
cacheState <- R.useState' NT.CacheOn cacheState <- R.useState' $ getCacheState NT.CacheOff session nodeId
pure $ loader {session, nodeId} loadCorpusWithChild $ pure $ loader { nodeId, session } loadCorpusWithChild $
\corpusData@{ corpusId, corpusNode, defaultListId } -> do \corpusData@{ corpusId, corpusNode, defaultListId } -> do
let NodePoly { name, date, hyperdata: Hyperdata h } = corpusNode let NodePoly { date, hyperdata: Hyperdata h, name } = corpusNode
CorpusInfo { authors, desc, query } = getCorpusInfo h.fields CorpusInfo { authors, desc, query } = getCorpusInfo h.fields
tabs' = tabs { corpusData, corpusId, frontends, session }
title = "Corpus " <> name title = "Corpus " <> name
R.fragment [ R.fragment [
Table.tableHeaderLayout { afterCacheStateChange: \_ -> launchAff_ $ clearCache unit Table.tableHeaderLayout { afterCacheStateChange
, cacheState , cacheState
, date , date
, desc , desc
, key: "textsLayoutWithKey-" <> (show $ fst cacheState)
, query , query
, title , title
, user: authors } , user: authors }
, tabs' , tabs { cacheState, corpusData, corpusId, frontends, session }
] ]
where
afterCacheStateChange cacheState = do
launchAff_ $ clearCache unit
sessionUpdate $ setCacheState session nodeId cacheState
data Mode = MoreLikeFav | MoreLikeTrash data Mode = MoreLikeFav | MoreLikeTrash
...@@ -89,7 +100,13 @@ modeTabType :: Mode -> CTabNgramType ...@@ -89,7 +100,13 @@ modeTabType :: Mode -> CTabNgramType
modeTabType MoreLikeFav = CTabAuthors -- TODO modeTabType MoreLikeFav = CTabAuthors -- TODO
modeTabType MoreLikeTrash = CTabSources -- TODO modeTabType MoreLikeTrash = CTabSources -- TODO
type TabsProps = ( frontends :: Frontends, session :: Session, corpusId :: Int, corpusData :: CorpusData ) type TabsProps = (
cacheState :: R.State NT.CacheState
, corpusData :: CorpusData
, corpusId :: Int
, frontends :: Frontends
, session :: Session
)
tabs :: Record TabsProps -> R.Element tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
...@@ -97,27 +114,43 @@ tabs props = R.createElement tabsCpt props [] ...@@ -97,27 +114,43 @@ tabs props = R.createElement tabsCpt props []
tabsCpt :: R.Component TabsProps tabsCpt :: R.Component TabsProps
tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt tabsCpt = R.hooksComponentWithModule thisModule "tabs" cpt
where where
cpt {frontends, session, corpusId, corpusData} _ = do cpt { cacheState, corpusId, corpusData, frontends, session } _ = do
(selected /\ setSelected) <- R.useState' 0 (selected /\ setSelected) <- R.useState' 0
pure $ Tab.tabs { tabs: tabs', selected }
where
tabs' = [ "Documents" /\ docs, "Trash" /\ trash
, "More like fav" /\ moreLikeFav, "More like trash" /\ moreLikeTrash ]
docView' tabType = docView { frontends, session, corpusId, corpusData, tabType }
docs = R.fragment [ docsHisto, docView' TabDocs ]
docsHisto = histo { path, session }
where
path = { corpusId, listId: 0, limit: Nothing, tabType: TabCorpus TabDocs }
moreLikeFav = docView' TabMoreLikeFav
moreLikeTrash = docView' TabMoreLikeTrash
trash = docView' TabTrash
type DocViewProps a = let path = initialPath
( frontends :: Frontends
, session :: Session pure $ Tab.tabs {
, corpusId :: Int selected
, tabs: [
"Documents" /\ R.fragment [
histo { path, session }
, docView' path TabDocs
]
, "Trash" /\ docView' path TabTrash
-- , "More like fav" /\ docView' path TabMoreLikeFav
-- , "More like trash" /\ docView' path TabMoreLikeTrash
]
}
where
initialPath = { corpusId, listId: 0, limit: Nothing, tabType: TabCorpus TabDocs }
docView' path tabType = docView { cacheState
, corpusData
, corpusId
, frontends
-- , path
, session
, tabType }
type DocViewProps a = (
cacheState :: R.State NT.CacheState
, corpusData :: CorpusData , corpusData :: CorpusData
, tabType :: TabSubType a ) , corpusId :: Int
, frontends :: Frontends
-- , path :: Record DT.Path
, session :: Session
, tabType :: TabSubType a
)
docView :: forall a. Record (DocViewProps a) -> R.Element docView :: forall a. Record (DocViewProps a) -> R.Element
docView props = R.createElement docViewCpt props [] docView props = R.createElement docViewCpt props []
...@@ -125,13 +158,14 @@ docView props = R.createElement docViewCpt props [] ...@@ -125,13 +158,14 @@ docView props = R.createElement docViewCpt props []
docViewCpt :: forall a. R.Component (DocViewProps a) docViewCpt :: forall a. R.Component (DocViewProps a)
docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
where where
cpt {frontends, session, corpusId, corpusData: {defaultListId}, tabType} _children = do cpt props _children = do
pure $ DT.docViewLayout $ params tabType pure $ DT.docViewLayout $ docViewLayoutRec props
where
params :: forall b. TabSubType b -> Record DT.LayoutProps -- docViewLayoutRec :: forall a. DocViewProps a -> Record DT.LayoutProps
params TabDocs = docViewLayoutRec { cacheState, corpusData: { defaultListId }, corpusId, frontends, session, tabType: TabDocs } =
{ nodeId: corpusId { nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT -- ^ TODO merge nodeId and corpusId in DT
, cacheState
, chart : H.div {} [] , chart : H.div {} []
, tabType: TabCorpus TabDocs , tabType: TabCorpus TabDocs
, totalRecords: 4737 , totalRecords: 4737
...@@ -139,9 +173,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -139,9 +173,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: true , showSearch: true
, frontends, session } , frontends, session }
params TabMoreLikeFav = docViewLayoutRec { cacheState, corpusData: { defaultListId }, corpusId, frontends, session, tabType: TabMoreLikeFav } =
{ nodeId: corpusId { nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT -- ^ TODO merge nodeId and corpusId in DT
, cacheState
, chart : H.div {} [] , chart : H.div {} []
, tabType: TabCorpus TabMoreLikeFav , tabType: TabCorpus TabMoreLikeFav
, totalRecords: 4737 , totalRecords: 4737
...@@ -149,9 +184,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -149,9 +184,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: false , showSearch: false
, frontends, session } , frontends, session }
params TabMoreLikeTrash = docViewLayoutRec { cacheState, corpusData: { defaultListId }, corpusId, frontends, session, tabType: TabMoreLikeTrash } =
{ nodeId: corpusId { nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT -- ^ TODO merge nodeId and corpusId in DT
, cacheState
, chart : H.div {} [] , chart : H.div {} []
, tabType: TabCorpus TabMoreLikeTrash , tabType: TabCorpus TabMoreLikeTrash
, totalRecords: 4737 , totalRecords: 4737
...@@ -159,9 +195,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -159,9 +195,10 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
, corpusId: Just corpusId , corpusId: Just corpusId
, showSearch: false , showSearch: false
, frontends, session } , frontends, session }
params TabTrash = docViewLayoutRec { cacheState, corpusData: { defaultListId }, corpusId, frontends, session, tabType: TabTrash } =
{ nodeId: corpusId { nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT -- ^ TODO merge nodeId and corpusId in DT
, cacheState
, chart : H.div {} [] , chart : H.div {} []
, tabType: TabCorpus TabTrash , tabType: TabCorpus TabTrash
, totalRecords: 4737 , totalRecords: 4737
...@@ -169,10 +206,11 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt ...@@ -169,10 +206,11 @@ docViewCpt = R.hooksComponentWithModule thisModule "docView" cpt
, corpusId: Nothing , corpusId: Nothing
, showSearch: true , showSearch: true
, frontends, session } , frontends, session }
-- DUMMY -- DUMMY
params _ = docViewLayoutRec { cacheState, corpusData: { defaultListId }, corpusId, frontends, session, tabType } =
{ nodeId: corpusId { nodeId: corpusId
-- ^ TODO merge nodeId and corpusId in DT -- ^ TODO merge nodeId and corpusId in DT
, cacheState
, chart : H.div {} [] , chart : H.div {} []
, tabType: TabCorpus TabTrash , tabType: TabCorpus TabTrash
, totalRecords: 4737 , totalRecords: 4737
......
...@@ -9,9 +9,13 @@ import Reactix.DOM.HTML as H ...@@ -9,9 +9,13 @@ import Reactix.DOM.HTML as H
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Tab" thisModule = "Gargantext.Components.Tab"
type TabsProps = ( tabs :: Array (Tuple String R.Element), selected :: Int ) type TabsProps = (
selected :: Int
, tabs :: Array (Tuple String R.Element)
)
tabs :: Record TabsProps -> R.Element tabs :: Record TabsProps -> R.Element
tabs props = R.createElement tabsCpt props [] tabs props = R.createElement tabsCpt props []
......
...@@ -18,6 +18,7 @@ import Gargantext.Components.Search ...@@ -18,6 +18,7 @@ import Gargantext.Components.Search
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Reactix (effectLink) import Gargantext.Utils.Reactix (effectLink)
thisModule :: String
thisModule = "Gargantext.Components.Table" thisModule = "Gargantext.Components.Table"
type TableContainerProps = type TableContainerProps =
...@@ -33,8 +34,8 @@ type Rows = Seq.Seq Row ...@@ -33,8 +34,8 @@ type Rows = Seq.Seq Row
type OrderBy = Maybe (OrderByDirection ColumnName) type OrderBy = Maybe (OrderByDirection ColumnName)
type Params = { offset :: Int type Params = { limit :: Int
, limit :: Int , offset :: Int
, orderBy :: OrderBy , orderBy :: OrderBy
, searchType :: SearchType , searchType :: SearchType
} }
...@@ -60,14 +61,18 @@ instance showOrderByDirection :: Show a => Show (OrderByDirection a) where ...@@ -60,14 +61,18 @@ instance showOrderByDirection :: Show a => Show (OrderByDirection a) where
derive instance eqOrderByDirection :: Eq a => Eq (OrderByDirection a) derive instance eqOrderByDirection :: Eq a => Eq (OrderByDirection a)
orderByToForm :: OrderByDirection ColumnName -> String
orderByToForm (ASC (ColumnName x)) = x <> "Asc"
orderByToForm (DESC (ColumnName x)) = x <> "Desc"
type Props = type Props =
( colNames :: Array ColumnName ( colNames :: Array ColumnName
, wrapColElts :: ColumnName -> Array R.Element -> Array R.Element , container :: Record TableContainerProps -> R.Element
-- ^ Use `const identity` as a default behavior.
, totalRecords :: Int
, params :: R.State Params , params :: R.State Params
, rows :: Rows , rows :: Rows
, container :: Record TableContainerProps -> R.Element , totalRecords :: Int
, wrapColElts :: ColumnName -> Array R.Element -> Array R.Element
-- ^ Use `const identity` as a default behavior.
) )
type State = type State =
...@@ -90,10 +95,11 @@ stateParams {pageSize, page, orderBy, searchType} = {offset, limit, orderBy, sea ...@@ -90,10 +95,11 @@ stateParams {pageSize, page, orderBy, searchType} = {offset, limit, orderBy, sea
offset = limit * (page - 1) offset = limit * (page - 1)
type TableHeaderLayoutProps = type TableHeaderLayoutProps =
( afterCacheStateChange :: Unit -> Effect Unit ( afterCacheStateChange :: NT.CacheState -> Effect Unit
, cacheState :: R.State NT.CacheState , cacheState :: R.State NT.CacheState
, date :: String , date :: String
, desc :: String , desc :: String
, key :: String
, query :: String , query :: String
, title :: String , title :: String
, user :: String , user :: String
...@@ -120,26 +126,26 @@ tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout" ...@@ -120,26 +126,26 @@ tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout"
[ H.div {className: "jumbotron1", style: {padding: "12px 0px 20px 12px"}} [ H.div {className: "jumbotron1", style: {padding: "12px 0px 20px 12px"}}
[ H.div {className: "col-md-8 content"} [ H.div {className: "col-md-8 content"}
[ H.p {} [ H.p {}
[ H.i {className: "fa fa-globe"} [] [ H.span {className: "fa fa-globe"} []
, H.text $ " " <> desc , H.text $ " " <> desc
] ]
, H.p {} , H.p {}
[ H.i {className: "fa fa-search-plus"} [] [ H.span {className: "fa fa-search-plus"} []
, H.text $ " " <> query , H.text $ " " <> query
] ]
, H.p { className: "cache-toggle" , H.p { className: "cache-toggle"
, on: { click: cacheClick cacheState afterCacheStateChange } } , on: { click: cacheClick cacheState afterCacheStateChange } }
[ H.i {className: "fa " <> (cacheToggle cacheState)} [] [ H.span { className: "fa " <> (cacheToggle cacheState) } []
, H.text $ cacheText cacheState , H.text $ cacheText cacheState
] ]
] ]
, H.div {className: "col-md-4 content"} , H.div {className: "col-md-4 content"}
[ H.p {} [ H.p {}
[ H.i {className: "fa fa-calendar"} [] [ H.span {className: "fa fa-calendar"} []
, H.text $ " " <> date , H.text $ " " <> date
] ]
, H.p {} , H.p {}
[ H.i {className: "fa fa-user"} [] [ H.span {className: "fa fa-user"} []
, H.text $ " " <> user , H.text $ " " <> user
] ]
] ]
...@@ -153,9 +159,11 @@ tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout" ...@@ -153,9 +159,11 @@ tableHeaderLayoutCpt = R.hooksComponentWithModule thisModule "tableHeaderLayout"
cacheText (NT.CacheOn /\ _) = "Cache On" cacheText (NT.CacheOn /\ _) = "Cache On"
cacheText (NT.CacheOff /\ _) = "Cache Off" cacheText (NT.CacheOff /\ _) = "Cache Off"
cacheClick (_ /\ setCacheState) after _ = do cacheClick (cacheState /\ setCacheState) after _ = do
setCacheState cacheStateToggle setCacheState $ const newCacheState
after unit after newCacheState
where
newCacheState = cacheStateToggle cacheState
cacheStateToggle NT.CacheOn = NT.CacheOff cacheStateToggle NT.CacheOn = NT.CacheOff
cacheStateToggle NT.CacheOff = NT.CacheOn cacheStateToggle NT.CacheOff = NT.CacheOn
......
...@@ -167,6 +167,8 @@ sessionPath (R.PutNgrams t listId termList i) = ...@@ -167,6 +167,8 @@ sessionPath (R.PutNgrams t listId termList i) =
<> showTabType' t <> showTabType' t
<> maybe "" (\x -> "&list=" <> show x) listId <> maybe "" (\x -> "&list=" <> show x) listId
<> foldMap (\x -> "&listType=" <> show x) termList <> foldMap (\x -> "&listType=" <> show x) termList
sessionPath (R.PostNgramsChartsAsync i) =
sessionPath $ R.NodeAPI Node i $ "ngrams/async/charts/update"
sessionPath (R.NodeAPI nt i p) = nodeTypePath nt sessionPath (R.NodeAPI nt i p) = nodeTypePath nt
<> (maybe "" (\i' -> "/" <> show i') i) <> (maybe "" (\i' -> "/" <> show i') i)
<> (if p == "" then "" else "/" <> p) <> (if p == "" then "" else "/" <> p)
......
...@@ -33,6 +33,7 @@ router = oneOf ...@@ -33,6 +33,7 @@ router = oneOf
, RouteFrameWrite <$> (route "write" *> sid) <*> int , RouteFrameWrite <$> (route "write" *> sid) <*> int
, RouteFrameCalc <$> (route "calc" *> sid) <*> int , RouteFrameCalc <$> (route "calc" *> sid) <*> int
, RouteFrameCode <$> (route "code" *> sid) <*> int
, RouteFile <$> (route "file" *> sid) <*> int , RouteFile <$> (route "file" *> sid) <*> int
, Home <$ lit "" , Home <$ lit ""
] ]
......
...@@ -26,6 +26,7 @@ data AppRoute ...@@ -26,6 +26,7 @@ data AppRoute
| PGraphExplorer SessionId Int | PGraphExplorer SessionId Int
| RouteFile SessionId Int | RouteFile SessionId Int
| RouteFrameCalc SessionId Int | RouteFrameCalc SessionId Int
| RouteFrameCode SessionId Int
| RouteFrameWrite SessionId Int | RouteFrameWrite SessionId Int
| Team SessionId Int | Team SessionId Int
| Texts SessionId Int | Texts SessionId Int
...@@ -44,6 +45,7 @@ data SessionRoute ...@@ -44,6 +45,7 @@ data SessionRoute
| GetNgramsTableAll NgramsGetTableAllOpts (Maybe Id) | GetNgramsTableAll NgramsGetTableAllOpts (Maybe Id)
| GetNgramsTableVersion { listId :: ListId, tabType :: TabType } (Maybe Id) | GetNgramsTableVersion { listId :: ListId, tabType :: TabType } (Maybe Id)
| PutNgrams TabType (Maybe ListId) (Maybe TermList) (Maybe Id) | PutNgrams TabType (Maybe ListId) (Maybe TermList) (Maybe Id)
| PostNgramsChartsAsync (Maybe Id)
-- ^ This name is not good. In particular this URL is used both in PUT and POST. -- ^ This name is not good. In particular this URL is used both in PUT and POST.
| RecomputeNgrams (TabSubType CTabNgramType) Id ListId | RecomputeNgrams (TabSubType CTabNgramType) Id ListId
| RecomputeListChart ChartType CTabNgramType Id ListId | RecomputeListChart ChartType CTabNgramType Id ListId
...@@ -77,6 +79,7 @@ instance showAppRoute :: Show AppRoute where ...@@ -77,6 +79,7 @@ instance showAppRoute :: Show AppRoute where
show (ContactPage s a i) = "Contact" <> show a <> "::" <> show i <> " (" <> show s <> ")" show (ContactPage s a i) = "Contact" <> show a <> "::" <> show i <> " (" <> show s <> ")"
show (RouteFrameWrite s i) = "write" <> show i <> " (" <> show s <> ")" show (RouteFrameWrite s i) = "write" <> show i <> " (" <> show s <> ")"
show (RouteFrameCalc s i) = "calc" <> show i <> " (" <> show s <> ")" show (RouteFrameCalc s i) = "calc" <> show i <> " (" <> show s <> ")"
show (RouteFrameCode s i) = "code" <> show i <> " (" <> show s <> ")"
show (RouteFile s i) = "file" <> show i <> " (" <> show s <> ")" show (RouteFile s i) = "file" <> show i <> " (" <> show s <> ")"
...@@ -100,6 +103,7 @@ appPath (UserPage s i) = "user/" <> show s <> "/" <> show i ...@@ -100,6 +103,7 @@ appPath (UserPage s i) = "user/" <> show s <> "/" <> show i
appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> "/contact/" <> show i appPath (ContactPage s a i) = "annuaire/" <> show s <> "/" <> show a <> "/contact/" <> show i
appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i appPath (RouteFrameWrite s i) = "write/" <> show s <> "/" <> show i
appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i appPath (RouteFrameCalc s i) = "calc/" <> show s <> "/" <> show i
appPath (RouteFrameCode s i) = "code/" <> show s <> "/" <> show i
appPath (RouteFile s i) = "file/" <> show s <> "/" <> show i appPath (RouteFile s i) = "file/" <> show s <> "/" <> show i
nodeTypeAppRoute :: NodeType -> SessionId -> Int -> Maybe AppRoute nodeTypeAppRoute :: NodeType -> SessionId -> Int -> Maybe AppRoute
......
-- | A module for authenticating to create sessions and handling them -- | A module for authenticating to create sessions and handling them
module Gargantext.Sessions where module Gargantext.Sessions where
import DOM.Simple.Console (log2)
import Data.Argonaut (class DecodeJson, decodeJson, class EncodeJson, encodeJson, (:=), (~>), (.:)) import Data.Argonaut (class DecodeJson, decodeJson, class EncodeJson, encodeJson, (:=), (~>), (.:))
import Data.Argonaut.Core (Json, fromArray, jsonEmptyObject, stringify) import Data.Argonaut.Core (Json, fromArray, jsonEmptyObject, stringify)
import Data.Argonaut.Decode.Error (JsonDecodeError(..)) import Data.Argonaut.Decode.Error (JsonDecodeError(..))
...@@ -10,32 +9,38 @@ import Data.Array as A ...@@ -10,32 +9,38 @@ import Data.Array as A
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Generic.Rep (class Generic) import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq) import Data.Generic.Rep.Eq (genericEq)
import Data.Maybe (Maybe(..)) import Data.Map (Map)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Sequence (Seq) import Data.Sequence (Seq)
import Data.Sequence as Seq import Data.Sequence as Seq
import Data.Set (Set) import Data.Set (Set)
import Data.Traversable (traverse) import Data.Traversable (traverse)
import DOM.Simple.Console (log2)
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Prelude (class Eq, class Show, Unit, const, otherwise, pure, show, unit, ($), (*>), (<*), (<$>), (<>), (==), (/=), (>>=), (<<<), bind)
import Reactix as R
import Web.Storage.Storage (getItem, removeItem, setItem)
import Gargantext.Components.Login.Types (AuthData(..), AuthInvalid(..), AuthRequest(..), AuthResponse(..), TreeId) import Gargantext.Components.Login.Types (AuthData(..), AuthInvalid(..), AuthRequest(..), AuthResponse(..), TreeId)
import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Config.REST as REST import Gargantext.Config.REST as REST
import Gargantext.Ends (class ToUrl, Backend(..), backendUrl, sessionPath, toUrl) import Gargantext.Ends (class ToUrl, Backend(..), backendUrl, sessionPath, toUrl)
import Gargantext.Routes (SessionRoute) import Gargantext.Routes (SessionRoute)
import Gargantext.Types (NodePath, SessionId(..), nodePath) import Gargantext.Types (NodePath, SessionId(..), nodePath)
import Gargantext.Utils.Reactix (getls) import Gargantext.Utils.Reactix (getls)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Prelude (class Eq, class Show, Unit, const, otherwise, pure, show, unit, ($), (*>), (<*), (<$>), (<>), (==), (/=), (>>=), (<<<), bind)
import Reactix as R
import Web.Storage.Storage (getItem, removeItem, setItem)
-- | A Session represents an authenticated session for a user at a -- | A Session represents an authenticated session for a user at a
-- | backend. It contains a token and root tree id. -- | backend. It contains a token and root tree id.
newtype Session = Session newtype Session = Session
{ backend :: Backend { backend :: Backend
, username :: String , caches :: Map Int NT.CacheState -- whether cache is turned on for node id
, token :: String , token :: String
, treeId :: TreeId , treeId :: TreeId
, username :: String
} }
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -64,21 +69,23 @@ sessionId = SessionId <<< show ...@@ -64,21 +69,23 @@ sessionId = SessionId <<< show
-------------------- --------------------
-- | JSON instances -- | JSON instances
instance encodeJsonSession :: EncodeJson Session where instance encodeJsonSession :: EncodeJson Session where
encodeJson (Session {backend, username, token, treeId}) encodeJson (Session { backend, caches, username, token, treeId })
= "backend" := encodeJson backend = "backend" := encodeJson backend
~> "username" := username ~> "caches" := encodeJson caches
~> "token" := token ~> "token" := token
~> "treeId" := treeId ~> "treeId" := treeId
~> "username" := username
~> jsonEmptyObject ~> jsonEmptyObject
instance decodeJsonSession :: DecodeJson Session where instance decodeJsonSession :: DecodeJson Session where
decodeJson json = do decodeJson json = do
obj <- decodeJson json obj <- decodeJson json
backend <- obj .: "backend" backend <- obj .: "backend"
username <- obj .: "username" caches <- obj .: "caches"
token <- obj .: "token" token <- obj .: "token"
treeId <- obj .: "treeId" treeId <- obj .: "treeId"
pure $ Session { backend, username, token, treeId} username <- obj .: "username"
pure $ Session { backend, caches, token, treeId, username }
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -124,11 +131,19 @@ cons :: Session -> Sessions -> Sessions ...@@ -124,11 +131,19 @@ cons :: Session -> Sessions -> Sessions
cons s (Sessions {sessions:ss}) = Sessions {sessions:(Seq.cons s ss)} cons s (Sessions {sessions:ss}) = Sessions {sessions:(Seq.cons s ss)}
tryCons :: Session -> Sessions -> Either Unit Sessions tryCons :: Session -> Sessions -> Either Unit Sessions
tryCons s ss = try (lookup sid ss) where tryCons s ss = try $ lookup sid ss
where
sid = sessionId s sid = sessionId s
try Nothing = Right (cons s ss) try Nothing = Right (cons s ss)
try _ = Left unit try _ = Left unit
update :: Session -> Sessions -> Sessions
update s ss = up $ lookup sid ss
where
sid = sessionId s
up Nothing = cons s ss
up _ = cons s $ remove sid ss
remove :: SessionId -> Sessions -> Sessions remove :: SessionId -> Sessions -> Sessions
remove sid (Sessions {sessions:ss}) = Sessions {sessions: Seq.filter f ss} where remove sid (Sessions {sessions:ss}) = Sessions {sessions: Seq.filter f ss} where
f s = sid /= sessionId s f s = sid /= sessionId s
...@@ -157,6 +172,7 @@ instance toUrlSessionString :: ToUrl Session String where ...@@ -157,6 +172,7 @@ instance toUrlSessionString :: ToUrl Session String where
data Action data Action
= Login Session = Login Session
| Logout Session | Logout Session
| Update Session
act :: Sessions -> Action -> Effect Sessions act :: Sessions -> Action -> Effect Sessions
act ss (Login s) = act ss (Login s) =
...@@ -167,18 +183,26 @@ act old@(Sessions ss) (Logout s) = ...@@ -167,18 +183,26 @@ act old@(Sessions ss) (Logout s) =
case tryRemove (sessionId s) old of case tryRemove (sessionId s) old of
Right new -> pure $ new Right new -> pure $ new
_ -> pure old <* log2 "Logged out of stale session:" (sessionId s) _ -> pure old <* log2 "Logged out of stale session:" (sessionId s)
act ss (Update s) = saveSessions $ update s ss
-- Key we will store the data under -- Key we will store the data under
localStorageKey :: String localStorageKey :: String
localStorageKey = "garg-sessions" localStorageKey = "garg-sessions"
empty :: Sessions empty :: Sessions
empty = Sessions {sessions:Seq.empty} empty = Sessions { sessions: Seq.empty }
-- True if there are no sessions stored -- True if there are no sessions stored
null :: Sessions -> Boolean null :: Sessions -> Boolean
null (Sessions {sessions:seq}) = Seq.null seq null (Sessions { sessions: seq }) = Seq.null seq
getCacheState :: NT.CacheState -> Session -> Int -> NT.CacheState
getCacheState defaultCacheState (Session { caches }) nodeId =
fromMaybe defaultCacheState $ Map.lookup nodeId caches
setCacheState :: Session -> Int -> NT.CacheState -> Session
setCacheState (Session session@{ caches }) nodeId cacheState =
Session $ session { caches = Map.insert nodeId cacheState caches }
-- | Will attempt to load saved sessions from localstorage. should log -- | Will attempt to load saved sessions from localstorage. should log
-- | if decoding fails -- | if decoding fails
...@@ -208,6 +232,12 @@ saveSessions sessions = effect *> pure sessions where ...@@ -208,6 +232,12 @@ saveSessions sessions = effect *> pure sessions where
| null sessions = rem | null sessions = rem
| otherwise = set (stringify $ encodeJson sessions) | otherwise = set (stringify $ encodeJson sessions)
updateSession :: Session -> Effect Unit
updateSession s = do
ss <- loadSessions
_ <- saveSessions $ update s ss
pure unit
postAuthRequest :: Backend -> AuthRequest -> Aff (Either String Session) postAuthRequest :: Backend -> AuthRequest -> Aff (Either String Session)
postAuthRequest backend ar@(AuthRequest {username}) = postAuthRequest backend ar@(AuthRequest {username}) =
decode <$> REST.post Nothing (toUrl backend "auth") ar decode <$> REST.post Nothing (toUrl backend "auth") ar
...@@ -215,7 +245,7 @@ postAuthRequest backend ar@(AuthRequest {username}) = ...@@ -215,7 +245,7 @@ postAuthRequest backend ar@(AuthRequest {username}) =
decode (AuthResponse ar2) decode (AuthResponse ar2)
| {inval: Just (AuthInvalid {message})} <- ar2 = Left message | {inval: Just (AuthInvalid {message})} <- ar2 = Left message
| {valid: Just (AuthData {token, tree_id})} <- ar2 = | {valid: Just (AuthData {token, tree_id})} <- ar2 =
Right $ Session { backend, username, token, treeId: tree_id } Right $ Session { backend, caches: Map.empty, token, treeId: tree_id, username }
| otherwise = Left "Invalid response from server" | otherwise = Left "Invalid response from server"
get :: forall a p. DecodeJson a => ToUrl Session p => Session -> p -> Aff a get :: forall a p. DecodeJson a => ToUrl Session p => Session -> p -> Aff a
......
...@@ -159,6 +159,7 @@ data NodeType = Annuaire ...@@ -159,6 +159,7 @@ data NodeType = Annuaire
-- TODO Optional Nodes -- TODO Optional Nodes
| NodeFile | NodeFile
| NodeFrameCalc | NodeFrameCalc
| NodeFrameNotebook
| NodeFrameWrite | NodeFrameWrite
| NodePublic NodeType | NodePublic NodeType
...@@ -187,9 +188,10 @@ instance showNodeType :: Show NodeType where ...@@ -187,9 +188,10 @@ instance showNodeType :: Show NodeType where
show Tree = "NodeTree" show Tree = "NodeTree"
show Team = "NodeTeam" show Team = "NodeTeam"
show NodeList = "NodeList" show NodeList = "NodeList"
show Texts = "NodeTexts" show Texts = "NodeDocs"
show NodeFrameWrite = "NodeFrameWrite" show NodeFrameWrite = "NodeFrameWrite"
show NodeFrameCalc = "NodeFrameCalc" show NodeFrameCalc = "NodeFrameCalc"
show NodeFrameNotebook = "NodeFrameNotebook"
show (NodePublic nt) = "NodePublic" <> show nt show (NodePublic nt) = "NodePublic" <> show nt
show NodeFile = "NodeFile" show NodeFile = "NodeFile"
...@@ -217,6 +219,7 @@ instance readNodeType :: Read NodeType where ...@@ -217,6 +219,7 @@ instance readNodeType :: Read NodeType where
read "Annuaire" = Just Annuaire read "Annuaire" = Just Annuaire
read "NodeFrameWrite" = Just NodeFrameWrite read "NodeFrameWrite" = Just NodeFrameWrite
read "NodeFrameCalc" = Just NodeFrameCalc read "NodeFrameCalc" = Just NodeFrameCalc
read "NodeFrameNotebook" = Just NodeFrameNotebook
read "NodeFile" = Just NodeFile read "NodeFile" = Just NodeFile
-- TODO NodePublic read ? -- TODO NodePublic read ?
read _ = Nothing read _ = Nothing
...@@ -264,6 +267,10 @@ fldr NodeFrameWrite false = "fa fa-file-text" ...@@ -264,6 +267,10 @@ fldr NodeFrameWrite false = "fa fa-file-text"
fldr NodeFrameCalc true = "fa fa-calculator" fldr NodeFrameCalc true = "fa fa-calculator"
fldr NodeFrameCalc false = "fa fa-calculator" fldr NodeFrameCalc false = "fa fa-calculator"
fldr NodeFrameNotebook true = "fa fa-file-code-o"
fldr NodeFrameNotebook false = "fa fa-code"
fldr (NodePublic nt) b = fldr nt b fldr (NodePublic nt) b = fldr nt b
fldr _ true = "fa fa-folder-open" fldr _ true = "fa fa-folder-open"
...@@ -319,6 +326,7 @@ nodeTypePath Texts = "texts" ...@@ -319,6 +326,7 @@ nodeTypePath Texts = "texts"
nodeTypePath Team = "team" nodeTypePath Team = "team"
nodeTypePath NodeFrameWrite = "write" nodeTypePath NodeFrameWrite = "write"
nodeTypePath NodeFrameCalc = "calc" nodeTypePath NodeFrameCalc = "calc"
nodeTypePath NodeFrameNotebook = "code"
nodeTypePath (NodePublic nt) = nodeTypePath nt nodeTypePath (NodePublic nt) = nodeTypePath nt
nodeTypePath NodeFile = "file" nodeTypePath NodeFile = "file"
...@@ -445,31 +453,33 @@ data CTabNgramType = CTabTerms | CTabSources | CTabAuthors | CTabInstitutes ...@@ -445,31 +453,33 @@ data CTabNgramType = CTabTerms | CTabSources | CTabAuthors | CTabInstitutes
derive instance eqCTabNgramType :: Eq CTabNgramType derive instance eqCTabNgramType :: Eq CTabNgramType
derive instance ordCTabNgramType :: Ord CTabNgramType derive instance ordCTabNgramType :: Ord CTabNgramType
instance showCTabNgramType :: Show CTabNgramType where instance showCTabNgramType :: Show CTabNgramType where
show CTabTerms = "Terms" show CTabTerms = "Terms"
show CTabSources = "Sources" show CTabSources = "Sources"
show CTabAuthors = "Authors" show CTabAuthors = "Authors"
show CTabInstitutes = "Institutes" show CTabInstitutes = "Institutes"
instance encodeCTabNgramType :: EncodeJson CTabNgramType where
encodeJson t = encodeJson $ show t
data PTabNgramType = PTabPatents | PTabBooks | PTabCommunication data PTabNgramType = PTabPatents | PTabBooks | PTabCommunication
derive instance eqPTabNgramType :: Eq PTabNgramType derive instance eqPTabNgramType :: Eq PTabNgramType
derive instance ordPTabNgramType :: Ord PTabNgramType derive instance ordPTabNgramType :: Ord PTabNgramType
instance showPTabNgramType :: Show PTabNgramType where instance showPTabNgramType :: Show PTabNgramType where
show PTabPatents = "Patents" show PTabPatents = "Patents"
show PTabBooks = "Books" show PTabBooks = "Books"
show PTabCommunication = "Communication" show PTabCommunication = "Communication"
instance encodePTabNgramType :: EncodeJson PTabNgramType where
encodeJson t = encodeJson $ show t
data TabSubType a = TabDocs | TabNgramType a | TabTrash | TabMoreLikeFav | TabMoreLikeTrash data TabSubType a = TabDocs | TabNgramType a | TabTrash | TabMoreLikeFav | TabMoreLikeTrash
derive instance eqTabSubType :: Eq a => Eq (TabSubType a) derive instance eqTabSubType :: Eq a => Eq (TabSubType a)
derive instance ordTabSubType :: Ord a => Ord (TabSubType a) derive instance ordTabSubType :: Ord a => Ord (TabSubType a)
{- instance encodeTabSubType a :: EncodeJson a => EncodeJson (TabSubType a) where instance encodeTabSubType :: EncodeJson a => EncodeJson (TabSubType a) where
encodeJson TabDocs = encodeJson TabDocs =
"type" := "TabDocs" "type" := "TabDocs"
~> "data" := Nothing ~> "data" := (Nothing :: Maybe String)
~> jsonEmptyObject ~> jsonEmptyObject
encodeJson (TabNgramType a) = encodeJson (TabNgramType a) =
"type" := "TabNgramType" "type" := "TabNgramType"
...@@ -477,16 +487,17 @@ derive instance ordTabSubType :: Ord a => Ord (TabSubType a) ...@@ -477,16 +487,17 @@ derive instance ordTabSubType :: Ord a => Ord (TabSubType a)
~> jsonEmptyObject ~> jsonEmptyObject
encodeJson TabTrash = encodeJson TabTrash =
"type" := "TabTrash" "type" := "TabTrash"
~> "data" := Nothing ~> "data" := (Nothing :: Maybe String)
~> jsonEmptyObject ~> jsonEmptyObject
encodeJson TabMoreLikeFav = encodeJson TabMoreLikeFav =
"type" := "TabMoreLikeFav" "type" := "TabMoreLikeFav"
~> "data" := Nothing ~> "data" := (Nothing :: Maybe String)
~> jsonEmptyObject ~> jsonEmptyObject
encodeJson TabMoreLikeTrash = encodeJson TabMoreLikeTrash =
"type" := "TabMoreLikeTrash" "type" := "TabMoreLikeTrash"
~> "data" := Nothing ~> "data" := (Nothing :: Maybe String)
~> jsonEmptyObject ~> jsonEmptyObject
{-
instance decodeTabSubType a :: DecodeJson a => DecodeJson (TabSubType a) where instance decodeTabSubType a :: DecodeJson a => DecodeJson (TabSubType a) where
decodeJson j = do decodeJson j = do
obj <- decodeJson j obj <- decodeJson j
...@@ -517,19 +528,26 @@ derive instance eqTabType :: Eq TabType ...@@ -517,19 +528,26 @@ derive instance eqTabType :: Eq TabType
derive instance ordTabType :: Ord TabType derive instance ordTabType :: Ord TabType
instance showTabType :: Show TabType where instance showTabType :: Show TabType where
show = genericShow show = genericShow
{- instance encodeTabType :: EncodeJson TabType where instance encodeTabType :: EncodeJson TabType where
encodeJson (TabCorpus d) = encodeJson (TabCorpus TabDocs) = encodeJson "Docs"
"type" := "TabCorpus" encodeJson (TabCorpus (TabNgramType CTabAuthors)) = encodeJson "Authors"
~> "data" := encodeJson d encodeJson (TabCorpus (TabNgramType CTabInstitutes)) = encodeJson "Institutes"
~> jsonEmptyObject encodeJson (TabCorpus (TabNgramType CTabSources)) = encodeJson "Sources"
encodeJson (TabDocument d) = encodeJson (TabCorpus (TabNgramType CTabTerms)) = encodeJson "Terms"
"type" := "TabDocument" encodeJson (TabCorpus TabMoreLikeFav) = encodeJson "MoreFav"
~> "data" := encodeJson d encodeJson (TabCorpus TabMoreLikeTrash) = encodeJson "MoreTrash"
~> jsonEmptyObject encodeJson (TabCorpus TabTrash) = encodeJson "Trash"
encodeJson (TabPairing d) = encodeJson (TabDocument TabDocs) = encodeJson "Docs"
"type" := "TabPairing" encodeJson (TabDocument (TabNgramType CTabAuthors)) = encodeJson "Authors"
~> "data" := encodeJson d encodeJson (TabDocument (TabNgramType CTabInstitutes)) = encodeJson "Institutes"
~> jsonEmptyObject encodeJson (TabDocument (TabNgramType CTabSources)) = encodeJson "Sources"
encodeJson (TabDocument (TabNgramType CTabTerms)) = encodeJson "Terms"
encodeJson (TabDocument TabMoreLikeFav) = encodeJson "MoreFav"
encodeJson (TabDocument TabMoreLikeTrash) = encodeJson "MoreTrash"
encodeJson (TabDocument TabTrash) = encodeJson "Trash"
encodeJson (TabPairing d) = encodeJson "TabPairing" -- TODO
-- ["Docs","Trash","MoreFav","MoreTrash","Terms","Sources","Authors","Institutes","Contacts"]
{-
instance decodeTabType :: DecodeJson TabType where instance decodeTabType :: DecodeJson TabType where
decodeJson j = do decodeJson j = do
obj <- decodeJson j obj <- decodeJson j
...@@ -574,12 +592,13 @@ modeFromString _ = Nothing ...@@ -574,12 +592,13 @@ modeFromString _ = Nothing
-- Async tasks -- Async tasks
-- corresponds to /add/form/async or /add/query/async -- corresponds to /add/form/async or /add/query/async
data AsyncTaskType = Form data AsyncTaskType = AddNode
| UploadFile | Form
| GraphRecompute | GraphRecompute
| Query | Query
| AddNode | UpdateNgramsCharts
| UpdateNode | UpdateNode
| UploadFile
derive instance genericAsyncTaskType :: Generic AsyncTaskType _ derive instance genericAsyncTaskType :: Generic AsyncTaskType _
instance eqAsyncTaskType :: Eq AsyncTaskType where instance eqAsyncTaskType :: Eq AsyncTaskType where
...@@ -592,20 +611,23 @@ instance decodeJsonAsyncTaskType :: DecodeJson AsyncTaskType where ...@@ -592,20 +611,23 @@ instance decodeJsonAsyncTaskType :: DecodeJson AsyncTaskType where
decodeJson json = do decodeJson json = do
obj <- decodeJson json obj <- decodeJson json
case obj of case obj of
"AddNode" -> pure AddNode
"Form" -> pure Form "Form" -> pure Form
"UploadFile" -> pure UploadFile
"GraphRecompute" -> pure GraphRecompute "GraphRecompute" -> pure GraphRecompute
"Query" -> pure Query "Query" -> pure Query
"AddNode" -> pure AddNode "UpdateNgramsCharts" -> pure UpdateNgramsCharts
"UpdateNode" -> pure UpdateNode
"UploadFile" -> pure UploadFile
s -> Left $ AtKey s $ TypeMismatch "Unknown string" s -> Left $ AtKey s $ TypeMismatch "Unknown string"
asyncTaskTypePath :: AsyncTaskType -> String asyncTaskTypePath :: AsyncTaskType -> String
asyncTaskTypePath AddNode = "async/nobody/"
asyncTaskTypePath Form = "add/form/async/" asyncTaskTypePath Form = "add/form/async/"
asyncTaskTypePath UploadFile = "async/file/add/"
asyncTaskTypePath Query = "query/"
asyncTaskTypePath GraphRecompute = "async/recompute/" asyncTaskTypePath GraphRecompute = "async/recompute/"
asyncTaskTypePath AddNode = "async/nobody/" asyncTaskTypePath Query = "query/"
asyncTaskTypePath UpdateNgramsCharts = "ngrams/async/charts/update/"
asyncTaskTypePath UpdateNode = "update/" asyncTaskTypePath UpdateNode = "update/"
asyncTaskTypePath UploadFile = "async/file/add/"
type AsyncTaskID = String type AsyncTaskID = String
......
...@@ -2,13 +2,15 @@ module Gargantext.Utils where ...@@ -2,13 +2,15 @@ module Gargantext.Utils where
import DOM.Simple.Window (window) import DOM.Simple.Window (window)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Foldable (class Foldable, foldr)
import Data.Lens (Lens', lens) import Data.Lens (Lens', lens)
import Data.Newtype (class Newtype, unwrap, wrap) import Data.Newtype (class Newtype, unwrap, wrap)
import Data.Set (Set) import Data.Set (Set)
import Data.Set as Set import Data.Set as Set
import Data.Sequence.Ordered as OSeq
import Data.String as S import Data.String as S
import Data.Unfoldable (class Unfoldable)
import Effect (Effect) import Effect (Effect)
import Effect.Class (liftEffect)
import FFI.Simple ((..)) import FFI.Simple ((..))
import FFI.Simple.Functions (delay) import FFI.Simple.Functions (delay)
import Prelude import Prelude
...@@ -84,5 +86,19 @@ mapLeft _ (Right r) = Right r ...@@ -84,5 +86,19 @@ mapLeft _ (Right r) = Right r
location :: Effect String location :: Effect String
location = delay unit $ \_ -> pure $ window .. "location" location = delay unit $ \_ -> pure $ window .. "location"
data On a b = On a b
instance eqOn :: Eq a => Eq (On a b) where
eq (On x _) (On y _) = eq x y
instance ordOn :: Ord a => Ord (On a b) where
compare (On x _) (On y _) = compare x y
-- same as
-- https://github.com/purescript/purescript-arrays/blob/v5.3.1/src/Data/Array.purs#L715-L715
sortWith :: forall a b f. Functor f =>
Foldable f =>
Unfoldable f =>
Ord b =>
(a -> b) -> f a -> f a
sortWith f = map (\(On _ y) -> y) <<< OSeq.toUnfoldable <<< foldr (\x -> OSeq.insert (On (f x) x)) OSeq.empty
\ No newline at end of file
module Gargantext.Utils.QueryString where
import Data.Array
import Data.Maybe
import Data.String.Common (joinWith)
import Gargantext.Prelude
queryParam :: forall a. Show a => String -> a -> String
queryParam key value = key <> "=" <> show value
queryParamS :: String -> String -> String
queryParamS key value = key <> "=" <> value
mQueryParam :: forall a. Show a => String -> Maybe a -> String
mQueryParam _ Nothing = ""
mQueryParam key (Just v) = queryParam key v
mQueryParamS :: forall a. String -> (a -> String) -> Maybe a -> String
mQueryParamS _ _ Nothing = ""
mQueryParamS key mFunc (Just v) = queryParamS key $ mFunc v
joinQueryStrings :: Array String -> String
joinQueryStrings qs =
case uncons qs of
Nothing -> ""
Just { head, tail } -> "?" <> head <> (joinQS tail)
where
joinQS ys =
case uncons ys of
Nothing -> ""
Just { tail: ys } -> "&" <> (joinWith "&" ys)
...@@ -109,9 +109,6 @@ select = createDOM "select" ...@@ -109,9 +109,6 @@ select = createDOM "select"
menu :: ElemFactory menu :: ElemFactory
menu = createDOM "menu" menu = createDOM "menu"
effToggler :: forall e. R.State Boolean -> EffectFn1 e Unit
effToggler (value /\ setValue) = mkEffectFn1 $ \_ -> setValue $ const $ not value
keyCode :: forall event. event -> Effect Int keyCode :: forall event. event -> Effect Int
keyCode = runEffectFn1 _keyCode keyCode = runEffectFn1 _keyCode
......
module Gargantext.Utils.Seq where module Gargantext.Utils.Seq (mapMaybe) where
import Data.Array as Array import Data.Maybe (Maybe, maybe)
import Data.Maybe import Data.Sequence (Seq, concatMap, empty, singleton)
import Data.Sequence
import Data.Tuple
import Gargantext.Prelude import Gargantext.Prelude ((<<<))
mapMaybe :: forall a b. (a -> Maybe b) -> Seq a -> Seq b mapMaybe :: forall a b. (a -> Maybe b) -> Seq a -> Seq b
mapMaybe f = go empty mapMaybe f = concatMap (maybe empty singleton <<< f)
where
go acc s =
case uncons s of
Nothing -> acc
Just (Tuple x xs) ->
case f x of
Nothing -> go acc xs
Just y -> go (cons y acc) xs
-- same as
-- https://github.com/purescript/purescript-arrays/blob/v5.3.1/src/Data/Array.purs#L715-L715
sortWith :: forall a b. Ord b => (a -> b) -> Seq a -> Seq a
sortWith f l = Array.toUnfoldable $ Array.sortBy (comparing f) $ Array.fromFoldable l
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