diff --git a/README.md b/README.md index 775a679..a0d4fa2 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,15 @@ programming. Experimental. # Table of contents -* [Why Turbine?](#why-turbine) -* [Examples](#examples) -* [High-level overview](#high-level-overview) -* [Principles](#principles) -* [Installation](#installation) -* [More examples](#more-examples) -* [Tutorial](#tutorial) -* [API](#api) -* [Contributing](#contributing) +- [Why Turbine?](#why-turbine) +- [Examples](#examples) +- [High-level overview](#high-level-overview) +- [Principles](#principles) +- [Installation](#installation) +- [More examples](#more-examples) +- [Tutorial](#tutorial) +- [API](#api) +- [Contributing](#contributing) ## Why Turbine? @@ -67,25 +67,25 @@ runComponent("#mount", main); [See the example live here](https://codesandbox.io/s/k9y0po3vv3?module=%2Fsrc%2Findex.js). ```js -const counterModel = fgo(function* ({ incrementClick, decrementClick }) { +const counterModel = fgo(function*({ incrementClick, decrementClick }) { const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); const changes = combine(increment, decrement); - const count = yield sample(scan((n, m) => n + m, 0, changes)); + const count = yield accum((n, m) => n + m, 0, changes); return { count }; }); const counterView = ({ count }) => div([ - "Counter ", - count, + "Counter ", + count, button({ class: "btn btn-default" }, "+").output({ incrementClick: "click" }), button({ class: "btn btn-default" }, "-").output({ decrementClick: "click" }) -]); + ]); const counter = modelView(counterModel, counterView); ``` @@ -96,36 +96,36 @@ const counter = modelView(counterModel, counterView); Here our some of our key features. -* Purely functional. A Turbine app is made up of only pure functions. -* Leverage TypeScript and runtime checking to improve the developing +- Purely functional. A Turbine app is made up of only pure functions. +- Leverage TypeScript and runtime checking to improve the developing experience. -* Based on classic FRP. Behaviors represents values that change over +- Based on classic FRP. Behaviors represents values that change over time and streams provide reactivity. Turbine uses the FRP library [Hareactive](https://github.com/funkia/hareactive). -* A component-based architecture. Components are immutable, +- A component-based architecture. Components are immutable, encapsulated and composable. Components are monads and are typically used and composed with do-notation (we implement do-notation with generators). -* Constructed DOM elements reacts directly to behaviors and streams. +- Constructed DOM elements reacts directly to behaviors and streams. This avoids the overhead of using virtual DOM and should lead to great performance. -* Side-effects are expressed with a declarative IO monad. This allows +- Side-effects are expressed with a declarative IO monad. This allows for easy testing of code with side-effects. Furthermore, the IO-monad is integrated with FRP. -* The entire data flow through applications is explicit and easy to +- The entire data flow through applications is explicit and easy to follow. -* Our libraries are available both as CommonJS and ES2015 modules. +- Our libraries are available both as CommonJS and ES2015 modules. This allows for tree-shaking. Here are some of the features we want to implement and goals we're working towards. -* Declarative and concise testing of time-dependent FRP code. -* Performance. We think Turbine can be made very efficient. But we are +- Declarative and concise testing of time-dependent FRP code. +- Performance. We think Turbine can be made very efficient. But we are not yet at a point where we focus on performance. -* Support for server side rendering. -* Browser devtools for easier development and debugging. -* Hot-module replacement (if possible given our design). +- Support for server side rendering. +- Browser devtools for easier development and debugging. +- Hot-module replacement (if possible given our design). ## Principles @@ -204,7 +204,7 @@ function* counterModel({ incrementClick, decrementClick, deleteClick }) { const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); const deleteS = deleteClick.mapTo(id); - const count = yield sample(scan(add, 0, combine(increment, decrement))); + const count = yield accum(add, 0, combine(increment, decrement)); return { count, deleteS }; } ``` @@ -236,22 +236,21 @@ Alternatively, for quickly trying out Turbine you may want to see our ## More examples - Here is a series of examples that demonstrate how to use Turbine. Approximately listed in order of increasing complexity. -* [Simple](/examples/simple) — Very simple example of an email +- [Simple](/examples/simple) — Very simple example of an email validator. -* [Fahrenheit celsius](/examples/fahrenheit-celsius) — A converter +- [Fahrenheit celsius](/examples/fahrenheit-celsius) — A converter between fahrenheit and celsius. -* [Zip codes](/examples/zip-codes) — A zip code validator. Shows one +- [Zip codes](/examples/zip-codes) — A zip code validator. Shows one way of doing HTTP-requests with the IO-monad. -* [Continuous time](/examples/continuous-time) — Shows how to utilize +- [Continuous time](/examples/continuous-time) — Shows how to utilize continuous time. -* [Counters](/examples/counters) — A list of counters. Demonstrates +- [Counters](/examples/counters) — A list of counters. Demonstrates nested components, managing a list of components and how child components can communicate with parent components. -* [Todo](/examples/todo) — An implementation of the classic +- [Todo](/examples/todo) — An implementation of the classic TodoMVC application. ## Tutorial @@ -283,10 +282,10 @@ more detail in the [Hareactive readme](https://github.com/funkia/hareactive). But the most important things to understand are behavior and stream. -* `Behavior` represents values that change over time. For instance, +- `Behavior` represents values that change over time. For instance, the position of the mouse or the number of times a user has clicked a button. -* `Stream` represents discrete events that happen over time. For +- `Stream` represents discrete events that happen over time. For instance click events. ### What is `Component` @@ -297,15 +296,15 @@ it—you understand Turbine. A Turbine app is just one big component. Here is a high-level overview of what a component is. -* Components can __contain logic__ expressed through operations on +- Components can **contain logic** expressed through operations on behaviors and streams. -* Components are __encapsulated__ and have completely private state. -* Components __contain output__ through which they selectively decide +- Components are **encapsulated** and have completely private state. +- Components **contain output** through which they selectively decide what state they share with their parent. -* Components __write DOM elements__ as children to their parent. They +- Components **write DOM elements** as children to their parent. They can write zero, one or more DOM elements. -* Components can __declare side-effects__ expressed as `IO`-actions. -* Components are __composable__—one component can be combined with +- Components can **declare side-effects** expressed as `IO`-actions. +- Components are **composable**—one component can be combined with another component and the result is a third component. A `Component` in Turbine is pure and immutable. A `Component` can be @@ -328,7 +327,7 @@ attributes, classes, etc. The second argument is a child component. For instance, to create a div with a span child we would write. ```typescript -const myDiv = div({class: "foo"}, span("Some text")); +const myDiv = div({ class: "foo" }, span("Some text")); ``` The element functions are overloaded. So instead of giving `span` a @@ -336,10 +335,7 @@ component as child we can give it a string. The element functions also accept an array of child elements like this. ```typescript -const myDiv = div({class: "foo"}, [ - h1("A header"), - p("Some text") -]) +const myDiv = div({ class: "foo" }, [h1("A header"), p("Some text")]); ``` Using this we can build arbitrarily complex HTML. As an example we @@ -350,14 +346,7 @@ import { elements, runComponent } from "@funkia/turbine"; const { br, div, button } = elements; // Counter -const counterView = div([ - "Counter ", - 1, - " ", - button("+"), - " ", - button("-") -]); +const counterView = div(["Counter ", 1, " ", button("+"), " ", button("-")]); runComponent("body", counterView); ``` @@ -393,14 +382,8 @@ function that takes a behavior of a number and inserts it into the view. ```ts -const counterView = ({ count }: CounterViewInput) => div([ - "Counter ", - count, - " ", - button("+"), - " ", - button("-"), -]); +const counterView = ({ count }: CounterViewInput) => + div(["Counter ", count, " ", button("+"), " ", button("-")]); ``` Because it will be easier going forward `counterView` takes an object @@ -418,11 +401,11 @@ description also explains what output will come from the component. To get a feel for what "output" means it may be helpful to mention a few examples. -* A button outputs, among other things, a stream of click events. So +- A button outputs, among other things, a stream of click events. So part of its output is a stream of the type `Stream>`. -* An input box's output includes a behavior of the text inside the +- An input box's output includes a behavior of the text inside the input. The type would be `Behavior`. -* A checkbox might output a behavior representing whether it is +- A checkbox might output a behavior representing whether it is checked or not. It would have type `Behavior`. One way of looking at the output is that it is the information we @@ -434,14 +417,14 @@ an object. Components are represented by a generic type `Component`. The `A` represents the _available_ output of the component and the `O` -represents the _selected_ out of the component. The difference +represents the _selected_ out of the component. The difference between selected and available output is highlighted in the example below. Constructing an input element looks like this ```ts -const usernameInput = input({ placeholder: "Username"}); +const usernameInput = input({ placeholder: "Username" }); ``` The type of the component constructed above is as follows ( the `...` @@ -486,9 +469,9 @@ For instance, in the code below the `div` is given two children. ```ts div([ - button("Clik me").output({firstButtonClick: "click"}), + button("Click me").output({ firstButtonClick: "click" }), button("Don't click me") -]) +]); ``` The `div` element composes the two buttons. When doing so all output @@ -519,13 +502,13 @@ We can achieve that by using the `output` method in each button. ```ts const counterView = ({ count }) => div([ - "Counter ", - count, - " ", - button("+").output({ incrementClick: "click" }), - " ", - button("-").output({ decrementClick: "click" }) -]); + "Counter ", + count, + " ", + button("+").output({ incrementClick: "click" }), + " ", + button("-").output({ decrementClick: "click" }) + ]); ``` The call to `output` on each `button` tells them what output we are @@ -579,13 +562,12 @@ that the `button` function gets as an argumen. The same thing in Turbine looks like this. ```ts -button("Click me").output({click: "click"}); +button("Click me").output({ click: "click" }); ``` This is similar to the `readFilePromise` function. The `button` function does not take any callbacks but returns a stream of clicks -wrapped in a component of the type `Component<{ click: -Stream }, ...>`. +wrapped in a component of the type `Component<{ click: Stream }, ...>`. This example should give some intuition about how Turbine differs from most other frameworks. Other frameworks handle events similar to doing @@ -612,8 +594,8 @@ The first argument is a function that returns a `Now`-computation. You don't have to fully understand `Now`. One of the things it does is to make it possible to create stateful behaviors. The model function will as input receive the output from the component that the view function -returns. The result of the `Now`-computation will be passed on to the -view function and will be the output of the component that `modelView` +returns. The result of the `Now`-computation will be passed on to the +view function and will be the output of the component that `modelView` returns. Here is how we use to create our counter component. ```ts @@ -621,7 +603,7 @@ function* counterModel({ incrementClick, decrementClick }: CounterModelInput) { const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); const changes = combine(increment, decrement); - const count = yield sample(scan((n, m) => n + m, 0, changes)); + const count = yield accum((n, m) => n + m, 0, changes); return { count }; } @@ -650,7 +632,10 @@ button. ```js function* counterListView() { yield h1("Counters"); - const { click: addCounter } = yield button({ class: "btn btn-primary" }, "Add counter"); + const { click: addCounter } = yield button( + { class: "btn btn-primary" }, + "Add counter" + ); return { addCounter }; } ``` @@ -661,13 +646,13 @@ function receives the return value from the view function. ```js const counterList = modelView(counterListModel, counterListView); -const counterListModel = fgo(function*({addCounter, listOut}) { - const nextId = yield sample(scanS(add, 2, addCounter.mapTo(1))); +const counterListModel = fgo(function*({ addCounter, listOut }) { + const nextId = yield scan(add, 2, addCounter.mapTo(1)); const appendCounterFn = map( (id) => (ids: number[]) => ids.concat([id]), nextId ); - const counterIds = yield sample(scan(apply, [0], appendCounterFn)); + const counterIds = yield accum(apply, [0], appendCounterFn); return { counterIds }; }); @@ -703,13 +688,11 @@ output from one component into the next. The code below combines two the text in the two input fields. ```typescript -input({ attrs: { placeholder: "foo" } }).chain( - ({ value: aValue }) => input().chain( - ({ value: bValue }) => { - const concatenated = lift((a, b) => a + b, aValue, bValue); - return span(["Concatenated text: ", concatenated]).mapTo({concatenated}); - } - ) +input({ attrs: { placeholder: "foo" } }).chain(({ value: aValue }) => + input().chain(({ value: bValue }) => { + const concatenated = lift((a, b) => a + b, aValue, bValue); + return span(["Concatenated text: ", concatenated]).mapTo({ concatenated }); + }) ); ``` @@ -719,11 +702,11 @@ generators. ```typescript go(function*() { - const {value: aValue} = yield input(); - const {value: bValue} = yield input(); + const { value: aValue } = yield input(); + const { value: bValue } = yield input(); const concatenated = lift((a, b) => a + b, aValue, bValue); yield span(["Concatenated text: ", concatenated]); - return {concatenated}; + return { concatenated }; }); ``` @@ -743,19 +726,21 @@ component that `go` returns. Here is another example. The following code uses `chain` explicitly. ```ts -const view = button("Accept") - .chain(({click: acceptClick}) => button("Reject") - .map(({click: rejectClick}) => ({acceptClick, rejectClick})) - ); +const view = button("Accept").chain(({ click: acceptClick }) => + button("Reject").map(({ click: rejectClick }) => ({ + acceptClick, + rejectClick + })) +); ``` The above code is equivalent to the following. ```ts -const view = go(function* () { - const {click: acceptClick} = yield button("Accept"); - const {click: rejectClick} = yield button("Reject"); - return {acceptClick, rejectClick}; +const view = go(function*() { + const { click: acceptClick } = yield button("Accept"); + const { click: rejectClick } = yield button("Reject"); + return { acceptClick, rejectClick }; }); ``` @@ -784,7 +769,7 @@ whose output is of type `B`. In the example below `input` creates a component with an object as output. The object contains a behavior named `value`. The -function given to `map` receives the output from the component. +function given to `map` receives the output from the component. We then call `map` on the behavior `value` and take the length of the string. The result is that `usernameInput` has the type @@ -793,9 +778,9 @@ number-valued behavior whose value is the current length of the text in the input element. ```ts -const usernameInput = - input({class: "form-control"}) - .map((output) => output.value.map((s) => s.length)); +const usernameInput = input({ class: "form-control" }).map((output) => + output.value.map((s) => s.length) +); ``` #### `Component#chain` @@ -815,11 +800,11 @@ function that takes `Output` as argument and returns a new component. Here is an example. An invocation `component.chain(fn)` returns a new component that works like this: -* The output from `component` is passed to `fn`. -* `fn` returns a new component, let's call it `component2` -* The DOM-elements from `component` and `component2` are both added to +- The output from `component` is passed to `fn`. +- `fn` returns a new component, let's call it `component2` +- The DOM-elements from `component` and `component2` are both added to the parent. -* The output is the output from `component2`. +- The output is the output from `component2`. Here is an example. @@ -860,11 +845,13 @@ the second showed output from the first. With `loop` we can do it like this: ```typescript -loop(({output1, output2}) => go(function*() { - const output1_ = yield myComponent(output2); - const output2_ = yield myComponent(output1); - return {output1: output1_, output2: output2_}; -})); +loop(({ output1, output2 }) => + go(function*() { + const output1_ = yield myComponent(output2); + const output2_ = yield myComponent(output1); + return { output1: output1_, output2: output2_ }; + }) +); ``` The `loop` functional seems pretty magical. It has the following @@ -892,9 +879,9 @@ the view is decoupled from the model and its logic. `modelView` takes two arguments: -* The model which is a function that returns a `Now` computation. The +- The model which is a function that returns a `Now` computation. The `Now` computation is run when the component is being created. -* The view which is a function that returns a `Component`. +- The view which is a function that returns a `Component`. `modelView` establishes a circular dependency between the model and the view. The model returns a `Now` computation and the result of this @@ -929,6 +916,7 @@ The `list` function is used to create _dynamic_ lists in the UI. > Angular 2, and `v-for` in Vue. The list function has the following type. + ```ts function list( componentCreator: (a: A) => Component, @@ -958,35 +946,26 @@ where each user is an object with an `id` and a `username`: type User = { id: number; username: string; -} +}; ``` -The current list of users is represented by a behavior `users: -Behavior`. We want to display the users in a list with their username +The current list of users is represented by a behavior `users: Behavior`. We want to display the users in a list with their username being editable. This can be achieved with the list function. ```ts -list( - (user) => input({ value: user.username }), - users, - (user) => user.id -); +list((user) => input({ value: user.username }), users, (user) => user.id); ``` If the `users` behavior starts out with the value ```js -[ - { username: "foo", id: 1 }, - { username: "bar", id: 2 } -] +[{ username: "foo", id: 1 }, { username: "bar", id: 2 }]; ``` Then the component created by calling `list` will produce HTML like this ```html - - + ``` Now, if the value of `users` changes into diff --git a/examples/continuous-time/index.ts b/examples/continuous-time/index.ts index 84fa35d..0e4afca 100644 --- a/examples/continuous-time/index.ts +++ b/examples/continuous-time/index.ts @@ -1,7 +1,6 @@ import { Behavior, map, - sample, snapshot, stepper, Stream, @@ -28,8 +27,9 @@ const model = fgo(function*({ snapClick }: ViewOut) { (t) => "You last pressed the button at " + formatTime(t), snapshot(time, snapClick) ); - const message = yield sample( - stepper("You've not clicked the button yet", msgFromClick) + const message = yield stepper( + "You've not clicked the button yet", + msgFromClick ); return { time, message }; }); diff --git a/examples/counters/src/index.ts b/examples/counters/src/index.ts index 411b129..3aebebf 100644 --- a/examples/counters/src/index.ts +++ b/examples/counters/src/index.ts @@ -1,13 +1,6 @@ -import { Behavior, combine, sample, stepper, Stream } from "@funkia/hareactive"; +import { Behavior, combine, stepper, Stream } from "@funkia/hareactive"; import { go } from "@funkia/jabz"; -import { - Component, - dynamic, - elements, - fgo, - modelView, - runComponent -} from "../../../src"; +import { elements, fgo, modelView, runComponent } from "../../../src"; import { main1 } from "./version1"; import { main2 } from "./version2"; import { main3 } from "./version3"; @@ -45,7 +38,7 @@ type FromModel = { const versionSelector = modelView( fgo(function*({ selectVersion }) { - const selected = yield sample(stepper("1", selectVersion)); + const selected = yield stepper("1", selectVersion); return { selected }; }), ({ selected }) => @@ -64,7 +57,7 @@ const versionSelector = modelView( const main = go(function*() { const { selected } = yield versionSelector(); const currentApp = selected.map((n: AppId) => numberToApp[n]); - yield div(dynamic(currentApp)); + yield div(currentApp); return {}; }); diff --git a/examples/counters/src/version1.ts b/examples/counters/src/version1.ts index f3f9490..11f8c3f 100644 --- a/examples/counters/src/version1.ts +++ b/examples/counters/src/version1.ts @@ -1,6 +1,5 @@ -import { Stream } from "@funkia/hareactive"; -import { elements, Component } from "../../../src"; -const { br, div, button } = elements; +import { elements } from "../../../src"; +const { div, button } = elements; // Counter const counterView = div([ diff --git a/examples/counters/src/version2.ts b/examples/counters/src/version2.ts index deb9e74..ec00d36 100644 --- a/examples/counters/src/version2.ts +++ b/examples/counters/src/version2.ts @@ -1,6 +1,6 @@ -import { Behavior, sample, scan, Stream, combine } from "@funkia/hareactive"; -import { elements, modelView, Component, fgo } from "../../../src"; -const { br, div, button } = elements; +import { Behavior, accum, Stream, combine } from "@funkia/hareactive"; +import { elements, modelView, fgo } from "../../../src"; +const { div, button } = elements; type CounterModelInput = { incrementClick: Stream; @@ -18,7 +18,7 @@ const counterModel = fgo(function*({ const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); const changes = combine(increment, decrement); - const count = yield sample(scan((n, m) => n + m, 0, changes)); + const count = yield accum((n, m) => n + m, 0, changes); return { count }; }); diff --git a/examples/counters/src/version3.ts b/examples/counters/src/version3.ts index bc3e58c..1baad82 100644 --- a/examples/counters/src/version3.ts +++ b/examples/counters/src/version3.ts @@ -3,16 +3,16 @@ import { combine, map, Now, - sample, + accum, scan, - scanS, Stream } from "@funkia/hareactive"; + import { elements, fgo, list, ModelReturn, modelView } from "../../../src"; const { br, div, button, h1, ul } = elements; const add = (n: number, m: number) => n + m; -const apply = (f: (a: A) => A, a: A) => f(a); +const apply = (f: (a: A) => B, a: A) => f(a); type CounterModelInput = { incrementClick: Stream; @@ -33,7 +33,7 @@ const counterModel = fgo(function*({ }: CounterModelInput): ModelReturn { const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); - const count = yield sample(scan(add, 0, combine(increment, decrement))); + const count = yield accum(add, 0, combine(increment, decrement)); return { count }; }); @@ -67,14 +67,16 @@ const counterListModel = fgo(function*({ addCounter, listOut }: ModelInput): Iterator> { - const nextId: Stream = yield sample( - scanS(add, 2, addCounter.mapTo(1)) - ); + const nextId: Stream = yield scan(add, 2, addCounter.mapTo(1)); const appendCounterFn = map( (id) => (ids: number[]) => ids.concat([id]), nextId ); - const counterIds = yield sample(scan(apply, [0], appendCounterFn)); + const counterIds = yield accum<(a: number[]) => number[], number[]>( + apply, + [0], + appendCounterFn + ); return { counterIds }; }); diff --git a/examples/counters/src/version4.ts b/examples/counters/src/version4.ts index 753efdc..7cb374c 100644 --- a/examples/counters/src/version4.ts +++ b/examples/counters/src/version4.ts @@ -1,17 +1,17 @@ import { foldr, lift, flatten } from "@funkia/jabz"; import { Now, - sample, Behavior, scan, Stream, combine, map, - switchStream, - scanS + accum, + shiftCurrent, + empty } from "@funkia/hareactive"; -import { Component, modelView, list, elements, fgo } from "../../../src"; +import { modelView, list, elements, fgo } from "../../../src"; const { ul, li, p, br, button, h1 } = elements; const add = (n: number, m: number) => n + m; @@ -43,7 +43,7 @@ const counterModel = fgo(function*( const increment = incrementClick.mapTo(1); const decrement = decrementClick.mapTo(-1); const deleteS = deleteClick.mapTo(id); - const count = yield sample(scan(add, 0, combine(increment, decrement))); + const count = yield accum(add, 0, combine(increment, decrement)); return { count, deleteS }; }); @@ -82,8 +82,8 @@ const mainModel = fgo(function*({ addCounter, listOut }: ToModel): Iterator> { - const removeIdB = listOut.map( - (l) => console.log(l) || combine(...l.map((o) => o.deleteS)) + const removeIdB = listOut.map((l) => + l.length > 0 ? combine(...l.map((o) => o.deleteS)) : >empty ); const sum = >( flatten( @@ -98,15 +98,13 @@ const mainModel = fgo(function*({ ) ) ); - const removeCounterIdFn = switchStream(removeIdB).map( + const removeCounterIdFn = shiftCurrent(removeIdB).map( (id) => (arr: number[]) => arr.filter((i) => i !== id) ); - const nextId: Stream = yield sample( - scanS(add, 2, addCounter.mapTo(1)) - ); + const nextId: Stream = yield scan(add, 2, addCounter.mapTo(1)); const appendCounterFn = map((id) => (ids: Id[]) => ids.concat([id]), nextId); const modifications = combine(appendCounterFn, removeCounterIdFn); - const counterIds = yield sample(scan(apply, [0, 1, 2], modifications)); + const counterIds = yield accum(apply, [0, 1, 2], modifications); return { counterIds, sum }; }); diff --git a/examples/drag/src/index.ts b/examples/drag/src/index.ts index bb190d3..ea5b3fd 100644 --- a/examples/drag/src/index.ts +++ b/examples/drag/src/index.ts @@ -3,24 +3,24 @@ import { streamFromEvent, stepper, toggle, - sample, snapshot, switcher, Behavior, combine, - scan + lift, + runNow, + Stream, + accum } from "@funkia/hareactive"; -import { lift } from "@funkia/jabz"; import { runComponent, elements, go, fgo, modelView } from "../../../src"; const { div } = elements; type Point = { x: number; y: number }; const mousemove = streamFromEvent(window, "mousemove"); -const mousePosition = stepper( - { x: 0, y: 0 }, - mousemove.map((e) => ({ x: e.pageX, y: e.pageY })) -).at(); +const mousePosition = runNow( + stepper({ x: 0, y: 0 }, mousemove.map((e) => ({ x: e.pageX, y: e.pageY }))) +); const addPoint = (p1: Point, p2: Point) => ({ x: p1.x + p2.x, @@ -41,17 +41,17 @@ const boxModel = fgo(function*( (p) => map((p2) => ({ x: p2.x - p.x, y: p2.y - p.y }), mousePosition), startDragAt ); - const offset: Behavior = yield sample( - switcher( - Behavior.of({ x: 0, y: 0 }), - combine(dragOffset, endDrag.mapTo(Behavior.of({ x: 0, y: 0 }))) - ) + const offset: Behavior = yield switcher( + Behavior.of({ x: 0, y: 0 }), + combine(dragOffset, endDrag.mapTo(Behavior.of({ x: 0, y: 0 }))) ); - const committed = yield sample( - scan(addPoint, { x: 0, y: 0 }, snapshot(offset, endDrag)) + const committed: Behavior = yield accum( + addPoint, + { x: 0, y: 0 }, + snapshot(offset, endDrag) ); const position = lift(addPoint, committed, offset); - const isBeingDragged = yield sample(toggle(false, startDrag, endDrag)); + const isBeingDragged = yield toggle(false, startDrag, endDrag); return { isBeingDragged, position }; }); diff --git a/examples/fahrenheit-celsius/index.ts b/examples/fahrenheit-celsius/index.ts index adb32b1..072f98e 100644 --- a/examples/fahrenheit-celsius/index.ts +++ b/examples/fahrenheit-celsius/index.ts @@ -1,5 +1,5 @@ -import { Behavior, combine, sample, stepper, Stream } from "@funkia/hareactive"; -import { elements, fgo, modelView, runComponent, toComponent } from "../../src"; +import { Behavior, combine, stepper, Stream } from "@funkia/hareactive"; +import { elements, fgo, modelView, runComponent } from "../../src"; const { input, div, label } = elements; @@ -21,17 +21,13 @@ const parseNumbers = (s: Stream) => const model = fgo(function*({ fahrenChange, celsiusChange }: View) { const fahrenNrChange = parseNumbers(fahrenChange); const celsiusNrChange = parseNumbers(celsiusChange); - const celsius = yield sample( - stepper( - 0, - combine(celsiusNrChange, fahrenNrChange.map((f) => (f - 32) / 1.8)) - ) + const celsius = yield stepper( + 0, + combine(celsiusNrChange, fahrenNrChange.map((f) => (f - 32) / 1.8)) ); - const fahren = yield sample( - stepper( - 0, - combine(fahrenNrChange, celsiusNrChange.map((c) => (c * 9) / 5 + 32)) - ) + const fahren = yield stepper( + 0, + combine(fahrenNrChange, celsiusNrChange.map((c) => (c * 9) / 5 + 32)) ); return { celsius, fahren }; }); diff --git a/examples/package-lock.json b/examples/package-lock.json index be467ba..00ffa26 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -14,22 +14,22 @@ } }, "@babel/core": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.2.2.tgz", - "integrity": "sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz", + "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.3.4", "@babel/helpers": "^7.2.0", - "@babel/parser": "^7.2.2", + "@babel/parser": "^7.3.4", "@babel/template": "^7.2.2", - "@babel/traverse": "^7.2.2", - "@babel/types": "^7.2.2", + "@babel/traverse": "^7.3.4", + "@babel/types": "^7.3.4", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" @@ -53,14 +53,14 @@ } }, "@babel/generator": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.0.tgz", - "integrity": "sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", + "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", "dev": true, "requires": { - "@babel/types": "^7.3.0", + "@babel/types": "^7.3.4", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -233,15 +233,15 @@ } }, "@babel/helper-replace-supers": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.2.3.tgz", - "integrity": "sha512-GyieIznGUfPXPWu0yLS6U55Mz67AZD9cUk0BfirOWlPrXlBcan9Gz+vHGz+cPfuoweZSnPzPIm67VtQM0OWZbA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.3.4.tgz", + "integrity": "sha512-pvObL9WVf2ADs+ePg0jrqlhHoxRXlOa+SHRHzAXIz2xkYuOHfGl+fKxPMaS4Fq+uje8JQPobnertBBvyrWnQ1A==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.0.0", "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.2.3", - "@babel/types": "^7.0.0" + "@babel/traverse": "^7.3.4", + "@babel/types": "^7.3.4" } }, "@babel/helper-simple-access": { @@ -298,9 +298,9 @@ } }, "@babel/parser": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.1.tgz", - "integrity": "sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", + "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -325,9 +325,9 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.1.tgz", - "integrity": "sha512-Nmmv1+3LqxJu/V5jU9vJmxR/KIRWFk2qLHmbB56yRRRFhlaSuOVXscX3gUmhaKgUhzA3otOHVubbIEVYsZ0eZg==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.4.tgz", + "integrity": "sha512-j7VQmbbkA+qrzNqbKHrBsW3ddFnOeva6wzSe/zB7T+xaxGc+RCpwo44wCmRixAIGRoIpmVgvzFzNJqQcO3/9RA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -419,9 +419,9 @@ } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.2.0.tgz", - "integrity": "sha512-CEHzg4g5UraReozI9D4fblBYABs7IM6UerAVG7EJVrTLC5keh00aEuLUT+O40+mJCEzaXkYfTCUKIyeDfMOFFQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.3.4.tgz", + "integrity": "sha512-Y7nCzv2fw/jEZ9f678MuKdMo99MFDJMT/PvD9LisrR5JDFcJH6vYeH6RnjVt3p5tceyGRvTtEN0VOlU+rgHZjA==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.0.0", @@ -439,19 +439,19 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.2.0.tgz", - "integrity": "sha512-vDTgf19ZEV6mx35yiPJe4fS02mPQUUcBNwWQSZFXSzTSbsJFQvHt7DqyS3LK8oOWALFOsJ+8bbqBgkirZteD5Q==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.3.4.tgz", + "integrity": "sha512-blRr2O8IOZLAOJklXLV4WhcEzpYafYQKSGT3+R26lWG41u/FODJuBggehtOwilVAcFu393v3OFj+HmaE6tVjhA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "@babel/plugin-transform-classes": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz", - "integrity": "sha512-gEZvgTy1VtcDOaQty1l10T3jQmJKlNVxLDCs+3rCVPr6nMkODLELxViq5X9l+rfxbie3XrfrMCYYY6eX3aOcOQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.3.4.tgz", + "integrity": "sha512-J9fAvCFBkXEvBimgYxCjvaVDzL6thk0j0dBvCeZmIUDBwyt+nv6HfbImsSrWsYXfDNDivyANgJlFXDUWRTZBuA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.0.0", @@ -459,7 +459,7 @@ "@babel/helper-function-name": "^7.1.0", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.1.0", + "@babel/helper-replace-supers": "^7.3.4", "@babel/helper-split-export-declaration": "^7.0.0", "globals": "^11.1.0" } @@ -474,9 +474,9 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.2.0.tgz", - "integrity": "sha512-coVO2Ayv7g0qdDbrNiadE4bU7lvCd9H539m2gMknyVjjMdwF/iCOM7R+E8PkntoqLkltO0rk+3axhpp/0v68VQ==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.3.2.tgz", + "integrity": "sha512-Lrj/u53Ufqxl/sGxyjsJ2XNtNuEjDyjpqdhMNh5aZ+XFOdThL46KBj27Uem4ggoezSYBxKWAil6Hu8HtwqesYw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0" @@ -513,9 +513,9 @@ } }, "@babel/plugin-transform-flow-strip-types": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.2.3.tgz", - "integrity": "sha512-xnt7UIk9GYZRitqCnsVMjQK1O2eKZwFB3CvvHjf5SGx6K6vr/MScCKQDnf1DxRaj501e3pXjti+inbSXX2ZUoQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.3.4.tgz", + "integrity": "sha512-PmQC9R7DwpBFA+7ATKMyzViz3zCaMNouzZMPZN2K5PnbBbtL3AXFYTkDk+Hey5crQq2A90UG5Uthz0mel+XZrA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -572,9 +572,9 @@ } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.2.0.tgz", - "integrity": "sha512-aYJwpAhoK9a+1+O625WIjvMY11wkB/ok0WClVwmeo3mCjcNRjt+/8gHWrB5i+00mUju0gWsBkQnPpdvQ7PImmQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.3.4.tgz", + "integrity": "sha512-VZ4+jlGOF36S7TjKs8g4ojp4MEI+ebCQZdswWb/T9I4X84j8OtFAyjXjt/M16iIm5RIZn0UMQgg/VgIwo/87vw==", "dev": true, "requires": { "@babel/helper-hoist-variables": "^7.0.0", @@ -620,9 +620,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.2.0.tgz", - "integrity": "sha512-kB9+hhUidIgUoBQ0MsxMewhzr8i60nMa2KgeJKQWYrqQpqcBYtnpR+JgkadZVZoaEZ/eKu9mclFaVwhRpLNSzA==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.3.3.tgz", + "integrity": "sha512-IrIP25VvXWu/VlBWTpsjGptpomtIkYrN/3aDp4UKm7xK6UxZY88kcJ1UwETbzHAlwN21MnNfwlar0u8y3KpiXw==", "dev": true, "requires": { "@babel/helper-call-delegate": "^7.1.0", @@ -642,12 +642,12 @@ } }, "@babel/plugin-transform-regenerator": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz", - "integrity": "sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.3.4.tgz", + "integrity": "sha512-hvJg8EReQvXT6G9H2MvNPXkv9zK36Vxa1+csAVTpE1J3j0zlHplw76uudEbJxgvqZzAq9Yh45FLD4pk5mKRFQA==", "dev": true, "requires": { - "regenerator-transform": "^0.13.3" + "regenerator-transform": "^0.13.4" } }, "@babel/plugin-transform-shorthand-properties": { @@ -709,16 +709,16 @@ } }, "@babel/preset-env": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.1.tgz", - "integrity": "sha512-FHKrD6Dxf30e8xgHQO0zJZpUPfVZg+Xwgz5/RdSWCbza9QLNk4Qbp40ctRoqDxml3O8RMzB1DU55SXeDG6PqHQ==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.4.tgz", + "integrity": "sha512-2mwqfYMK8weA0g0uBKOt4FE3iEodiHy9/CW0b+nWXcbL+pGzLx8ESYc+j9IIxr6LTDHWKgPm71i9smo02bw+gA==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.3.1", + "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", "@babel/plugin-syntax-async-generators": "^7.2.0", @@ -726,10 +726,10 @@ "@babel/plugin-syntax-object-rest-spread": "^7.2.0", "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.2.0", + "@babel/plugin-transform-async-to-generator": "^7.3.4", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.2.0", - "@babel/plugin-transform-classes": "^7.2.0", + "@babel/plugin-transform-block-scoping": "^7.3.4", + "@babel/plugin-transform-classes": "^7.3.4", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.2.0", "@babel/plugin-transform-dotall-regex": "^7.2.0", @@ -740,13 +740,13 @@ "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.2.0", "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/plugin-transform-modules-systemjs": "^7.2.0", + "@babel/plugin-transform-modules-systemjs": "^7.3.4", "@babel/plugin-transform-modules-umd": "^7.2.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0", "@babel/plugin-transform-new-target": "^7.0.0", "@babel/plugin-transform-object-super": "^7.2.0", "@babel/plugin-transform-parameters": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.0.0", + "@babel/plugin-transform-regenerator": "^7.3.4", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.2.0", "@babel/plugin-transform-sticky-regex": "^7.2.0", @@ -760,9 +760,9 @@ } }, "@babel/runtime": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.1.tgz", - "integrity": "sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", + "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", "dev": true, "requires": { "regenerator-runtime": "^0.12.0" @@ -780,37 +780,37 @@ } }, "@babel/traverse": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", - "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", + "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.3.4", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.2.3", - "@babel/types": "^7.2.2", + "@babel/parser": "^7.3.4", + "@babel/types": "^7.3.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "@babel/types": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.0.tgz", - "integrity": "sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw==", + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", + "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" } }, "@funkia/hareactive": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@funkia/hareactive/-/hareactive-0.2.4.tgz", - "integrity": "sha512-UrVhrmD2TnXQ/Si/S749QMrmB40wibArx5Q4jPRn5t2R79Oj/wF6RvyOkFntm0g7Fjn01f0PDmVI3QCY6XVQ5g==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@funkia/hareactive/-/hareactive-0.3.1.tgz", + "integrity": "sha512-wcNLNF4uF8hDFzo1vXNo6Zyx0ADbywWLKCxLDUnmcdPuaxdY9fy2a4TGeQIKLW+gDjhRM5aF+43zrF5q3sNLbQ==", "requires": { "@funkia/jabz": "0.0.24", "tslib": "^1.9.3" @@ -835,9 +835,9 @@ } }, "@funkia/rudolph": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@funkia/rudolph/-/rudolph-0.0.6.tgz", - "integrity": "sha512-C7LKNk/2HwiEIfN1Tlla1XWZwh1Qqx/QpW0hPUt94UrrFFnpEriCGGsSm7/qGJJUfRWXU43kA5oNEcwqfuR3+w==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@funkia/rudolph/-/rudolph-0.0.7.tgz", + "integrity": "sha512-QPDt+vFl6ltSWDuSXDwLWJx7kMYPcZ3VzaBGyDWfhrfWx97sWpcZNrBOGosLZXhJF4FYanKL8KaDCDbqGXIU7A==", "requires": { "@funkia/io": "0.0.3" } @@ -851,9 +851,9 @@ } }, "@iarna/toml": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.1.tgz", - "integrity": "sha512-I2EjI9TbEFJNLziNPFfpo64PNanOaK17iL2kTW/jGlGOa4bvHw4VEied83kOEB7NJjXf1KfvmsQ2aEjy3xjiGg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.3.tgz", + "integrity": "sha512-FmuxfCuolpLl0AnQ2NHSzoUKWEJDFl63qXjzdoWBVyFCXzMGm1spBzk7LeHNoVCiWCF7mRVms9e6jEV9+MoPbg==", "dev": true }, "@mrmlnc/readdir-enhanced": { @@ -923,9 +923,9 @@ } }, "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "version": "10.12.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.27.tgz", + "integrity": "sha512-e9wgeY6gaY21on3ve0xAjgBVjGDWq/xUteK0ujsE53bUoxycMkqfnkUgMt6ffZtykZ5X12Mg3T7Pw4TRCObDKg==", "dev": true }, "@types/q": { @@ -990,6 +990,17 @@ "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "argparse": { @@ -1304,9 +1315,9 @@ "dev": true }, "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz", + "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==", "dev": true }, "bindings": { @@ -1464,14 +1475,14 @@ } }, "browserslist": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.1.tgz", - "integrity": "sha512-pEBxEXg7JwaakBXjATYw/D1YZh4QUSCX/Mnd/wnqSRPPSi1U39iDhDoKGoBUcraKdxDlrYqJxSI5nNvD+dWP2A==", + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz", + "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30000929", - "electron-to-chromium": "^1.3.103", - "node-releases": "^1.1.3" + "caniuse-lite": "^1.0.30000939", + "electron-to-chromium": "^1.3.113", + "node-releases": "^1.1.8" } }, "buffer": { @@ -1556,12 +1567,6 @@ "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, "caniuse-api": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", @@ -1575,15 +1580,15 @@ } }, "caniuse-db": { - "version": "1.0.30000932", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000932.tgz", - "integrity": "sha512-nc4jIhwpajQCvADmBo3F1fj8ySvE2+dw0lXAmYmtYJi1l7CvfdZVTkrwD60SrQHDC1mddgYtLyAcwrtYVtiMSQ==", + "version": "1.0.30000939", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000939.tgz", + "integrity": "sha512-nB5tLf3hOs+biXl1lhKjHRgNC0J1I7H52h/t1FP7qxARKKwpB0z+P/JewJLYAlxCBP/q7rxJzQzHHrQMl0viKg==", "dev": true }, "caniuse-lite": { - "version": "1.0.30000932", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000932.tgz", - "integrity": "sha512-4bghJFItvzz8m0T3lLZbacmEY9X1Z2AtIzTr7s7byqZIOumASfr4ynDx7rtm0J85nDmx8vsgR6vnaSoeU8Oh0A==", + "version": "1.0.30000939", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000939.tgz", + "integrity": "sha512-oXB23ImDJOgQpGjRv1tCtzAvJr4/OvrHi5SO2vUgB0g0xpdZZoA/BxfImiWfdwoYdUTtQrPsXsvYU/dmCSM8gg==", "dev": true }, "chalk": { @@ -1598,24 +1603,23 @@ } }, "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz", + "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", "dev": true, "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", - "inherits": "^2.0.1", + "inherits": "^2.0.3", "is-binary-path": "^1.0.0", "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", + "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" + "readdirp": "^2.2.1", + "upath": "^1.1.0" } }, "cipher-base": { @@ -1717,28 +1721,6 @@ "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "dev": true }, - "cli-table3": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", - "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", - "dev": true, - "requires": { - "colors": "^1.1.2", - "object-assign": "^4.1.0", - "string-width": "^2.1.1" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, "clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", @@ -1762,12 +1744,6 @@ "q": "^1.1.2" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -1853,9 +1829,9 @@ } }, "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, "command-exists": { @@ -1935,9 +1911,9 @@ "dev": true }, "core-js": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", - "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", "dev": true }, "core-util-is": { @@ -1947,14 +1923,15 @@ "dev": true }, "cosmiconfig": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.7.tgz", - "integrity": "sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz", + "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==", "dev": true, "requires": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", "js-yaml": "^3.9.0", + "lodash.get": "^4.4.2", "parse-json": "^4.0.0" } }, @@ -2092,9 +2069,9 @@ "dev": true }, "css-what": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.2.tgz", - "integrity": "sha512-wan8dMWQ0GUeF7DGEPVjhHemVW/vy6xUYmFzRY8RYqgA0JtXC9rJmbScBjqSu6dg9q0lwPQy6ZAmJVr3PPTvqQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, "cssesc": { @@ -2104,52 +2081,52 @@ "dev": true }, "cssnano": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.8.tgz", - "integrity": "sha512-5GIY0VzAHORpbKiL3rMXp4w4M1Ki+XlXgEXyuWXVd3h6hlASb+9Vo76dNP56/elLMVBBsUfusCo1q56uW0UWig==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", + "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==", "dev": true, "requires": { "cosmiconfig": "^5.0.0", - "cssnano-preset-default": "^4.0.6", + "cssnano-preset-default": "^4.0.7", "is-resolvable": "^1.0.0", "postcss": "^7.0.0" } }, "cssnano-preset-default": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.6.tgz", - "integrity": "sha512-UPboYbFaJFtDUhJ4fqctThWbbyF4q01/7UhsZbLzp35l+nUxtzh1SifoVlEfyLM3n3Z0htd8B1YlCxy9i+bQvg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz", + "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==", "dev": true, "requires": { "css-declaration-sorter": "^4.0.1", "cssnano-util-raw-cache": "^4.0.1", "postcss": "^7.0.0", - "postcss-calc": "^7.0.0", - "postcss-colormin": "^4.0.2", + "postcss-calc": "^7.0.1", + "postcss-colormin": "^4.0.3", "postcss-convert-values": "^4.0.1", - "postcss-discard-comments": "^4.0.1", + "postcss-discard-comments": "^4.0.2", "postcss-discard-duplicates": "^4.0.2", "postcss-discard-empty": "^4.0.1", "postcss-discard-overridden": "^4.0.1", - "postcss-merge-longhand": "^4.0.10", - "postcss-merge-rules": "^4.0.2", + "postcss-merge-longhand": "^4.0.11", + "postcss-merge-rules": "^4.0.3", "postcss-minify-font-values": "^4.0.2", - "postcss-minify-gradients": "^4.0.1", - "postcss-minify-params": "^4.0.1", - "postcss-minify-selectors": "^4.0.1", + "postcss-minify-gradients": "^4.0.2", + "postcss-minify-params": "^4.0.2", + "postcss-minify-selectors": "^4.0.2", "postcss-normalize-charset": "^4.0.1", - "postcss-normalize-display-values": "^4.0.1", - "postcss-normalize-positions": "^4.0.1", - "postcss-normalize-repeat-style": "^4.0.1", - "postcss-normalize-string": "^4.0.1", - "postcss-normalize-timing-functions": "^4.0.1", + "postcss-normalize-display-values": "^4.0.2", + "postcss-normalize-positions": "^4.0.2", + "postcss-normalize-repeat-style": "^4.0.2", + "postcss-normalize-string": "^4.0.2", + "postcss-normalize-timing-functions": "^4.0.2", "postcss-normalize-unicode": "^4.0.1", "postcss-normalize-url": "^4.0.1", - "postcss-normalize-whitespace": "^4.0.1", - "postcss-ordered-values": "^4.1.1", - "postcss-reduce-initial": "^4.0.2", - "postcss-reduce-transforms": "^4.0.1", - "postcss-svgo": "^4.0.1", + "postcss-normalize-whitespace": "^4.0.2", + "postcss-ordered-values": "^4.1.2", + "postcss-reduce-initial": "^4.0.3", + "postcss-reduce-transforms": "^4.0.2", + "postcss-svgo": "^4.0.2", "postcss-unique-selectors": "^4.0.1" } }, @@ -2357,21 +2334,13 @@ } }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", "dev": true, "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } + "domelementtype": "^1.3.0", + "entities": "^1.1.1" } }, "domain-browser": { @@ -2456,9 +2425,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.108", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.108.tgz", - "integrity": "sha512-/QI4hMpAh48a1Sea6PALGv+kuVne9A2EWGd8HrWHMdYhIzGtbhVVHh6heL5fAzGaDnZuPyrlWJRl8WPm4RyiQQ==", + "version": "1.3.113", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.113.tgz", + "integrity": "sha512-De+lPAxEcpxvqPTyZAXELNpRZXABRxf+uL/rSykstQhzj/B0l1150G/ExIIxKc16lI89Hgz81J0BHAcbTqK49g==", "dev": true }, "elliptic": { @@ -2587,34 +2556,6 @@ "safe-buffer": "^5.1.1" } }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - } - } - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -2820,15 +2761,6 @@ } } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, "flatten": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", @@ -3403,24 +3335,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, "get-port": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", "dev": true }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -3469,9 +3389,9 @@ "dev": true }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "graceful-fs": { @@ -3693,12 +3613,6 @@ "q": "^1.1.2" } }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - }, "cssnano": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", @@ -4068,17 +3982,17 @@ } }, "htmlparser2": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", - "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", "dev": true, "requires": { - "domelementtype": "^1.3.0", + "domelementtype": "^1.3.1", "domhandler": "^2.3.0", "domutils": "^1.5.1", "entities": "^1.1.1", "inherits": "^2.0.1", - "readable-stream": "^3.0.6" + "readable-stream": "^3.1.1" }, "dependencies": { "readable-stream": { @@ -4171,12 +4085,6 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, "is-absolute-url": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", @@ -4307,12 +4215,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "is-glob": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", @@ -4378,12 +4280,6 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, "is-svg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", @@ -4514,15 +4410,6 @@ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -4533,16 +4420,6 @@ "type-check": "~0.3.2" } }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -4555,10 +4432,10 @@ "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=", "dev": true }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, "lodash.memoize": { @@ -4648,15 +4525,6 @@ "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", "dev": true }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, "merge-source-map": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", @@ -4870,9 +4738,9 @@ } }, "node-releases": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.3.tgz", - "integrity": "sha512-6VrvH7z6jqqNFY200kdB6HdzkgM96Oaj9v3dqGfgp6mF+cHmU4wyQKZ2/WPDRVoR0Jz9KqbamaBN0ZhdUaysUQ==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.8.tgz", + "integrity": "sha512-gQm+K9mGCiT/NXHy+V/ZZS1N/LOaGGqRAAJJs3X9Ah1g+CIbRcBgNyoNYQ+SEtcyAtB9KqDruu+fF7nWjsqRaA==", "dev": true, "requires": { "semver": "^5.3.0" @@ -4889,13 +4757,10 @@ } }, "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true }, "normalize-range": { "version": "0.1.2", @@ -4909,15 +4774,6 @@ "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", "dev": true }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -4933,12 +4789,6 @@ "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", "dev": true }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -4983,9 +4833,9 @@ "dev": true }, "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", "dev": true }, "object-visit": { @@ -5104,17 +4954,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -5131,36 +4970,6 @@ "os-tmpdir": "^1.0.0" } }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, "pako": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", @@ -5232,9 +5041,9 @@ } }, "parse-asn1": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.3.tgz", - "integrity": "sha512-VrPoetlz7B/FqjBLD2f5wBVZvsZVLnRUrxVLfRYhGXCODa/NWE4p3Wp+6+aV3ZPL3KM7/OZmxDIwwijD7yuucg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", "dev": true, "requires": { "asn1.js": "^4.0.0", @@ -5279,12 +5088,6 @@ "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -5363,9 +5166,9 @@ } }, "postcss-colormin": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.2.tgz", - "integrity": "sha512-1QJc2coIehnVFsz0otges8kQLsryi4lo19WD+U5xCWvXd0uw/Z+KKYnbiNDCnO9GP+PvErPHCG0jNvWTngk9Rw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz", + "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==", "dev": true, "requires": { "browserslist": "^4.0.0", @@ -5386,9 +5189,9 @@ } }, "postcss-discard-comments": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.1.tgz", - "integrity": "sha512-Ay+rZu1Sz6g8IdzRjUgG2NafSNpp2MSMOQUb+9kkzzzP+kh07fP0yNbhtFejURnyVXSX3FYy2nVNW1QTnNjgBQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz", + "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==", "dev": true, "requires": { "postcss": "^7.0.0" @@ -5683,9 +5486,9 @@ } }, "postcss-merge-longhand": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.10.tgz", - "integrity": "sha512-hME10s6CSjm9nlVIcO1ukR7Jr5RisTaaC1y83jWCivpuBtPohA3pZE7cGTIVSYjXvLnXozHTiVOkG4dnnl756g==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz", + "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==", "dev": true, "requires": { "css-color-names": "0.0.4", @@ -5695,9 +5498,9 @@ } }, "postcss-merge-rules": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.2.tgz", - "integrity": "sha512-UiuXwCCJtQy9tAIxsnurfF0mrNHKc4NnNx6NxqmzNNjXpQwLSukUxELHTRF0Rg1pAmcoKLih8PwvZbiordchag==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz", + "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==", "dev": true, "requires": { "browserslist": "^4.0.0", @@ -5738,9 +5541,9 @@ } }, "postcss-minify-gradients": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.1.tgz", - "integrity": "sha512-pySEW3E6Ly5mHm18rekbWiAjVi/Wj8KKt2vwSfVFAWdW6wOIekgqxKxLU7vJfb107o3FDNPkaYFCxGAJBFyogA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz", + "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==", "dev": true, "requires": { "cssnano-util-get-arguments": "^4.0.0", @@ -5750,9 +5553,9 @@ } }, "postcss-minify-params": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.1.tgz", - "integrity": "sha512-h4W0FEMEzBLxpxIVelRtMheskOKKp52ND6rJv+nBS33G1twu2tCyurYj/YtgU76+UDCvWeNs0hs8HFAWE2OUFg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz", + "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==", "dev": true, "requires": { "alphanum-sort": "^1.0.0", @@ -5764,9 +5567,9 @@ } }, "postcss-minify-selectors": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.1.tgz", - "integrity": "sha512-8+plQkomve3G+CodLCgbhAKrb5lekAnLYuL1d7Nz+/7RANpBEVdgBkPNwljfSKvZ9xkkZTZITd04KP+zeJTJqg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz", + "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==", "dev": true, "requires": { "alphanum-sort": "^1.0.0", @@ -5798,9 +5601,9 @@ } }, "postcss-normalize-display-values": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.1.tgz", - "integrity": "sha512-R5mC4vaDdvsrku96yXP7zak+O3Mm9Y8IslUobk7IMP+u/g+lXvcN4jngmHY5zeJnrQvE13dfAg5ViU05ZFDwdg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz", + "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==", "dev": true, "requires": { "cssnano-util-get-match": "^4.0.0", @@ -5809,9 +5612,9 @@ } }, "postcss-normalize-positions": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.1.tgz", - "integrity": "sha512-GNoOaLRBM0gvH+ZRb2vKCIujzz4aclli64MBwDuYGU2EY53LwiP7MxOZGE46UGtotrSnmarPPZ69l2S/uxdaWA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz", + "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==", "dev": true, "requires": { "cssnano-util-get-arguments": "^4.0.0", @@ -5821,9 +5624,9 @@ } }, "postcss-normalize-repeat-style": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.1.tgz", - "integrity": "sha512-fFHPGIjBUyUiswY2rd9rsFcC0t3oRta4wxE1h3lpwfQZwFeFjXFSiDtdJ7APCmHQOnUZnqYBADNRPKPwFAONgA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz", + "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==", "dev": true, "requires": { "cssnano-util-get-arguments": "^4.0.0", @@ -5833,9 +5636,9 @@ } }, "postcss-normalize-string": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.1.tgz", - "integrity": "sha512-IJoexFTkAvAq5UZVxWXAGE0yLoNN/012v7TQh5nDo6imZJl2Fwgbhy3J2qnIoaDBrtUP0H7JrXlX1jjn2YcvCQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz", + "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==", "dev": true, "requires": { "has": "^1.0.0", @@ -5844,9 +5647,9 @@ } }, "postcss-normalize-timing-functions": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.1.tgz", - "integrity": "sha512-1nOtk7ze36+63ONWD8RCaRDYsnzorrj+Q6fxkQV+mlY5+471Qx9kspqv0O/qQNMeApg8KNrRf496zHwJ3tBZ7w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz", + "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==", "dev": true, "requires": { "cssnano-util-get-match": "^4.0.0", @@ -5878,9 +5681,9 @@ } }, "postcss-normalize-whitespace": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.1.tgz", - "integrity": "sha512-U8MBODMB2L+nStzOk6VvWWjZgi5kQNShCyjRhMT3s+W9Jw93yIjOnrEkKYD3Ul7ChWbEcjDWmXq0qOL9MIAnAw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz", + "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==", "dev": true, "requires": { "postcss": "^7.0.0", @@ -5888,9 +5691,9 @@ } }, "postcss-ordered-values": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.1.tgz", - "integrity": "sha512-PeJiLgJWPzkVF8JuKSBcylaU+hDJ/TX3zqAMIjlghgn1JBi6QwQaDZoDIlqWRcCAI8SxKrt3FCPSRmOgKRB97Q==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz", + "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==", "dev": true, "requires": { "cssnano-util-get-arguments": "^4.0.0", @@ -5986,9 +5789,9 @@ } }, "postcss-reduce-initial": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.2.tgz", - "integrity": "sha512-epUiC39NonKUKG+P3eAOKKZtm5OtAtQJL7Ye0CBN1f+UQTHzqotudp+hki7zxXm7tT0ZAKDMBj1uihpPjP25ug==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz", + "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==", "dev": true, "requires": { "browserslist": "^4.0.0", @@ -5998,9 +5801,9 @@ } }, "postcss-reduce-transforms": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.1.tgz", - "integrity": "sha512-sZVr3QlGs0pjh6JAIe6DzWvBaqYw05V1t3d9Tp+VnFRT5j+rsqoWsysh/iSD7YNsULjq9IAylCznIwVd5oU/zA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz", + "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==", "dev": true, "requires": { "cssnano-util-get-match": "^4.0.0", @@ -6021,9 +5824,9 @@ } }, "postcss-svgo": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.1.tgz", - "integrity": "sha512-YD5uIk5NDRySy0hcI+ZJHwqemv2WiqqzDgtvgMzO8EGSkK5aONyX8HMVFRFJSdO8wUWTuisUFn/d7yRRbBr5Qw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz", + "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==", "dev": true, "requires": { "is-svg": "^3.0.0", @@ -6199,9 +6002,9 @@ "dev": true }, "prettier": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.1.tgz", - "integrity": "sha512-XXUITwIkGb3CPJ2hforHah/zTINRyie5006Jd2HKy2qz7snEJXl0KLfsJZW/wst9g6R2rFvqba3VpNYdu1hDcA==" + "version": "1.16.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", + "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==" }, "private": { "version": "0.1.8", @@ -6293,9 +6096,9 @@ } }, "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" @@ -6401,9 +6204,9 @@ "dev": true }, "regenerator-transform": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.3.tgz", - "integrity": "sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA==", + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", "dev": true, "requires": { "private": "^0.1.6" @@ -6420,15 +6223,10 @@ } }, "regexp-tree": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.0.tgz", - "integrity": "sha512-rHQv+tzu+0l3KS/ERabas1yK49ahNVxuH40WcPg53CzP5p8TgmmyBgHELLyJcvjhTD0e5ahSY6C76LbEVtr7cg==", - "dev": true, - "requires": { - "cli-table3": "^0.5.0", - "colors": "^1.1.2", - "yargs": "^10.0.3" - } + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.5.tgz", + "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==", + "dev": true }, "regexpu-core": { "version": "4.4.0", @@ -6485,18 +6283,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -6661,12 +6447,6 @@ "send": "0.16.2" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -6956,9 +6736,9 @@ "dev": true }, "static-eval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz", - "integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", "dev": true, "requires": { "escodegen": "^1.8.1" @@ -7042,16 +6822,6 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -7070,16 +6840,10 @@ "ansi-regex": "^3.0.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, "stylehacks": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.1.tgz", - "integrity": "sha512-TK5zEPeD9NyC1uPIdjikzsgWxdQQN/ry1X3d1iOz1UkYDCmcr928gWD1KHgyC27F50UnE0xCTrBOO1l6KR8M4w==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", + "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==", "dev": true, "requires": { "browserslist": "^4.0.0", @@ -7110,44 +6874,36 @@ } }, "svgo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.1.1.tgz", - "integrity": "sha512-GBkJbnTuFpM4jFbiERHDWhZc/S/kpHToqmZag3aEBjPYK44JAN2QBjvrGIxLOoCyMZjuFQIfTO2eJd8uwLY/9g==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.0.tgz", + "integrity": "sha512-xBfxJxfk4UeVN8asec9jNxHiv3UAMv/ujwBWGYvQhhMb2u3YTGKkiybPcLFDLq7GLLWE9wa73e0/m8L5nTzQbw==", "dev": true, "requires": { - "coa": "~2.0.1", - "colors": "~1.1.2", + "chalk": "^2.4.1", + "coa": "^2.0.2", "css-select": "^2.0.0", - "css-select-base-adapter": "~0.1.0", + "css-select-base-adapter": "^0.1.1", "css-tree": "1.0.0-alpha.28", "css-url-regex": "^1.1.0", - "csso": "^3.5.0", + "csso": "^3.5.1", "js-yaml": "^3.12.0", "mkdirp": "~0.5.1", - "object.values": "^1.0.4", + "object.values": "^1.1.0", "sax": "~1.2.4", - "stable": "~0.1.6", + "stable": "^0.1.8", "unquote": "~1.1.1", "util.promisify": "~1.0.0" - }, - "dependencies": { - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true - } } }, "terser": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.14.1.tgz", - "integrity": "sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw==", + "version": "3.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.16.1.tgz", + "integrity": "sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow==", "dev": true, "requires": { "commander": "~2.17.1", "source-map": "~0.6.1", - "source-map-support": "~0.5.6" + "source-map-support": "~0.5.9" }, "dependencies": { "commander": { @@ -7244,9 +7000,9 @@ } }, "todomvc-app-css": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/todomvc-app-css/-/todomvc-app-css-2.1.2.tgz", - "integrity": "sha512-WgXLWY4snfC7yBkpzFb6xRmUbB06NGuji6njCByte0byW2DUpmyhh32o4sCQ8HX/pTwm71huKQlFiKYxR/2iVQ==" + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/todomvc-app-css/-/todomvc-app-css-2.2.0.tgz", + "integrity": "sha512-H03oc3QOxiGXv+MqnotcduZIwoGX8A8QbSx9J4U2Z5R96LrK+dvQmRDTgeCc0nlkPBhd3nUL4EbfS7l0TccM5g==" }, "trim-right": { "version": "1.0.1", @@ -7523,65 +7279,12 @@ "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -7603,46 +7306,11 @@ "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true - }, - "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", - "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^8.1.0" - } - }, - "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } } } } diff --git a/examples/package.json b/examples/package.json index d96bece..f2cb2bf 100644 --- a/examples/package.json +++ b/examples/package.json @@ -16,10 +16,9 @@ "author": "Funkia", "license": "MIT", "dependencies": { - "@funkia/hareactive": "^0.2.4", - "@funkia/rudolph": "0.0.6", - "@funkia/turbine": "^0.2.0", - "todomvc-app-css": "^2.1.2" + "@funkia/hareactive": "^0.3.1", + "@funkia/rudolph": "0.0.7", + "todomvc-app-css": "^2.2.0" }, "devDependencies": { "parcel-bundler": "^1.11.0" diff --git a/examples/todo/src/Item.ts b/examples/todo/src/Item.ts index 26b56b8..5735882 100644 --- a/examples/todo/src/Item.ts +++ b/examples/todo/src/Item.ts @@ -1,4 +1,4 @@ -import { combine, fromMaybe, lift, map, Maybe, fgo } from "@funkia/jabz"; +import { combine } from "@funkia/jabz"; import { Behavior, changes, @@ -10,12 +10,12 @@ import { snapshot, stepper, Stream, - switcher, + lift, toggle } from "@funkia/hareactive"; import { Router, routePath } from "@funkia/rudolph"; -import { modelView, elements } from "../../../src"; +import { modelView, elements, fgo } from "../../../src"; const { div, li, input, label, button, checkbox } = elements; import { setItemIO, itemBehavior, removeItemIO } from "./localstorage"; @@ -82,22 +82,20 @@ const itemModel = fgo(function*( { toggleAll, name: initialName, id, router }: Input ): any { const enterPress = filter(isKey(enter), nameKeyup); - const enterNotPressed = yield sample(toggle(true, startEditing, enterPress)); + const enterNotPressed = yield toggle(true, startEditing, enterPress); const cancel = filter(isKey(esc), nameKeyup); - const notCancelled = yield sample(toggle(true, startEditing, cancel)); + const notCancelled = yield toggle(true, startEditing, cancel); const stopEditing = combine( enterPress, keepWhen(nameBlur, enterNotPressed), cancel ); - const isEditing = yield sample(toggle(false, startEditing, stopEditing)); - const newName = yield sample( - stepper( - initialName, - combine( - newNameInput.map((ev) => ev.target.value), - snapshot(taskName, cancel) - ) + const isEditing = yield toggle(false, startEditing, stopEditing); + const newName = yield stepper( + initialName, + combine( + newNameInput.map((ev) => ev.target.value), + snapshot(taskName, cancel) ) ); const nameChange = snapshot(newName, keepWhen(stopEditing, notCancelled)); @@ -111,9 +109,13 @@ const itemModel = fgo(function*( : savedItem; // Initialize task to restored values - const taskName_ = yield sample(stepper(initial.taskName, nameChange)); - const isComplete: Behavior = yield sample( - stepper(initial.isComplete, combine(toggleTodo, toggleAll)) + const taskName_: Behavior = yield stepper( + initial.taskName, + nameChange + ); + const isComplete: Behavior = yield stepper( + initial.isComplete, + combine(toggleTodo, toggleAll) ); // Persist todo item diff --git a/examples/todo/src/TodoApp.ts b/examples/todo/src/TodoApp.ts index a4a66c1..0840f62 100644 --- a/examples/todo/src/TodoApp.ts +++ b/examples/todo/src/TodoApp.ts @@ -1,16 +1,17 @@ -import { lift, fgo, sequence, IO } from "@funkia/jabz"; +import { fgo, sequence, IO, combine } from "@funkia/jabz"; import { Behavior, sample, snapshot, Stream, - switchStream, - combine, performStream, changes, + lift, snapshotWith, - scanCombine, - moment + accumCombine, + moment, + shiftCurrent, + empty } from "@funkia/hareactive"; import { modelView, elements, list, output } from "../../../src"; const { h1, p, header, footer, section, checkbox, ul, label } = elements; @@ -67,18 +68,15 @@ function listModel({ itemToKey, initial }: ListModel) { - return sample( - scanCombine( + return accumCombine( + [ + [prependItemS, (item, list) => [item].concat(list)], [ - [prependItemS, (item, list) => [item].concat(list)], - [ - removeKeyListS, - (keys, list) => - list.filter((item) => !includes(itemToKey(item), keys)) - ] - ], - initial - ) + removeKeyListS, + (keys, list) => list.filter((item) => !includes(itemToKey(item), keys)) + ] + ], + initial ); } @@ -88,22 +86,22 @@ function* model({ addItem, toggleAll, clearCompleted, itemOutputs }: FromView) { ); const newTodoS = snapshotWith((name, id) => ({ name, id }), nextId, addItem); - const deleteS = switchStream( - itemOutputs.map((list) => combine(...list.map((o) => o.destroyItemId))) + const deleteS = shiftCurrent( + itemOutputs.map((list) => + list.length > 0 ? combine(...list.map((o) => o.destroyItemId)) : empty + ) ); const completedIds = getCompletedIds(itemOutputs); const savedTodoName: ItemParams[] = yield sample(todoListStorage); const restoredTodoName = savedTodoName === null ? [] : savedTodoName; - const getItemId = ({ id }: ItemParams) => id; - const clearCompletedIdS = snapshot(completedIds, clearCompleted); const removeListS = combine(deleteS.map((a) => [a]), clearCompletedIdS); - const todoNames = yield listModel({ + const todoNames = yield listModel<{ id: number; name: string }, number>({ prependItemS: newTodoS, removeKeyListS: removeListS, - itemToKey: getItemId, + itemToKey: ({ id }) => id, initial: restoredTodoName }); @@ -166,8 +164,7 @@ function view( { completed: "completed", destroyItemId: "destroyItemId", - id: "id", - completed: "completed" + id: "id" }, item({ toggleAll, router, ...n }) ), diff --git a/examples/todo/src/TodoFooter.ts b/examples/todo/src/TodoFooter.ts index 01428cc..f73a9ef 100644 --- a/examples/todo/src/TodoFooter.ts +++ b/examples/todo/src/TodoFooter.ts @@ -2,7 +2,6 @@ import { Behavior, Stream, moment, combine } from "@funkia/hareactive"; import { Component, elements, modelView, fgo } from "../../../src"; const { span, button, ul, li, a, footer, strong } = elements; import { navigate, Router } from "@funkia/rudolph"; -import { get } from "../../../src/utils"; // import {mapTraverseFlat} from "./TodoApp"; import { Output as ItemOut } from "./Item"; @@ -48,7 +47,7 @@ const model = function*( filterBtnCompleted, clearCompleted }: FromView, - { router } + { router }: { router: Router } ) { const navs = combine( filterBtnAll.mapTo("all"), diff --git a/examples/todo/src/TodoInput.ts b/examples/todo/src/TodoInput.ts index b02ab2a..c87a30c 100644 --- a/examples/todo/src/TodoInput.ts +++ b/examples/todo/src/TodoInput.ts @@ -4,8 +4,7 @@ import { changes, combine, Behavior, - stepper, - sample + stepper } from "@funkia/hareactive"; import { elements, modelView, fgo } from "../../../src"; @@ -25,15 +24,17 @@ export type Out = { }; function* model({ enterPressed, value }: FromView) { - const clearedValue: Behavior = yield sample( - stepper("", combine(enterPressed.mapTo(""), changes(value))) + const clearedValue: Behavior = yield stepper( + "", + combine(enterPressed.mapTo(""), changes(value)) ); + const addItem = snapshot(clearedValue, enterPressed).filter(isValidValue); return { addItem, clearedValue }; } -const view = ({ clearedValue }) => +const view = ({ clearedValue }: { clearedValue: Behavior }) => input({ class: "new-todo", props: { value: clearedValue }, diff --git a/examples/todo/src/localstorage.ts b/examples/todo/src/localstorage.ts index 0ff1d8d..fd2c2bd 100644 --- a/examples/todo/src/localstorage.ts +++ b/examples/todo/src/localstorage.ts @@ -2,7 +2,7 @@ import { withEffects } from "@funkia/jabz"; import { Behavior, fromFunction } from "@funkia/hareactive"; export function itemBehavior(key: string): Behavior { - return fromFunction(() => JSON.parse(localStorage.getItem(key))); + return fromFunction(() => JSON.parse(localStorage.getItem(key)!)); } export const setItemIO = withEffects((key: string, value: any) => { diff --git a/examples/webpack.config.js b/examples/webpack.config.js deleted file mode 100644 index 99ceafe..0000000 --- a/examples/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -const path = require('path'); - -module.exports = { - output: { - path: __dirname, - filename: "bundle.js" - }, - resolve: { - extensions: [".ts", ".js"], - modules: [path.join(__dirname, "src"), "node_modules"] - }, - module: { - rules: [ - {test: /\.ts$/, exclude: /node_modules/, use: "ts-loader"}, - {test: /\.css$/, use: [ 'style-loader', 'css-loader' ]} - ] - } -}; diff --git a/examples/zip-codes/index.ts b/examples/zip-codes/index.ts index 8621aa7..16d5241 100644 --- a/examples/zip-codes/index.ts +++ b/examples/zip-codes/index.ts @@ -3,7 +3,6 @@ import { changes, Now, performStreamLatest, - sample, split, stepper, Stream @@ -17,13 +16,7 @@ import { right, withEffectsP } from "@funkia/jabz"; -import { - Component, - elements, - modelView, - runComponent, - fgo -} from "../../src/index"; +import { elements, modelView, runComponent, fgo } from "../../src/index"; const { span, br, input } = elements; @@ -31,8 +24,8 @@ const apiUrl = "http://api.zippopotam.us/us/"; const fetchJSON = withEffectsP( (url: string): Promise => { - return fetch(url).then( - (resp) => (resp.ok ? resp.json() : Promise.reject("Not found")) + return fetch(url).then((resp) => + resp.ok ? resp.json() : Promise.reject("Not found") ); } ); @@ -76,18 +69,16 @@ const model = fgo(function*({ zipCode }: ViewOut): Iterator> { const results: Stream> = yield performStreamLatest( requests ); - const status = yield sample( - stepper( - "", - combine( - invalidZipCodeChange.mapTo("Not a valid zip code"), - validZipCodeChange.mapTo("Loading ..."), - results.map((r) => - r.match({ - left: () => "Zip code does not exist", - right: (res) => `Valid zip code for ${res.places[0]["place name"]}` - }) - ) + const status = yield stepper( + "", + combine( + invalidZipCodeChange.mapTo("Not a valid zip code"), + validZipCodeChange.mapTo("Loading ..."), + results.map((r) => + r.match({ + left: () => "Zip code does not exist", + right: (res) => `Valid zip code for ${res.places[0]["place name"]}` + }) ) ) ); diff --git a/package-lock.json b/package-lock.json index 5b154f3..506c41d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@funkia/hareactive": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@funkia/hareactive/-/hareactive-0.2.6.tgz", - "integrity": "sha512-5bQKNCw61J+saSZoETdsZWuASXItwHLUYLAnpA2R+jDkmGZsoiToJAclITldEdmzVxRYLF630nYcaLABisgg7w==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@funkia/hareactive/-/hareactive-0.3.1.tgz", + "integrity": "sha512-wcNLNF4uF8hDFzo1vXNo6Zyx0ADbywWLKCxLDUnmcdPuaxdY9fy2a4TGeQIKLW+gDjhRM5aF+43zrF5q3sNLbQ==", "dev": true, "requires": { "@funkia/jabz": "0.0.24", @@ -1000,7 +1000,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -2335,12 +2335,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2355,17 +2357,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2482,7 +2487,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2494,6 +2500,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2508,6 +2515,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2515,12 +2523,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -2539,6 +2549,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2619,7 +2630,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2631,6 +2643,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2752,6 +2765,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4198,7 +4212,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -4236,7 +4250,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -4616,9 +4630,9 @@ } }, "mocha": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.0.tgz", - "integrity": "sha512-A7g9k3yr8oJaXn2IItFnfgjyxFc/LTe6Wwv7FczP+e8G74o9xYNSbMYmCf1ouldRojLrFcOb+z75P6Ak0GX6ug==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", + "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -6863,9 +6877,9 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, "tslint": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.1.tgz", - "integrity": "sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==", + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.13.0.tgz", + "integrity": "sha512-ECOOQRxXCYnUUePG5h/+Z1Zouobk3KFpIHA9aKBB/nnMxs97S1JJPDGt5J4cGm1y9U9VmVlfboOxA8n1kSNzGw==", "dev": true, "requires": { "babel-code-frame": "^6.22.0", @@ -6876,6 +6890,7 @@ "glob": "^7.1.1", "js-yaml": "^3.7.0", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", @@ -6931,9 +6946,9 @@ } }, "typescript": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3.tgz", - "integrity": "sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==", + "version": "3.3.3333", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3333.tgz", + "integrity": "sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 066255f..98161b1 100644 --- a/package.json +++ b/package.json @@ -47,13 +47,13 @@ }, "homepage": "https://github.com/funkia/turbine#readme", "devDependencies": { - "@funkia/hareactive": "^0.2.6", + "@funkia/hareactive": "^0.3.1", "@types/chai": "^4.1.7", "@types/chai-dom": "0.0.7", - "@types/mocha": "^5.2.5", + "@types/mocha": "^5.2.6", "chai": "^4.2.0", "chai-dom": "^1.8.1", - "codecov": "^3.1.0", + "codecov": "^3.2.0", "fake-raf": "^1.0.1", "karma": "^4.0.0", "karma-chrome-launcher": "^2.2.0", @@ -63,11 +63,11 @@ "karma-mocha-reporter": "^2.2.5", "karma-sauce-launcher": "^2.0.2", "karma-typescript": "^4.0.0", - "mocha": "^6.0.0", + "mocha": "^6.0.2", "np": "^4.0.2", - "prettier": "^1.16.1", - "tslint": "^5.12.1", - "typescript": "^3.2.4" + "prettier": "^1.16.4", + "tslint": "^5.13.0", + "typescript": "^3.3.3333" }, "contributors": [ {