├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── docs ├── refract-logo.png └── typedraw │ ├── foreachMapF │ ├── foreachMapF.png │ ├── modifyL │ ├── modifyL.png │ ├── modifyR │ ├── modifyR.png │ ├── stateL │ ├── stateL.png │ ├── stateR │ ├── stateR.png │ ├── typemap1.json │ ├── typemap2.json │ ├── zoom │ ├── zoom.png │ ├── zoomR │ ├── zoomR.png │ ├── zoomUn │ └── zoomUn.png ├── generated-docs ├── Props.md ├── Refract.md ├── Refract │ ├── DOM.md │ └── Lens.md └── Undefined.md ├── package-lock.json ├── package.json ├── psc-package.json ├── src ├── Props.purs ├── Refract.js ├── Refract.purs ├── Refract │ ├── DOM.purs │ ├── Lens.js │ └── Lens.purs └── Undefined.purs ├── static ├── font │ ├── Dosis-Bold.ttf │ ├── Dosis-ExtraBold.ttf │ ├── Dosis-ExtraLight.ttf │ ├── Dosis-Light.ttf │ ├── Dosis-Medium.ttf │ ├── Dosis-Regular.ttf │ ├── Dosis-SemiBold.ttf │ └── OFL.txt ├── index.html └── style.css ├── support ├── config.js └── entry.js ├── test └── examples │ ├── Counters.purs │ └── ToDoMVC.purs └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .#. 3 | .psc-package 4 | .psci_modules 5 | bower_components 6 | reactive-query/.stack-work 7 | reactive-query/test 8 | node_modules 9 | output 10 | static/dist 11 | README.html 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Philip Kamenarsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![zoomR](docs/refract-logo.png) 2 | 3 | `purescript-refract` is an optical Purescript UI library based on React and the [Elm architecture](https://guide.elm-lang.org/architecture/), but without the boilerplate. 4 | 5 | ## Motivation 6 | 7 | The Elm architecture is conceptually extremely simple: 8 | 9 | * Define an `Event` type 10 | * Define a function `Model -> View` (`Views` may fire `Events`) 11 | * Define a fold function `Event -> Model -> Model` 12 | 13 | Unfortunately, while straightforward, composition is verbose. Something as mundane as displaying the same component twice would force one to at least define a new `Event` constructor and adjust the fold function appropriately, forwarding sub events to the second component where needed. 14 | 15 | While other libraries solve that problem in various ways (e.g. [purescript-specular](https://github.com/restaumatic/purescript-specular)), they give up the conceptual simplicity of Elm's central `Model -> View` idea. `purescript-refract` tries to further explore the design space by retaining that simplicity while throwing away the boilerplate. 16 | 17 | ## Quick start 18 | 19 | The canonical example of a counter in `purescript-refract`: 20 | 21 | ```purescript 22 | counter :: ∀ eff. Component eff Int 23 | counter = state \st -> div [] 24 | [ div [ onClick \_ -> modify (_ - 1) ] [ text "Decrement" ] 25 | , text (show st) 26 | , div [ onClick \_ -> modify (_ + 1) ] [ text "Increment" ] 27 | ] 28 | ``` 29 | 30 | In short, skip the need to define an `Event` type and provide direct access to a component's state in its DOM event handlers. Composition happens through [lenses](https://github.com/purescript-contrib/purescript-profunctor-lenses); to focus on a specific sub-state, use [`zoom`](#zooming): 31 | 32 | ```purescript 33 | twoCounters :: ∀ eff. Component eff (Tuple Int Int) 34 | twoCounters = div [] [ zoom _1 counter, zoom _2 counter ] 35 | ``` 36 | 37 | To render a list of components, each one focused on a single element, use one of the [`foreach*` combinators](#traversals): 38 | 39 | ```purescript 40 | counters :: ∀ eff. Component eff (Array Int) 41 | counters = div [] 42 | [ div [ onClick \_ -> modify (cons 0) ] [ text "Add counter" ] 43 | , foreachZ _id counter 44 | ] 45 | ``` 46 | 47 | ## Documentation 48 | 49 | Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-refract). 50 | 51 | ## Full ToDoMVC example 52 | 53 | To get a better idea of how `purescript-refract` code looks in the wild, check out the full ToDoMVC example - [Source](test/examples/ToDoMVC.purs) / [Demo](https://pkamenarsky.github.io/purescript-refract-todomvc). 54 | 55 | ## Components 56 | 57 | A `Component eff st` is parameterized over an effect type `eff` and a state type `st` over which it operates. 58 | 59 | All basic HTML building blocks are `Components`. For example, to construct a `span` within a `div`: 60 | 61 | ```purescript 62 | spanWithinDiv :: ∀ eff st. Component eff st 63 | spanWithinDiv = div [] [ span [] [ text "Nested!" ] ] 64 | ``` 65 | 66 | ## Accessing state 67 | 68 | Having a `Component` with a state of type `Int`: 69 | 70 | ```purescript 71 | intComponent :: ∀ eff. Component eff Int 72 | intComponent = div [] [ text "State: " ] 73 | ``` 74 | 75 | To access the `Component`'s state, use the `state` combinator: 76 | 77 | ```purescript 78 | state :: ∀ eff st. (st -> Component eff st) -> Component eff st 79 | ``` 80 | In other words, `state` "reifies" the current `Component`'s state, e.g: 81 | 82 | ```purescript 83 | intComponent :: ∀ eff. Component eff Int 84 | intComponent = state \st -> div [] [ text ("State: " <> show st) ] 85 | ``` 86 | 87 | ## Modifying state and effects 88 | 89 | Every HTML `Component` takes an array of `Props`, such as `onClick`: 90 | 91 | ```purescript 92 | onClick :: ∀ eff st. (Event -> Effect eff st Unit) -> Props eff st 93 | ``` 94 | 95 | In turn, the following basic actions run in the `Effect eff st` monad: 96 | 97 | ```purescript 98 | modify :: ∀ eff st. (st -> st) -> Effect eff st Unit 99 | modify' :: ∀ eff st a. (st -> st × a) -> Effect eff st a 100 | ``` 101 | 102 | which modify the current `Component`'s state (and return a result in `modify'`'s case), and 103 | 104 | ```purescript 105 | effectfully :: ∀ a eff st. (st -> Aff eff a) -> Effect eff st a 106 | ``` 107 | 108 | which embeds random `Aff eff` actions in `Effect eff st`. For example: 109 | 110 | ```purescript 111 | div [ onClick \e -> do 112 | modify (_ + 1) 113 | effectfully \_ -> sendAjaxConfirmation 114 | modify (_ + 1) 115 | ] 116 | ``` 117 | 118 | ## Composing components 119 | 120 | Sometimes, a component needs to operate on different, not directly related substates of its parent. Imagine an input `Component` which only saves the typed text when the user presses the Enter key (and restores the original text if the Esc key pressed or a blur event is fired.) 121 | 122 | There are two ways to define and reuse that `Component`: 123 | 124 | * By concretely defining its state and zooming into it: 125 | ```purescript 126 | inputComponent :: ∀ eff. Component eff { current :: String, input :: String } 127 | ``` 128 | * By keeping it polymorphic in its state and providing lenses to the different substates: 129 | ```purescript 130 | inputComponent 131 | :: ∀ eff st. 132 | { current :: ALens' st String 133 | , input :: ALens' st String 134 | } 135 | -> Component eff st 136 | ``` 137 | 138 | ### Zooming 139 | 140 | Zooming may be a better choice if `{ current :: String, input :: String }` is a literal substate of the parent `Component`'s state: 141 | 142 | ```purescript 143 | parentComponent 144 | :: ∀ eff. Component eff 145 | { inputState :: { current :: String, input :: String } 146 | , loggedIn :: Boolean 147 | } 148 | parentComponent = div [] [ zoom inputState inputComponent ] -- assuming inputState is a Lens 149 | ``` 150 | 151 | `zoom` takes a `Lens'` from `st` to `stt`, a `Component` with a state of type `stt` and embeds it into a `Component` with a state of type `st`: 152 | 153 | ![zoom](docs/typedraw/zoom.png) 154 | 155 | The new `RowToList` goodness allows for a `zoomR` combinator that works with generic records. Specializing to a concrete state, its type would be: 156 | 157 | ![zoomR](docs/typedraw/zoomR.png) 158 | 159 | ### Polymorphic components 160 | 161 | Polymorphic components are more flexible and allow for easier [children-parent communication](#children-to-parent-communication) (though not impossible otherwise!) 162 | 163 | ```purescript 164 | parentComponent 165 | :: ∀ eff. Component 166 | { current :: String 167 | , input :: String 168 | , loggedIn :: Boolean 169 | } 170 | parentComponent = div [] 171 | [ inputComponent { current, input } -- assuming currentText and input are Lenses 172 | ] 173 | ``` 174 | 175 | This allows for easier mix-and-matching of various substates, if that is desired. Note that `parentComponent` here is _not_ a polymorphic `Component`! 176 | 177 | ### Accessing state in polymorphic `Component`s 178 | 179 | To access polymorphic state use the `stateL` combinator: 180 | 181 | ![stateL](docs/typedraw/stateL.png) 182 | 183 | Note that `stateL` keeps the `Component`'s state at `st`. For example: 184 | 185 | ```purescript 186 | inputComponent focus = 187 | stateL focus.current \current -> 188 | stateL focus.input \input -> ... 189 | ``` 190 | 191 | Analogously to `zoomR`, there's `stateR` which works with generic records. Specializing to a concrete state, its type would be: 192 | 193 | ![stateR](docs/typedraw/stateR.png) 194 | 195 | ### Modifying state in polymorphic `Component`s 196 | 197 | Analogously to `modify` and `stateL`, there is `modifyL` (as well as `modifyL'`): 198 | 199 | ![modifyL](docs/typedraw/modifyL.png) 200 | 201 | as well as `modifyR` and `modifyR'` (again, specialized to a concrete type): 202 | 203 | ![modifyR](docs/typedraw/modifyR.png) 204 | 205 | ## Children to parent communication 206 | 207 | Sometimes a `Component` needs to alter its parent's state in some way (for example delete itself from a list.) One easy approach is to keep the `Component` polymorhpic in its state, use the `*L` or `*R` combinators and provide a state modifying function: 208 | 209 | ```purescript 210 | inputComponent 211 | :: ∀ eff st. 212 | { current :: ALens' st String 213 | , input :: ALens' st String 214 | } 215 | -> (st -> st) 216 | -> Component eff st 217 | inputComponent focus delete = div [] 218 | [ div [ onClick \_ -> modifyR focus \st -> st { current = "" } ] [ text "Clear text" ] 219 | , div [ onClick \_ -> modify delete ] [ text "Delete" ] 220 | ] 221 | 222 | parent = div [] [ inputComponent { current, input } ] 223 | ``` 224 | 225 | (Note that one could pass `Effect eff st Unit` instead of `st -> st` for an effectful action.) 226 | 227 | Another approach is to specify the parent's state as part of the `Component`'s state and `zoomR` into the child `Component` from the parent `Component`: 228 | 229 | ```purescript 230 | inputComponent 231 | :: ∀ eff st. 232 | -> (st -> st) 233 | -> Component eff 234 | { parent :: st 235 | , current :: String 236 | , input :: String 237 | } 238 | inputComponent focus delete = div [] 239 | [ div [ onClick \_ -> modify \st -> st { current = "" } ] [ text "Clear text" ] 240 | , div [ onClick \_ -> modify \st -> st { parent = delete st.parent } ] [ text "Delete" ] 241 | ] 242 | 243 | parent = div [] [ zoomR { parent: _id, current, input } inputComponent ] -- _id being the identity Lens' 244 | ``` 245 | 246 | ### Unzooming 247 | 248 | A combination of both approaches described above is to use `zoomUn*` to "unzoom" from the child `Component` into the parent `Component`: 249 | 250 | ![zoomUn](docs/typedraw/zoomUn.png) 251 | 252 | For example: 253 | 254 | ```purescript 255 | inputComponent 256 | :: ∀ eff st. 257 | { current :: ALens' st String 258 | , input :: ALens' st String 259 | } 260 | -> (st -> st) 261 | -> Component eff st 262 | inputComponent focus delete = zoomR focus \unzoom -> div [] 263 | [ div [ onClick \_ -> modify \st -> st { current = "" } ] [ text "Clear text" ] 264 | , unzoom $ div [ onClick \_ -> modify delete ] [ text "Delete" ] 265 | ] 266 | 267 | parent = div [] [ inputComponent { current, input } ] 268 | ``` 269 | 270 | ## Traversals 271 | 272 | Currently there are traversal combinators for `Array`s and `Map`s. Each combinator is provided in a filtered or unfiltered, polymorphic, zoom + unzoom and zoom only variant. 273 | 274 | For example, here's the polymorphic filtered `Map` traversal `foreachMapF`: 275 | 276 | ![foreachMapF](docs/typedraw/foreachMapF.png) 277 | 278 | `Array` traversals: 279 | 280 | | Filtered | Polymorphic | Zoom + Unzoom | Zoom only | 281 | |----------|-------------|---------------|-------------| 282 | | **yes** | `foreachF` | `foreachUF` | `foreachZF` | 283 | | **no** | `foreach` | `foreachU` | `foreachZ` | 284 | 285 | `Map` traversals: 286 | 287 | | Filtered | Polymorphic | Zoom + Unzoom | 288 | |----------|----------------|----------------| 289 | | **yes** | `foreachMapF` | `foreachMapUF` | 290 | | **no** | `foreachMap` | `foreachMapU` | 291 | 292 | The reason why only the `foreachMap*` variants provide an `st -> st` function that deletes the current focused element is that with arrays it's easy to run into the following situation: 293 | 294 | ``` purescript 295 | div [ onClick \_ -> do 296 | modify delete 297 | modifyL focus \st -> st ... 298 | ] 299 | [] 300 | ``` 301 | 302 | which would first delete the focused element and _only then_ attempt to modify it (in turn modifying the following element, if any, or resulting in a runtime error.) Since a `Map` is a one to one mapping of keys to values, attempting to modify an already deleted element will be a no-op and is thus safe. 303 | 304 | ## React bindings 305 | 306 | `purescript-refract` is a thin wrapper over React and thus presents direct access to the lifetime methods API: 307 | 308 | ``` purescript 309 | type Spec eff st = 310 | { displayName :: String 311 | 312 | , componentWillMount :: Effect eff st Unit 313 | , componentDidMount :: Effect eff st Unit 314 | , componentWillUnmount :: Effect eff st Unit 315 | 316 | , componentWillUpdate :: st -> Effect eff st Unit 317 | , componentDidUpdate :: st -> Effect eff st Unit 318 | 319 | , shouldComponentUpdate :: st -> Boolean 320 | } 321 | 322 | componentClass :: ∀ eff st. Spec eff st -> Component eff st -> ComponentClass eff st 323 | 324 | component :: ∀ eff st. ComponentClass eff st -> Component eff st 325 | ``` 326 | 327 | Note that `ComponentClass`es should be defined at the top level, otherwise every rerender will create a new `ComponentClass` and consequently force React to immediately and repeatedly call `componentWillMount`, `componentDidMount`, etc. 328 | 329 | ## Contributions 330 | 331 | Comments, PRs, bug reports welcome. 332 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-refract", 3 | "authors": [ 4 | "Philip Kamenarsky " 5 | ], 6 | "license": "MIT", 7 | "ignore": [ 8 | "**/.*", 9 | "node_modules", 10 | "bower_components", 11 | "test", 12 | "tests" 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "git://github.com/pkamenarsky/purescript-refract.git" 17 | }, 18 | "dependencies": { 19 | "purescript-prelude": "^3.1.1", 20 | "purescript-arrays": "^4.2.1", 21 | "purescript-aff": "^4.0.0", 22 | "purescript-dom": "^4.12.0", 23 | "purescript-free": "^4.1.0", 24 | "purescript-maps": "^3.5.2", 25 | "purescript-react": "^4.4.0", 26 | "purescript-react-dom": "^4.1.0", 27 | "purescript-record": "^0.2.5", 28 | "purescript-psci-support": "^3.0.0", 29 | "purescript-tuples": "^4.1.0", 30 | "purescript-transformers": "^3.4.0", 31 | "purescript-typelevel-prelude": "^2.5.0", 32 | "purescript-profunctor-lenses": "^3.8.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /docs/refract-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/refract-logo.png -------------------------------------------------------------------------------- /docs/typedraw/foreachMapF: -------------------------------------------------------------------------------- 1 | foreachMapF :: (k × v -> k × v -> Ordering) -- Sort function 2 | -> (k × v -> Boolean) -- Filter function 3 | -> Lens s (Map k v) 4 | -> (Lens s v -> (s -> s) -> Component s) -- (s -> s) deletes the current element 5 | -> Component s -------------------------------------------------------------------------------- /docs/typedraw/foreachMapF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/foreachMapF.png -------------------------------------------------------------------------------- /docs/typedraw/modifyL: -------------------------------------------------------------------------------- 1 | modifyL :: Lens st s -> (s -> s) -> Effect st -------------------------------------------------------------------------------- /docs/typedraw/modifyL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/modifyL.png -------------------------------------------------------------------------------- /docs/typedraw/modifyR: -------------------------------------------------------------------------------- 1 | { 2 | x :: Lens su a 3 | modifyR :: , y :: Lens su b -> ( { x :: a, y :: b, z :: c } -> { x :: a, y :: b, z :: c }) -> Effect su 4 | , z :: Lens su c 5 | } -------------------------------------------------------------------------------- /docs/typedraw/modifyR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/modifyR.png -------------------------------------------------------------------------------- /docs/typedraw/stateL: -------------------------------------------------------------------------------- 1 | stateL :: Lens st s -> (s -> Component st) -> Component st -------------------------------------------------------------------------------- /docs/typedraw/stateL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/stateL.png -------------------------------------------------------------------------------- /docs/typedraw/stateR: -------------------------------------------------------------------------------- 1 | { 2 | x :: Lens su a 3 | stateR :: , y :: Lens su b -> ({ x :: a, y :: b, z :: c } -> Component su) -> Component su 4 | , z :: Lens su c 5 | } -------------------------------------------------------------------------------- /docs/typedraw/stateR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/stateR.png -------------------------------------------------------------------------------- /docs/typedraw/typemap1.json: -------------------------------------------------------------------------------- 1 | { 2 | "st": [ 3 | [ "rect", "#333", 0, 0, 1, 1 ], 4 | [ "rect", "#D4145A", 0.25, 0.25, 0.5, 0.5 ] 5 | ], 6 | "s": [ 7 | [ "rect", "#D4145A", 0.25, 0.25, 0.5, 0.5 ] 8 | ], 9 | "k": [ 10 | [ "rect", "#29ABE2", 0.25, 0.25, 0.5, 0.5 ] 11 | ], 12 | "v": [ 13 | [ "rect", "#F7931E", 0.25, 0.25, 0.5, 0.5 ] 14 | ], 15 | 16 | "su": [ 17 | [ "rect", "#333", 0, 0, 1, 1 ], 18 | [ "rect", "#29ABE2", 0.25, 0.25, 0.25, 0.25 ], 19 | [ "rect", "#FBB03B", 0.5, 0.25, 0.25, 0.25 ], 20 | [ "rect", "#D4145A", 0.25, 0.5, 0.5, 0.25 ] 21 | ], 22 | 23 | "a": [ 24 | [ "rect", "#29ABE2", 0.25, 0.25, 0.25, 0.25 ] 25 | ], 26 | "b": [ 27 | [ "rect", "#FBB03B", 0.25, 0.25, 0.25, 0.25 ] 28 | ], 29 | "c": [ 30 | [ "rect", "#D4145A", 0.25, 0.5, 0.5, 0.25 ] 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /docs/typedraw/typemap2.json: -------------------------------------------------------------------------------- 1 | { 2 | "st": [ 3 | [ "circle", "#333", 0.5, 0.5, 0.5 ], 4 | [ "circle", "#D4145A", 0.5, 0.5, 0.25 ] 5 | ], 6 | "s": [ 7 | [ "circle", "#D4145A", 0.5, 0.5, 0.25 ] 8 | ], 9 | "k": [ 10 | [ "circle", "#29ABE2", 0.5, 0.5, 0.25 ] 11 | ], 12 | "v": [ 13 | [ "circle", "#F7931E", 0.5, 0.5, 0.25 ] 14 | ], 15 | 16 | "su": [ 17 | [ "circle", "#333", 0.5, 0.5, 0.5 ], 18 | [ "circle", "#D4145A", 0.5, 0.67, 0.15 ], 19 | [ "circle", "#D4145A", 0.3, 0.4, 0.15 ], 20 | [ "circle", "#D4145A", 0.7, 0.4, 0.15 ] 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /docs/typedraw/zoom: -------------------------------------------------------------------------------- 1 | zoom :: Lens st s -> Component s -> Component st -------------------------------------------------------------------------------- /docs/typedraw/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/zoom.png -------------------------------------------------------------------------------- /docs/typedraw/zoomR: -------------------------------------------------------------------------------- 1 | { 2 | x :: Lens su a 3 | zoomR :: , y :: Lens su b -> Component { x :: a, y :: b, z :: c } -> Component su 4 | , z :: Lens su c 5 | } -------------------------------------------------------------------------------- /docs/typedraw/zoomR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/zoomR.png -------------------------------------------------------------------------------- /docs/typedraw/zoomUn: -------------------------------------------------------------------------------- 1 | zoomUn :: Lens st s -> ((Component st -> Component s) -> Component s) -> Component st -------------------------------------------------------------------------------- /docs/typedraw/zoomUn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/docs/typedraw/zoomUn.png -------------------------------------------------------------------------------- /generated-docs/Props.md: -------------------------------------------------------------------------------- 1 | ## Module Props 2 | 3 | #### `aria` 4 | 5 | ``` purescript 6 | aria :: forall ariaAttrs eff st. { | ariaAttrs } -> Props eff st 7 | ``` 8 | 9 | #### `_data` 10 | 11 | ``` purescript 12 | _data :: forall dataAttrs eff st. { | dataAttrs } -> Props eff st 13 | ``` 14 | 15 | #### `style` 16 | 17 | ``` purescript 18 | style :: forall style eff st. { | style } -> Props eff st 19 | ``` 20 | 21 | #### `dangerouslySetInnerHTML` 22 | 23 | ``` purescript 24 | dangerouslySetInnerHTML :: forall eff st. { __html :: String } -> Props eff st 25 | ``` 26 | 27 | #### `accept` 28 | 29 | ``` purescript 30 | accept :: forall eff st. String -> Props eff st 31 | ``` 32 | 33 | #### `acceptCharset` 34 | 35 | ``` purescript 36 | acceptCharset :: forall eff st. String -> Props eff st 37 | ``` 38 | 39 | #### `accessKey` 40 | 41 | ``` purescript 42 | accessKey :: forall eff st. String -> Props eff st 43 | ``` 44 | 45 | #### `action` 46 | 47 | ``` purescript 48 | action :: forall eff st. String -> Props eff st 49 | ``` 50 | 51 | #### `allowFullScreen` 52 | 53 | ``` purescript 54 | allowFullScreen :: forall eff st. Boolean -> Props eff st 55 | ``` 56 | 57 | #### `allowTransparency` 58 | 59 | ``` purescript 60 | allowTransparency :: forall eff st. Boolean -> Props eff st 61 | ``` 62 | 63 | #### `alt` 64 | 65 | ``` purescript 66 | alt :: forall eff st. String -> Props eff st 67 | ``` 68 | 69 | #### `async` 70 | 71 | ``` purescript 72 | async :: forall eff st. Boolean -> Props eff st 73 | ``` 74 | 75 | #### `autoComplete` 76 | 77 | ``` purescript 78 | autoComplete :: forall eff st. String -> Props eff st 79 | ``` 80 | 81 | #### `autoFocus` 82 | 83 | ``` purescript 84 | autoFocus :: forall eff st. Boolean -> Props eff st 85 | ``` 86 | 87 | #### `autoPlay` 88 | 89 | ``` purescript 90 | autoPlay :: forall eff st. Boolean -> Props eff st 91 | ``` 92 | 93 | #### `capture` 94 | 95 | ``` purescript 96 | capture :: forall eff st. Boolean -> Props eff st 97 | ``` 98 | 99 | #### `cellPadding` 100 | 101 | ``` purescript 102 | cellPadding :: forall eff st. String -> Props eff st 103 | ``` 104 | 105 | #### `cellSpacing` 106 | 107 | ``` purescript 108 | cellSpacing :: forall eff st. String -> Props eff st 109 | ``` 110 | 111 | #### `charSet` 112 | 113 | ``` purescript 114 | charSet :: forall eff st. String -> Props eff st 115 | ``` 116 | 117 | #### `challenge` 118 | 119 | ``` purescript 120 | challenge :: forall eff st. String -> Props eff st 121 | ``` 122 | 123 | #### `checked` 124 | 125 | ``` purescript 126 | checked :: forall eff st. Boolean -> Props eff st 127 | ``` 128 | 129 | #### `cite` 130 | 131 | ``` purescript 132 | cite :: forall eff st. String -> Props eff st 133 | ``` 134 | 135 | #### `classID` 136 | 137 | ``` purescript 138 | classID :: forall eff st. String -> Props eff st 139 | ``` 140 | 141 | #### `className` 142 | 143 | ``` purescript 144 | className :: forall eff st. String -> Props eff st 145 | ``` 146 | 147 | #### `cols` 148 | 149 | ``` purescript 150 | cols :: forall eff st. Int -> Props eff st 151 | ``` 152 | 153 | #### `colSpan` 154 | 155 | ``` purescript 156 | colSpan :: forall eff st. Int -> Props eff st 157 | ``` 158 | 159 | #### `content` 160 | 161 | ``` purescript 162 | content :: forall eff st. String -> Props eff st 163 | ``` 164 | 165 | #### `contentEditable` 166 | 167 | ``` purescript 168 | contentEditable :: forall eff st. Boolean -> Props eff st 169 | ``` 170 | 171 | #### `contextMenu` 172 | 173 | ``` purescript 174 | contextMenu :: forall eff st. String -> Props eff st 175 | ``` 176 | 177 | #### `controls` 178 | 179 | ``` purescript 180 | controls :: forall eff st. Boolean -> Props eff st 181 | ``` 182 | 183 | #### `coords` 184 | 185 | ``` purescript 186 | coords :: forall eff st. String -> Props eff st 187 | ``` 188 | 189 | #### `crossOrigin` 190 | 191 | ``` purescript 192 | crossOrigin :: forall eff st. String -> Props eff st 193 | ``` 194 | 195 | #### `dateTime` 196 | 197 | ``` purescript 198 | dateTime :: forall eff st. String -> Props eff st 199 | ``` 200 | 201 | #### `default` 202 | 203 | ``` purescript 204 | default :: forall eff st. Boolean -> Props eff st 205 | ``` 206 | 207 | #### `defaultChecked` 208 | 209 | ``` purescript 210 | defaultChecked :: forall eff st. Boolean -> Props eff st 211 | ``` 212 | 213 | #### `defaultValue` 214 | 215 | ``` purescript 216 | defaultValue :: forall eff st. String -> Props eff st 217 | ``` 218 | 219 | #### `defer` 220 | 221 | ``` purescript 222 | defer :: forall eff st. Boolean -> Props eff st 223 | ``` 224 | 225 | #### `dir` 226 | 227 | ``` purescript 228 | dir :: forall eff st. String -> Props eff st 229 | ``` 230 | 231 | #### `disabled` 232 | 233 | ``` purescript 234 | disabled :: forall eff st. Boolean -> Props eff st 235 | ``` 236 | 237 | #### `download` 238 | 239 | ``` purescript 240 | download :: forall eff st. String -> Props eff st 241 | ``` 242 | 243 | #### `draggable` 244 | 245 | ``` purescript 246 | draggable :: forall eff st. Boolean -> Props eff st 247 | ``` 248 | 249 | #### `encType` 250 | 251 | ``` purescript 252 | encType :: forall eff st. String -> Props eff st 253 | ``` 254 | 255 | #### `form` 256 | 257 | ``` purescript 258 | form :: forall eff st. String -> Props eff st 259 | ``` 260 | 261 | #### `formAction` 262 | 263 | ``` purescript 264 | formAction :: forall eff st. String -> Props eff st 265 | ``` 266 | 267 | #### `formEncType` 268 | 269 | ``` purescript 270 | formEncType :: forall eff st. String -> Props eff st 271 | ``` 272 | 273 | #### `formMethod` 274 | 275 | ``` purescript 276 | formMethod :: forall eff st. String -> Props eff st 277 | ``` 278 | 279 | #### `formNoValidate` 280 | 281 | ``` purescript 282 | formNoValidate :: forall eff st. Boolean -> Props eff st 283 | ``` 284 | 285 | #### `formTarget` 286 | 287 | ``` purescript 288 | formTarget :: forall eff st. String -> Props eff st 289 | ``` 290 | 291 | #### `frameBorder` 292 | 293 | ``` purescript 294 | frameBorder :: forall eff st. String -> Props eff st 295 | ``` 296 | 297 | #### `headers` 298 | 299 | ``` purescript 300 | headers :: forall eff st. String -> Props eff st 301 | ``` 302 | 303 | #### `height` 304 | 305 | ``` purescript 306 | height :: forall eff st. String -> Props eff st 307 | ``` 308 | 309 | #### `hidden` 310 | 311 | ``` purescript 312 | hidden :: forall eff st. Boolean -> Props eff st 313 | ``` 314 | 315 | #### `high` 316 | 317 | ``` purescript 318 | high :: forall eff st. String -> Props eff st 319 | ``` 320 | 321 | #### `href` 322 | 323 | ``` purescript 324 | href :: forall eff st. String -> Props eff st 325 | ``` 326 | 327 | #### `hrefLang` 328 | 329 | ``` purescript 330 | hrefLang :: forall eff st. String -> Props eff st 331 | ``` 332 | 333 | #### `htmlFor` 334 | 335 | ``` purescript 336 | htmlFor :: forall eff st. String -> Props eff st 337 | ``` 338 | 339 | #### `httpEquiv` 340 | 341 | ``` purescript 342 | httpEquiv :: forall eff st. String -> Props eff st 343 | ``` 344 | 345 | #### `icon` 346 | 347 | ``` purescript 348 | icon :: forall eff st. String -> Props eff st 349 | ``` 350 | 351 | #### `_id` 352 | 353 | ``` purescript 354 | _id :: forall eff st. String -> Props eff st 355 | ``` 356 | 357 | #### `inputMode` 358 | 359 | ``` purescript 360 | inputMode :: forall eff st. String -> Props eff st 361 | ``` 362 | 363 | #### `integrity` 364 | 365 | ``` purescript 366 | integrity :: forall eff st. String -> Props eff st 367 | ``` 368 | 369 | #### `is` 370 | 371 | ``` purescript 372 | is :: forall eff st. String -> Props eff st 373 | ``` 374 | 375 | #### `key` 376 | 377 | ``` purescript 378 | key :: forall eff st. String -> Props eff st 379 | ``` 380 | 381 | #### `keyParams` 382 | 383 | ``` purescript 384 | keyParams :: forall eff st. String -> Props eff st 385 | ``` 386 | 387 | #### `keyType` 388 | 389 | ``` purescript 390 | keyType :: forall eff st. String -> Props eff st 391 | ``` 392 | 393 | #### `kind` 394 | 395 | ``` purescript 396 | kind :: forall eff st. String -> Props eff st 397 | ``` 398 | 399 | #### `label` 400 | 401 | ``` purescript 402 | label :: forall eff st. String -> Props eff st 403 | ``` 404 | 405 | #### `lang` 406 | 407 | ``` purescript 408 | lang :: forall eff st. String -> Props eff st 409 | ``` 410 | 411 | #### `list` 412 | 413 | ``` purescript 414 | list :: forall eff st. String -> Props eff st 415 | ``` 416 | 417 | #### `loop` 418 | 419 | ``` purescript 420 | loop :: forall eff st. Boolean -> Props eff st 421 | ``` 422 | 423 | #### `low` 424 | 425 | ``` purescript 426 | low :: forall eff st. String -> Props eff st 427 | ``` 428 | 429 | #### `manifest` 430 | 431 | ``` purescript 432 | manifest :: forall eff st. String -> Props eff st 433 | ``` 434 | 435 | #### `marginHeight` 436 | 437 | ``` purescript 438 | marginHeight :: forall eff st. String -> Props eff st 439 | ``` 440 | 441 | #### `marginWidth` 442 | 443 | ``` purescript 444 | marginWidth :: forall eff st. String -> Props eff st 445 | ``` 446 | 447 | #### `max` 448 | 449 | ``` purescript 450 | max :: forall eff st. String -> Props eff st 451 | ``` 452 | 453 | #### `maxLength` 454 | 455 | ``` purescript 456 | maxLength :: forall eff st. String -> Props eff st 457 | ``` 458 | 459 | #### `media` 460 | 461 | ``` purescript 462 | media :: forall eff st. String -> Props eff st 463 | ``` 464 | 465 | #### `mediaGroup` 466 | 467 | ``` purescript 468 | mediaGroup :: forall eff st. String -> Props eff st 469 | ``` 470 | 471 | #### `method` 472 | 473 | ``` purescript 474 | method :: forall eff st. String -> Props eff st 475 | ``` 476 | 477 | #### `min` 478 | 479 | ``` purescript 480 | min :: forall eff st. String -> Props eff st 481 | ``` 482 | 483 | #### `minLength` 484 | 485 | ``` purescript 486 | minLength :: forall eff st. String -> Props eff st 487 | ``` 488 | 489 | #### `multiple` 490 | 491 | ``` purescript 492 | multiple :: forall eff st. Boolean -> Props eff st 493 | ``` 494 | 495 | #### `muted` 496 | 497 | ``` purescript 498 | muted :: forall eff st. Boolean -> Props eff st 499 | ``` 500 | 501 | #### `name` 502 | 503 | ``` purescript 504 | name :: forall eff st. String -> Props eff st 505 | ``` 506 | 507 | #### `nonce` 508 | 509 | ``` purescript 510 | nonce :: forall eff st. String -> Props eff st 511 | ``` 512 | 513 | #### `noValidate` 514 | 515 | ``` purescript 516 | noValidate :: forall eff st. Boolean -> Props eff st 517 | ``` 518 | 519 | #### `open` 520 | 521 | ``` purescript 522 | open :: forall eff st. Boolean -> Props eff st 523 | ``` 524 | 525 | #### `optimum` 526 | 527 | ``` purescript 528 | optimum :: forall eff st. String -> Props eff st 529 | ``` 530 | 531 | #### `pattern` 532 | 533 | ``` purescript 534 | pattern :: forall eff st. String -> Props eff st 535 | ``` 536 | 537 | #### `placeholder` 538 | 539 | ``` purescript 540 | placeholder :: forall eff st. String -> Props eff st 541 | ``` 542 | 543 | #### `poster` 544 | 545 | ``` purescript 546 | poster :: forall eff st. String -> Props eff st 547 | ``` 548 | 549 | #### `preload` 550 | 551 | ``` purescript 552 | preload :: forall eff st. String -> Props eff st 553 | ``` 554 | 555 | #### `profile` 556 | 557 | ``` purescript 558 | profile :: forall eff st. String -> Props eff st 559 | ``` 560 | 561 | #### `radioGroup` 562 | 563 | ``` purescript 564 | radioGroup :: forall eff st. String -> Props eff st 565 | ``` 566 | 567 | #### `readOnly` 568 | 569 | ``` purescript 570 | readOnly :: forall eff st. Boolean -> Props eff st 571 | ``` 572 | 573 | #### `rel` 574 | 575 | ``` purescript 576 | rel :: forall eff st. String -> Props eff st 577 | ``` 578 | 579 | #### `required` 580 | 581 | ``` purescript 582 | required :: forall eff st. Boolean -> Props eff st 583 | ``` 584 | 585 | #### `reversed` 586 | 587 | ``` purescript 588 | reversed :: forall eff st. Boolean -> Props eff st 589 | ``` 590 | 591 | #### `role` 592 | 593 | ``` purescript 594 | role :: forall eff st. String -> Props eff st 595 | ``` 596 | 597 | #### `rows` 598 | 599 | ``` purescript 600 | rows :: forall eff st. Int -> Props eff st 601 | ``` 602 | 603 | #### `rowSpan` 604 | 605 | ``` purescript 606 | rowSpan :: forall eff st. Int -> Props eff st 607 | ``` 608 | 609 | #### `sandbox` 610 | 611 | ``` purescript 612 | sandbox :: forall eff st. String -> Props eff st 613 | ``` 614 | 615 | #### `scope` 616 | 617 | ``` purescript 618 | scope :: forall eff st. String -> Props eff st 619 | ``` 620 | 621 | #### `scoped` 622 | 623 | ``` purescript 624 | scoped :: forall eff st. Boolean -> Props eff st 625 | ``` 626 | 627 | #### `scrolling` 628 | 629 | ``` purescript 630 | scrolling :: forall eff st. String -> Props eff st 631 | ``` 632 | 633 | #### `seamless` 634 | 635 | ``` purescript 636 | seamless :: forall eff st. Boolean -> Props eff st 637 | ``` 638 | 639 | #### `selected` 640 | 641 | ``` purescript 642 | selected :: forall eff st. Boolean -> Props eff st 643 | ``` 644 | 645 | #### `shape` 646 | 647 | ``` purescript 648 | shape :: forall eff st. String -> Props eff st 649 | ``` 650 | 651 | #### `size` 652 | 653 | ``` purescript 654 | size :: forall eff st. Int -> Props eff st 655 | ``` 656 | 657 | #### `sizes` 658 | 659 | ``` purescript 660 | sizes :: forall eff st. String -> Props eff st 661 | ``` 662 | 663 | #### `span` 664 | 665 | ``` purescript 666 | span :: forall eff st. Int -> Props eff st 667 | ``` 668 | 669 | #### `spellCheck` 670 | 671 | ``` purescript 672 | spellCheck :: forall eff st. Boolean -> Props eff st 673 | ``` 674 | 675 | #### `src` 676 | 677 | ``` purescript 678 | src :: forall eff st. String -> Props eff st 679 | ``` 680 | 681 | #### `srcDoc` 682 | 683 | ``` purescript 684 | srcDoc :: forall eff st. String -> Props eff st 685 | ``` 686 | 687 | #### `srcLang` 688 | 689 | ``` purescript 690 | srcLang :: forall eff st. String -> Props eff st 691 | ``` 692 | 693 | #### `srcSet` 694 | 695 | ``` purescript 696 | srcSet :: forall eff st. String -> Props eff st 697 | ``` 698 | 699 | #### `start` 700 | 701 | ``` purescript 702 | start :: forall eff st. Int -> Props eff st 703 | ``` 704 | 705 | #### `step` 706 | 707 | ``` purescript 708 | step :: forall eff st. String -> Props eff st 709 | ``` 710 | 711 | #### `summary` 712 | 713 | ``` purescript 714 | summary :: forall eff st. String -> Props eff st 715 | ``` 716 | 717 | #### `tabIndex` 718 | 719 | ``` purescript 720 | tabIndex :: forall eff st. Int -> Props eff st 721 | ``` 722 | 723 | #### `target` 724 | 725 | ``` purescript 726 | target :: forall eff st. String -> Props eff st 727 | ``` 728 | 729 | #### `title` 730 | 731 | ``` purescript 732 | title :: forall eff st. String -> Props eff st 733 | ``` 734 | 735 | #### `_type` 736 | 737 | ``` purescript 738 | _type :: forall eff st. String -> Props eff st 739 | ``` 740 | 741 | #### `useMap` 742 | 743 | ``` purescript 744 | useMap :: forall eff st. String -> Props eff st 745 | ``` 746 | 747 | #### `value` 748 | 749 | ``` purescript 750 | value :: forall eff st. String -> Props eff st 751 | ``` 752 | 753 | #### `width` 754 | 755 | ``` purescript 756 | width :: forall eff st. String -> Props eff st 757 | ``` 758 | 759 | #### `wmode` 760 | 761 | ``` purescript 762 | wmode :: forall eff st. String -> Props eff st 763 | ``` 764 | 765 | #### `wrap` 766 | 767 | ``` purescript 768 | wrap :: forall eff st. String -> Props eff st 769 | ``` 770 | 771 | #### `about` 772 | 773 | ``` purescript 774 | about :: forall eff st. String -> Props eff st 775 | ``` 776 | 777 | #### `datatype` 778 | 779 | ``` purescript 780 | datatype :: forall eff st. String -> Props eff st 781 | ``` 782 | 783 | #### `inlist` 784 | 785 | ``` purescript 786 | inlist :: forall eff st. String -> Props eff st 787 | ``` 788 | 789 | #### `prefix` 790 | 791 | ``` purescript 792 | prefix :: forall eff st. String -> Props eff st 793 | ``` 794 | 795 | #### `property` 796 | 797 | ``` purescript 798 | property :: forall eff st. String -> Props eff st 799 | ``` 800 | 801 | #### `resource` 802 | 803 | ``` purescript 804 | resource :: forall eff st. String -> Props eff st 805 | ``` 806 | 807 | #### `typeof` 808 | 809 | ``` purescript 810 | typeof :: forall eff st. String -> Props eff st 811 | ``` 812 | 813 | #### `vocab` 814 | 815 | ``` purescript 816 | vocab :: forall eff st. String -> Props eff st 817 | ``` 818 | 819 | #### `autoCapitalize` 820 | 821 | ``` purescript 822 | autoCapitalize :: forall eff st. String -> Props eff st 823 | ``` 824 | 825 | #### `autoCorrect` 826 | 827 | ``` purescript 828 | autoCorrect :: forall eff st. String -> Props eff st 829 | ``` 830 | 831 | #### `autoSave` 832 | 833 | ``` purescript 834 | autoSave :: forall eff st. String -> Props eff st 835 | ``` 836 | 837 | #### `color` 838 | 839 | ``` purescript 840 | color :: forall eff st. String -> Props eff st 841 | ``` 842 | 843 | #### `itemProp` 844 | 845 | ``` purescript 846 | itemProp :: forall eff st. String -> Props eff st 847 | ``` 848 | 849 | #### `itemScope` 850 | 851 | ``` purescript 852 | itemScope :: forall eff st. Boolean -> Props eff st 853 | ``` 854 | 855 | #### `itemType` 856 | 857 | ``` purescript 858 | itemType :: forall eff st. String -> Props eff st 859 | ``` 860 | 861 | #### `itemID` 862 | 863 | ``` purescript 864 | itemID :: forall eff st. String -> Props eff st 865 | ``` 866 | 867 | #### `itemRef` 868 | 869 | ``` purescript 870 | itemRef :: forall eff st. String -> Props eff st 871 | ``` 872 | 873 | #### `results` 874 | 875 | ``` purescript 876 | results :: forall eff st. Int -> Props eff st 877 | ``` 878 | 879 | #### `security` 880 | 881 | ``` purescript 882 | security :: forall eff st. String -> Props eff st 883 | ``` 884 | 885 | #### `unselectable` 886 | 887 | ``` purescript 888 | unselectable :: forall eff st. Boolean -> Props eff st 889 | ``` 890 | 891 | #### `onAnimationStart` 892 | 893 | ``` purescript 894 | onAnimationStart :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 895 | ``` 896 | 897 | #### `onAnimationEnd` 898 | 899 | ``` purescript 900 | onAnimationEnd :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 901 | ``` 902 | 903 | #### `onAnimationIteration` 904 | 905 | ``` purescript 906 | onAnimationIteration :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 907 | ``` 908 | 909 | #### `onTransitionEnd` 910 | 911 | ``` purescript 912 | onTransitionEnd :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 913 | ``` 914 | 915 | #### `onLoad` 916 | 917 | ``` purescript 918 | onLoad :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 919 | ``` 920 | 921 | #### `onCopy` 922 | 923 | ``` purescript 924 | onCopy :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 925 | ``` 926 | 927 | #### `onCut` 928 | 929 | ``` purescript 930 | onCut :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 931 | ``` 932 | 933 | #### `onPaste` 934 | 935 | ``` purescript 936 | onPaste :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 937 | ``` 938 | 939 | #### `onKeyDown` 940 | 941 | ``` purescript 942 | onKeyDown :: forall eff st. (KeyboardEvent -> Effect eff st Unit) -> Props eff st 943 | ``` 944 | 945 | #### `onKeyPress` 946 | 947 | ``` purescript 948 | onKeyPress :: forall eff st. (KeyboardEvent -> Effect eff st Unit) -> Props eff st 949 | ``` 950 | 951 | #### `onKeyUp` 952 | 953 | ``` purescript 954 | onKeyUp :: forall eff st. (KeyboardEvent -> Effect eff st Unit) -> Props eff st 955 | ``` 956 | 957 | #### `onFocus` 958 | 959 | ``` purescript 960 | onFocus :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 961 | ``` 962 | 963 | #### `onBlur` 964 | 965 | ``` purescript 966 | onBlur :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 967 | ``` 968 | 969 | #### `onChange` 970 | 971 | ``` purescript 972 | onChange :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 973 | ``` 974 | 975 | #### `onInput` 976 | 977 | ``` purescript 978 | onInput :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 979 | ``` 980 | 981 | #### `onInvalid` 982 | 983 | ``` purescript 984 | onInvalid :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 985 | ``` 986 | 987 | #### `onSubmit` 988 | 989 | ``` purescript 990 | onSubmit :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 991 | ``` 992 | 993 | #### `onClick` 994 | 995 | ``` purescript 996 | onClick :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 997 | ``` 998 | 999 | #### `onDoubleClick` 1000 | 1001 | ``` purescript 1002 | onDoubleClick :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1003 | ``` 1004 | 1005 | #### `onDrag` 1006 | 1007 | ``` purescript 1008 | onDrag :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1009 | ``` 1010 | 1011 | #### `onDragEnd` 1012 | 1013 | ``` purescript 1014 | onDragEnd :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1015 | ``` 1016 | 1017 | #### `onDragEnter` 1018 | 1019 | ``` purescript 1020 | onDragEnter :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1021 | ``` 1022 | 1023 | #### `onDragExit` 1024 | 1025 | ``` purescript 1026 | onDragExit :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1027 | ``` 1028 | 1029 | #### `onDragLeave` 1030 | 1031 | ``` purescript 1032 | onDragLeave :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1033 | ``` 1034 | 1035 | #### `onDragOver` 1036 | 1037 | ``` purescript 1038 | onDragOver :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1039 | ``` 1040 | 1041 | #### `onDragStart` 1042 | 1043 | ``` purescript 1044 | onDragStart :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1045 | ``` 1046 | 1047 | #### `onDrop` 1048 | 1049 | ``` purescript 1050 | onDrop :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1051 | ``` 1052 | 1053 | #### `onMouseDown` 1054 | 1055 | ``` purescript 1056 | onMouseDown :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1057 | ``` 1058 | 1059 | #### `onMouseEnter` 1060 | 1061 | ``` purescript 1062 | onMouseEnter :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1063 | ``` 1064 | 1065 | #### `onMouseLeave` 1066 | 1067 | ``` purescript 1068 | onMouseLeave :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1069 | ``` 1070 | 1071 | #### `onMouseMove` 1072 | 1073 | ``` purescript 1074 | onMouseMove :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1075 | ``` 1076 | 1077 | #### `onMouseOut` 1078 | 1079 | ``` purescript 1080 | onMouseOut :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1081 | ``` 1082 | 1083 | #### `onMouseOver` 1084 | 1085 | ``` purescript 1086 | onMouseOver :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1087 | ``` 1088 | 1089 | #### `onMouseUp` 1090 | 1091 | ``` purescript 1092 | onMouseUp :: forall eff st. (MouseEvent -> Effect eff st Unit) -> Props eff st 1093 | ``` 1094 | 1095 | #### `onTouchCancel` 1096 | 1097 | ``` purescript 1098 | onTouchCancel :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1099 | ``` 1100 | 1101 | #### `onTouchEnd` 1102 | 1103 | ``` purescript 1104 | onTouchEnd :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1105 | ``` 1106 | 1107 | #### `onTouchMove` 1108 | 1109 | ``` purescript 1110 | onTouchMove :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1111 | ``` 1112 | 1113 | #### `onTouchStart` 1114 | 1115 | ``` purescript 1116 | onTouchStart :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1117 | ``` 1118 | 1119 | #### `onScroll` 1120 | 1121 | ``` purescript 1122 | onScroll :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1123 | ``` 1124 | 1125 | #### `onWheel` 1126 | 1127 | ``` purescript 1128 | onWheel :: forall eff st. (Event -> Effect eff st Unit) -> Props eff st 1129 | ``` 1130 | 1131 | #### `suppressContentEditableWarning` 1132 | 1133 | ``` purescript 1134 | suppressContentEditableWarning :: forall eff st. Boolean -> Props eff st 1135 | ``` 1136 | 1137 | #### `x` 1138 | 1139 | ``` purescript 1140 | x :: forall eff st. Int -> Props eff st 1141 | ``` 1142 | 1143 | #### `y` 1144 | 1145 | ``` purescript 1146 | y :: forall eff st. Int -> Props eff st 1147 | ``` 1148 | 1149 | #### `cx` 1150 | 1151 | ``` purescript 1152 | cx :: forall eff st. Int -> Props eff st 1153 | ``` 1154 | 1155 | #### `cy` 1156 | 1157 | ``` purescript 1158 | cy :: forall eff st. Int -> Props eff st 1159 | ``` 1160 | 1161 | #### `r` 1162 | 1163 | ``` purescript 1164 | r :: forall eff st. Int -> Props eff st 1165 | ``` 1166 | 1167 | #### `fill` 1168 | 1169 | ``` purescript 1170 | fill :: forall eff st. String -> Props eff st 1171 | ``` 1172 | 1173 | #### `opacity` 1174 | 1175 | ``` purescript 1176 | opacity :: forall eff st. Int -> Props eff st 1177 | ``` 1178 | 1179 | #### `fillOpacity` 1180 | 1181 | ``` purescript 1182 | fillOpacity :: forall eff st. Int -> Props eff st 1183 | ``` 1184 | 1185 | #### `stroke` 1186 | 1187 | ``` purescript 1188 | stroke :: forall eff st. String -> Props eff st 1189 | ``` 1190 | 1191 | #### `strokeWidth` 1192 | 1193 | ``` purescript 1194 | strokeWidth :: forall eff st. Int -> Props eff st 1195 | ``` 1196 | 1197 | #### `points` 1198 | 1199 | ``` purescript 1200 | points :: forall eff st. String -> Props eff st 1201 | ``` 1202 | 1203 | #### `d` 1204 | 1205 | ``` purescript 1206 | d :: forall eff st. String -> Props eff st 1207 | ``` 1208 | 1209 | #### `viewBox` 1210 | 1211 | ``` purescript 1212 | viewBox :: forall eff st. String -> Props eff st 1213 | ``` 1214 | 1215 | #### `unsafeEventConvert` 1216 | 1217 | ``` purescript 1218 | unsafeEventConvert :: forall a. Event -> a 1219 | ``` 1220 | 1221 | #### `onEnter` 1222 | 1223 | ``` purescript 1224 | onEnter :: forall eff st. Effect eff st Unit -> Props eff st 1225 | ``` 1226 | 1227 | #### `onEscape` 1228 | 1229 | ``` purescript 1230 | onEscape :: forall eff st. Effect eff st Unit -> Props eff st 1231 | ``` 1232 | 1233 | 1234 | -------------------------------------------------------------------------------- /generated-docs/Refract.md: -------------------------------------------------------------------------------- 1 | ## Module Refract 2 | 3 | #### `(○)` 4 | 5 | ``` purescript 6 | infixr 9 compose as ○ 7 | ``` 8 | 9 | A synonym for `<<<`. 10 | 11 | #### `(×)` 12 | 13 | ``` purescript 14 | infixr 6 Tuple as × 15 | ``` 16 | 17 | A synonym for `Tuple`. 18 | 19 | #### `type (×)` 20 | 21 | ``` purescript 22 | infixr 6 type Tuple as ype (× 23 | ``` 24 | 25 | A type synonym for `Tuple`. 26 | 27 | #### `_id` 28 | 29 | ``` purescript 30 | _id :: forall a. Lens' a a 31 | ``` 32 | 33 | The identity `Lens`. 34 | 35 | #### `EffectF` 36 | 37 | ``` purescript 38 | data EffectF eff st next 39 | ``` 40 | 41 | The base functor of the `Effect` free monad. 42 | 43 | ##### Instances 44 | ``` purescript 45 | Functor (EffectF eff st) 46 | ``` 47 | 48 | #### `Effect` 49 | 50 | ``` purescript 51 | type Effect eff st = Free (EffectF eff st) 52 | ``` 53 | 54 | An `Effect` with base type `st`. 55 | 56 | #### `modify` 57 | 58 | ``` purescript 59 | modify :: forall eff st. (st -> st) -> Effect eff st Unit 60 | ``` 61 | 62 | Modify the current `Component` state. 63 | 64 | #### `effectfully` 65 | 66 | ``` purescript 67 | effectfully :: forall a eff st. (st -> Aff eff a) -> Effect eff st a 68 | ``` 69 | 70 | Perform a `Control.Monad.Aff` action and return a result. 71 | 72 | #### `state` 73 | 74 | ``` purescript 75 | state :: forall eff st. (st -> Component eff st) -> Component eff st 76 | ``` 77 | 78 | Reify the current `Component` state. 79 | 80 | #### `stateL` 81 | 82 | ``` purescript 83 | stateL :: forall eff st stt. ALens' st stt -> (stt -> Component eff st) -> Component eff st 84 | ``` 85 | 86 | Reify `Component` substate specified by a lens. 87 | 88 | #### `stateR` 89 | 90 | ``` purescript 91 | stateR :: forall eff r rs st. RecordToLens st r rs => { | r } -> ({ | rs } -> Component eff st) -> Component eff st 92 | ``` 93 | 94 | `stateL` for generic records. 95 | 96 | Specializing to a concrete state, its type would be: 97 | 98 | ```purescript 99 | stateR 100 | :: ∀ eff st. 101 | { name :: ALens' st String 102 | , age :: ALens' st Int 103 | } 104 | -> ( { name :: String 105 | , age :: Int 106 | } -> Component eff st 107 | ) 108 | -> Component eff st 109 | ``` 110 | 111 | #### `modifyL` 112 | 113 | ``` purescript 114 | modifyL :: forall eff st stt. ALens' st stt -> (stt -> stt) -> Effect eff st Unit 115 | ``` 116 | 117 | Modify `Component` substate specified by a `Lens`. 118 | 119 | #### `modifyR` 120 | 121 | ``` purescript 122 | modifyR :: forall eff r rs st. RecordToLens st r rs => { | r } -> ({ | rs } -> { | rs }) -> Effect eff st Unit 123 | ``` 124 | 125 | `modifyL` for generic records. 126 | 127 | Specializing to a concrete state, its type would be: 128 | 129 | ```purescript 130 | modifyR 131 | :: ∀ eff st. 132 | { name :: ALens' st String 133 | , age :: ALens' st Int 134 | } 135 | -> ({ name :: String , age :: Int } -> { name :: String , age :: Int }) 136 | -> Effect eff st Unit 137 | ``` 138 | 139 | #### `Unzoom` 140 | 141 | ``` purescript 142 | type Unzoom eff st stt = Component eff st -> Component eff stt 143 | ``` 144 | 145 | #### `zoom` 146 | 147 | ``` purescript 148 | zoom :: forall eff st stt. ALens' st stt -> Component eff stt -> Component eff st 149 | ``` 150 | 151 | Embed a `Component` with a state of type `stt` into a `Component` 152 | with a state of type `st`. 153 | 154 | #### `zoomUn` 155 | 156 | ``` purescript 157 | zoomUn :: forall eff st stt. ALens' st stt -> (Unzoom eff st stt -> Component eff stt) -> Component eff st 158 | ``` 159 | 160 | Embed a `Component` with a state of type `stt` into a `Component` 161 | with a state of type `st` and provide it with an unzoom combinator. 162 | 163 | #### `zoomR` 164 | 165 | ``` purescript 166 | zoomR :: forall eff r rs st. RecordToLens st r rs => { | r } -> Component eff ({ | rs }) -> Component eff st 167 | ``` 168 | 169 | `zoom` for generic records. 170 | 171 | Specializing to a concrete state, its type would be: 172 | 173 | ``` purescript 174 | zoomR 175 | :: ∀ eff st. 176 | { name :: ALens' st String 177 | , age :: ALens' st Int 178 | } 179 | -> Component eff 180 | { name :: String 181 | , age :: Int 182 | } 183 | -> Component eff st 184 | ``` 185 | 186 | #### `zoomRUn` 187 | 188 | ``` purescript 189 | zoomRUn :: forall eff r rs st. RecordToLens st r rs => { | r } -> (Unzoom eff st ({ | rs }) -> Component eff ({ | rs })) -> Component eff st 190 | ``` 191 | 192 | `zoomUn` for generic records. 193 | 194 | #### `Handler` 195 | 196 | ``` purescript 197 | type Handler st = EventHandlerContext ReadWrite Unit st Unit 198 | ``` 199 | 200 | #### `Props` 201 | 202 | ``` purescript 203 | type Props eff st = (Effect eff st Unit -> Handler st) -> Props 204 | ``` 205 | 206 | #### `Component` 207 | 208 | ``` purescript 209 | type Component eff st = (Effect eff st Unit -> Handler st) -> st -> ReactElement 210 | ``` 211 | 212 | A `Component eff st` is parameterized over an effect type `eff` and a 213 | state type `st` over which it operates. 214 | 215 | #### `ComponentClass` 216 | 217 | ``` purescript 218 | type ComponentClass eff st = ReactClass ((Effect eff st Unit -> Handler st) × st) 219 | ``` 220 | 221 | A React component class. Useful whenever a `Component` needs to implement 222 | React lifecycle methods. 223 | 224 | #### `Spec` 225 | 226 | ``` purescript 227 | type Spec eff st = { displayName :: String, componentWillMount :: Effect eff st Unit, componentDidMount :: Effect eff st Unit, componentWillUnmount :: Effect eff st Unit, componentWillUpdate :: st -> Effect eff st Unit, componentDidUpdate :: st -> Effect eff st Unit, shouldComponentUpdate :: st -> Boolean } 228 | ``` 229 | 230 | React lifecycle spec. 231 | 232 | #### `defaultSpec` 233 | 234 | ``` purescript 235 | defaultSpec :: forall eff st. Spec eff st 236 | ``` 237 | 238 | No-op lifecycle method spec. 239 | 240 | #### `componentClass` 241 | 242 | ``` purescript 243 | componentClass :: forall eff st. Spec eff st -> Component eff st -> ComponentClass eff st 244 | ``` 245 | 246 | Create a `ComponentClass` from a `Spec` and a `Component`. 247 | 248 | #### `component` 249 | 250 | ``` purescript 251 | component :: forall eff st. ComponentClass eff st -> Component eff st 252 | ``` 253 | 254 | Create a `Component` from a `ComponentClass`. 255 | 256 | #### `mkComponent` 257 | 258 | ``` purescript 259 | mkComponent :: forall eff st. String -> Array (Props eff st) -> Array (Component eff st) -> Component eff st 260 | ``` 261 | 262 | Create a DOM element `Component`. 263 | 264 | #### `run` 265 | 266 | ``` purescript 267 | run :: forall eff st. String -> Component eff st -> st -> (st -> Eff eff Unit) -> Eff (dom :: DOM | eff) Unit 268 | ``` 269 | 270 | Attach `Component` to the DOM element with the specified id and run it. 271 | 272 | #### `foreach` 273 | 274 | ``` purescript 275 | foreach :: forall eff st a. ALens' st (Array a) -> (ALens' st a -> Component eff st) -> Component eff st 276 | ``` 277 | 278 | Unfiltered `Array` traversal. 279 | 280 | #### `foreachF` 281 | 282 | ``` purescript 283 | foreachF :: forall eff st a. (a -> Boolean) -> ALens' st (Array a) -> (ALens' st a -> Component eff st) -> Component eff st 284 | ``` 285 | 286 | Filtered `Array` traversal. 287 | 288 | #### `foreachU` 289 | 290 | ``` purescript 291 | foreachU :: forall eff st a. ALens' st (Array a) -> (Unzoom eff st a -> Component eff a) -> Component eff st 292 | ``` 293 | 294 | Unfiltered `Array` traversal providing an unzoom combinator. 295 | 296 | #### `foreachUF` 297 | 298 | ``` purescript 299 | foreachUF :: forall eff st a. (a -> Boolean) -> ALens' st (Array a) -> (Unzoom eff st a -> Component eff a) -> Component eff st 300 | ``` 301 | 302 | Filtered `Array` traversal providing an unzoom combinator. 303 | 304 | #### `foreachZ` 305 | 306 | ``` purescript 307 | foreachZ :: forall eff st a. ALens' st (Array a) -> Component eff a -> Component eff st 308 | ``` 309 | 310 | Zooming unfiltered `Array` traversal. 311 | 312 | #### `foreachZF` 313 | 314 | ``` purescript 315 | foreachZF :: forall eff st a. (a -> Boolean) -> ALens' st (Array a) -> Component eff a -> Component eff st 316 | ``` 317 | 318 | Zooming filtered `Array` traversal. 319 | 320 | #### `foreachMap` 321 | 322 | ``` purescript 323 | foreachMap :: forall eff st k v. Ord k => (k × v -> k × v -> Ordering) -> ALens' st (Map k v) -> (ALens' st v -> (st -> st) -> Component eff st) -> Component eff st 324 | ``` 325 | 326 | Unfiltered `Map` traversal. 327 | 328 | #### `foreachMapF` 329 | 330 | ``` purescript 331 | foreachMapF :: forall eff st k v. Ord k => (k × v -> k × v -> Ordering) -> (k × v -> Boolean) -> ALens' st (Map k v) -> (ALens' st v -> (st -> st) -> Component eff st) -> Component eff st 332 | ``` 333 | 334 | Filtered `Map` traversal. 335 | 336 | #### `foreachMapU` 337 | 338 | ``` purescript 339 | foreachMapU :: forall eff st k v. Ord k => (k × v -> k × v -> Ordering) -> ALens' st (Map k v) -> (Unzoom eff st v -> (st -> st) -> Component eff v) -> Component eff st 340 | ``` 341 | 342 | Unfiltered `Map` traversal providing an unzoom combinator. 343 | 344 | #### `foreachMapUF` 345 | 346 | ``` purescript 347 | foreachMapUF :: forall eff st k v. Ord k => (k × v -> k × v -> Ordering) -> (k × v -> Boolean) -> ALens' st (Map k v) -> (Unzoom eff st v -> (st -> st) -> Component eff v) -> Component eff st 348 | ``` 349 | 350 | Filtered `Map` traversal providing an unzoom combinator. 351 | 352 | 353 | -------------------------------------------------------------------------------- /generated-docs/Refract/DOM.md: -------------------------------------------------------------------------------- 1 | ## Module Refract.DOM 2 | 3 | #### `text` 4 | 5 | ``` purescript 6 | text :: forall eff st. String -> Component eff st 7 | ``` 8 | 9 | #### `a` 10 | 11 | ``` purescript 12 | a :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 13 | ``` 14 | 15 | #### `a'` 16 | 17 | ``` purescript 18 | a' :: forall eff st. Array (Component eff st) -> Component eff st 19 | ``` 20 | 21 | #### `abbr` 22 | 23 | ``` purescript 24 | abbr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 25 | ``` 26 | 27 | #### `abbr'` 28 | 29 | ``` purescript 30 | abbr' :: forall eff st. Array (Component eff st) -> Component eff st 31 | ``` 32 | 33 | #### `address` 34 | 35 | ``` purescript 36 | address :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 37 | ``` 38 | 39 | #### `address'` 40 | 41 | ``` purescript 42 | address' :: forall eff st. Array (Component eff st) -> Component eff st 43 | ``` 44 | 45 | #### `area` 46 | 47 | ``` purescript 48 | area :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 49 | ``` 50 | 51 | #### `area'` 52 | 53 | ``` purescript 54 | area' :: forall eff st. Array (Component eff st) -> Component eff st 55 | ``` 56 | 57 | #### `article` 58 | 59 | ``` purescript 60 | article :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 61 | ``` 62 | 63 | #### `article'` 64 | 65 | ``` purescript 66 | article' :: forall eff st. Array (Component eff st) -> Component eff st 67 | ``` 68 | 69 | #### `aside` 70 | 71 | ``` purescript 72 | aside :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 73 | ``` 74 | 75 | #### `aside'` 76 | 77 | ``` purescript 78 | aside' :: forall eff st. Array (Component eff st) -> Component eff st 79 | ``` 80 | 81 | #### `audio` 82 | 83 | ``` purescript 84 | audio :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 85 | ``` 86 | 87 | #### `audio'` 88 | 89 | ``` purescript 90 | audio' :: forall eff st. Array (Component eff st) -> Component eff st 91 | ``` 92 | 93 | #### `b` 94 | 95 | ``` purescript 96 | b :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 97 | ``` 98 | 99 | #### `b'` 100 | 101 | ``` purescript 102 | b' :: forall eff st. Array (Component eff st) -> Component eff st 103 | ``` 104 | 105 | #### `base` 106 | 107 | ``` purescript 108 | base :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 109 | ``` 110 | 111 | #### `base'` 112 | 113 | ``` purescript 114 | base' :: forall eff st. Array (Component eff st) -> Component eff st 115 | ``` 116 | 117 | #### `bdi` 118 | 119 | ``` purescript 120 | bdi :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 121 | ``` 122 | 123 | #### `bdi'` 124 | 125 | ``` purescript 126 | bdi' :: forall eff st. Array (Component eff st) -> Component eff st 127 | ``` 128 | 129 | #### `bdo` 130 | 131 | ``` purescript 132 | bdo :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 133 | ``` 134 | 135 | #### `bdo'` 136 | 137 | ``` purescript 138 | bdo' :: forall eff st. Array (Component eff st) -> Component eff st 139 | ``` 140 | 141 | #### `big` 142 | 143 | ``` purescript 144 | big :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 145 | ``` 146 | 147 | #### `big'` 148 | 149 | ``` purescript 150 | big' :: forall eff st. Array (Component eff st) -> Component eff st 151 | ``` 152 | 153 | #### `blockquote` 154 | 155 | ``` purescript 156 | blockquote :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 157 | ``` 158 | 159 | #### `blockquote'` 160 | 161 | ``` purescript 162 | blockquote' :: forall eff st. Array (Component eff st) -> Component eff st 163 | ``` 164 | 165 | #### `body` 166 | 167 | ``` purescript 168 | body :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 169 | ``` 170 | 171 | #### `body'` 172 | 173 | ``` purescript 174 | body' :: forall eff st. Array (Component eff st) -> Component eff st 175 | ``` 176 | 177 | #### `br` 178 | 179 | ``` purescript 180 | br :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 181 | ``` 182 | 183 | #### `br'` 184 | 185 | ``` purescript 186 | br' :: forall eff st. Array (Component eff st) -> Component eff st 187 | ``` 188 | 189 | #### `button` 190 | 191 | ``` purescript 192 | button :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 193 | ``` 194 | 195 | #### `button'` 196 | 197 | ``` purescript 198 | button' :: forall eff st. Array (Component eff st) -> Component eff st 199 | ``` 200 | 201 | #### `canvas` 202 | 203 | ``` purescript 204 | canvas :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 205 | ``` 206 | 207 | #### `canvas'` 208 | 209 | ``` purescript 210 | canvas' :: forall eff st. Array (Component eff st) -> Component eff st 211 | ``` 212 | 213 | #### `caption` 214 | 215 | ``` purescript 216 | caption :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 217 | ``` 218 | 219 | #### `caption'` 220 | 221 | ``` purescript 222 | caption' :: forall eff st. Array (Component eff st) -> Component eff st 223 | ``` 224 | 225 | #### `cite` 226 | 227 | ``` purescript 228 | cite :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 229 | ``` 230 | 231 | #### `cite'` 232 | 233 | ``` purescript 234 | cite' :: forall eff st. Array (Component eff st) -> Component eff st 235 | ``` 236 | 237 | #### `code` 238 | 239 | ``` purescript 240 | code :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 241 | ``` 242 | 243 | #### `code'` 244 | 245 | ``` purescript 246 | code' :: forall eff st. Array (Component eff st) -> Component eff st 247 | ``` 248 | 249 | #### `col` 250 | 251 | ``` purescript 252 | col :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 253 | ``` 254 | 255 | #### `col'` 256 | 257 | ``` purescript 258 | col' :: forall eff st. Array (Component eff st) -> Component eff st 259 | ``` 260 | 261 | #### `colgroup` 262 | 263 | ``` purescript 264 | colgroup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 265 | ``` 266 | 267 | #### `colgroup'` 268 | 269 | ``` purescript 270 | colgroup' :: forall eff st. Array (Component eff st) -> Component eff st 271 | ``` 272 | 273 | #### `_data` 274 | 275 | ``` purescript 276 | _data :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 277 | ``` 278 | 279 | #### `_data'` 280 | 281 | ``` purescript 282 | _data' :: forall eff st. Array (Component eff st) -> Component eff st 283 | ``` 284 | 285 | #### `datalist` 286 | 287 | ``` purescript 288 | datalist :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 289 | ``` 290 | 291 | #### `datalist'` 292 | 293 | ``` purescript 294 | datalist' :: forall eff st. Array (Component eff st) -> Component eff st 295 | ``` 296 | 297 | #### `dd` 298 | 299 | ``` purescript 300 | dd :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 301 | ``` 302 | 303 | #### `dd'` 304 | 305 | ``` purescript 306 | dd' :: forall eff st. Array (Component eff st) -> Component eff st 307 | ``` 308 | 309 | #### `del` 310 | 311 | ``` purescript 312 | del :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 313 | ``` 314 | 315 | #### `del'` 316 | 317 | ``` purescript 318 | del' :: forall eff st. Array (Component eff st) -> Component eff st 319 | ``` 320 | 321 | #### `details` 322 | 323 | ``` purescript 324 | details :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 325 | ``` 326 | 327 | #### `details'` 328 | 329 | ``` purescript 330 | details' :: forall eff st. Array (Component eff st) -> Component eff st 331 | ``` 332 | 333 | #### `dfn` 334 | 335 | ``` purescript 336 | dfn :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 337 | ``` 338 | 339 | #### `dfn'` 340 | 341 | ``` purescript 342 | dfn' :: forall eff st. Array (Component eff st) -> Component eff st 343 | ``` 344 | 345 | #### `dialog` 346 | 347 | ``` purescript 348 | dialog :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 349 | ``` 350 | 351 | #### `dialog'` 352 | 353 | ``` purescript 354 | dialog' :: forall eff st. Array (Component eff st) -> Component eff st 355 | ``` 356 | 357 | #### `div` 358 | 359 | ``` purescript 360 | div :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 361 | ``` 362 | 363 | #### `div'` 364 | 365 | ``` purescript 366 | div' :: forall eff st. Array (Component eff st) -> Component eff st 367 | ``` 368 | 369 | #### `dl` 370 | 371 | ``` purescript 372 | dl :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 373 | ``` 374 | 375 | #### `dl'` 376 | 377 | ``` purescript 378 | dl' :: forall eff st. Array (Component eff st) -> Component eff st 379 | ``` 380 | 381 | #### `dt` 382 | 383 | ``` purescript 384 | dt :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 385 | ``` 386 | 387 | #### `dt'` 388 | 389 | ``` purescript 390 | dt' :: forall eff st. Array (Component eff st) -> Component eff st 391 | ``` 392 | 393 | #### `em` 394 | 395 | ``` purescript 396 | em :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 397 | ``` 398 | 399 | #### `em'` 400 | 401 | ``` purescript 402 | em' :: forall eff st. Array (Component eff st) -> Component eff st 403 | ``` 404 | 405 | #### `embed` 406 | 407 | ``` purescript 408 | embed :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 409 | ``` 410 | 411 | #### `embed'` 412 | 413 | ``` purescript 414 | embed' :: forall eff st. Array (Component eff st) -> Component eff st 415 | ``` 416 | 417 | #### `fieldset` 418 | 419 | ``` purescript 420 | fieldset :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 421 | ``` 422 | 423 | #### `fieldset'` 424 | 425 | ``` purescript 426 | fieldset' :: forall eff st. Array (Component eff st) -> Component eff st 427 | ``` 428 | 429 | #### `figcaption` 430 | 431 | ``` purescript 432 | figcaption :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 433 | ``` 434 | 435 | #### `figcaption'` 436 | 437 | ``` purescript 438 | figcaption' :: forall eff st. Array (Component eff st) -> Component eff st 439 | ``` 440 | 441 | #### `figure` 442 | 443 | ``` purescript 444 | figure :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 445 | ``` 446 | 447 | #### `figure'` 448 | 449 | ``` purescript 450 | figure' :: forall eff st. Array (Component eff st) -> Component eff st 451 | ``` 452 | 453 | #### `footer` 454 | 455 | ``` purescript 456 | footer :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 457 | ``` 458 | 459 | #### `footer'` 460 | 461 | ``` purescript 462 | footer' :: forall eff st. Array (Component eff st) -> Component eff st 463 | ``` 464 | 465 | #### `form` 466 | 467 | ``` purescript 468 | form :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 469 | ``` 470 | 471 | #### `form'` 472 | 473 | ``` purescript 474 | form' :: forall eff st. Array (Component eff st) -> Component eff st 475 | ``` 476 | 477 | #### `h1` 478 | 479 | ``` purescript 480 | h1 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 481 | ``` 482 | 483 | #### `h1'` 484 | 485 | ``` purescript 486 | h1' :: forall eff st. Array (Component eff st) -> Component eff st 487 | ``` 488 | 489 | #### `h2` 490 | 491 | ``` purescript 492 | h2 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 493 | ``` 494 | 495 | #### `h2'` 496 | 497 | ``` purescript 498 | h2' :: forall eff st. Array (Component eff st) -> Component eff st 499 | ``` 500 | 501 | #### `h3` 502 | 503 | ``` purescript 504 | h3 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 505 | ``` 506 | 507 | #### `h3'` 508 | 509 | ``` purescript 510 | h3' :: forall eff st. Array (Component eff st) -> Component eff st 511 | ``` 512 | 513 | #### `h4` 514 | 515 | ``` purescript 516 | h4 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 517 | ``` 518 | 519 | #### `h4'` 520 | 521 | ``` purescript 522 | h4' :: forall eff st. Array (Component eff st) -> Component eff st 523 | ``` 524 | 525 | #### `h5` 526 | 527 | ``` purescript 528 | h5 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 529 | ``` 530 | 531 | #### `h5'` 532 | 533 | ``` purescript 534 | h5' :: forall eff st. Array (Component eff st) -> Component eff st 535 | ``` 536 | 537 | #### `h6` 538 | 539 | ``` purescript 540 | h6 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 541 | ``` 542 | 543 | #### `h6'` 544 | 545 | ``` purescript 546 | h6' :: forall eff st. Array (Component eff st) -> Component eff st 547 | ``` 548 | 549 | #### `head` 550 | 551 | ``` purescript 552 | head :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 553 | ``` 554 | 555 | #### `head'` 556 | 557 | ``` purescript 558 | head' :: forall eff st. Array (Component eff st) -> Component eff st 559 | ``` 560 | 561 | #### `header` 562 | 563 | ``` purescript 564 | header :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 565 | ``` 566 | 567 | #### `header'` 568 | 569 | ``` purescript 570 | header' :: forall eff st. Array (Component eff st) -> Component eff st 571 | ``` 572 | 573 | #### `hr` 574 | 575 | ``` purescript 576 | hr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 577 | ``` 578 | 579 | #### `hr'` 580 | 581 | ``` purescript 582 | hr' :: forall eff st. Array (Component eff st) -> Component eff st 583 | ``` 584 | 585 | #### `html` 586 | 587 | ``` purescript 588 | html :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 589 | ``` 590 | 591 | #### `html'` 592 | 593 | ``` purescript 594 | html' :: forall eff st. Array (Component eff st) -> Component eff st 595 | ``` 596 | 597 | #### `i` 598 | 599 | ``` purescript 600 | i :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 601 | ``` 602 | 603 | #### `i'` 604 | 605 | ``` purescript 606 | i' :: forall eff st. Array (Component eff st) -> Component eff st 607 | ``` 608 | 609 | #### `iframe` 610 | 611 | ``` purescript 612 | iframe :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 613 | ``` 614 | 615 | #### `iframe'` 616 | 617 | ``` purescript 618 | iframe' :: forall eff st. Array (Component eff st) -> Component eff st 619 | ``` 620 | 621 | #### `img` 622 | 623 | ``` purescript 624 | img :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 625 | ``` 626 | 627 | #### `img'` 628 | 629 | ``` purescript 630 | img' :: forall eff st. Array (Component eff st) -> Component eff st 631 | ``` 632 | 633 | #### `input` 634 | 635 | ``` purescript 636 | input :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 637 | ``` 638 | 639 | #### `input'` 640 | 641 | ``` purescript 642 | input' :: forall eff st. Array (Component eff st) -> Component eff st 643 | ``` 644 | 645 | #### `ins` 646 | 647 | ``` purescript 648 | ins :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 649 | ``` 650 | 651 | #### `ins'` 652 | 653 | ``` purescript 654 | ins' :: forall eff st. Array (Component eff st) -> Component eff st 655 | ``` 656 | 657 | #### `kbd` 658 | 659 | ``` purescript 660 | kbd :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 661 | ``` 662 | 663 | #### `kbd'` 664 | 665 | ``` purescript 666 | kbd' :: forall eff st. Array (Component eff st) -> Component eff st 667 | ``` 668 | 669 | #### `keygen` 670 | 671 | ``` purescript 672 | keygen :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 673 | ``` 674 | 675 | #### `keygen'` 676 | 677 | ``` purescript 678 | keygen' :: forall eff st. Array (Component eff st) -> Component eff st 679 | ``` 680 | 681 | #### `label` 682 | 683 | ``` purescript 684 | label :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 685 | ``` 686 | 687 | #### `label'` 688 | 689 | ``` purescript 690 | label' :: forall eff st. Array (Component eff st) -> Component eff st 691 | ``` 692 | 693 | #### `legend` 694 | 695 | ``` purescript 696 | legend :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 697 | ``` 698 | 699 | #### `legend'` 700 | 701 | ``` purescript 702 | legend' :: forall eff st. Array (Component eff st) -> Component eff st 703 | ``` 704 | 705 | #### `li` 706 | 707 | ``` purescript 708 | li :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 709 | ``` 710 | 711 | #### `li'` 712 | 713 | ``` purescript 714 | li' :: forall eff st. Array (Component eff st) -> Component eff st 715 | ``` 716 | 717 | #### `link` 718 | 719 | ``` purescript 720 | link :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 721 | ``` 722 | 723 | #### `link'` 724 | 725 | ``` purescript 726 | link' :: forall eff st. Array (Component eff st) -> Component eff st 727 | ``` 728 | 729 | #### `main` 730 | 731 | ``` purescript 732 | main :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 733 | ``` 734 | 735 | #### `main'` 736 | 737 | ``` purescript 738 | main' :: forall eff st. Array (Component eff st) -> Component eff st 739 | ``` 740 | 741 | #### `map` 742 | 743 | ``` purescript 744 | map :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 745 | ``` 746 | 747 | #### `map'` 748 | 749 | ``` purescript 750 | map' :: forall eff st. Array (Component eff st) -> Component eff st 751 | ``` 752 | 753 | #### `mark` 754 | 755 | ``` purescript 756 | mark :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 757 | ``` 758 | 759 | #### `mark'` 760 | 761 | ``` purescript 762 | mark' :: forall eff st. Array (Component eff st) -> Component eff st 763 | ``` 764 | 765 | #### `menu` 766 | 767 | ``` purescript 768 | menu :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 769 | ``` 770 | 771 | #### `menu'` 772 | 773 | ``` purescript 774 | menu' :: forall eff st. Array (Component eff st) -> Component eff st 775 | ``` 776 | 777 | #### `menuitem` 778 | 779 | ``` purescript 780 | menuitem :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 781 | ``` 782 | 783 | #### `menuitem'` 784 | 785 | ``` purescript 786 | menuitem' :: forall eff st. Array (Component eff st) -> Component eff st 787 | ``` 788 | 789 | #### `meta` 790 | 791 | ``` purescript 792 | meta :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 793 | ``` 794 | 795 | #### `meta'` 796 | 797 | ``` purescript 798 | meta' :: forall eff st. Array (Component eff st) -> Component eff st 799 | ``` 800 | 801 | #### `meter` 802 | 803 | ``` purescript 804 | meter :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 805 | ``` 806 | 807 | #### `meter'` 808 | 809 | ``` purescript 810 | meter' :: forall eff st. Array (Component eff st) -> Component eff st 811 | ``` 812 | 813 | #### `nav` 814 | 815 | ``` purescript 816 | nav :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 817 | ``` 818 | 819 | #### `nav'` 820 | 821 | ``` purescript 822 | nav' :: forall eff st. Array (Component eff st) -> Component eff st 823 | ``` 824 | 825 | #### `noscript` 826 | 827 | ``` purescript 828 | noscript :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 829 | ``` 830 | 831 | #### `noscript'` 832 | 833 | ``` purescript 834 | noscript' :: forall eff st. Array (Component eff st) -> Component eff st 835 | ``` 836 | 837 | #### `object` 838 | 839 | ``` purescript 840 | object :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 841 | ``` 842 | 843 | #### `object'` 844 | 845 | ``` purescript 846 | object' :: forall eff st. Array (Component eff st) -> Component eff st 847 | ``` 848 | 849 | #### `ol` 850 | 851 | ``` purescript 852 | ol :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 853 | ``` 854 | 855 | #### `ol'` 856 | 857 | ``` purescript 858 | ol' :: forall eff st. Array (Component eff st) -> Component eff st 859 | ``` 860 | 861 | #### `optgroup` 862 | 863 | ``` purescript 864 | optgroup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 865 | ``` 866 | 867 | #### `optgroup'` 868 | 869 | ``` purescript 870 | optgroup' :: forall eff st. Array (Component eff st) -> Component eff st 871 | ``` 872 | 873 | #### `option` 874 | 875 | ``` purescript 876 | option :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 877 | ``` 878 | 879 | #### `option'` 880 | 881 | ``` purescript 882 | option' :: forall eff st. Array (Component eff st) -> Component eff st 883 | ``` 884 | 885 | #### `output` 886 | 887 | ``` purescript 888 | output :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 889 | ``` 890 | 891 | #### `output'` 892 | 893 | ``` purescript 894 | output' :: forall eff st. Array (Component eff st) -> Component eff st 895 | ``` 896 | 897 | #### `p` 898 | 899 | ``` purescript 900 | p :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 901 | ``` 902 | 903 | #### `p'` 904 | 905 | ``` purescript 906 | p' :: forall eff st. Array (Component eff st) -> Component eff st 907 | ``` 908 | 909 | #### `param` 910 | 911 | ``` purescript 912 | param :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 913 | ``` 914 | 915 | #### `param'` 916 | 917 | ``` purescript 918 | param' :: forall eff st. Array (Component eff st) -> Component eff st 919 | ``` 920 | 921 | #### `picture` 922 | 923 | ``` purescript 924 | picture :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 925 | ``` 926 | 927 | #### `picture'` 928 | 929 | ``` purescript 930 | picture' :: forall eff st. Array (Component eff st) -> Component eff st 931 | ``` 932 | 933 | #### `pre` 934 | 935 | ``` purescript 936 | pre :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 937 | ``` 938 | 939 | #### `pre'` 940 | 941 | ``` purescript 942 | pre' :: forall eff st. Array (Component eff st) -> Component eff st 943 | ``` 944 | 945 | #### `progress` 946 | 947 | ``` purescript 948 | progress :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 949 | ``` 950 | 951 | #### `progress'` 952 | 953 | ``` purescript 954 | progress' :: forall eff st. Array (Component eff st) -> Component eff st 955 | ``` 956 | 957 | #### `q` 958 | 959 | ``` purescript 960 | q :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 961 | ``` 962 | 963 | #### `q'` 964 | 965 | ``` purescript 966 | q' :: forall eff st. Array (Component eff st) -> Component eff st 967 | ``` 968 | 969 | #### `rp` 970 | 971 | ``` purescript 972 | rp :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 973 | ``` 974 | 975 | #### `rp'` 976 | 977 | ``` purescript 978 | rp' :: forall eff st. Array (Component eff st) -> Component eff st 979 | ``` 980 | 981 | #### `rt` 982 | 983 | ``` purescript 984 | rt :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 985 | ``` 986 | 987 | #### `rt'` 988 | 989 | ``` purescript 990 | rt' :: forall eff st. Array (Component eff st) -> Component eff st 991 | ``` 992 | 993 | #### `ruby` 994 | 995 | ``` purescript 996 | ruby :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 997 | ``` 998 | 999 | #### `ruby'` 1000 | 1001 | ``` purescript 1002 | ruby' :: forall eff st. Array (Component eff st) -> Component eff st 1003 | ``` 1004 | 1005 | #### `s` 1006 | 1007 | ``` purescript 1008 | s :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1009 | ``` 1010 | 1011 | #### `s'` 1012 | 1013 | ``` purescript 1014 | s' :: forall eff st. Array (Component eff st) -> Component eff st 1015 | ``` 1016 | 1017 | #### `samp` 1018 | 1019 | ``` purescript 1020 | samp :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1021 | ``` 1022 | 1023 | #### `samp'` 1024 | 1025 | ``` purescript 1026 | samp' :: forall eff st. Array (Component eff st) -> Component eff st 1027 | ``` 1028 | 1029 | #### `script` 1030 | 1031 | ``` purescript 1032 | script :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1033 | ``` 1034 | 1035 | #### `script'` 1036 | 1037 | ``` purescript 1038 | script' :: forall eff st. Array (Component eff st) -> Component eff st 1039 | ``` 1040 | 1041 | #### `section` 1042 | 1043 | ``` purescript 1044 | section :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1045 | ``` 1046 | 1047 | #### `section'` 1048 | 1049 | ``` purescript 1050 | section' :: forall eff st. Array (Component eff st) -> Component eff st 1051 | ``` 1052 | 1053 | #### `select` 1054 | 1055 | ``` purescript 1056 | select :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1057 | ``` 1058 | 1059 | #### `select'` 1060 | 1061 | ``` purescript 1062 | select' :: forall eff st. Array (Component eff st) -> Component eff st 1063 | ``` 1064 | 1065 | #### `small` 1066 | 1067 | ``` purescript 1068 | small :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1069 | ``` 1070 | 1071 | #### `small'` 1072 | 1073 | ``` purescript 1074 | small' :: forall eff st. Array (Component eff st) -> Component eff st 1075 | ``` 1076 | 1077 | #### `source` 1078 | 1079 | ``` purescript 1080 | source :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1081 | ``` 1082 | 1083 | #### `source'` 1084 | 1085 | ``` purescript 1086 | source' :: forall eff st. Array (Component eff st) -> Component eff st 1087 | ``` 1088 | 1089 | #### `span` 1090 | 1091 | ``` purescript 1092 | span :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1093 | ``` 1094 | 1095 | #### `span'` 1096 | 1097 | ``` purescript 1098 | span' :: forall eff st. Array (Component eff st) -> Component eff st 1099 | ``` 1100 | 1101 | #### `strong` 1102 | 1103 | ``` purescript 1104 | strong :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1105 | ``` 1106 | 1107 | #### `strong'` 1108 | 1109 | ``` purescript 1110 | strong' :: forall eff st. Array (Component eff st) -> Component eff st 1111 | ``` 1112 | 1113 | #### `style` 1114 | 1115 | ``` purescript 1116 | style :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1117 | ``` 1118 | 1119 | #### `style'` 1120 | 1121 | ``` purescript 1122 | style' :: forall eff st. Array (Component eff st) -> Component eff st 1123 | ``` 1124 | 1125 | #### `sub` 1126 | 1127 | ``` purescript 1128 | sub :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1129 | ``` 1130 | 1131 | #### `sub'` 1132 | 1133 | ``` purescript 1134 | sub' :: forall eff st. Array (Component eff st) -> Component eff st 1135 | ``` 1136 | 1137 | #### `summary` 1138 | 1139 | ``` purescript 1140 | summary :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1141 | ``` 1142 | 1143 | #### `summary'` 1144 | 1145 | ``` purescript 1146 | summary' :: forall eff st. Array (Component eff st) -> Component eff st 1147 | ``` 1148 | 1149 | #### `sup` 1150 | 1151 | ``` purescript 1152 | sup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1153 | ``` 1154 | 1155 | #### `sup'` 1156 | 1157 | ``` purescript 1158 | sup' :: forall eff st. Array (Component eff st) -> Component eff st 1159 | ``` 1160 | 1161 | #### `table` 1162 | 1163 | ``` purescript 1164 | table :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1165 | ``` 1166 | 1167 | #### `table'` 1168 | 1169 | ``` purescript 1170 | table' :: forall eff st. Array (Component eff st) -> Component eff st 1171 | ``` 1172 | 1173 | #### `tbody` 1174 | 1175 | ``` purescript 1176 | tbody :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1177 | ``` 1178 | 1179 | #### `tbody'` 1180 | 1181 | ``` purescript 1182 | tbody' :: forall eff st. Array (Component eff st) -> Component eff st 1183 | ``` 1184 | 1185 | #### `td` 1186 | 1187 | ``` purescript 1188 | td :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1189 | ``` 1190 | 1191 | #### `td'` 1192 | 1193 | ``` purescript 1194 | td' :: forall eff st. Array (Component eff st) -> Component eff st 1195 | ``` 1196 | 1197 | #### `textarea` 1198 | 1199 | ``` purescript 1200 | textarea :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1201 | ``` 1202 | 1203 | #### `textarea'` 1204 | 1205 | ``` purescript 1206 | textarea' :: forall eff st. Array (Component eff st) -> Component eff st 1207 | ``` 1208 | 1209 | #### `tfoot` 1210 | 1211 | ``` purescript 1212 | tfoot :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1213 | ``` 1214 | 1215 | #### `tfoot'` 1216 | 1217 | ``` purescript 1218 | tfoot' :: forall eff st. Array (Component eff st) -> Component eff st 1219 | ``` 1220 | 1221 | #### `th` 1222 | 1223 | ``` purescript 1224 | th :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1225 | ``` 1226 | 1227 | #### `th'` 1228 | 1229 | ``` purescript 1230 | th' :: forall eff st. Array (Component eff st) -> Component eff st 1231 | ``` 1232 | 1233 | #### `thead` 1234 | 1235 | ``` purescript 1236 | thead :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1237 | ``` 1238 | 1239 | #### `thead'` 1240 | 1241 | ``` purescript 1242 | thead' :: forall eff st. Array (Component eff st) -> Component eff st 1243 | ``` 1244 | 1245 | #### `time` 1246 | 1247 | ``` purescript 1248 | time :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1249 | ``` 1250 | 1251 | #### `time'` 1252 | 1253 | ``` purescript 1254 | time' :: forall eff st. Array (Component eff st) -> Component eff st 1255 | ``` 1256 | 1257 | #### `title` 1258 | 1259 | ``` purescript 1260 | title :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1261 | ``` 1262 | 1263 | #### `title'` 1264 | 1265 | ``` purescript 1266 | title' :: forall eff st. Array (Component eff st) -> Component eff st 1267 | ``` 1268 | 1269 | #### `tr` 1270 | 1271 | ``` purescript 1272 | tr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1273 | ``` 1274 | 1275 | #### `tr'` 1276 | 1277 | ``` purescript 1278 | tr' :: forall eff st. Array (Component eff st) -> Component eff st 1279 | ``` 1280 | 1281 | #### `track` 1282 | 1283 | ``` purescript 1284 | track :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1285 | ``` 1286 | 1287 | #### `track'` 1288 | 1289 | ``` purescript 1290 | track' :: forall eff st. Array (Component eff st) -> Component eff st 1291 | ``` 1292 | 1293 | #### `u` 1294 | 1295 | ``` purescript 1296 | u :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1297 | ``` 1298 | 1299 | #### `u'` 1300 | 1301 | ``` purescript 1302 | u' :: forall eff st. Array (Component eff st) -> Component eff st 1303 | ``` 1304 | 1305 | #### `ul` 1306 | 1307 | ``` purescript 1308 | ul :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1309 | ``` 1310 | 1311 | #### `ul'` 1312 | 1313 | ``` purescript 1314 | ul' :: forall eff st. Array (Component eff st) -> Component eff st 1315 | ``` 1316 | 1317 | #### `var` 1318 | 1319 | ``` purescript 1320 | var :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1321 | ``` 1322 | 1323 | #### `var'` 1324 | 1325 | ``` purescript 1326 | var' :: forall eff st. Array (Component eff st) -> Component eff st 1327 | ``` 1328 | 1329 | #### `video` 1330 | 1331 | ``` purescript 1332 | video :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1333 | ``` 1334 | 1335 | #### `video'` 1336 | 1337 | ``` purescript 1338 | video' :: forall eff st. Array (Component eff st) -> Component eff st 1339 | ``` 1340 | 1341 | #### `wbr` 1342 | 1343 | ``` purescript 1344 | wbr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 1345 | ``` 1346 | 1347 | #### `wbr'` 1348 | 1349 | ``` purescript 1350 | wbr' :: forall eff st. Array (Component eff st) -> Component eff st 1351 | ``` 1352 | 1353 | 1354 | -------------------------------------------------------------------------------- /generated-docs/Refract/Lens.md: -------------------------------------------------------------------------------- 1 | ## Module Refract.Lens 2 | 3 | #### `ListToLens` 4 | 5 | ``` purescript 6 | class ListToLens st (l :: RowList) (r :: RowList) | l st -> r, r st -> l 7 | ``` 8 | 9 | ##### Instances 10 | ``` purescript 11 | ListToLens st Nil Nil 12 | (Strong p, ListToLens st ls rs) => ListToLens st (Cons k (p o o -> p st st) ls) (Cons k o rs) 13 | ``` 14 | 15 | #### `RecordToLens` 16 | 17 | ``` purescript 18 | class RecordToLens st (r :: # Type) (rs :: # Type) 19 | ``` 20 | 21 | ##### Instances 22 | ``` purescript 23 | (ListToRow rl r, ListToRow rsl rs, RowToList r rl, RowToList rs rsl, ListToLens st rl rsl) => RecordToLens st r rs 24 | ``` 25 | 26 | #### `recordToLens` 27 | 28 | ``` purescript 29 | recordToLens :: forall r rs st. RecordToLens st r rs => { | r } -> Lens' st ({ | rs }) 30 | ``` 31 | 32 | 33 | -------------------------------------------------------------------------------- /generated-docs/Undefined.md: -------------------------------------------------------------------------------- 1 | ## Module Undefined 2 | 3 | #### `undefined` 4 | 5 | ``` purescript 6 | undefined :: forall a. a 7 | ``` 8 | 9 | 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-refract", 3 | "files": [], 4 | "scripts": { 5 | "webpack": "webpack --progress", 6 | "webpack:watch": "webpack --progress --watch", 7 | "webpack-dev-server": "webpack-dev-server --content-base static/ --hot --inline --progress --config webpack.config.js" 8 | }, 9 | "dependencies": { 10 | "react": "^15.4.2", 11 | "react-dom": "^15.4.2" 12 | }, 13 | "devDependencies": { 14 | "css-loader": "^0.28.7", 15 | "node-sass": "^4.5.3", 16 | "purs-loader": "^3.0.0", 17 | "sass-loader": "^6.0.6", 18 | "style-loader": "^0.18.2", 19 | "webpack": "^3.4", 20 | "webpack-dev-server": "^2.9" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /psc-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-refract", 3 | "set": "psc-0.11.7", 4 | "source": "https://github.com/purescript/package-sets.git", 5 | "depends": [ 6 | "prelude", 7 | "arrays", 8 | "aff", 9 | "dom", 10 | "free", 11 | "maps", 12 | "react", 13 | "react-dom", 14 | "record", 15 | "psci-support", 16 | "tuples", 17 | "transformers", 18 | "typelevel-prelude", 19 | "profunctor-lenses" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/Props.purs: -------------------------------------------------------------------------------- 1 | module Props where 2 | 3 | import Prelude 4 | 5 | import React (Event, KeyboardEvent, MouseEvent) 6 | import React.DOM.Props as P 7 | import Refract (Effect, Props, (○)) 8 | import Unsafe.Coerce (unsafeCoerce) 9 | 10 | aria :: ∀ ariaAttrs eff st. { | ariaAttrs } -> Props eff st 11 | aria v _ = P.aria v 12 | 13 | _data :: ∀ dataAttrs eff st. { | dataAttrs } -> Props eff st 14 | _data v _ = P._data v 15 | 16 | style :: ∀ style eff st. { | style } -> Props eff st 17 | style v _ = P.style v 18 | 19 | dangerouslySetInnerHTML :: ∀ eff st. { __html :: String } -> Props eff st 20 | dangerouslySetInnerHTML v _ = P.dangerouslySetInnerHTML v 21 | 22 | accept :: ∀ eff st. String -> Props eff st 23 | accept v _ = P.accept v 24 | 25 | acceptCharset :: ∀ eff st. String -> Props eff st 26 | acceptCharset v _ = P.acceptCharset v 27 | 28 | accessKey :: ∀ eff st. String -> Props eff st 29 | accessKey v _ = P.accessKey v 30 | 31 | action :: ∀ eff st. String -> Props eff st 32 | action v _ = P.action v 33 | 34 | allowFullScreen :: ∀ eff st. Boolean -> Props eff st 35 | allowFullScreen v _ = P.allowFullScreen v 36 | 37 | allowTransparency :: ∀ eff st. Boolean -> Props eff st 38 | allowTransparency v _ = P.allowTransparency v 39 | 40 | alt :: ∀ eff st. String -> Props eff st 41 | alt v _ = P.alt v 42 | 43 | async :: ∀ eff st. Boolean -> Props eff st 44 | async v _ = P.async v 45 | 46 | autoComplete :: ∀ eff st. String -> Props eff st 47 | autoComplete v _ = P.autoComplete v 48 | 49 | autoFocus :: ∀ eff st. Boolean -> Props eff st 50 | autoFocus v _ = P.autoFocus v 51 | 52 | autoPlay :: ∀ eff st. Boolean -> Props eff st 53 | autoPlay v _ = P.autoPlay v 54 | 55 | capture :: ∀ eff st. Boolean -> Props eff st 56 | capture v _ = P.capture v 57 | 58 | cellPadding :: ∀ eff st. String -> Props eff st 59 | cellPadding v _ = P.cellPadding v 60 | 61 | cellSpacing :: ∀ eff st. String -> Props eff st 62 | cellSpacing v _ = P.cellSpacing v 63 | 64 | charSet :: ∀ eff st. String -> Props eff st 65 | charSet v _ = P.charSet v 66 | 67 | challenge :: ∀ eff st. String -> Props eff st 68 | challenge v _ = P.challenge v 69 | 70 | checked :: ∀ eff st. Boolean -> Props eff st 71 | checked v _ = P.checked v 72 | 73 | cite :: ∀ eff st. String -> Props eff st 74 | cite v _ = P.cite v 75 | 76 | classID :: ∀ eff st. String -> Props eff st 77 | classID v _ = P.classID v 78 | 79 | className :: ∀ eff st. String -> Props eff st 80 | className v _ = P.className v 81 | 82 | cols :: ∀ eff st. Int -> Props eff st 83 | cols v _ = P.cols v 84 | 85 | colSpan :: ∀ eff st. Int -> Props eff st 86 | colSpan v _ = P.colSpan v 87 | 88 | content :: ∀ eff st. String -> Props eff st 89 | content v _ = P.content v 90 | 91 | contentEditable :: ∀ eff st. Boolean -> Props eff st 92 | contentEditable v _ = P.contentEditable v 93 | 94 | contextMenu :: ∀ eff st. String -> Props eff st 95 | contextMenu v _ = P.contextMenu v 96 | 97 | controls :: ∀ eff st. Boolean -> Props eff st 98 | controls v _ = P.controls v 99 | 100 | coords :: ∀ eff st. String -> Props eff st 101 | coords v _ = P.coords v 102 | 103 | crossOrigin :: ∀ eff st. String -> Props eff st 104 | crossOrigin v _ = P.crossOrigin v 105 | 106 | dateTime :: ∀ eff st. String -> Props eff st 107 | dateTime v _ = P.dateTime v 108 | 109 | default :: ∀ eff st. Boolean -> Props eff st 110 | default v _ = P.default v 111 | 112 | defaultChecked :: ∀ eff st. Boolean -> Props eff st 113 | defaultChecked v _ = P.defaultChecked v 114 | 115 | defaultValue :: ∀ eff st. String -> Props eff st 116 | defaultValue v _ = P.defaultValue v 117 | 118 | defer :: ∀ eff st. Boolean -> Props eff st 119 | defer v _ = P.defer v 120 | 121 | dir :: ∀ eff st. String -> Props eff st 122 | dir v _ = P.dir v 123 | 124 | disabled :: ∀ eff st. Boolean -> Props eff st 125 | disabled v _ = P.disabled v 126 | 127 | download :: ∀ eff st. String -> Props eff st 128 | download v _ = P.download v 129 | 130 | draggable :: ∀ eff st. Boolean -> Props eff st 131 | draggable v _ = P.draggable v 132 | 133 | encType :: ∀ eff st. String -> Props eff st 134 | encType v _ = P.encType v 135 | 136 | form :: ∀ eff st. String -> Props eff st 137 | form v _ = P.form v 138 | 139 | formAction :: ∀ eff st. String -> Props eff st 140 | formAction v _ = P.formAction v 141 | 142 | formEncType :: ∀ eff st. String -> Props eff st 143 | formEncType v _ = P.formEncType v 144 | 145 | formMethod :: ∀ eff st. String -> Props eff st 146 | formMethod v _ = P.formMethod v 147 | 148 | formNoValidate :: ∀ eff st. Boolean -> Props eff st 149 | formNoValidate v _ = P.formNoValidate v 150 | 151 | formTarget :: ∀ eff st. String -> Props eff st 152 | formTarget v _ = P.formTarget v 153 | 154 | frameBorder :: ∀ eff st. String -> Props eff st 155 | frameBorder v _ = P.frameBorder v 156 | 157 | headers :: ∀ eff st. String -> Props eff st 158 | headers v _ = P.headers v 159 | 160 | height :: ∀ eff st. String -> Props eff st 161 | height v _ = P.height v 162 | 163 | hidden :: ∀ eff st. Boolean -> Props eff st 164 | hidden v _ = P.hidden v 165 | 166 | high :: ∀ eff st. String -> Props eff st 167 | high v _ = P.high v 168 | 169 | href :: ∀ eff st. String -> Props eff st 170 | href v _ = P.href v 171 | 172 | hrefLang :: ∀ eff st. String -> Props eff st 173 | hrefLang v _ = P.hrefLang v 174 | 175 | htmlFor :: ∀ eff st. String -> Props eff st 176 | htmlFor v _ = P.htmlFor v 177 | 178 | httpEquiv :: ∀ eff st. String -> Props eff st 179 | httpEquiv v _ = P.httpEquiv v 180 | 181 | icon :: ∀ eff st. String -> Props eff st 182 | icon v _ = P.icon v 183 | 184 | _id :: ∀ eff st. String -> Props eff st 185 | _id v _ = P._id v 186 | 187 | inputMode :: ∀ eff st. String -> Props eff st 188 | inputMode v _ = P.inputMode v 189 | 190 | integrity :: ∀ eff st. String -> Props eff st 191 | integrity v _ = P.integrity v 192 | 193 | is :: ∀ eff st. String -> Props eff st 194 | is v _ = P.is v 195 | 196 | key :: ∀ eff st. String -> Props eff st 197 | key v _ = P.key v 198 | 199 | keyParams :: ∀ eff st. String -> Props eff st 200 | keyParams v _ = P.keyParams v 201 | 202 | keyType :: ∀ eff st. String -> Props eff st 203 | keyType v _ = P.keyType v 204 | 205 | kind :: ∀ eff st. String -> Props eff st 206 | kind v _ = P.kind v 207 | 208 | label :: ∀ eff st. String -> Props eff st 209 | label v _ = P.label v 210 | 211 | lang :: ∀ eff st. String -> Props eff st 212 | lang v _ = P.lang v 213 | 214 | list :: ∀ eff st. String -> Props eff st 215 | list v _ = P.list v 216 | 217 | loop :: ∀ eff st. Boolean -> Props eff st 218 | loop v _ = P.loop v 219 | 220 | low :: ∀ eff st. String -> Props eff st 221 | low v _ = P.low v 222 | 223 | manifest :: ∀ eff st. String -> Props eff st 224 | manifest v _ = P.manifest v 225 | 226 | marginHeight :: ∀ eff st. String -> Props eff st 227 | marginHeight v _ = P.marginHeight v 228 | 229 | marginWidth :: ∀ eff st. String -> Props eff st 230 | marginWidth v _ = P.marginWidth v 231 | 232 | max :: ∀ eff st. String -> Props eff st 233 | max v _ = P.max v 234 | 235 | maxLength :: ∀ eff st. String -> Props eff st 236 | maxLength v _ = P.maxLength v 237 | 238 | media :: ∀ eff st. String -> Props eff st 239 | media v _ = P.media v 240 | 241 | mediaGroup :: ∀ eff st. String -> Props eff st 242 | mediaGroup v _ = P.mediaGroup v 243 | 244 | method :: ∀ eff st. String -> Props eff st 245 | method v _ = P.method v 246 | 247 | min :: ∀ eff st. String -> Props eff st 248 | min v _ = P.min v 249 | 250 | minLength :: ∀ eff st. String -> Props eff st 251 | minLength v _ = P.minLength v 252 | 253 | multiple :: ∀ eff st. Boolean -> Props eff st 254 | multiple v _ = P.multiple v 255 | 256 | muted :: ∀ eff st. Boolean -> Props eff st 257 | muted v _ = P.muted v 258 | 259 | name :: ∀ eff st. String -> Props eff st 260 | name v _ = P.name v 261 | 262 | nonce :: ∀ eff st. String -> Props eff st 263 | nonce v _ = P.nonce v 264 | 265 | noValidate :: ∀ eff st. Boolean -> Props eff st 266 | noValidate v _ = P.noValidate v 267 | 268 | open :: ∀ eff st. Boolean -> Props eff st 269 | open v _ = P.open v 270 | 271 | optimum :: ∀ eff st. String -> Props eff st 272 | optimum v _ = P.optimum v 273 | 274 | pattern :: ∀ eff st. String -> Props eff st 275 | pattern v _ = P.pattern v 276 | 277 | placeholder :: ∀ eff st. String -> Props eff st 278 | placeholder v _ = P.placeholder v 279 | 280 | poster :: ∀ eff st. String -> Props eff st 281 | poster v _ = P.poster v 282 | 283 | preload :: ∀ eff st. String -> Props eff st 284 | preload v _ = P.preload v 285 | 286 | profile :: ∀ eff st. String -> Props eff st 287 | profile v _ = P.profile v 288 | 289 | radioGroup :: ∀ eff st. String -> Props eff st 290 | radioGroup v _ = P.radioGroup v 291 | 292 | readOnly :: ∀ eff st. Boolean -> Props eff st 293 | readOnly v _ = P.readOnly v 294 | 295 | rel :: ∀ eff st. String -> Props eff st 296 | rel v _ = P.rel v 297 | 298 | required :: ∀ eff st. Boolean -> Props eff st 299 | required v _ = P.required v 300 | 301 | reversed :: ∀ eff st. Boolean -> Props eff st 302 | reversed v _ = P.reversed v 303 | 304 | role :: ∀ eff st. String -> Props eff st 305 | role v _ = P.role v 306 | 307 | rows :: ∀ eff st. Int -> Props eff st 308 | rows v _ = P.rows v 309 | 310 | rowSpan :: ∀ eff st. Int -> Props eff st 311 | rowSpan v _ = P.rowSpan v 312 | 313 | sandbox :: ∀ eff st. String -> Props eff st 314 | sandbox v _ = P.sandbox v 315 | 316 | scope :: ∀ eff st. String -> Props eff st 317 | scope v _ = P.scope v 318 | 319 | scoped :: ∀ eff st. Boolean -> Props eff st 320 | scoped v _ = P.scoped v 321 | 322 | scrolling :: ∀ eff st. String -> Props eff st 323 | scrolling v _ = P.scrolling v 324 | 325 | seamless :: ∀ eff st. Boolean -> Props eff st 326 | seamless v _ = P.seamless v 327 | 328 | selected :: ∀ eff st. Boolean -> Props eff st 329 | selected v _ = P.selected v 330 | 331 | shape :: ∀ eff st. String -> Props eff st 332 | shape v _ = P.shape v 333 | 334 | size :: ∀ eff st. Int -> Props eff st 335 | size v _ = P.size v 336 | 337 | sizes :: ∀ eff st. String -> Props eff st 338 | sizes v _ = P.sizes v 339 | 340 | span :: ∀ eff st. Int -> Props eff st 341 | span v _ = P.span v 342 | 343 | spellCheck :: ∀ eff st. Boolean -> Props eff st 344 | spellCheck v _ = P.spellCheck v 345 | 346 | src :: ∀ eff st. String -> Props eff st 347 | src v _ = P.src v 348 | 349 | srcDoc :: ∀ eff st. String -> Props eff st 350 | srcDoc v _ = P.srcDoc v 351 | 352 | srcLang :: ∀ eff st. String -> Props eff st 353 | srcLang v _ = P.srcLang v 354 | 355 | srcSet :: ∀ eff st. String -> Props eff st 356 | srcSet v _ = P.srcSet v 357 | 358 | start :: ∀ eff st. Int -> Props eff st 359 | start v _ = P.start v 360 | 361 | step :: ∀ eff st. String -> Props eff st 362 | step v _ = P.step v 363 | 364 | summary :: ∀ eff st. String -> Props eff st 365 | summary v _ = P.summary v 366 | 367 | tabIndex :: ∀ eff st. Int -> Props eff st 368 | tabIndex v _ = P.tabIndex v 369 | 370 | target :: ∀ eff st. String -> Props eff st 371 | target v _ = P.target v 372 | 373 | title :: ∀ eff st. String -> Props eff st 374 | title v _ = P.title v 375 | 376 | _type :: ∀ eff st. String -> Props eff st 377 | _type v _ = P._type v 378 | 379 | useMap :: ∀ eff st. String -> Props eff st 380 | useMap v _ = P.useMap v 381 | 382 | value :: ∀ eff st. String -> Props eff st 383 | value v _ = P.value v 384 | 385 | width :: ∀ eff st. String -> Props eff st 386 | width v _ = P.width v 387 | 388 | wmode :: ∀ eff st. String -> Props eff st 389 | wmode v _ = P.wmode v 390 | 391 | wrap :: ∀ eff st. String -> Props eff st 392 | wrap v _ = P.wrap v 393 | 394 | -- RDFa Attributes 395 | about :: ∀ eff st. String -> Props eff st 396 | about v _ = P.about v 397 | 398 | datatype :: ∀ eff st. String -> Props eff st 399 | datatype v _ = P.datatype v 400 | 401 | inlist :: ∀ eff st. String -> Props eff st 402 | inlist v _ = P.inlist v 403 | 404 | prefix :: ∀ eff st. String -> Props eff st 405 | prefix v _ = P.prefix v 406 | 407 | property :: ∀ eff st. String -> Props eff st 408 | property v _ = P.property v 409 | 410 | resource :: ∀ eff st. String -> Props eff st 411 | resource v _ = P.resource v 412 | 413 | typeof :: ∀ eff st. String -> Props eff st 414 | typeof v _ = P.typeof v 415 | 416 | vocab :: ∀ eff st. String -> Props eff st 417 | vocab v _ = P.vocab v 418 | 419 | -- Non-standard Attributes 420 | autoCapitalize :: ∀ eff st. String -> Props eff st 421 | autoCapitalize v _ = P.autoCapitalize v 422 | 423 | autoCorrect :: ∀ eff st. String -> Props eff st 424 | autoCorrect v _ = P.autoCorrect v 425 | 426 | autoSave :: ∀ eff st. String -> Props eff st 427 | autoSave v _ = P.autoSave v 428 | 429 | color :: ∀ eff st. String -> Props eff st 430 | color v _ = P.color v 431 | 432 | itemProp :: ∀ eff st. String -> Props eff st 433 | itemProp v _ = P.itemProp v 434 | 435 | itemScope :: ∀ eff st. Boolean -> Props eff st 436 | itemScope v _ = P.itemScope v 437 | 438 | itemType :: ∀ eff st. String -> Props eff st 439 | itemType v _ = P.itemType v 440 | 441 | itemID :: ∀ eff st. String -> Props eff st 442 | itemID v _ = P.itemID v 443 | 444 | itemRef :: ∀ eff st. String -> Props eff st 445 | itemRef v _ = P.itemRef v 446 | 447 | results :: ∀ eff st. Int -> Props eff st 448 | results v _ = P.results v 449 | 450 | security :: ∀ eff st. String -> Props eff st 451 | security v _ = P.security v 452 | 453 | unselectable :: ∀ eff st. Boolean -> Props eff st 454 | unselectable v _ = P.unselectable v 455 | 456 | -------------------------------------------------------------------------------- 457 | 458 | onAnimationStart :: ∀ eff st. 459 | (Event -> Effect eff st Unit) -> Props eff st 460 | onAnimationStart f effect = P.onAnimationStart (effect ○ f) 461 | 462 | onAnimationEnd :: ∀ eff st. 463 | (Event -> Effect eff st Unit) -> Props eff st 464 | onAnimationEnd f effect = P.onAnimationEnd (effect ○ f) 465 | 466 | onAnimationIteration :: ∀ eff st. 467 | (Event -> Effect eff st Unit) -> Props eff st 468 | onAnimationIteration f effect = P.onAnimationIteration (effect ○ f) 469 | 470 | onTransitionEnd :: ∀ eff st. 471 | (Event -> Effect eff st Unit) -> Props eff st 472 | onTransitionEnd f effect = P.onTransitionEnd (effect ○ f) 473 | 474 | onLoad :: ∀ eff st. 475 | (Event -> Effect eff st Unit) -> Props eff st 476 | onLoad f effect = P.onLoad (effect ○ f) 477 | 478 | onCopy :: ∀ eff st. 479 | (Event -> Effect eff st Unit) -> Props eff st 480 | onCopy f effect = P.onCopy (effect ○ f) 481 | 482 | onCut :: ∀ eff st. 483 | (Event -> Effect eff st Unit) -> Props eff st 484 | onCut f effect = P.onCut (effect ○ f) 485 | 486 | onPaste :: ∀ eff st. 487 | (Event -> Effect eff st Unit) -> Props eff st 488 | onPaste f effect = P.onPaste (effect ○ f) 489 | 490 | onKeyDown :: ∀ eff st. 491 | (KeyboardEvent -> Effect eff st Unit) -> Props eff st 492 | onKeyDown f effect = P.onKeyDown (effect ○ f) 493 | 494 | onKeyPress :: ∀ eff st. 495 | (KeyboardEvent -> Effect eff st Unit) -> Props eff st 496 | onKeyPress f effect = P.onKeyPress (effect ○ f) 497 | 498 | onKeyUp :: ∀ eff st. 499 | (KeyboardEvent -> Effect eff st Unit) -> Props eff st 500 | onKeyUp f effect = P.onKeyUp (effect ○ f) 501 | 502 | onFocus :: ∀ eff st. 503 | (Event -> Effect eff st Unit) -> Props eff st 504 | onFocus f effect = P.onFocus (effect ○ f) 505 | 506 | onBlur :: ∀ eff st. 507 | (Event -> Effect eff st Unit) -> Props eff st 508 | onBlur f effect = P.onBlur (effect ○ f) 509 | 510 | onChange :: ∀ eff st. 511 | (Event -> Effect eff st Unit) -> Props eff st 512 | onChange f effect = P.onChange (effect ○ f) 513 | 514 | onInput :: ∀ eff st. 515 | (Event -> Effect eff st Unit) -> Props eff st 516 | onInput f effect = P.onInput (effect ○ f) 517 | 518 | onInvalid :: ∀ eff st. 519 | (Event -> Effect eff st Unit) -> Props eff st 520 | onInvalid f effect = P.onInvalid (effect ○ f) 521 | 522 | onSubmit :: ∀ eff st. 523 | (Event -> Effect eff st Unit) -> Props eff st 524 | onSubmit f effect = P.onSubmit (effect ○ f) 525 | 526 | onClick :: ∀ eff st. 527 | (Event -> Effect eff st Unit) -> Props eff st 528 | onClick f effect = P.onClick (effect ○ f) 529 | 530 | onDoubleClick :: ∀ eff st. 531 | (Event -> Effect eff st Unit) -> Props eff st 532 | onDoubleClick f effect = P.onDoubleClick (effect ○ f) 533 | 534 | onDrag :: ∀ eff st. 535 | (Event -> Effect eff st Unit) -> Props eff st 536 | onDrag f effect = P.onDrag (effect ○ f) 537 | 538 | onDragEnd :: ∀ eff st. 539 | (Event -> Effect eff st Unit) -> Props eff st 540 | onDragEnd f effect = P.onDragEnd (effect ○ f) 541 | 542 | onDragEnter :: ∀ eff st. 543 | (Event -> Effect eff st Unit) -> Props eff st 544 | onDragEnter f effect = P.onDragEnter (effect ○ f) 545 | 546 | onDragExit :: ∀ eff st. 547 | (Event -> Effect eff st Unit) -> Props eff st 548 | onDragExit f effect = P.onDragExit (effect ○ f) 549 | 550 | onDragLeave :: ∀ eff st. 551 | (Event -> Effect eff st Unit) -> Props eff st 552 | onDragLeave f effect = P.onDragLeave (effect ○ f) 553 | 554 | onDragOver :: ∀ eff st. 555 | (Event -> Effect eff st Unit) -> Props eff st 556 | onDragOver f effect = P.onDragOver (effect ○ f) 557 | 558 | onDragStart :: ∀ eff st. 559 | (Event -> Effect eff st Unit) -> Props eff st 560 | onDragStart f effect = P.onDragStart (effect ○ f) 561 | 562 | onDrop :: ∀ eff st. 563 | (Event -> Effect eff st Unit) -> Props eff st 564 | onDrop f effect = P.onDrop (effect ○ f) 565 | 566 | onMouseDown :: ∀ eff st. 567 | (MouseEvent -> Effect eff st Unit) -> Props eff st 568 | onMouseDown f effect = P.onMouseDown (effect ○ f) 569 | 570 | onMouseEnter :: ∀ eff st. 571 | (MouseEvent -> Effect eff st Unit) -> Props eff st 572 | onMouseEnter f effect = P.onMouseEnter (effect ○ f) 573 | 574 | onMouseLeave :: ∀ eff st. 575 | (MouseEvent -> Effect eff st Unit) -> Props eff st 576 | onMouseLeave f effect = P.onMouseLeave (effect ○ f) 577 | 578 | onMouseMove :: ∀ eff st. 579 | (MouseEvent -> Effect eff st Unit) -> Props eff st 580 | onMouseMove f effect = P.onMouseMove (effect ○ f) 581 | 582 | onMouseOut :: ∀ eff st. 583 | (MouseEvent -> Effect eff st Unit) -> Props eff st 584 | onMouseOut f effect = P.onMouseOut (effect ○ f) 585 | 586 | onMouseOver :: ∀ eff st. 587 | (MouseEvent -> Effect eff st Unit) -> Props eff st 588 | onMouseOver f effect = P.onMouseOver (effect ○ f) 589 | 590 | onMouseUp :: ∀ eff st. 591 | (MouseEvent -> Effect eff st Unit) -> Props eff st 592 | onMouseUp f effect = P.onMouseUp (effect ○ f) 593 | 594 | onTouchCancel :: ∀ eff st. 595 | (Event -> Effect eff st Unit) -> Props eff st 596 | onTouchCancel f effect = P.onTouchCancel (effect ○ f) 597 | 598 | onTouchEnd :: ∀ eff st. 599 | (Event -> Effect eff st Unit) -> Props eff st 600 | onTouchEnd f effect = P.onTouchEnd (effect ○ f) 601 | 602 | onTouchMove :: ∀ eff st. 603 | (Event -> Effect eff st Unit) -> Props eff st 604 | onTouchMove f effect = P.onTouchMove (effect ○ f) 605 | 606 | onTouchStart :: ∀ eff st. 607 | (Event -> Effect eff st Unit) -> Props eff st 608 | onTouchStart f effect = P.onTouchStart (effect ○ f) 609 | 610 | onScroll :: ∀ eff st. 611 | (Event -> Effect eff st Unit) -> Props eff st 612 | onScroll f effect = P.onScroll (effect ○ f) 613 | 614 | onWheel :: ∀ eff st. 615 | (Event -> Effect eff st Unit) -> Props eff st 616 | onWheel f effect = P.onWheel (effect ○ f) 617 | 618 | -------------------------------------------------------------------------------- 619 | 620 | suppressContentEditableWarning :: ∀ eff st. Boolean -> Props eff st 621 | suppressContentEditableWarning v _ = P.suppressContentEditableWarning v 622 | 623 | -- SVG attributes 624 | x :: ∀ eff st. Int -> Props eff st 625 | x v _ = P.x v 626 | 627 | y :: ∀ eff st. Int -> Props eff st 628 | y v _ = P.y v 629 | 630 | cx :: ∀ eff st. Int -> Props eff st 631 | cx v _ = P.cx v 632 | 633 | cy :: ∀ eff st. Int -> Props eff st 634 | cy v _ = P.cy v 635 | 636 | r :: ∀ eff st. Int -> Props eff st 637 | r v _ = P.r v 638 | 639 | fill :: ∀ eff st. String -> Props eff st 640 | fill v _ = P.fill v 641 | 642 | opacity :: ∀ eff st. Int -> Props eff st 643 | opacity v _ = P.opacity v 644 | 645 | fillOpacity :: ∀ eff st. Int -> Props eff st 646 | fillOpacity v _ = P.fillOpacity v 647 | 648 | stroke :: ∀ eff st. String -> Props eff st 649 | stroke v _ = P.stroke v 650 | 651 | strokeWidth :: ∀ eff st. Int -> Props eff st 652 | strokeWidth v _ = P.strokeWidth v 653 | 654 | points :: ∀ eff st. String -> Props eff st 655 | points v _ = P.points v 656 | 657 | d :: ∀ eff st. String -> Props eff st 658 | d v _ = P.d v 659 | 660 | viewBox :: ∀ eff st. String -> Props eff st 661 | viewBox v _ = P.viewBox v 662 | 663 | -------------------------------------------------------------------------------- 664 | 665 | unsafeEventConvert :: ∀ a. Event -> a 666 | unsafeEventConvert = unsafeCoerce 667 | 668 | onEnter :: ∀ eff st. Effect eff st Unit -> Props eff st 669 | onEnter f effect = P.onKeyDown \e -> effect do 670 | if e.keyCode == 13 then f else pure unit 671 | 672 | onEscape :: ∀ eff st. Effect eff st Unit -> Props eff st 673 | onEscape f effect = P.onKeyDown \e -> effect do 674 | if e.keyCode == 27 then f else pure unit 675 | -------------------------------------------------------------------------------- /src/Refract.js: -------------------------------------------------------------------------------- 1 | exports.mapI = function(x) { 2 | return function(f) { 3 | var as = new Array(x); 4 | var i; 5 | 6 | for (i = 0; i < x; i++) { 7 | as[i] = f(i); 8 | } 9 | 10 | return as; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Refract.purs: -------------------------------------------------------------------------------- 1 | module Refract 2 | ( Component 3 | , ComponentClass 4 | , EffectEF 5 | , EffectF 6 | , Effect 7 | , Handler 8 | , Props 9 | , Spec 10 | , Unzoom 11 | , (○) 12 | , type (×) 13 | , (×) 14 | , componentClass 15 | , component 16 | , defaultSpec 17 | , effectfully 18 | , foreach 19 | , foreachF 20 | , foreachU 21 | , foreachUF 22 | , foreachZ 23 | , foreachZF 24 | , foreachMap 25 | , foreachMapF 26 | , foreachMapU 27 | , foreachMapUF 28 | , mkComponent 29 | , modify 30 | , modifyL 31 | , modifyR 32 | , run 33 | , state 34 | , stateL 35 | , stateR 36 | , zoom 37 | , zoomUn 38 | , zoomR 39 | , zoomRUn 40 | ) where 41 | 42 | import Prelude 43 | 44 | import Control.Monad.Aff (Aff, launchAff_, makeAff, nonCanceler) 45 | import Control.Monad.Eff (Eff) 46 | import Control.Monad.Eff.Class (liftEff) 47 | import Control.Monad.Eff.Console (CONSOLE) 48 | import Control.Monad.Eff.Unsafe (unsafeCoerceEff) 49 | import Control.Monad.Free (Free, hoistFree, liftF, runFreeM) 50 | import DOM (DOM) 51 | import DOM.HTML (window) 52 | import DOM.HTML.Types (htmlDocumentToDocument) 53 | import DOM.HTML.Window (document) 54 | import DOM.Node.NonElementParentNode (getElementById) 55 | import DOM.Node.Types (Element, ElementId(..), documentToNonElementParentNode) 56 | import Data.Array (catMaybes, filter, index, length, sortBy, updateAt) 57 | import Data.Either (Either(..)) 58 | import Data.Exists (Exists, mkExists, runExists) 59 | import Data.Functor.Invariant (class Invariant) 60 | import Data.Lens (ALens', Lens', Setter', cloneLens, lens, over, set, (^.)) 61 | import Data.Map (Map) 62 | import Data.Map as M 63 | import Data.Maybe (Maybe(..), fromJust, fromMaybe) 64 | import Data.Tuple (Tuple(Tuple)) 65 | import Partial.Unsafe (unsafePartial) 66 | import React (ReactClass, ReactElement, createClass, createFactory) 67 | import React as R 68 | import React.DOM (IsDynamic(..), mkDOM) 69 | import React.DOM as RD 70 | import React.DOM.Props as P 71 | import ReactDOM (render) 72 | import Refract.Lens (class RecordToLens, recordToLens) 73 | import Undefined (undefined) 74 | import Unsafe.Coerce (unsafeCoerce) 75 | 76 | -- | A synonym for `<<<`. 77 | infixr 9 compose as ○ 78 | 79 | -- | A synonym for `Tuple`. 80 | infixr 6 Tuple as × 81 | 82 | -- | A type synonym for `Tuple`. 83 | infixr 6 type Tuple as × 84 | 85 | -- Effects --------------------------------------------------------------------- 86 | 87 | -- | The base functor of the `Effect` free monad. 88 | newtype EffectF eff st next = EffectF (Exists (EffectEF eff st next)) 89 | 90 | -- | A functor for the existential. 91 | data EffectEF eff st next r 92 | = Modify (st -> st × r) (r -> next) 93 | | Effect (st -> Aff eff r) (r -> next) 94 | 95 | -- | Slightly safer coerce to change effect types on the base functor 96 | unsafeCoerceEffectF :: ∀ eff eff' st next. EffectF eff st next -> EffectF eff' st next 97 | unsafeCoerceEffectF = unsafeCoerce 98 | 99 | -- | Slightly safe coerce to change effect types on the free monad 100 | unsafeCoerceEffect :: ∀ eff eff' st a. Effect eff st a -> Effect eff' st a 101 | unsafeCoerceEffect = unsafeCoerce 102 | 103 | instance invariantEffectEF :: Invariant (EffectEF eff st next) where 104 | imap f g = case _ of 105 | Modify m n -> Modify (map f <<< m) (n <<< g) 106 | Effect e n -> Effect (map f <<< e) (n <<< g) 107 | 108 | instance functorEffectF :: Functor (EffectF eff st) where 109 | map f = overEffectF \eef -> mkExists case eef of 110 | Modify m n -> Modify m (f <<< n) 111 | Effect e n -> Effect e (f <<< n) 112 | 113 | unEffectF :: ∀ eff st next. EffectF eff st next -> Exists (EffectEF eff st next) 114 | unEffectF (EffectF ef) = ef 115 | 116 | overEffectF 117 | :: ∀ eff st st' next next' 118 | . (∀ a. EffectEF eff st next a -> Exists (EffectEF eff st' next')) 119 | -> EffectF eff st next 120 | -> EffectF eff st' next' 121 | overEffectF f = EffectF <<< runExists f <<< unEffectF 122 | 123 | -- | An `Effect` with base type `st`. 124 | type Effect eff st = Free (EffectF eff st) 125 | 126 | type ReactEff eff = (state :: R.ReactState R.ReadWrite, console :: CONSOLE | eff) 127 | 128 | mapEffectEF :: ∀ eff st stt next a. Lens' st stt -> EffectEF eff stt next a -> EffectEF eff st next a 129 | mapEffectEF lns (Modify f next) = Modify (\st -> let st' × a = f (st ^. lns) in set lns st' st × a) next 130 | mapEffectEF lns (Effect f next) = Effect (\st -> f (st ^. lns)) next 131 | 132 | mapEffectF :: ∀ eff st stt next. Lens' st stt -> EffectF eff stt next -> EffectF eff st next 133 | mapEffectF lns = overEffectF (mkExists <<< mapEffectEF lns) 134 | 135 | mapEffect :: ∀ eff st stt a. Lens' st stt -> Effect eff stt a -> Effect eff st a 136 | mapEffect lns m = hoistFree (mapEffectF lns) m 137 | 138 | interpretEffect :: ∀ eff st a. R.ReactThis Unit st -> Effect (ReactEff eff) st a -> Aff (ReactEff eff) a 139 | interpretEffect this m = runFreeM (runExists go <<< unEffectF) m 140 | where 141 | -- Since we don't know what the particular type of `b` is (it is hidden away 142 | -- in the existential), we need to make sure that `go` works for any `b`. 143 | -- Which means that we take the second component of `Modify`/`Effect` and 144 | -- apply it to the result of the first. 145 | go :: ∀ next b. EffectEF (ReactEff eff) st next b -> Aff (ReactEff eff) next 146 | go (Modify f next) = do 147 | st <- liftEff $ R.readState this 148 | let st' × a = f st 149 | _ <- makeAff \cb -> do 150 | void $ R.writeStateWithCallback this st' (cb $ Right st') 151 | pure nonCanceler 152 | pure (next a) 153 | go (Effect f next) = do 154 | st <- liftEff $ R.readState this 155 | f st >>= pure ○ next 156 | 157 | -- | Modify the current `Component` state. 158 | modify :: ∀ eff st. (st -> st) -> Effect eff st Unit 159 | modify f = modify' \st -> f st × unit 160 | 161 | -- | Modify the current `Component` state and return a result. 162 | modify' :: ∀ eff st a. (st -> st × a) -> Effect eff st a 163 | modify' f = liftF $ EffectF $ mkExists $ Modify f id 164 | 165 | -- | Perform a `Control.Monad.Aff` action and return a result. 166 | effectfully :: ∀ a eff st. (st -> Aff eff a) -> Effect eff st a 167 | -- Use `id` here to get the hidden existential to match up with the result type 168 | effectfully f = liftF $ EffectF $ mkExists $ Effect f id 169 | 170 | -- Zoom, state, effects -------------------------------------------------------- 171 | 172 | -- | Reify the current `Component` state. 173 | state :: ∀ eff st. (st -> Component eff st) -> Component eff st 174 | state f effect st = (f st) effect st 175 | 176 | -- | Reify `Component` substate specified by a lens. 177 | stateL 178 | :: ∀ eff st stt. ALens' st stt 179 | -> (stt -> Component eff st) 180 | -> Component eff st 181 | stateL lns f effect st = (f (st ^. cloneLens lns)) effect st 182 | 183 | -- | `stateL` for generic records. 184 | -- | 185 | -- | Specializing to a concrete state, its type would be: 186 | -- | 187 | -- | ```purescript 188 | -- | stateR 189 | -- | :: ∀ eff st. 190 | -- | { name :: ALens' st String 191 | -- | , age :: ALens' st Int 192 | -- | } 193 | -- | -> ( { name :: String 194 | -- | , age :: Int 195 | -- | } -> Component eff st 196 | -- | ) 197 | -- | -> Component eff st 198 | -- | ``` 199 | stateR 200 | :: ∀ eff r rs st. RecordToLens st r rs 201 | => Record r 202 | -> (Record rs -> Component eff st) 203 | -> Component eff st 204 | stateR r f effect st = (f (st ^. recordToLens r)) effect st 205 | 206 | -- | Modify `Component` substate specified by a `Lens`. 207 | modifyL 208 | :: ∀ eff st stt. ALens' st stt 209 | -> (stt -> stt) 210 | -> Effect eff st Unit 211 | modifyL lns f = modify (over (cloneLens lns) f) 212 | 213 | -- | Modify `Component` substate with any kind of `Setter`. 214 | modifyS 215 | :: ∀ eff st stt. Setter' st stt 216 | -> (stt -> stt) 217 | -> Effect eff st Unit 218 | modifyS lns f = modify (over lns f) 219 | 220 | -- | Modify `Component` substate specified by a `Lens` and return a result. 221 | modifyL' 222 | :: ∀ eff st stt a. ALens' st stt 223 | -> (stt -> stt × a) 224 | -> Effect eff st a 225 | modifyL' lns' f = modify' (\st -> let st' × a = f (st ^. lns) in set lns st' st × a) 226 | where 227 | lns = cloneLens lns' 228 | 229 | -- | `modifyL` for generic records. 230 | -- | 231 | -- | Specializing to a concrete state, its type would be: 232 | -- | 233 | -- | ```purescript 234 | -- | modifyR 235 | -- | :: ∀ eff st. 236 | -- | { name :: ALens' st String 237 | -- | , age :: ALens' st Int 238 | -- | } 239 | -- | -> ({ name :: String , age :: Int } -> { name :: String , age :: Int }) 240 | -- | -> Effect eff st Unit 241 | -- | ``` 242 | modifyR 243 | :: ∀ eff r rs st. RecordToLens st r rs 244 | => Record r 245 | -> (Record rs -> Record rs) 246 | -> Effect eff st Unit 247 | modifyR r f = modify (over (recordToLens r) f) 248 | 249 | -- | Like `modifyR` but return a result. 250 | modifyR' 251 | :: ∀ eff r rs st a. RecordToLens st r rs 252 | => Record r 253 | -> (Record rs -> Record rs × a) 254 | -> Effect eff st a 255 | modifyR' r f = modify' (\st -> let st' × a = f (st ^. lns) in set lns st' st × a) 256 | where 257 | lns = recordToLens r 258 | 259 | type Unzoom eff st stt = Component eff st -> Component eff stt 260 | 261 | -- | Embed a `Component` with a state of type `stt` into a `Component` 262 | -- | with a state of type `st`. 263 | zoom 264 | :: ∀ eff st stt. ALens' st stt 265 | -> Component eff stt 266 | -> Component eff st 267 | zoom lns cmp effect st = cmp (\e -> effect $ mapEffect (cloneLens lns) e) (st ^. cloneLens lns) 268 | 269 | -- | Embed a `Component` with a state of type `stt` into a `Component` 270 | -- | with a state of type `st` and provide it with an unzoom combinator. 271 | zoomUn 272 | :: ∀ eff st stt. ALens' st stt 273 | -> (Unzoom eff st stt -> Component eff stt) 274 | -> Component eff st 275 | zoomUn lns cmp effect st = cmp (\cmp' _ _ -> cmp' effect st) (\e -> effect $ mapEffect lns' e) (st ^. lns') 276 | where lns' = cloneLens lns 277 | 278 | -- | `zoom` for generic records. 279 | -- | 280 | -- | Specializing to a concrete state, its type would be: 281 | -- | 282 | -- | ``` purescript 283 | -- | zoomR 284 | -- | :: ∀ eff st. 285 | -- | { name :: ALens' st String 286 | -- | , age :: ALens' st Int 287 | -- | } 288 | -- | -> Component eff 289 | -- | { name :: String 290 | -- | , age :: Int 291 | -- | } 292 | -- | -> Component eff st 293 | -- | ``` 294 | zoomR 295 | :: ∀ eff r rs st. RecordToLens st r rs 296 | => Record r 297 | -> Component eff (Record rs) 298 | -> Component eff st 299 | zoomR r cmp effect st = cmp (\e -> effect $ mapEffect (recordToLens r) e) (st ^. recordToLens r) 300 | 301 | -- | `zoomUn` for generic records. 302 | zoomRUn 303 | :: ∀ eff r rs st. RecordToLens st r rs 304 | => Record r 305 | -> (Unzoom eff st (Record rs) 306 | -> Component eff (Record rs)) 307 | -> Component eff st 308 | zoomRUn r cmp effect st = cmp (\cmp' _ _ -> cmp' effect st) (\e -> effect $ mapEffect (recordToLens r) e) (st ^. recordToLens r) 309 | 310 | -- Props ----------------------------------------------------------------------- 311 | 312 | type Handler st = R.EventHandlerContext R.ReadWrite Unit st Unit 313 | 314 | type Props eff st = (Effect eff st Unit -> Handler st) -> P.Props 315 | 316 | -- Components ------------------------------------------------------------------ 317 | 318 | 319 | -- | A `Component eff st` is parameterized over an effect type `eff` and a 320 | -- | state type `st` over which it operates. 321 | type Component eff st = (Effect eff st Unit -> Handler st) -> st -> ReactElement 322 | 323 | -- | A React component class. Useful whenever a `Component` needs to implement 324 | -- | React lifecycle methods. 325 | type ComponentClass eff st = ReactClass ((Effect eff st Unit -> Handler st) × st) 326 | 327 | -- | React lifecycle spec. 328 | type Spec eff st = 329 | { displayName :: String 330 | 331 | , componentWillMount :: Effect eff st Unit 332 | , componentDidMount :: Effect eff st Unit 333 | , componentWillUnmount :: Effect eff st Unit 334 | 335 | , componentWillUpdate :: st -> Effect eff st Unit 336 | , componentDidUpdate :: st -> Effect eff st Unit 337 | 338 | , shouldComponentUpdate :: st -> Boolean 339 | } 340 | 341 | -- | No-op lifecycle method spec. 342 | defaultSpec :: ∀ eff st. Spec eff st 343 | defaultSpec = 344 | { displayName: "" 345 | , componentWillMount: pure unit 346 | , componentDidMount: pure unit 347 | , componentWillUnmount: pure unit 348 | 349 | , componentWillUpdate: \_ -> pure unit 350 | , componentDidUpdate: \_ -> pure unit 351 | 352 | , shouldComponentUpdate: \_ -> true 353 | } 354 | 355 | -- | Create a `ComponentClass` from a `Spec` and a `Component`. 356 | componentClass 357 | :: ∀ eff st. Spec eff st 358 | -> Component eff st 359 | -> ComponentClass eff st 360 | componentClass spec cmp = createClass 361 | { render: \this -> do 362 | (effect × st) <- R.getProps this 363 | pure $ cmp effect st 364 | , displayName: spec.displayName 365 | , getInitialState: \_ -> pure unit 366 | , componentWillMount: \this -> do 367 | (effect × _) <- R.getProps this 368 | unsafeCoerce $ effect spec.componentWillMount 369 | , componentDidMount: \this -> do 370 | (effect × _) <- R.getProps this 371 | effect spec.componentDidMount 372 | , componentWillReceiveProps: \_ _ -> pure unit 373 | , shouldComponentUpdate: \_ (_ × newst) _ -> pure $ spec.shouldComponentUpdate newst 374 | , componentWillUpdate: \this (_ × newst) _ -> do 375 | (effect × _) <- R.getProps this 376 | effect $ spec.componentWillUpdate newst 377 | , componentDidUpdate: \this (_ × oldst) _ -> do 378 | (effect × _) <- R.getProps this 379 | unsafeCoerce $ effect $ spec.componentDidUpdate oldst 380 | , componentWillUnmount: \this -> do 381 | (effect × _) <- R.getProps this 382 | unsafeCoerce $ effect spec.componentWillUnmount 383 | } 384 | 385 | -- | Create a `Component` from a `ComponentClass`. 386 | component :: ∀ eff st. ComponentClass eff st -> Component eff st 387 | component class_ effect st = createFactory class_ (effect × st) 388 | 389 | -- | Create a DOM element `Component`. 390 | mkComponent 391 | :: ∀ eff st. String -- | Element name 392 | -> Array (Props eff st) -- | Props 393 | -> Array (Component eff st) -- | Children 394 | -> Component eff st 395 | mkComponent element props children effect st = mkDOM (IsDynamic false) element (map (\p -> p effect) props) (map (\e -> e effect st) children) 396 | 397 | -- Run ------------------------------------------------------------------------- 398 | 399 | -- | Attach `Component` to the DOM element with the specified id and run it. 400 | run 401 | :: ∀ eff st. String -- | Element id 402 | -> Component eff st -- | Component 403 | -> st -- | Initial state 404 | -> (st -> Eff eff Unit) -- | State callback (useful for hot reloading) 405 | -> Eff (dom :: DOM | eff) Unit 406 | run elemId cmp st updateState = void $ element >>= render ui 407 | where 408 | ui = R.createFactory (R.createClass spec) unit 409 | 410 | spec :: R.ReactSpec Unit st (ReactEff eff) 411 | spec = R.spec st \this -> do 412 | st' <- R.readState this 413 | unsafeCoerceEff $ updateState $ st' 414 | pure $ st' # cmp \effect -> 415 | unsafeCoerceEff $ launchAff_ $ 416 | interpretEffect this (unsafeCoerceEffect effect) 417 | 418 | element :: Eff (dom :: DOM | eff) Element 419 | element = do 420 | win <- window 421 | doc <- document win 422 | e <- getElementById (ElementId elemId) (documentToNonElementParentNode (htmlDocumentToDocument doc)) 423 | pure $ fromMaybe undefined e 424 | 425 | -------------------------------------------------------------------------------- 426 | 427 | lensAtA :: ∀ a. Int -> Lens' (Array a) a 428 | lensAtA i = lens (\m -> unsafePartial $ fromJust $ index m i) (\m v -> fromMaybe m $ updateAt i v m) 429 | 430 | lensAtM :: ∀ k v. Ord k => k -> Lens' (Map k v) v 431 | lensAtM k = lens (\m -> unsafePartial $ fromJust $ M.lookup k m) (\m v -> M.insert k v m) 432 | 433 | foreign import mapI :: ∀ a. Int -> (Int -> a) -> Array a 434 | 435 | -- | Unfiltered `Array` traversal. 436 | foreach 437 | :: ∀ eff st a. 438 | ALens' st (Array a) 439 | -> (ALens' st a -> Component eff st) 440 | -> Component eff st 441 | foreach = foreachF (const true) 442 | 443 | -- | Filtered `Array` traversal. 444 | foreachF 445 | :: ∀ eff st a. 446 | (a -> Boolean) 447 | -> ALens' st (Array a) 448 | -> (ALens' st a -> Component eff st) 449 | -> Component eff st 450 | foreachF f lns' cmp effect st = 451 | RD.div [] $ catMaybes $ mapI (length st') \i -> case index st' i >>= pure ○ f of 452 | Just true -> Just $ cmp (lns ○ lensAtA i) effect st 453 | Just false -> Nothing 454 | Nothing -> Nothing 455 | where 456 | lns = cloneLens lns' 457 | st' = st ^. lns 458 | 459 | -- | Unfiltered `Array` traversal providing an unzoom combinator. 460 | foreachU 461 | :: ∀ eff st a. 462 | ALens' st (Array a) 463 | -> (Unzoom eff st a -> Component eff a) 464 | -> Component eff st 465 | foreachU = foreachUF (const true) 466 | 467 | -- | Filtered `Array` traversal providing an unzoom combinator. 468 | foreachUF 469 | :: ∀ eff st a. 470 | (a -> Boolean) 471 | -> ALens' st (Array a) 472 | -> (Unzoom eff st a -> Component eff a) 473 | -> Component eff st 474 | foreachUF f lns cmp = foreachF f lns \lns' -> zoomUn lns' \unzoom -> cmp unzoom 475 | 476 | -- | Zooming unfiltered `Array` traversal. 477 | foreachZ 478 | :: ∀ eff st a. 479 | ALens' st (Array a) 480 | -> Component eff a 481 | -> Component eff st 482 | foreachZ = foreachZF (const true) 483 | 484 | -- | Zooming filtered `Array` traversal. 485 | foreachZF :: ∀ eff st a. 486 | (a -> Boolean) 487 | -> ALens' st (Array a) 488 | -> Component eff a 489 | -> Component eff st 490 | foreachZF f lns cmp = foreachF f lns \lns' -> zoom lns' cmp 491 | 492 | -- | Unfiltered `Map` traversal. 493 | foreachMap 494 | :: ∀ eff st k v. Ord k 495 | => (k × v -> k × v -> Ordering) 496 | -> ALens' st (Map k v) 497 | -> (ALens' st v -> (st -> st) -> Component eff st) 498 | -> Component eff st 499 | foreachMap ord_f = foreachMapF ord_f (const true) 500 | 501 | -- | Filtered `Map` traversal. 502 | foreachMapF 503 | :: ∀ eff st k v. Ord k 504 | => (k × v -> k × v -> Ordering) 505 | -> (k × v -> Boolean) 506 | -> ALens' st (Map k v) 507 | -> (ALens' st v -> (st -> st) -> Component eff st) 508 | -> Component eff st 509 | foreachMapF ord_f filter_f lns' cmp effect st = 510 | RD.div [] $ flip map (elems $ M.toUnfoldable (st ^. lns)) \(k × v) -> cmp (lns ○ lensAtM k) (over lns (M.delete k)) effect st 511 | where 512 | lns = cloneLens lns' 513 | elems = sortBy ord_f ○ filter filter_f 514 | 515 | -- | Unfiltered `Map` traversal providing an unzoom combinator. 516 | foreachMapU 517 | :: ∀ eff st k v. Ord k 518 | => (k × v -> k × v -> Ordering) 519 | -> ALens' st (Map k v) 520 | -> (Unzoom eff st v -> (st -> st) -> Component eff v) 521 | -> Component eff st 522 | foreachMapU ord_f = foreachMapUF ord_f (const true) 523 | 524 | -- | Filtered `Map` traversal providing an unzoom combinator. 525 | foreachMapUF 526 | :: ∀ eff st k v. Ord k 527 | => (k × v -> k × v -> Ordering) 528 | -> (k × v -> Boolean) 529 | -> ALens' st (Map k v) 530 | -> (Unzoom eff st v -> (st -> st) -> Component eff v) 531 | -> Component eff st 532 | foreachMapUF ord_f filter_f lns cmp = 533 | foreachMapF ord_f filter_f lns \lns' delete -> 534 | zoomUn lns' \unzoom -> cmp unzoom delete 535 | -------------------------------------------------------------------------------- /src/Refract/DOM.purs: -------------------------------------------------------------------------------- 1 | module Refract.DOM where 2 | 3 | import Refract 4 | 5 | import Unsafe.Coerce (unsafeCoerce) 6 | 7 | text :: ∀ eff st. String -> Component eff st 8 | text str _ _ = unsafeCoerce str 9 | 10 | a :: ∀ eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 11 | a = mkComponent "a" 12 | 13 | a' :: ∀ eff st. Array (Component eff st) -> Component eff st 14 | a' = a [] 15 | 16 | abbr :: ∀ eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 17 | abbr = mkComponent "abbr" 18 | 19 | abbr' :: ∀ eff st. Array (Component eff st) -> Component eff st 20 | abbr' = abbr [] 21 | 22 | address :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 23 | address = mkComponent "address" 24 | 25 | address' :: forall eff st. Array (Component eff st) -> Component eff st 26 | address' = address [] 27 | 28 | area :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 29 | area = mkComponent "area" 30 | 31 | area' :: forall eff st. Array (Component eff st) -> Component eff st 32 | area' = area [] 33 | 34 | article :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 35 | article = mkComponent "article" 36 | 37 | article' :: forall eff st. Array (Component eff st) -> Component eff st 38 | article' = article [] 39 | 40 | aside :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 41 | aside = mkComponent "aside" 42 | 43 | aside' :: forall eff st. Array (Component eff st) -> Component eff st 44 | aside' = aside [] 45 | 46 | audio :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 47 | audio = mkComponent "audio" 48 | 49 | audio' :: forall eff st. Array (Component eff st) -> Component eff st 50 | audio' = audio [] 51 | 52 | b :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 53 | b = mkComponent "b" 54 | 55 | b' :: forall eff st. Array (Component eff st) -> Component eff st 56 | b' = b [] 57 | 58 | base :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 59 | base = mkComponent "base" 60 | 61 | base' :: forall eff st. Array (Component eff st) -> Component eff st 62 | base' = base [] 63 | 64 | bdi :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 65 | bdi = mkComponent "bdi" 66 | 67 | bdi' :: forall eff st. Array (Component eff st) -> Component eff st 68 | bdi' = bdi [] 69 | 70 | bdo :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 71 | bdo = mkComponent "bdo" 72 | 73 | bdo' :: forall eff st. Array (Component eff st) -> Component eff st 74 | bdo' = bdo [] 75 | 76 | big :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 77 | big = mkComponent "big" 78 | 79 | big' :: forall eff st. Array (Component eff st) -> Component eff st 80 | big' = big [] 81 | 82 | blockquote :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 83 | blockquote = mkComponent "blockquote" 84 | 85 | blockquote' :: forall eff st. Array (Component eff st) -> Component eff st 86 | blockquote' = blockquote [] 87 | 88 | body :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 89 | body = mkComponent "body" 90 | 91 | body' :: forall eff st. Array (Component eff st) -> Component eff st 92 | body' = body [] 93 | 94 | br :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 95 | br = mkComponent "br" 96 | 97 | br' :: forall eff st. Array (Component eff st) -> Component eff st 98 | br' = br [] 99 | 100 | button :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 101 | button = mkComponent "button" 102 | 103 | button' :: forall eff st. Array (Component eff st) -> Component eff st 104 | button' = button [] 105 | 106 | canvas :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 107 | canvas = mkComponent "canvas" 108 | 109 | canvas' :: forall eff st. Array (Component eff st) -> Component eff st 110 | canvas' = canvas [] 111 | 112 | caption :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 113 | caption = mkComponent "caption" 114 | 115 | caption' :: forall eff st. Array (Component eff st) -> Component eff st 116 | caption' = caption [] 117 | 118 | cite :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 119 | cite = mkComponent "cite" 120 | 121 | cite' :: forall eff st. Array (Component eff st) -> Component eff st 122 | cite' = cite [] 123 | 124 | code :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 125 | code = mkComponent "code" 126 | 127 | code' :: forall eff st. Array (Component eff st) -> Component eff st 128 | code' = code [] 129 | 130 | col :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 131 | col = mkComponent "col" 132 | 133 | col' :: forall eff st. Array (Component eff st) -> Component eff st 134 | col' = col [] 135 | 136 | colgroup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 137 | colgroup = mkComponent "colgroup" 138 | 139 | colgroup' :: forall eff st. Array (Component eff st) -> Component eff st 140 | colgroup' = colgroup [] 141 | 142 | _data :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 143 | _data = mkComponent "data" 144 | 145 | _data' :: forall eff st. Array (Component eff st) -> Component eff st 146 | _data' = _data [] 147 | 148 | datalist :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 149 | datalist = mkComponent "datalist" 150 | 151 | datalist' :: forall eff st. Array (Component eff st) -> Component eff st 152 | datalist' = datalist [] 153 | 154 | dd :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 155 | dd = mkComponent "dd" 156 | 157 | dd' :: forall eff st. Array (Component eff st) -> Component eff st 158 | dd' = dd [] 159 | 160 | del :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 161 | del = mkComponent "del" 162 | 163 | del' :: forall eff st. Array (Component eff st) -> Component eff st 164 | del' = del [] 165 | 166 | details :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 167 | details = mkComponent "details" 168 | 169 | details' :: forall eff st. Array (Component eff st) -> Component eff st 170 | details' = details [] 171 | 172 | dfn :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 173 | dfn = mkComponent "dfn" 174 | 175 | dfn' :: forall eff st. Array (Component eff st) -> Component eff st 176 | dfn' = dfn [] 177 | 178 | dialog :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 179 | dialog = mkComponent "dialog" 180 | 181 | dialog' :: forall eff st. Array (Component eff st) -> Component eff st 182 | dialog' = dialog [] 183 | 184 | div :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 185 | div = mkComponent "div" 186 | 187 | div' :: forall eff st. Array (Component eff st) -> Component eff st 188 | div' = div [] 189 | 190 | dl :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 191 | dl = mkComponent "dl" 192 | 193 | dl' :: forall eff st. Array (Component eff st) -> Component eff st 194 | dl' = dl [] 195 | 196 | dt :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 197 | dt = mkComponent "dt" 198 | 199 | dt' :: forall eff st. Array (Component eff st) -> Component eff st 200 | dt' = dt [] 201 | 202 | em :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 203 | em = mkComponent "em" 204 | 205 | em' :: forall eff st. Array (Component eff st) -> Component eff st 206 | em' = em [] 207 | 208 | embed :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 209 | embed = mkComponent "embed" 210 | 211 | embed' :: forall eff st. Array (Component eff st) -> Component eff st 212 | embed' = embed [] 213 | 214 | fieldset :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 215 | fieldset = mkComponent "fieldset" 216 | 217 | fieldset' :: forall eff st. Array (Component eff st) -> Component eff st 218 | fieldset' = fieldset [] 219 | 220 | figcaption :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 221 | figcaption = mkComponent "figcaption" 222 | 223 | figcaption' :: forall eff st. Array (Component eff st) -> Component eff st 224 | figcaption' = figcaption [] 225 | 226 | figure :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 227 | figure = mkComponent "figure" 228 | 229 | figure' :: forall eff st. Array (Component eff st) -> Component eff st 230 | figure' = figure [] 231 | 232 | footer :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 233 | footer = mkComponent "footer" 234 | 235 | footer' :: forall eff st. Array (Component eff st) -> Component eff st 236 | footer' = footer [] 237 | 238 | form :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 239 | form = mkComponent "form" 240 | 241 | form' :: forall eff st. Array (Component eff st) -> Component eff st 242 | form' = form [] 243 | 244 | h1 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 245 | h1 = mkComponent "h1" 246 | 247 | h1' :: forall eff st. Array (Component eff st) -> Component eff st 248 | h1' = h1 [] 249 | 250 | h2 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 251 | h2 = mkComponent "h2" 252 | 253 | h2' :: forall eff st. Array (Component eff st) -> Component eff st 254 | h2' = h2 [] 255 | 256 | h3 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 257 | h3 = mkComponent "h3" 258 | 259 | h3' :: forall eff st. Array (Component eff st) -> Component eff st 260 | h3' = h3 [] 261 | 262 | h4 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 263 | h4 = mkComponent "h4" 264 | 265 | h4' :: forall eff st. Array (Component eff st) -> Component eff st 266 | h4' = h4 [] 267 | 268 | h5 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 269 | h5 = mkComponent "h5" 270 | 271 | h5' :: forall eff st. Array (Component eff st) -> Component eff st 272 | h5' = h5 [] 273 | 274 | h6 :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 275 | h6 = mkComponent "h6" 276 | 277 | h6' :: forall eff st. Array (Component eff st) -> Component eff st 278 | h6' = h6 [] 279 | 280 | head :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 281 | head = mkComponent "head" 282 | 283 | head' :: forall eff st. Array (Component eff st) -> Component eff st 284 | head' = head [] 285 | 286 | header :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 287 | header = mkComponent "header" 288 | 289 | header' :: forall eff st. Array (Component eff st) -> Component eff st 290 | header' = header [] 291 | 292 | hr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 293 | hr = mkComponent "hr" 294 | 295 | hr' :: forall eff st. Array (Component eff st) -> Component eff st 296 | hr' = hr [] 297 | 298 | html :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 299 | html = mkComponent "html" 300 | 301 | html' :: forall eff st. Array (Component eff st) -> Component eff st 302 | html' = html [] 303 | 304 | i :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 305 | i = mkComponent "i" 306 | 307 | i' :: forall eff st. Array (Component eff st) -> Component eff st 308 | i' = i [] 309 | 310 | iframe :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 311 | iframe = mkComponent "iframe" 312 | 313 | iframe' :: forall eff st. Array (Component eff st) -> Component eff st 314 | iframe' = iframe [] 315 | 316 | img :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 317 | img = mkComponent "img" 318 | 319 | img' :: forall eff st. Array (Component eff st) -> Component eff st 320 | img' = img [] 321 | 322 | input :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 323 | input = mkComponent "input" 324 | 325 | input' :: forall eff st. Array (Component eff st) -> Component eff st 326 | input' = input [] 327 | 328 | ins :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 329 | ins = mkComponent "ins" 330 | 331 | ins' :: forall eff st. Array (Component eff st) -> Component eff st 332 | ins' = ins [] 333 | 334 | kbd :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 335 | kbd = mkComponent "kbd" 336 | 337 | kbd' :: forall eff st. Array (Component eff st) -> Component eff st 338 | kbd' = kbd [] 339 | 340 | keygen :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 341 | keygen = mkComponent "keygen" 342 | 343 | keygen' :: forall eff st. Array (Component eff st) -> Component eff st 344 | keygen' = keygen [] 345 | 346 | label :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 347 | label = mkComponent "label" 348 | 349 | label' :: forall eff st. Array (Component eff st) -> Component eff st 350 | label' = label [] 351 | 352 | legend :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 353 | legend = mkComponent "legend" 354 | 355 | legend' :: forall eff st. Array (Component eff st) -> Component eff st 356 | legend' = legend [] 357 | 358 | li :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 359 | li = mkComponent "li" 360 | 361 | li' :: forall eff st. Array (Component eff st) -> Component eff st 362 | li' = li [] 363 | 364 | link :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 365 | link = mkComponent "link" 366 | 367 | link' :: forall eff st. Array (Component eff st) -> Component eff st 368 | link' = body [] 369 | 370 | main :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 371 | main = mkComponent "main" 372 | 373 | main' :: forall eff st. Array (Component eff st) -> Component eff st 374 | main' = main [] 375 | 376 | map :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 377 | map = mkComponent "map" 378 | 379 | map' :: forall eff st. Array (Component eff st) -> Component eff st 380 | map' = map [] 381 | 382 | mark :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 383 | mark = mkComponent "mark" 384 | 385 | mark' :: forall eff st. Array (Component eff st) -> Component eff st 386 | mark' = mark [] 387 | 388 | menu :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 389 | menu = mkComponent "menu" 390 | 391 | menu' :: forall eff st. Array (Component eff st) -> Component eff st 392 | menu' = menu [] 393 | 394 | menuitem :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 395 | menuitem = mkComponent "menuitem" 396 | 397 | menuitem' :: forall eff st. Array (Component eff st) -> Component eff st 398 | menuitem' = menuitem [] 399 | 400 | meta :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 401 | meta = mkComponent "meta" 402 | 403 | meta' :: forall eff st. Array (Component eff st) -> Component eff st 404 | meta' = meta [] 405 | 406 | meter :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 407 | meter = mkComponent "meter" 408 | 409 | meter' :: forall eff st. Array (Component eff st) -> Component eff st 410 | meter' = meter [] 411 | 412 | nav :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 413 | nav = mkComponent "nav" 414 | 415 | nav' :: forall eff st. Array (Component eff st) -> Component eff st 416 | nav' = nav [] 417 | 418 | noscript :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 419 | noscript = mkComponent "noscript" 420 | 421 | noscript' :: forall eff st. Array (Component eff st) -> Component eff st 422 | noscript' = noscript [] 423 | 424 | object :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 425 | object = mkComponent "object" 426 | 427 | object' :: forall eff st. Array (Component eff st) -> Component eff st 428 | object' = object [] 429 | 430 | ol :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 431 | ol = mkComponent "ol" 432 | 433 | ol' :: forall eff st. Array (Component eff st) -> Component eff st 434 | ol' = ol [] 435 | 436 | optgroup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 437 | optgroup = mkComponent "optgroup" 438 | 439 | optgroup' :: forall eff st. Array (Component eff st) -> Component eff st 440 | optgroup' = optgroup [] 441 | 442 | option :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 443 | option = mkComponent "option" 444 | 445 | option' :: forall eff st. Array (Component eff st) -> Component eff st 446 | option' = option [] 447 | 448 | output :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 449 | output = mkComponent "output" 450 | 451 | output' :: forall eff st. Array (Component eff st) -> Component eff st 452 | output' = output [] 453 | 454 | p :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 455 | p = mkComponent "p" 456 | 457 | p' :: forall eff st. Array (Component eff st) -> Component eff st 458 | p' = p [] 459 | 460 | param :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 461 | param = mkComponent "param" 462 | 463 | param' :: forall eff st. Array (Component eff st) -> Component eff st 464 | param' = param [] 465 | 466 | picture :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 467 | picture = mkComponent "picture" 468 | 469 | picture' :: forall eff st. Array (Component eff st) -> Component eff st 470 | picture' = picture [] 471 | 472 | pre :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 473 | pre = mkComponent "pre" 474 | 475 | pre' :: forall eff st. Array (Component eff st) -> Component eff st 476 | pre' = pre [] 477 | 478 | progress :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 479 | progress = mkComponent "progress" 480 | 481 | progress' :: forall eff st. Array (Component eff st) -> Component eff st 482 | progress' = progress [] 483 | 484 | q :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 485 | q = mkComponent "q" 486 | 487 | q' :: forall eff st. Array (Component eff st) -> Component eff st 488 | q' = q [] 489 | 490 | rp :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 491 | rp = mkComponent "rp" 492 | 493 | rp' :: forall eff st. Array (Component eff st) -> Component eff st 494 | rp' = rp [] 495 | 496 | rt :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 497 | rt = mkComponent "rt" 498 | 499 | rt' :: forall eff st. Array (Component eff st) -> Component eff st 500 | rt' = rt [] 501 | 502 | ruby :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 503 | ruby = mkComponent "ruby" 504 | 505 | ruby' :: forall eff st. Array (Component eff st) -> Component eff st 506 | ruby' = ruby [] 507 | 508 | s :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 509 | s = mkComponent "s" 510 | 511 | s' :: forall eff st. Array (Component eff st) -> Component eff st 512 | s' = s [] 513 | 514 | samp :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 515 | samp = mkComponent "samp" 516 | 517 | samp' :: forall eff st. Array (Component eff st) -> Component eff st 518 | samp' = samp [] 519 | 520 | script :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 521 | script = mkComponent "script" 522 | 523 | script' :: forall eff st. Array (Component eff st) -> Component eff st 524 | script' = script [] 525 | 526 | section :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 527 | section = mkComponent "section" 528 | 529 | section' :: forall eff st. Array (Component eff st) -> Component eff st 530 | section' = section [] 531 | 532 | select :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 533 | select = mkComponent "select" 534 | 535 | select' :: forall eff st. Array (Component eff st) -> Component eff st 536 | select' = select [] 537 | 538 | small :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 539 | small = mkComponent "small" 540 | 541 | small' :: forall eff st. Array (Component eff st) -> Component eff st 542 | small' = small [] 543 | 544 | source :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 545 | source = mkComponent "source" 546 | 547 | source' :: forall eff st. Array (Component eff st) -> Component eff st 548 | source' = source [] 549 | 550 | span :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 551 | span = mkComponent "span" 552 | 553 | span' :: forall eff st. Array (Component eff st) -> Component eff st 554 | span' = span [] 555 | 556 | strong :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 557 | strong = mkComponent "strong" 558 | 559 | strong' :: forall eff st. Array (Component eff st) -> Component eff st 560 | strong' = strong [] 561 | 562 | style :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 563 | style = mkComponent "style" 564 | 565 | style' :: forall eff st. Array (Component eff st) -> Component eff st 566 | style' = style [] 567 | 568 | sub :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 569 | sub = mkComponent "sub" 570 | 571 | sub' :: forall eff st. Array (Component eff st) -> Component eff st 572 | sub' = sub [] 573 | 574 | summary :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 575 | summary = mkComponent "summary" 576 | 577 | summary' :: forall eff st. Array (Component eff st) -> Component eff st 578 | summary' = summary [] 579 | 580 | sup :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 581 | sup = mkComponent "sup" 582 | 583 | sup' :: forall eff st. Array (Component eff st) -> Component eff st 584 | sup' = sup [] 585 | 586 | table :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 587 | table = mkComponent "table" 588 | 589 | table' :: forall eff st. Array (Component eff st) -> Component eff st 590 | table' = table [] 591 | 592 | tbody :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 593 | tbody = mkComponent "tbody" 594 | 595 | tbody' :: forall eff st. Array (Component eff st) -> Component eff st 596 | tbody' = tbody [] 597 | 598 | td :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 599 | td = mkComponent "td" 600 | 601 | td' :: forall eff st. Array (Component eff st) -> Component eff st 602 | td' = td [] 603 | 604 | textarea :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 605 | textarea = mkComponent "textarea" 606 | 607 | textarea' :: forall eff st. Array (Component eff st) -> Component eff st 608 | textarea' = textarea [] 609 | 610 | tfoot :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 611 | tfoot = mkComponent "tfoot" 612 | 613 | tfoot' :: forall eff st. Array (Component eff st) -> Component eff st 614 | tfoot' = tfoot [] 615 | 616 | th :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 617 | th = mkComponent "th" 618 | 619 | th' :: forall eff st. Array (Component eff st) -> Component eff st 620 | th' = th [] 621 | 622 | thead :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 623 | thead = mkComponent "thead" 624 | 625 | thead' :: forall eff st. Array (Component eff st) -> Component eff st 626 | thead' = thead [] 627 | 628 | time :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 629 | time = mkComponent "time" 630 | 631 | time' :: forall eff st. Array (Component eff st) -> Component eff st 632 | time' = time [] 633 | 634 | title :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 635 | title = mkComponent "title" 636 | 637 | title' :: forall eff st. Array (Component eff st) -> Component eff st 638 | title' = title [] 639 | 640 | tr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 641 | tr = mkComponent "tr" 642 | 643 | tr' :: forall eff st. Array (Component eff st) -> Component eff st 644 | tr' = tr [] 645 | 646 | track :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 647 | track = mkComponent "track" 648 | 649 | track' :: forall eff st. Array (Component eff st) -> Component eff st 650 | track' = track [] 651 | 652 | u :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 653 | u = mkComponent "u" 654 | 655 | u' :: forall eff st. Array (Component eff st) -> Component eff st 656 | u' = u [] 657 | 658 | ul :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 659 | ul = mkComponent "ul" 660 | 661 | ul' :: forall eff st. Array (Component eff st) -> Component eff st 662 | ul' = ul [] 663 | 664 | var :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 665 | var = mkComponent "var" 666 | 667 | var' :: forall eff st. Array (Component eff st) -> Component eff st 668 | var' = var [] 669 | 670 | video :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 671 | video = mkComponent "video" 672 | 673 | video' :: forall eff st. Array (Component eff st) -> Component eff st 674 | video' = video [] 675 | 676 | wbr :: forall eff st. Array (Props eff st) -> Array (Component eff st) -> Component eff st 677 | wbr = mkComponent "body" 678 | 679 | wbr' :: forall eff st. Array (Component eff st) -> Component eff st 680 | wbr' = wbr [] 681 | -------------------------------------------------------------------------------- /src/Refract/Lens.js: -------------------------------------------------------------------------------- 1 | exports.lensget = 2 | function(dictRecordToLens) { 3 | return function(view) { 4 | return function(r) { 5 | return function(st) { 6 | var obj = {}; 7 | 8 | Object.keys(r).forEach(function(k) { 9 | obj[k] = view(r[k])(st); 10 | }); 11 | 12 | return obj; 13 | } 14 | } 15 | } 16 | }; 17 | 18 | exports.lensset = 19 | function(dictRecordToLens) { 20 | return function(set) { 21 | return function(r) { 22 | return function(st) { 23 | return function(a) { 24 | var obj = st; 25 | 26 | // TODO: only set changed values? 27 | Object.keys(r).forEach(function(k) { 28 | obj = set(r[k])(a[k])(obj); 29 | }); 30 | 31 | return obj; 32 | } 33 | } 34 | } 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /src/Refract/Lens.purs: -------------------------------------------------------------------------------- 1 | module Refract.Lens 2 | ( class RecordToLens 3 | , class ListToLens 4 | , recordToLens 5 | ) where 6 | 7 | import Data.Lens (ALens', Lens', Shop, cloneLens, lens, set, view) 8 | import Type.Row (Cons, Nil, kind RowList, class RowToList, class ListToRow) 9 | 10 | -- If `l` is `Nil`, `st` will be left to be whatever it wants to be. 11 | -- Otherwise `l` will determine what `st` should be, i.e. `l -> r st` would 12 | -- be possible. 13 | class ListToLens st (l :: RowList) (r :: RowList) | l st -> r, r st -> l 14 | 15 | instance listToLensNil :: ListToLens st Nil Nil 16 | 17 | -- | This is just an expansion of the `ALens' o st` type synonym. 18 | -- In particular, the JS implementation relies on the concrete Shop type, 19 | -- because if there were just a `Strong p` constraint on any type `p`, that 20 | -- constraint would not be passed along to the JS. 21 | instance listToLensCons :: (ListToLens st ls rs) => ListToLens st (Cons k (Shop o o o o -> Shop o o st st) ls) (Cons k o rs) 22 | 23 | class RecordToLens st (r :: # Type) (rs :: # Type) | r st -> rs, rs st -> r 24 | 25 | instance recordToLensInst :: (ListToRow rl r, ListToRow rsl rs, RowToList r rl, RowToList rs rsl, ListToLens st rl rsl) => RecordToLens st r rs 26 | 27 | foreign import lensget :: ∀ r rs st s a. RecordToLens st r rs => (ALens' s a -> s -> a) -> Record r -> st -> Record rs 28 | 29 | foreign import lensset :: ∀ r rs st s a. RecordToLens st r rs => (ALens' s a -> a -> s -> s) -> Record r -> st -> Record rs -> st 30 | 31 | -- Monomorphic lens getter 32 | alensview :: ∀ st a. ALens' st a -> st -> a 33 | alensview l = view (cloneLens l) 34 | 35 | -- Monomorphic lens setter 36 | alensset :: ∀ st a. ALens' st a -> a -> st -> st 37 | alensset l = set (cloneLens l) 38 | 39 | recordToLens :: ∀ r rs st. RecordToLens st r rs => Record r -> Lens' st (Record rs) 40 | recordToLens r = lens (lensget alensview r) (lensset alensset r) 41 | -------------------------------------------------------------------------------- /src/Undefined.purs: -------------------------------------------------------------------------------- 1 | module Undefined (undefined) where 2 | 3 | import Unsafe.Coerce (unsafeCoerce) 4 | import Prelude (unit) 5 | 6 | undefined :: forall a. a 7 | undefined = unsafeCoerce unit 8 | -------------------------------------------------------------------------------- /static/font/Dosis-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-Bold.ttf -------------------------------------------------------------------------------- /static/font/Dosis-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-ExtraBold.ttf -------------------------------------------------------------------------------- /static/font/Dosis-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-ExtraLight.ttf -------------------------------------------------------------------------------- /static/font/Dosis-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-Light.ttf -------------------------------------------------------------------------------- /static/font/Dosis-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-Medium.ttf -------------------------------------------------------------------------------- /static/font/Dosis-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-Regular.ttf -------------------------------------------------------------------------------- /static/font/Dosis-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkamenarsky/purescript-refract/283906c126c5f1f7e0e0aaa348a878fed9bf2560/static/font/Dosis-SemiBold.ttf -------------------------------------------------------------------------------- /static/font/OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Edgar Tolentino and Pablo Impallari (www.impallari.com|impallari@gmail.com), 2 | Copyright (c) 2011, Igino Marini. (www.ikern.com|mail@iginomarini.com), 3 | with Reserved Font Names "Dosis". 4 | 5 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 6 | This license is copied below, and is also available with a FAQ at: 7 | http://scripts.sil.org/OFL 8 | 9 | 10 | ----------------------------------------------------------- 11 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 12 | ----------------------------------------------------------- 13 | 14 | PREAMBLE 15 | The goals of the Open Font License (OFL) are to stimulate worldwide 16 | development of collaborative font projects, to support the font creation 17 | efforts of academic and linguistic communities, and to provide a free and 18 | open framework in which fonts may be shared and improved in partnership 19 | with others. 20 | 21 | The OFL allows the licensed fonts to be used, studied, modified and 22 | redistributed freely as long as they are not sold by themselves. The 23 | fonts, including any derivative works, can be bundled, embedded, 24 | redistributed and/or sold with any software provided that any reserved 25 | names are not used by derivative works. The fonts and derivatives, 26 | however, cannot be released under any other type of license. The 27 | requirement for fonts to remain under this license does not apply 28 | to any document created using the fonts or their derivatives. 29 | 30 | DEFINITIONS 31 | "Font Software" refers to the set of files released by the Copyright 32 | Holder(s) under this license and clearly marked as such. This may 33 | include source files, build scripts and documentation. 34 | 35 | "Reserved Font Name" refers to any names specified as such after the 36 | copyright statement(s). 37 | 38 | "Original Version" refers to the collection of Font Software components as 39 | distributed by the Copyright Holder(s). 40 | 41 | "Modified Version" refers to any derivative made by adding to, deleting, 42 | or substituting -- in part or in whole -- any of the components of the 43 | Original Version, by changing formats or by porting the Font Software to a 44 | new environment. 45 | 46 | "Author" refers to any designer, engineer, programmer, technical 47 | writer or other person who contributed to the Font Software. 48 | 49 | PERMISSION & CONDITIONS 50 | Permission is hereby granted, free of charge, to any person obtaining 51 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 52 | redistribute, and sell modified and unmodified copies of the Font 53 | Software, subject to the following conditions: 54 | 55 | 1) Neither the Font Software nor any of its individual components, 56 | in Original or Modified Versions, may be sold by itself. 57 | 58 | 2) Original or Modified Versions of the Font Software may be bundled, 59 | redistributed and/or sold with any software, provided that each copy 60 | contains the above copyright notice and this license. These can be 61 | included either as stand-alone text files, human-readable headers or 62 | in the appropriate machine-readable metadata fields within text or 63 | binary files as long as those fields can be easily viewed by the user. 64 | 65 | 3) No Modified Version of the Font Software may use the Reserved Font 66 | Name(s) unless explicit written permission is granted by the corresponding 67 | Copyright Holder. This restriction only applies to the primary font name as 68 | presented to the users. 69 | 70 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 71 | Software shall not be used to promote, endorse or advertise any 72 | Modified Version, except to acknowledge the contribution(s) of the 73 | Copyright Holder(s) and the Author(s) or with their explicit written 74 | permission. 75 | 76 | 5) The Font Software, modified or unmodified, in part or in whole, 77 | must be distributed entirely under this license, and must not be 78 | distributed under any other license. The requirement for fonts to 79 | remain under this license does not apply to any document created 80 | using the Font Software. 81 | 82 | TERMINATION 83 | This license becomes null and void if any of the above conditions are 84 | not met. 85 | 86 | DISCLAIMER 87 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 88 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 89 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 90 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 91 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 92 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 93 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 94 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 95 | OTHER DEALINGS IN THE FONT SOFTWARE. 96 | -------------------------------------------------------------------------------- /static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Refract App 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /static/style.css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Dosis'; 4 | font-style: normal; 5 | font-weight: 500; 6 | src: local('Dosis Medium'), local('Dosis-Medium'), url(/fonts/Dosis-Medium.ttf) format('woff2'); 7 | } 8 | /* latin */ 9 | @font-face { 10 | font-family: 'Dosis'; 11 | font-style: normal; 12 | font-weight: 700; 13 | src: local('Dosis Medium'), local('Dosis-Bold'), url(/fonts/Dosis-Bold.ttf) format('woff2'); 14 | } 15 | 16 | body { 17 | -webkit-font-smoothing: antialiased; 18 | -moz-font-smoothing: antialiased; 19 | 20 | color: #333; 21 | 22 | font-weight: 500; 23 | font-family: 'Dosis'; 24 | font-size: 24px; 25 | text-transform: uppercase; 26 | } 27 | 28 | .container { 29 | position: relative; 30 | 31 | left: 50%; 32 | top: 160px; 33 | width: 480px; 34 | 35 | margin-left: -240px; 36 | } 37 | 38 | .container .todo { 39 | position: relative; 40 | } 41 | 42 | .container .todo-input { 43 | width: 100%; 44 | border: 0px; 45 | outline: 0px; 46 | 47 | font-size: 24px; 48 | font-family: 'Dosis'; 49 | text-transform: uppercase; 50 | 51 | padding-left: 32px; 52 | margin-bottom: 32px; 53 | } 54 | 55 | .container .todo-input::placeholder { 56 | color: #ccc; 57 | } 58 | 59 | .container .todo .todo-checkbox { 60 | position: absolute; 61 | -webkit-appearance: none; 62 | -moz-appearance: none; 63 | appearance: none; 64 | 65 | border: 2px solid #ccc; 66 | 67 | width: 17px; 68 | height: 17px; 69 | 70 | outline: none; 71 | line-height: 24px; 72 | margin: auto 0; 73 | box-sizing: border-box; 74 | top: 0px; 75 | bottom: 0px; 76 | display: block; 77 | } 78 | 79 | .container .todo .todo-checkbox:checked { 80 | border: 2px solid #333; 81 | } 82 | 83 | .container .todo .todo-checkbox:checked::after { 84 | content: ''; 85 | position: absolute; 86 | background-color: #333; 87 | width: 9px; 88 | height: 9px; 89 | top: 2px; 90 | left: 2px; 91 | } 92 | 93 | .container .todo .todo-edit { 94 | padding: 0px 32px; 95 | line-height: 42px; 96 | display: block; 97 | 98 | color: #000; 99 | 100 | width: 100%; 101 | border: 0px; 102 | outline: 0px; 103 | 104 | font-size: 24px; 105 | font-family: 'Dosis'; 106 | text-transform: uppercase; 107 | 108 | padding-left: 32px; 109 | } 110 | 111 | .container .todo .todo-description { 112 | padding: 0px 32px; 113 | line-height: 42px; 114 | display: block; 115 | } 116 | 117 | .container .todo .todo-delete { 118 | position: absolute; 119 | 120 | display: none; 121 | 122 | cursor: pointer; 123 | top: 0px; 124 | bottom: 0px; 125 | right: 0px; 126 | 127 | width: 16px; 128 | height: 36px; 129 | font-size: 36px; 130 | line-height: 31px; 131 | vertical-align: center; 132 | 133 | margin: auto 0px; 134 | } 135 | 136 | .container .todo .todo-delete::after { 137 | content: '×'; 138 | } 139 | 140 | .container .todo .todo-delete:hover { 141 | display: block; 142 | } 143 | 144 | .container .todo:hover .todo-delete { 145 | display: block; 146 | } 147 | 148 | .container .footer { 149 | margin-top: 32px; 150 | padding-left: 32px; 151 | } 152 | 153 | .container .footer .todo-count { 154 | font-size: 12px; 155 | font-weight: 700; 156 | 157 | float: left; 158 | text-align: left; 159 | } 160 | 161 | .container .footer .todo-filters { 162 | font-size: 12px; 163 | font-weight: 700; 164 | 165 | position: absolute; 166 | 167 | right: 0px; 168 | left: 0px; 169 | 170 | margin: 0px; 171 | padding: 0px; 172 | 173 | text-align: center; 174 | } 175 | 176 | .container .footer .todo-filters span { 177 | cursor: pointer; 178 | } 179 | 180 | .container .footer .todo-filters span:hover { 181 | color: #777; 182 | } 183 | 184 | .container .footer .todo-clear { 185 | font-size: 12px; 186 | font-weight: 700; 187 | 188 | cursor: pointer; 189 | 190 | position: relative; 191 | float: right; 192 | } 193 | 194 | .container .footer .todo-clear:hover { 195 | color: #777; 196 | } 197 | -------------------------------------------------------------------------------- /support/config.js: -------------------------------------------------------------------------------- 1 | exports.config = { 2 | title: 'Act Starter App', 3 | public_path: process.env.NODE_ENV === 'production' 4 | ? '/dist/' 5 | : 'http://localhost:8080/dist/' 6 | } 7 | -------------------------------------------------------------------------------- /support/entry.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var css = require('../static/style.css'); 4 | var entry = require('../test/examples/ToDoMVC.purs'); 5 | 6 | var subscribe = function(st) { 7 | return function() { 8 | // localStorage.setItem('__refract_state', JSON.stringify(st)); 9 | } 10 | } 11 | 12 | // entry.main(JSON.parse(localStorage.getItem('__refract_state')) || entry.initialState)(subscribe)(); 13 | entry.main(entry.initialState)(subscribe)(); 14 | 15 | if (module.hot) { 16 | module.hot.accept(); 17 | } 18 | -------------------------------------------------------------------------------- /test/examples/Counters.purs: -------------------------------------------------------------------------------- 1 | module Counters where 2 | 3 | -------------------------------------------------------------------------------- 4 | 5 | import Refract (Component, foreachZ, modify, state, run, zoom) 6 | import Refract.DOM (div, text) 7 | 8 | import Control.Monad.Eff (Eff) 9 | import Data.Array (cons) 10 | import Data.Tuple (Tuple) 11 | import Data.Lens (_1, _2) 12 | import DOM (DOM) 13 | import Props (onClick) 14 | import Prelude hiding (div) 15 | 16 | -------------------------------------------------------------------------------- 17 | 18 | counter :: ∀ eff. Component eff Int 19 | counter = state \st -> div [] 20 | [ div [ onClick \_ -> modify (_ - 1) ] [ text "Decrement" ] 21 | , text (show st) 22 | , div [ onClick \_ -> modify (_ + 1) ] [ text "Increment" ] 23 | ] 24 | 25 | twoCounters :: ∀ eff. Component eff (Tuple Int Int) 26 | twoCounters = div [] [ zoom _1 counter, zoom _2 counter ] 27 | 28 | manyCounters :: ∀ eff. Component eff (Array Int) 29 | manyCounters = div [] 30 | [ div [ onClick \_ -> modify (cons 0) ] [ text "Add counter" ] 31 | , foreachZ id counter 32 | ] 33 | 34 | main :: ∀ eff. Array Int -> (Array Int -> Eff eff Unit) -> Eff (dom :: DOM | eff) Unit 35 | main = run "main" manyCounters 36 | -------------------------------------------------------------------------------- /test/examples/ToDoMVC.purs: -------------------------------------------------------------------------------- 1 | module ToDoMVC where 2 | 3 | -------------------------------------------------------------------------------- 4 | 5 | import Refract 6 | 7 | import Control.Monad.Eff (Eff) 8 | import DOM (DOM) 9 | import Data.Function (on) 10 | import Data.Lens (ALens', Lens', cloneLens, lens, set) 11 | import Data.List (filter, length) 12 | import Data.Ordering (invert) 13 | import Data.Map (Map) 14 | import Data.Map as M 15 | import Data.String as S 16 | import Data.Tuple (fst, snd) 17 | import Prelude (class Ord, Unit, compare, id, not, show, when, ($), (+), (<>), (==), (>)) 18 | import Props (_type, autoFocus, checked, className, onBlur, onChange, onClick, onDoubleClick, onEnter, onKeyDown, placeholder, unsafeEventConvert, value) 19 | import React (Event) 20 | import Refract.DOM (div, input, label, span, text) 21 | 22 | -------------------------------------------------------------------------------- 23 | 24 | initialState :: AppState 25 | initialState = 26 | { todos: M.empty 27 | , todo: "" 28 | , nextId: 0 29 | , filter: All 30 | } 31 | 32 | -- | Lenses (`prop @"xyz"` will make this easier in the future). 33 | 34 | _todoId :: ∀ r. Lens' { todoId :: Int | r } Int 35 | _todoId = lens (_.todoId) (\x v -> x { todoId = v }) 36 | 37 | _description :: ∀ r. Lens' { description :: String | r } String 38 | _description = lens (_.description) (\x v -> x { description = v }) 39 | 40 | _completed :: ∀ r. Lens' { completed :: Boolean | r } Boolean 41 | _completed = lens (_.completed) (\x v -> x { completed = v }) 42 | 43 | _edited :: ∀ r. Lens' { edited :: Boolean | r } Boolean 44 | _edited = lens (_.edited) (\x v -> x { edited = v }) 45 | 46 | _input :: ∀ r. Lens' { input :: String | r } String 47 | _input = lens (_.input) (\x v -> x { input = v }) 48 | 49 | _todos :: ∀ r. Lens' { todos :: Map Int ToDo | r } (Map Int ToDo) 50 | _todos = lens (_.todos) (\x v -> x { todos = v }) 51 | 52 | _todo :: ∀ r. Lens' { todo :: String | r } String 53 | _todo = lens (_.todo) (\x v -> x { todo = v }) 54 | 55 | _todo' :: ∀ r. Lens' { todo :: ToDo | r } ToDo 56 | _todo' = lens (_.todo) (\x v -> x { todo = v }) 57 | 58 | _filter :: ∀ r. Lens' { filter :: ToDoFilter | r } ToDoFilter 59 | _filter = lens (_.filter) (\x v -> x { filter = v }) 60 | 61 | _temp :: ∀ r. Lens' { temp :: String | r } String 62 | _temp = lens (_.temp) (\x v -> x { temp = v }) 63 | 64 | _parent :: ∀ st r. Lens' { parent :: st | r } st 65 | _parent = lens (_.parent) (\x v -> x { parent = v }) 66 | 67 | data ToDoFilter = All | Active | Completed 68 | 69 | newtype ToDoIndex = ToDoIndex Int 70 | 71 | type ToDo = 72 | { description :: String 73 | , completed :: Boolean 74 | 75 | , edited :: Boolean 76 | , input :: String 77 | } 78 | 79 | type AppState = 80 | { todos :: Map Int ToDo 81 | , todo :: String 82 | , nextId :: Int 83 | , filter :: ToDoFilter 84 | } 85 | 86 | targetValue :: Event -> String 87 | targetValue e = (unsafeEventConvert e).target.value 88 | 89 | filterMap :: ∀ k v. Ord k => (v -> Boolean) -> Map k v -> Map k v 90 | filterMap f = M.fromFoldable ○ filter (f ○ snd) ○ M.toUnfoldable 91 | 92 | data InputResult = Cancel | Input String | Delete 93 | 94 | -- | Reusable input component (not specific to ToDoMVC) 95 | -- | * Reacts on enter and escape key and blur events 96 | -- | * Writes the entered text on enter 97 | -- | * Discards the entered text on escape or blur 98 | -- | * Deletes input component on enter, when the text is empty 99 | blurableInput 100 | :: ∀ eff st. 101 | ALens' st String -- | Lens specifying the target value 102 | -> (InputResult -> Effect eff st Unit) -- | Result effect operating on the parent state 103 | -> Component eff st 104 | blurableInput editL result = 105 | stateL editL \edit -> input 106 | [ className "todo-edit" 107 | , autoFocus true 108 | , value edit 109 | , onChange \e -> modifyL editL \_ -> targetValue e 110 | , onKeyDown \e -> if e.keyCode == 13 111 | then if S.length edit > 0 112 | then result $ Input edit 113 | else result Delete 114 | else when (e.keyCode == 27) (result Cancel) 115 | , onBlur \_ -> result Cancel 116 | ] [] 117 | 118 | checkbox :: ∀ eff st. ALens' st Boolean -> Component eff st 119 | checkbox lns = zoom lns $ state \st -> input 120 | [ _type "checkbox" 121 | , className "todo-checkbox" 122 | , checked st 123 | , onChange \_ -> modify not 124 | ] [] 125 | 126 | inputOnEnter :: ∀ eff st. ALens' st String -> (String -> Effect eff st Unit) -> Component eff st 127 | inputOnEnter lnsStr done = stateL lnsStr \str -> input 128 | [ className "todo-input" 129 | , placeholder "What needs to be done?" 130 | , autoFocus true 131 | , value str 132 | , onChange \e -> modifyL lnsStr \_ -> targetValue e 133 | , onEnter $ when (S.length str > 0) (done str) 134 | ] [] 135 | 136 | todoInput :: ∀ eff st. 137 | (st -> st) 138 | -> { temp :: ALens' st String 139 | , current :: ALens' st String 140 | , active :: ALens' st Boolean 141 | } 142 | -> Component eff st 143 | todoInput delete lns = stateR lns \st -> if st.active 144 | then blurableInput lns.temp \result -> do 145 | case result of 146 | Cancel -> modifyR lns \st -> st { temp = "", active = false } 147 | Input str -> modifyR lns \st -> st { temp = "", active = false, current = st.temp } 148 | Delete -> modify delete 149 | 150 | else label 151 | [ className "todo-description" 152 | , onDoubleClick \_ -> modifyR lns \st -> st { temp = st.current, active = true } 153 | ] 154 | [ text st.current ] 155 | 156 | spanButton :: ∀ eff st a. ALens' st a -> (a -> a) -> Array (Component eff st) -> Component eff st 157 | spanButton lns f children = span [ onClick \_ -> modifyL lns f ] children 158 | 159 | todo 160 | :: ∀ eff st. 161 | ALens' st ToDo -- | Lens to the current todo 162 | -> (st -> st) -- | Removes the current item from the list 163 | -> Component eff st -- | Todo Component 164 | todo lns' delete = div 165 | [ className "todo" ] 166 | [ checkbox (lns ○ _completed) 167 | , todoInput delete 168 | { temp: lns ○ _input 169 | , current: lns ○ _description 170 | , active: lns ○ _edited 171 | } 172 | , div [ className "todo-delete", onClick \_ -> modify delete ] [] 173 | ] 174 | where 175 | lns = cloneLens lns' 176 | 177 | todoMVC :: ∀ eff st. ALens' st AppState -> Component eff st 178 | todoMVC lns = zoom lns $ state \st -> div [ className "container" ] 179 | -- Input field 180 | [ inputOnEnter _todo \str -> modify \st -> st 181 | { todo = "" 182 | , nextId = st.nextId + 1 183 | , todos = M.insert st.nextId 184 | { description: str 185 | , completed: false 186 | , edited: false 187 | , input: "" 188 | } st.todos 189 | } 190 | 191 | -- Individual todos 192 | , foreachMapF ((invert ○ _) ○ (compare `on` fst)) (visible st.filter ○ snd) _todos todo 193 | 194 | -- Footer 195 | , div 196 | [ className "footer" ] 197 | [ span 198 | [ className "todo-count"] 199 | [ text $ show (length $ filter (not _.completed) $ M.values st.todos) <> " items left" ] 200 | 201 | , div 202 | [ className "todo-filters" ] 203 | [ spanButton id (set _filter All) [ text "All" ], text "/" 204 | , spanButton id (set _filter Active) [ text "Active" ], text "/" 205 | , spanButton id (set _filter Completed) [ text "Completed" ] 206 | ] 207 | 208 | , if (length $ filter (_.completed) $ M.values st.todos) > 0 209 | then span 210 | [ className "todo-clear" 211 | , onClick \_ -> modify \st -> st { todos = filterMap (not (_.completed)) st.todos } 212 | ] 213 | [ text "Clear completed"] 214 | else span [] [] 215 | ] 216 | ] 217 | where 218 | visible :: ToDoFilter -> ToDo -> Boolean 219 | visible All _ = true 220 | visible Active todo = not todo.completed 221 | visible Completed todo = todo.completed 222 | 223 | -- Main ------------------------------------------------------------------------ 224 | 225 | main :: ∀ eff. AppState -> (AppState -> Eff eff Unit) -> Eff (dom :: DOM | eff) Unit 226 | main = run "main" (todoMVC id) 227 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const appConfig = require('./support/config.js').config 2 | const path = require('path') 3 | const webpack = require('webpack') 4 | const isProd = process.env.NODE_ENV === 'production' 5 | 6 | const plugins = [ 7 | new webpack.DefinePlugin({ 8 | 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) 9 | }) 10 | ] 11 | 12 | if (isProd) { 13 | plugins.push( 14 | new webpack.LoaderOptionsPlugin({ 15 | minimize: true, 16 | debug: false 17 | }) 18 | ) 19 | } 20 | 21 | module.exports = { 22 | entry: './support/entry', 23 | context: __dirname, 24 | target: 'web', 25 | output: { 26 | path: path.join(__dirname, 'static', 'dist'), 27 | filename: 'bundle.js', 28 | publicPath: appConfig.public_path 29 | }, 30 | module: { 31 | loaders: [ 32 | { 33 | test: /\.purs$/, 34 | loader: 'purs-loader', 35 | exclude: /node_modules/, 36 | query: isProd ? { 37 | bundle: true, 38 | bundleOutput: 'static/dist/bundle.js' 39 | } : { 40 | psc: 'psc', 41 | pscIde: true, 42 | src: ['.psc-package/psc-*/*/*/src/**/*.purs', 'src/**/*.purs', 'test/**/*.purs'] 43 | } 44 | }, 45 | { 46 | test: /\.css$/, 47 | loaders: ['style-loader', 'css-loader'] 48 | } 49 | ], 50 | }, 51 | plugins: plugins, 52 | resolveLoader: { 53 | modules: [ 54 | path.join(__dirname, 'node_modules') 55 | ] 56 | }, 57 | resolve: { 58 | alias: { 59 | 'react': 'react', 60 | 'react-dom': 'react-dom' 61 | }, 62 | modules: [ 63 | 'node_modules', 64 | '.psc-package' 65 | ], 66 | extensions: ['.js', '.purs'] 67 | }, 68 | performance: { hints: false }, 69 | stats: { 70 | hash: false, 71 | timings: false, 72 | version: false, 73 | assets: false, 74 | errors: true, 75 | colors: false, 76 | chunks: false, 77 | children: false, 78 | cached: false, 79 | modules: false, 80 | chunkModules: false 81 | } 82 | } 83 | --------------------------------------------------------------------------------