From b7c87edf0102eadb844922ec61bb5bae5db96817 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Tue, 2 May 2017 23:53:49 +0800 Subject: [PATCH 01/19] typescript --- lib/react-most.ts | 207 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 +- yarn.lock | 4 + 3 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 lib/react-most.ts diff --git a/lib/react-most.ts b/lib/react-most.ts new file mode 100644 index 0000000..d1b558f --- /dev/null +++ b/lib/react-most.ts @@ -0,0 +1,207 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import initHistory from './history'; +import { from } from 'most'; +import mostEngine from './engine/most'; +// unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign +export const INTENT_STREAM = '@@reactive-react/react-most.intentStream'; +export const HISTORY_STREAM = '@@reactive-react/react-most.historyStream'; +const MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve'; + +const CONTEXT_TYPE = { + [INTENT_STREAM]: PropTypes.object, + [HISTORY_STREAM]: PropTypes.object, + [MERGE_OBSERVE]: PropTypes.func, +}; +interface State {} +interface Stream {} +interface Actions { + [propName: string]: (...v:any[])=>T +} +interface Props { + [propName: string]: any +} +interface Plan { + (intent: Stream, props?: Props): Process +} +interface Update { + (current: State): State +} +interface Process { + actions: Actions, + sink$: Stream> +} + +interface ConnectProps { + contextTypes: any +} +interface ReactClass {} +interface Connect{ + contextTypes?: any + new(props?, context?): any +} +const h = React.createElement; +function connect(main: Plan, opts = {}): (rc: typeof React.PureComponent)=>typeof React.PureComponent{ + return function(WrappedComponent: typeof React.PureComponent){ + let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; + if (WrappedComponent === ConnectNode) { + return class ConnectNode extends React.PureComponent{ + actions: Actions + sink$: Stream> + static contextTypes = CONTEXT_TYPE + static displayName = connectDisplayName + constructor(props, context) { + super(props, context); + let {actions, sink$} = main(context[INTENT_STREAM], props) + this.sink$ = sink$ + this.actions = Object.assign({}, actions, props.actions); + } + render() { + return h( + WrappedComponent, + Object.assign({}, this.props, opts, { + sink$: this.sink$, + actions: this.actions, + }) + ); + } + } + } else { + class ConnectLeaf extends React.PureComponent { + constructor(props, context) { + super(props, context); + if (opts.history || props.history) { + opts.history = initHistory(context[HISTORY_STREAM]); + opts.history.travel.forEach(state => { + return this.setState(state); + }); + } + + let [actions, sink$] = actionsAndSinks( + main(context[INTENT_STREAM], props), + this + ); + this.sink$ = sink$.concat(props.sink$ || []); + this.actions = Object.assign({}, actions, props.actions); + let defaultKey = Object.keys(WrappedComponent.defaultProps); + this.state = Object.assign( + {}, + WrappedComponent.defaultProps, + pick(defaultKey, props) + ); + } + componentWillReceiveProps(nextProps) { + this.setState(state => pick(Object.keys(state), nextProps)); + } + componentDidMount() { + this.subscriptions = this.context[MERGE_OBSERVE]( + this.sink$, + action => { + if (action instanceof Function) { + this.setState((prevState, props) => { + let newState = action.call(this, prevState, props); + if (opts.history && newState != prevState) { + opts.history.cursor = -1; + this.context[HISTORY_STREAM].send(prevState); + } + return newState; + }); + } else { + /* istanbul ignore next */ + console.warn( + 'action', + action, + 'need to be a Function which map from current state to new state' + ); + } + } + ); + } + componentWillUnmount() { + this.subscriptions.unsubscribe(); + } + render() { + return h( + WrappedComponent, + Object.assign({}, this.props, this.state, opts, { + actions: this.actions, + }) + ); + } + } + Connect.contextTypes = CONTEXT_TYPE; + Connect.displayName = connectDisplayName; + return Connect; + } + }; +} + +export default class Most extends React.PureComponent { + getChildContext() { + let engineClass = (this.props && this.props.engine) || mostEngine; + let engine = engineClass(); + /* istanbul ignore if */ + if (process.env.NODE_ENV === 'debug') { + inspect(engine); + } + return { + [INTENT_STREAM]: engine.intentStream, + [MERGE_OBSERVE]: engine.mergeObserve, + [HISTORY_STREAM]: engine.historyStream, + }; + } + render() { + return React.Children.only(this.props.children); + } +} +Most.childContextTypes = CONTEXT_TYPE; + +function observable(obj) { + return !!obj.subscribe; +} + +/* istanbul ignore next */ +function inspect(engine) { + from(engine.intentStream) + .timestamp() + .observe(stamp => + console.log(`[${new Date(stamp.time).toJSON()}][INTENT]:}`, stamp.value) + ); + from(engine.historyStream) + .timestamp() + .observe(stamp => + console.log(`[${new Date(stamp.time).toJSON()}][STATE]:}`, stamp.value) + ); +} + +function actionsAndSinks(sinks: Stream>, self) { + let _sinks = []; + let _actions = { + fromEvent(e, f = x => x) { + return self.context[INTENT_STREAM].send(f(e)); + }, + fromPromise(p) { + return p.then(x => self.context[INTENT_STREAM].send(x)); + }, + }; + for (let name in sinks) { + let value = sinks[name]; + if (observable(value)) { + _sinks.push(value); + } else if (value instanceof Function) { + _actions[name] = (...args) => { + return self.context[INTENT_STREAM].send(value.apply(self, args)); + }; + } else if (name === 'actions') { + for (let a in value) + _actions[a] = (...args) => { + return self.context[INTENT_STREAM].send(value[a].apply(self, args)); + }; + } + } + return [_actions, _sinks]; +} + +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} \ No newline at end of file diff --git a/package.json b/package.json index e6c5911..a82fcca 100644 --- a/package.json +++ b/package.json @@ -28,13 +28,14 @@ "dependencies": { "most": "^1.2.2", "most-subject": "^5.2.0", - "rxjs": "^5.0.0-rc.4", - "prop-types": "^15.5.8" + "prop-types": "^15.5.8", + "rxjs": "^5.0.0-rc.4" }, "peerDependencies": { "react": "^15.5.4" }, "devDependencies": { + "@types/react": "^15.0.22", "babel": "^6.1.18", "babel-cli": "^6.2.0", "babel-jest": "^19.0.0", diff --git a/yarn.lock b/yarn.lock index 40b215d..5d537d5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,6 +12,10 @@ version "1.4.1" resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.4.1.tgz#b940b5563096f27637401618a5351f42466ea8f3" +"@types/react@^15.0.22": + version "15.0.22" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.22.tgz#50803cde8d89f60a9b034f2dd0d619bc5f0273b5" + abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" From c09c35242d0a170cea814d9cbea88bafc54e01f3 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 3 May 2017 00:21:32 +0800 Subject: [PATCH 02/19] use react.componentClass --- lib/react-most.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/react-most.ts b/lib/react-most.ts index d1b558f..0170aa4 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -32,8 +32,8 @@ interface Process { sink$: Stream> } -interface ConnectProps { - contextTypes: any +interface ConnectProps { + actions: Actions } interface ReactClass {} interface Connect{ @@ -41,10 +41,10 @@ interface Connect{ new(props?, context?): any } const h = React.createElement; -function connect(main: Plan, opts = {}): (rc: typeof React.PureComponent)=>typeof React.PureComponent{ - return function(WrappedComponent: typeof React.PureComponent){ +function connect(main: Plan, opts = {history: false}): (rc: React.ComponentClass)=> React.ComponentClass>{ + return function(WrappedComponent: React.ComponentClass){ let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; - if (WrappedComponent === ConnectNode) { + if (WrappedComponent.contextTypes === CONTEXT_TYPE) { return class ConnectNode extends React.PureComponent{ actions: Actions sink$: Stream> @@ -67,7 +67,7 @@ function connect(main: Plan, opts = {}): (rc: typeof React.PureComponent)= } } } else { - class ConnectLeaf extends React.PureComponent { + class ConnectLeaf extends React.PureComponent { constructor(props, context) { super(props, context); if (opts.history || props.history) { From 5a05e55a09443a0877dbe5bd0f7e756cf776ff03 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 3 May 2017 11:20:03 +0800 Subject: [PATCH 03/19] add tsconfig --- tsconfig.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tsconfig.json diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..507a4cc --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "include": [ + "lib/*.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": ["es2015"], + "target": "es5", + "outDir": "dist", + "declarationDir": "types", + "declaration": true, + "noImplicitAny": false, + "sourceMap": false, + "pretty": true + } +} From 9d668e599cac7c8f6f64b6c13febf0cacfa284ad Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 3 May 2017 17:52:07 +0800 Subject: [PATCH 04/19] typescriptify history --- lib/history.ts | 42 +++++++++++++++++++++++++++++++++++++++++ lib/react-most.ts | 48 ++++++++++++++++++++++++++++------------------- 2 files changed, 71 insertions(+), 19 deletions(-) create mode 100644 lib/history.ts diff --git a/lib/history.ts b/lib/history.ts new file mode 100644 index 0000000..046ec6a --- /dev/null +++ b/lib/history.ts @@ -0,0 +1,42 @@ +import { from, Stream } from 'most' + +export interface Traveler { + cursor: number + travel: (history: Stream) => Stream + forward: () => void + backward: () => void + path: Stream +} +export interface History { + traveler: Traveler + history: Stream +} +export default function initHistory(contextHistory: History): [Stream, Traveler] { + let history = from(contextHistory.history) + .timestamp() + .scan((acc, state) => { + acc.push(state) + return acc; + }, []) + .multicast() + let traveler = { + cursor: -1, + travel: from(contextHistory.traveler.path) + .sample((offset: (number) => number, states: [S]) => { + let cursor = offset(states.length + contextHistory.traveler.cursor) + if (cursor < states.length && cursor >= 0) { + contextHistory.traveler.cursor = offset(contextHistory.traveler.cursor) + return states[cursor].value; + } + }, contextHistory.traveler, history) + .filter(x => !!x), + forward: function() { + contextHistory.traveler.path.send(x => x + 1) + }, + backward: function() { + contextHistory.traveler.path.send(x => x - 1) + } + } + + return [history, traveler] +} diff --git a/lib/react-most.ts b/lib/react-most.ts index 0170aa4..b9e5ee5 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,7 +1,7 @@ -import React from 'react'; +import * as React from 'react'; import PropTypes from 'prop-types'; import initHistory from './history'; -import { from } from 'most'; +import { from, Stream } from 'most'; import mostEngine from './engine/most'; // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign export const INTENT_STREAM = '@@reactive-react/react-most.intentStream'; @@ -13,10 +13,15 @@ const CONTEXT_TYPE = { [HISTORY_STREAM]: PropTypes.object, [MERGE_OBSERVE]: PropTypes.func, }; -interface State {} -interface Stream {} + +interface History extends Stream { + cursor: number + travel: Stream + forward: () => void + backward: () => void +} interface Actions { - [propName: string]: (...v:any[])=>T + [propName: string]: (...v: any[]) => T } interface Props { [propName: string]: any @@ -24,8 +29,8 @@ interface Props { interface Plan { (intent: Stream, props?: Props): Process } -interface Update { - (current: State): State +interface Update { + (current: S): S } interface Process { actions: Actions, @@ -35,24 +40,25 @@ interface Process { interface ConnectProps { actions: Actions } -interface ReactClass {} -interface Connect{ +interface ReactClass { } +interface Connect { contextTypes?: any - new(props?, context?): any + new (props?, context?): any } const h = React.createElement; -function connect(main: Plan, opts = {history: false}): (rc: React.ComponentClass)=> React.ComponentClass>{ - return function(WrappedComponent: React.ComponentClass){ +function connect(main: Plan, opts = { history: false }): (rc: React.ComponentClass) => React.ComponentClass> { + return function(WrappedComponent: React.ComponentClass) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - return class ConnectNode extends React.PureComponent{ + return class ConnectNode extends React.PureComponent, any>{ actions: Actions sink$: Stream> + props: ConnectProps static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName - constructor(props, context) { + constructor(props: ConnectProps, context) { super(props, context); - let {actions, sink$} = main(context[INTENT_STREAM], props) + let { actions, sink$ } = main(context[INTENT_STREAM], props) this.sink$ = sink$ this.actions = Object.assign({}, actions, props.actions); } @@ -67,12 +73,16 @@ function connect(main: Plan, opts = {history: false}): (rc: React.Compone } } } else { - class ConnectLeaf extends React.PureComponent { + return class ConnectLeaf extends React.PureComponent, any> { + actions: Actions + sink$: Stream> + props: ConnectProps + history: History constructor(props, context) { super(props, context); if (opts.history || props.history) { - opts.history = initHistory(context[HISTORY_STREAM]); - opts.history.travel.forEach(state => { + [this.history, travel] = initHistory(context[HISTORY_STREAM], context[HISTORY_STREAM].travel); + this.history.travel.forEach(state => { return this.setState(state); }); } @@ -204,4 +214,4 @@ function actionsAndSinks(sinks: Stream>, self) { function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || 'Component'; -} \ No newline at end of file +} From 402a4e3205ec3de4dffa05603b66186db6e055b2 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Fri, 5 May 2017 00:45:21 +0800 Subject: [PATCH 05/19] history.ts compiled :v: --- lib/history.ts | 67 ++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/lib/history.ts b/lib/history.ts index 046ec6a..3121c67 100644 --- a/lib/history.ts +++ b/lib/history.ts @@ -1,42 +1,51 @@ import { from, Stream } from 'most' -export interface Traveler { +export interface Path extends Stream { + send: (fn: T) => void +} +export class Traveler { cursor: number - travel: (history: Stream) => Stream - forward: () => void - backward: () => void - path: Stream + path: Path<(n: number) => number> + history: Stream[]> + constructor(history:Stream[]>, path:Path<(n: number) => number>) { + this.history = history + this.path = path + } + forward() { + this.path.send(x => x + 1) + } + backward() { + this.path.send(x => x - 1) + } + travel = from(this.path) + .sample((offset: (n: number) => number, states: Stamp[]) => { + let cursor = offset(states.length + this.cursor) + if (cursor < states.length && cursor >= 0) { + this.cursor = offset(this.cursor) + return states[cursor].value; + } + }, this.path, this.history) + .filter(x => !!x) + } -export interface History { - traveler: Traveler - history: Stream +export interface History { + path: Path<(n: number) => number> + history: Stream } -export default function initHistory(contextHistory: History): [Stream, Traveler] { + +export interface Stamp { + value: S + time: number +} +export default function initHistory(contextHistory: History): [Stream[]>, Traveler] { let history = from(contextHistory.history) .timestamp() - .scan((acc, state) => { + .scan((acc: Stamp[], state: Stamp) => { acc.push(state) return acc; }, []) .multicast() - let traveler = { - cursor: -1, - travel: from(contextHistory.traveler.path) - .sample((offset: (number) => number, states: [S]) => { - let cursor = offset(states.length + contextHistory.traveler.cursor) - if (cursor < states.length && cursor >= 0) { - contextHistory.traveler.cursor = offset(contextHistory.traveler.cursor) - return states[cursor].value; - } - }, contextHistory.traveler, history) - .filter(x => !!x), - forward: function() { - contextHistory.traveler.path.send(x => x + 1) - }, - backward: function() { - contextHistory.traveler.path.send(x => x - 1) - } - } - return [history, traveler] + + return [history, new Traveler(history, contextHistory.path)] } From 93cd81fb6713be2ed2c5365b0f694326fcad5aaf Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Fri, 5 May 2017 17:49:55 +0800 Subject: [PATCH 06/19] fix types in history.ts and most.ts --- .gitignore | 1 + dist/react-most.js | 702 ---- dist/vendor.js | 9913 -------------------------------------------- lib/history.ts | 14 +- lib/react-most.js | 357 +- lib/react-most.ts | 100 +- tsconfig.json | 2 +- yarn.lock | 6 +- 8 files changed, 232 insertions(+), 10863 deletions(-) delete mode 100644 dist/react-most.js delete mode 100644 dist/vendor.js diff --git a/.gitignore b/.gitignore index b7e60f6..1f602a6 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ deploy.pub public/app.js gh-pages/ wiki/ +dist diff --git a/dist/react-most.js b/dist/react-most.js deleted file mode 100644 index 8499474..0000000 --- a/dist/react-most.js +++ /dev/null @@ -1,702 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Most = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { - history.cursor = offset(history.cursor); - return states[cursor].value; - } - }, travel, history).filter(function (x) { - return !!x; - }); - history.forward = function () { - travel.send(function (x) { - return x + 1; - }); - }; - history.backward = function () { - travel.send(function (x) { - return x - 1; - }); - }; - return history; -} -},{"most":"most"}],3:[function(require,module,exports){ -var _objectAssign = require('./_objectAssign'); - -module.exports = - typeof Object.assign === 'function' ? Object.assign : _objectAssign; - -},{"./_objectAssign":9}],4:[function(require,module,exports){ -var _isPlaceholder = require('./_isPlaceholder'); - - -/** - * Optimized internal one-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ -module.exports = function _curry1(fn) { - return function f1(a) { - if (arguments.length === 0 || _isPlaceholder(a)) { - return f1; - } else { - return fn.apply(this, arguments); - } - }; -}; - -},{"./_isPlaceholder":8}],5:[function(require,module,exports){ -var _curry1 = require('./_curry1'); -var _isPlaceholder = require('./_isPlaceholder'); - - -/** - * Optimized internal two-arity curry function. - * - * @private - * @category Function - * @param {Function} fn The function to curry. - * @return {Function} The curried function. - */ -module.exports = function _curry2(fn) { - return function f2(a, b) { - switch (arguments.length) { - case 0: - return f2; - case 1: - return _isPlaceholder(a) ? f2 - : _curry1(function(_b) { return fn(a, _b); }); - default: - return _isPlaceholder(a) && _isPlaceholder(b) ? f2 - : _isPlaceholder(a) ? _curry1(function(_a) { return fn(_a, b); }) - : _isPlaceholder(b) ? _curry1(function(_b) { return fn(a, _b); }) - : fn(a, b); - } - }; -}; - -},{"./_curry1":4,"./_isPlaceholder":8}],6:[function(require,module,exports){ -module.exports = function _has(prop, obj) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -},{}],7:[function(require,module,exports){ -var _has = require('./_has'); - - -module.exports = (function() { - var toString = Object.prototype.toString; - return toString.call(arguments) === '[object Arguments]' ? - function _isArguments(x) { return toString.call(x) === '[object Arguments]'; } : - function _isArguments(x) { return _has('callee', x); }; -}()); - -},{"./_has":6}],8:[function(require,module,exports){ -module.exports = function _isPlaceholder(a) { - return a != null && - typeof a === 'object' && - a['@@functional/placeholder'] === true; -}; - -},{}],9:[function(require,module,exports){ -var _has = require('./_has'); - -// Based on https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign -module.exports = function _objectAssign(target) { - if (target == null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - - var output = Object(target); - var idx = 1; - var length = arguments.length; - while (idx < length) { - var source = arguments[idx]; - if (source != null) { - for (var nextKey in source) { - if (_has(nextKey, source)) { - output[nextKey] = source[nextKey]; - } - } - } - idx += 1; - } - return output; -}; - -},{"./_has":6}],10:[function(require,module,exports){ -var _curry1 = require('./internal/_curry1'); -var _has = require('./internal/_has'); -var _isArguments = require('./internal/_isArguments'); - - -/** - * Returns a list containing the names of all the enumerable own properties of - * the supplied object. - * Note that the order of the output array is not guaranteed to be consistent - * across different JS platforms. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category Object - * @sig {k: v} -> [k] - * @param {Object} obj The object to extract properties from - * @return {Array} An array of the object's own properties. - * @example - * - * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c'] - */ -module.exports = (function() { - // cover IE < 9 keys issues - var hasEnumBug = !({toString: null}).propertyIsEnumerable('toString'); - var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - // Safari bug - var hasArgsEnumBug = (function() { - 'use strict'; - return arguments.propertyIsEnumerable('length'); - }()); - - var contains = function contains(list, item) { - var idx = 0; - while (idx < list.length) { - if (list[idx] === item) { - return true; - } - idx += 1; - } - return false; - }; - - return typeof Object.keys === 'function' && !hasArgsEnumBug ? - _curry1(function keys(obj) { - return Object(obj) !== obj ? [] : Object.keys(obj); - }) : - _curry1(function keys(obj) { - if (Object(obj) !== obj) { - return []; - } - var prop, nIdx; - var ks = []; - var checkArgsLength = hasArgsEnumBug && _isArguments(obj); - for (prop in obj) { - if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) { - ks[ks.length] = prop; - } - } - if (hasEnumBug) { - nIdx = nonEnumerableProps.length - 1; - while (nIdx >= 0) { - prop = nonEnumerableProps[nIdx]; - if (_has(prop, obj) && !contains(ks, prop)) { - ks[ks.length] = prop; - } - nIdx -= 1; - } - } - return ks; - }); -}()); - -},{"./internal/_curry1":4,"./internal/_has":6,"./internal/_isArguments":7}],11:[function(require,module,exports){ -var _assign = require('./internal/_assign'); -var _curry1 = require('./internal/_curry1'); - - -/** - * Merges a list of objects together into one object. - * - * @func - * @memberOf R - * @since v0.10.0 - * @category List - * @sig [{k: v}] -> {k: v} - * @param {Array} list An array of objects - * @return {Object} A merged object. - * @see R.reduce - * @example - * - * R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3} - * R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2} - * @symb R.mergeAll([{ x: 1 }, { y: 2 }, { z: 3 }]) = { x: 1, y: 2, z: 3 } - */ -module.exports = _curry1(function mergeAll(list) { - return _assign.apply(null, [{}].concat(list)); -}); - -},{"./internal/_assign":3,"./internal/_curry1":4}],12:[function(require,module,exports){ -var _curry2 = require('./internal/_curry2'); - - -/** - * Returns a partial copy of an object containing only the keys specified. If - * the key does not exist, the property is ignored. - * - * @func - * @memberOf R - * @since v0.1.0 - * @category Object - * @sig [k] -> {k: v} -> {k: v} - * @param {Array} names an array of String property names to copy onto a new object - * @param {Object} obj The object to copy from - * @return {Object} A new object with only properties from `names` on it. - * @see R.omit, R.props - * @example - * - * R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4} - * R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1} - */ -module.exports = _curry2(function pick(names, obj) { - var result = {}; - var idx = 0; - while (idx < names.length) { - if (names[idx] in obj) { - result[names[idx]] = obj[names[idx]]; - } - idx += 1; - } - return result; -}); - -},{"./internal/_curry2":5}],13:[function(require,module,exports){ -(function (process){ -/** -The MIT License (MIT) - -Copyright (c) 2015 Jichao Ouyang - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.HISTORY_STREAM = exports.INTENT_STREAM = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _CONTEXT_TYPE; - -exports.connect = connect; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _history = require('./history'); - -var _history2 = _interopRequireDefault(_history); - -var _most = require('most'); - -var _most2 = require('./engine/most'); - -var _most3 = _interopRequireDefault(_most2); - -var _mergeAll = require('ramda/src/mergeAll'); - -var _mergeAll2 = _interopRequireDefault(_mergeAll); - -var _pick = require('ramda/src/pick'); - -var _pick2 = _interopRequireDefault(_pick); - -var _keys = require('ramda/src/keys'); - -var _keys2 = _interopRequireDefault(_keys); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -// unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign -var INTENT_STREAM = exports.INTENT_STREAM = "@@reactive-react/react-most.intentStream"; -var HISTORY_STREAM = exports.HISTORY_STREAM = "@@reactive-react/react-most.historyStream"; -var MERGE_OBSERVE = "@@reactive-react/react-most.mergeObserve"; - -var CONTEXT_TYPE = (_CONTEXT_TYPE = {}, _defineProperty(_CONTEXT_TYPE, INTENT_STREAM, _react2.default.PropTypes.object), _defineProperty(_CONTEXT_TYPE, HISTORY_STREAM, _react2.default.PropTypes.object), _defineProperty(_CONTEXT_TYPE, MERGE_OBSERVE, _react2.default.PropTypes.func), _CONTEXT_TYPE); - -function connect(main) { - var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return function (WrappedComponent) { - var connectDisplayName = 'Connect(' + getDisplayName(WrappedComponent) + ')'; - if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - var Connect = function (_React$PureComponent) { - _inherits(Connect, _React$PureComponent); - - function Connect(props, context) { - _classCallCheck(this, Connect); - - var _this = _possibleConstructorReturn(this, (Connect.__proto__ || Object.getPrototypeOf(Connect)).call(this, props, context)); - - var _actionsAndSinks = actionsAndSinks(main(context[INTENT_STREAM], props), _this), - _actionsAndSinks2 = _slicedToArray(_actionsAndSinks, 2), - actions = _actionsAndSinks2[0], - sink$ = _actionsAndSinks2[1]; - - _this.sink$ = sink$.concat(props.sink$ || []); - _this.actions = (0, _mergeAll2.default)([actions, props.actions]); - return _this; - } - - _createClass(Connect, [{ - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({}, this.props, opts, { sink$: this.sink$, actions: this.actions })); - } - }]); - - return Connect; - }(_react2.default.PureComponent); - - Connect.contextTypes = CONTEXT_TYPE; - Connect.displayName = connectDisplayName; - return Connect; - } else { - var _Connect = function (_React$PureComponent2) { - _inherits(_Connect, _React$PureComponent2); - - function _Connect(props, context) { - _classCallCheck(this, _Connect); - - var _this2 = _possibleConstructorReturn(this, (_Connect.__proto__ || Object.getPrototypeOf(_Connect)).call(this, props, context)); - - if (opts.history || props.history) { - opts.history = (0, _history2.default)(context[HISTORY_STREAM]); - opts.history.travel.forEach(function (state) { - return _this2.setState(state); - }); - } - - var _actionsAndSinks3 = actionsAndSinks(main(context[INTENT_STREAM], props), _this2), - _actionsAndSinks4 = _slicedToArray(_actionsAndSinks3, 2), - actions = _actionsAndSinks4[0], - sink$ = _actionsAndSinks4[1]; - - _this2.sink$ = sink$.concat(props.sink$ || []); - _this2.actions = (0, _mergeAll2.default)([actions, props.actions]); - var defaultKey = (0, _keys2.default)(WrappedComponent.defaultProps); - _this2.state = (0, _mergeAll2.default)([WrappedComponent.defaultProps, (0, _pick2.default)(defaultKey, props)]); - return _this2; - } - - _createClass(_Connect, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.setState(function (state) { - return (0, _pick2.default)((0, _keys2.default)(state), nextProps); - }); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - var _this3 = this; - - this.subscriptions = this.context[MERGE_OBSERVE](this.sink$, function (action) { - if (action instanceof Function) { - _this3.setState(function (prevState, props) { - var newState = action.call(_this3, prevState, props); - if (opts.history && newState != prevState) { - opts.history.cursor = -1; - _this3.context[HISTORY_STREAM].send(prevState); - } - return newState; - }); - } else { - /* istanbul ignore next */ - console.warn('action', action, 'need to be a Function which map from current state to new state'); - } - }); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.subscriptions.unsubscribe(); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(WrappedComponent, _extends({}, this.props, this.state, opts, { actions: this.actions })); - } - }]); - - return _Connect; - }(_react2.default.PureComponent); - - _Connect.contextTypes = CONTEXT_TYPE; - _Connect.displayName = connectDisplayName; - return _Connect; - } - }; -} - -var Most = _react2.default.createClass({ - childContextTypes: CONTEXT_TYPE, - getChildContext: function getChildContext() { - var _ref; - - var engineClass = this.props && this.props.engine || _most3.default; - var engine = engineClass(); - /* istanbul ignore if */ - if (process.env.NODE_ENV === 'debug') { - inspect(engine); - } - return _ref = {}, _defineProperty(_ref, INTENT_STREAM, engine.intentStream), _defineProperty(_ref, MERGE_OBSERVE, engine.mergeObserve), _defineProperty(_ref, HISTORY_STREAM, engine.historyStream), _ref; - }, - render: function render() { - return _react2.default.Children.only(this.props.children); - } -}); - -exports.default = Most; - - -function observable(obj) { - return !!obj.subscribe; -} - -/* istanbul ignore next */ -function inspect(engine) { - (0, _most.from)(engine.intentStream).timestamp().observe(function (stamp) { - return console.log('[' + new Date(stamp.time).toJSON() + '][INTENT]:}', stamp.value); - }); - (0, _most.from)(engine.historyStream).timestamp().observe(function (stamp) { - return console.log('[' + new Date(stamp.time).toJSON() + '][STATE]:}', stamp.value); - }); -} - -function actionsAndSinks(sinks, self) { - var _sinks = []; - var _actions = { - fromEvent: function fromEvent(e) { - var f = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (x) { - return x; - }; - - return self.context[INTENT_STREAM].send(f(e)); - }, - fromPromise: function fromPromise(p) { - return p.then(function (x) { - return self.context[INTENT_STREAM].send(x); - }); - } - }; - - var _loop = function _loop(name) { - var value = sinks[name]; - if (observable(value)) { - _sinks.push(value); - } else if (value instanceof Function) { - _actions[name] = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return self.context[INTENT_STREAM].send(value.apply(self, args)); - }; - } else if (name === 'actions') { - var _loop2 = function _loop2(a) { - _actions[a] = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return self.context[INTENT_STREAM].send(value[a].apply(self, args)); - }; - }; - - for (var a in value) { - _loop2(a); - } - } - }; - - for (var name in sinks) { - _loop(name); - } - return [_actions, _sinks]; -} - -function getDisplayName(WrappedComponent) { - return WrappedComponent.displayName || WrappedComponent.name || 'Component'; -} -}).call(this,require('_process')) -},{"./engine/most":1,"./history":2,"_process":14,"most":"most","ramda/src/keys":10,"ramda/src/mergeAll":11,"ramda/src/pick":12,"react":"react"}],14:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}]},{},[13])(13) -}); \ No newline at end of file diff --git a/dist/vendor.js b/dist/vendor.js deleted file mode 100644 index 735e545..0000000 --- a/dist/vendor.js +++ /dev/null @@ -1,9913 +0,0 @@ -require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0) { - this.sinks = _most_prelude.remove(i, this.sinks) - } - - return this.sinks.length -}; - -MulticastSource.prototype.event = function event (time, value) { - var s = this.sinks - if (s.length === 1) { - return s[0].event(time, value) - } - for (var i = 0; i < s.length; ++i) { - tryEvent(time, value, s[i]) - } -}; - -MulticastSource.prototype.end = function end (time, value) { - var s = this.sinks - for (var i = 0; i < s.length; ++i) { - tryEnd(time, value, s[i]) - } -}; - -MulticastSource.prototype.error = function error (time, err) { - var s = this.sinks - for (var i = 0; i < s.length; ++i) { - s[i].error(time, err) - } -}; - -function multicast (stream) { - var source = stream.source - return source instanceof MulticastSource - ? stream - : new stream.constructor(new MulticastSource(source)) -} - -exports['default'] = multicast; -exports.MulticastSource = MulticastSource; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - - -},{"@most/prelude":2}],2:[function(require,module,exports){ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.mostPrelude = global.mostPrelude || {}))); -}(this, (function (exports) { 'use strict'; - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ - -// Non-mutating array operations - -// cons :: a -> [a] -> [a] -// a with x prepended -function cons (x, a) { - var l = a.length - var b = new Array(l + 1) - b[0] = x - for (var i = 0; i < l; ++i) { - b[i + 1] = a[i] - } - return b -} - -// append :: a -> [a] -> [a] -// a with x appended -function append (x, a) { - var l = a.length - var b = new Array(l + 1) - for (var i = 0; i < l; ++i) { - b[i] = a[i] - } - - b[l] = x - return b -} - -// drop :: Int -> [a] -> [a] -// drop first n elements -function drop (n, a) { // eslint-disable-line complexity - if (n < 0) { - throw new TypeError('n must be >= 0') - } - - var l = a.length - if (n === 0 || l === 0) { - return a - } - - if (n >= l) { - return [] - } - - return unsafeDrop(n, a, l - n) -} - -// unsafeDrop :: Int -> [a] -> Int -> [a] -// Internal helper for drop -function unsafeDrop (n, a, l) { - var b = new Array(l) - for (var i = 0; i < l; ++i) { - b[i] = a[n + i] - } - return b -} - -// tail :: [a] -> [a] -// drop head element -function tail (a) { - return drop(1, a) -} - -// copy :: [a] -> [a] -// duplicate a (shallow duplication) -function copy (a) { - var l = a.length - var b = new Array(l) - for (var i = 0; i < l; ++i) { - b[i] = a[i] - } - return b -} - -// map :: (a -> b) -> [a] -> [b] -// transform each element with f -function map (f, a) { - var l = a.length - var b = new Array(l) - for (var i = 0; i < l; ++i) { - b[i] = f(a[i]) - } - return b -} - -// reduce :: (a -> b -> a) -> a -> [b] -> a -// accumulate via left-fold -function reduce (f, z, a) { - var r = z - for (var i = 0, l = a.length; i < l; ++i) { - r = f(r, a[i], i) - } - return r -} - -// replace :: a -> Int -> [a] -// replace element at index -function replace (x, i, a) { // eslint-disable-line complexity - if (i < 0) { - throw new TypeError('i must be >= 0') - } - - var l = a.length - var b = new Array(l) - for (var j = 0; j < l; ++j) { - b[j] = i === j ? x : a[j] - } - return b -} - -// remove :: Int -> [a] -> [a] -// remove element at index -function remove (i, a) { // eslint-disable-line complexity - if (i < 0) { - throw new TypeError('i must be >= 0') - } - - var l = a.length - if (l === 0 || i >= l) { // exit early if index beyond end of array - return a - } - - if (l === 1) { // exit early if index in bounds and length === 1 - return [] - } - - return unsafeRemove(i, a, l - 1) -} - -// unsafeRemove :: Int -> [a] -> Int -> [a] -// Internal helper to remove element at index -function unsafeRemove (i, a, l) { - var b = new Array(l) - var j - for (j = 0; j < i; ++j) { - b[j] = a[j] - } - for (j = i; j < l; ++j) { - b[j] = a[j + 1] - } - - return b -} - -// removeAll :: (a -> boolean) -> [a] -> [a] -// remove all elements matching a predicate -function removeAll (f, a) { - var l = a.length - var b = new Array(l) - var j = 0 - for (var x, i = 0; i < l; ++i) { - x = a[i] - if (!f(x)) { - b[j] = x - ++j - } - } - - b.length = j - return b -} - -// findIndex :: a -> [a] -> Int -// find index of x in a, from the left -function findIndex (x, a) { - for (var i = 0, l = a.length; i < l; ++i) { - if (x === a[i]) { - return i - } - } - return -1 -} - -// isArrayLike :: * -> boolean -// Return true iff x is array-like -function isArrayLike (x) { - return x != null && typeof x.length === 'number' && typeof x !== 'function' -} - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ - -// id :: a -> a -var id = function (x) { return x; } - -// compose :: (b -> c) -> (a -> b) -> (a -> c) -var compose = function (f, g) { return function (x) { return f(g(x)); }; } - -// apply :: (a -> b) -> a -> b -var apply = function (f, x) { return f(x); } - -// curry2 :: ((a, b) -> c) -> (a -> b -> c) -function curry2 (f) { - function curried (a, b) { - switch (arguments.length) { - case 0: return curried - case 1: return function (b) { return f(a, b); } - default: return f(a, b) - } - } - return curried -} - -// curry3 :: ((a, b, c) -> d) -> (a -> b -> c -> d) -function curry3 (f) { - function curried (a, b, c) { // eslint-disable-line complexity - switch (arguments.length) { - case 0: return curried - case 1: return curry2(function (b, c) { return f(a, b, c); }) - case 2: return function (c) { return f(a, b, c); } - default:return f(a, b, c) - } - } - return curried -} - -exports.cons = cons; -exports.append = append; -exports.drop = drop; -exports.tail = tail; -exports.copy = copy; -exports.map = map; -exports.reduce = reduce; -exports.replace = replace; -exports.remove = remove; -exports.removeAll = removeAll; -exports.findIndex = findIndex; -exports.isArrayLike = isArrayLike; -exports.id = id; -exports.compose = compose; -exports.apply = apply; -exports.curry2 = curry2; -exports.curry3 = curry3; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - - -},{}],3:[function(require,module,exports){ -"use strict"; - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; -},{}],4:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var emptyObject = {}; - -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; -}).call(this,require('_process')) -},{"_process":110}],5:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -function invariant(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; -}).call(this,require('_process')) -},{"_process":110}],6:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var emptyFunction = require('./emptyFunction'); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - (function () { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; - })(); -} - -module.exports = warning; -}).call(this,require('_process')) -},{"./emptyFunction":3,"_process":110}],7:[function(require,module,exports){ -"use strict"; -var prelude_1 = require('@most/prelude'); -exports.complete = prelude_1.curry2(function complete(value, subject) { - return subject.complete(value); -}); - -},{"@most/prelude":2}],8:[function(require,module,exports){ -"use strict"; -var prelude_1 = require('@most/prelude'); -exports.error = prelude_1.curry2(function error(err, subject) { - return subject.error(err); -}); - -},{"@most/prelude":2}],9:[function(require,module,exports){ -"use strict"; -var prelude_1 = require('@most/prelude'); -var sources_1 = require('../sources'); -exports.hold = prelude_1.curry2(function hold(bufferSize, subject) { - return new subject.constructor(new sources_1.HoldSubjectSource(subject.source, bufferSize)); -}); - -},{"../sources":13,"@most/prelude":2}],10:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -__export(require('./next')); -__export(require('./error')); -__export(require('./complete')); -__export(require('./hold')); - -},{"./complete":7,"./error":8,"./hold":9,"./next":11}],11:[function(require,module,exports){ -"use strict"; -var prelude_1 = require('@most/prelude'); -exports.next = prelude_1.curry2(function next(value, subject) { - return subject.next(value); -}); - -},{"@most/prelude":2}],12:[function(require,module,exports){ -"use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; -var most_1 = require('most'); -var multicast_1 = require('@most/multicast'); -var prelude_1 = require('@most/prelude'); -var HoldSubjectSource = (function (_super) { - __extends(HoldSubjectSource, _super); - function HoldSubjectSource(source, bufferSize) { - _super.call(this, source); - this.has = false; - this.buffer = []; - this.bufferSize = bufferSize; - } - HoldSubjectSource.prototype.add = function (sink) { - if (this.has) { - pushEvents(this.buffer, sink); - } - return _super.prototype.add.call(this, sink); - }; - HoldSubjectSource.prototype.event = function (time, value) { - this.has = true; - this.buffer = dropAndAppend(value, this.buffer, this.bufferSize); - return _super.prototype.event.call(this, time, value); - }; - return HoldSubjectSource; -}(multicast_1.MulticastSource)); -exports.HoldSubjectSource = HoldSubjectSource; -function pushEvents(buffer, sink) { - var length = buffer.length; - for (var i = 0; i < length; ++i) { - sink.event(most_1.defaultScheduler.now(), buffer[i]); - } -} -function dropAndAppend(value, buffer, bufferSize) { - if (buffer.length === bufferSize) { - return prelude_1.append(value, prelude_1.drop(1, buffer)); - } - return prelude_1.append(value, buffer); -} -exports.dropAndAppend = dropAndAppend; - -},{"@most/multicast":1,"@most/prelude":2,"most":"most"}],13:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -__export(require('./HoldSubjectSource')); - -},{"./HoldSubjectSource":12}],14:[function(require,module,exports){ -"use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; -var most_1 = require('most'); -var multicast_1 = require('@most/multicast'); -function async() { - return asAsync(most_1.never()); -} -exports.async = async; -function asAsync(stream) { - return new AsyncSubject(new multicast_1.MulticastSource(stream.source)); -} -exports.asAsync = asAsync; -var AsyncSubject = (function (_super) { - __extends(AsyncSubject, _super); - function AsyncSubject(source) { - _super.call(this, source); - } - AsyncSubject.prototype.next = function (value) { - most_1.defaultScheduler.asap(most_1.PropagateTask.event(value, this.source)); - return this; - }; - AsyncSubject.prototype.error = function (err) { - most_1.defaultScheduler.asap(most_1.PropagateTask.error(err, this.source)); - return this; - }; - AsyncSubject.prototype.complete = function (value) { - most_1.defaultScheduler.asap(most_1.PropagateTask.end(value, this.source)); - return this; - }; - return AsyncSubject; -}(most_1.Stream)); -exports.AsyncSubject = AsyncSubject; - -},{"@most/multicast":1,"most":"most"}],15:[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -__export(require('./async')); -__export(require('./sync')); - -},{"./async":14,"./sync":16}],16:[function(require,module,exports){ -"use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; -var most_1 = require('most'); -var multicast_1 = require('@most/multicast'); -function sync() { - return asSync(most_1.never()); -} -exports.sync = sync; -function asSync(stream) { - return new SyncSubject(new multicast_1.MulticastSource(stream.source)); -} -exports.asSync = asSync; -var SyncSubject = (function (_super) { - __extends(SyncSubject, _super); - function SyncSubject(source) { - _super.call(this, source); - } - SyncSubject.prototype.next = function (value) { - this.source.event(most_1.defaultScheduler.now(), value); - return this; - }; - SyncSubject.prototype.error = function (err) { - this.source.error(most_1.defaultScheduler.now(), err); - return this; - }; - SyncSubject.prototype.complete = function (value) { - this.source.end(most_1.defaultScheduler.now(), value); - return this; - }; - return SyncSubject; -}(most_1.Stream)); -exports.SyncSubject = SyncSubject; - -},{"@most/multicast":1,"most":"most"}],17:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = LinkedList; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -/** - * Doubly linked list - * @constructor - */ -function LinkedList() { - this.head = null; - this.length = 0; -} - -/** - * Add a node to the end of the list - * @param {{prev:Object|null, next:Object|null, dispose:function}} x node to add - */ -LinkedList.prototype.add = function (x) { - if (this.head !== null) { - this.head.prev = x; - x.next = this.head; - } - this.head = x; - ++this.length; -}; - -/** - * Remove the provided node from the list - * @param {{prev:Object|null, next:Object|null, dispose:function}} x node to remove - */ -LinkedList.prototype.remove = function (x) { - // eslint-disable-line complexity - --this.length; - if (x === this.head) { - this.head = this.head.next; - } - if (x.next !== null) { - x.next.prev = x.prev; - x.next = null; - } - if (x.prev !== null) { - x.prev.next = x.next; - x.prev = null; - } -}; - -/** - * @returns {boolean} true iff there are no nodes in the list - */ -LinkedList.prototype.isEmpty = function () { - return this.length === 0; -}; - -/** - * Dispose all nodes - * @returns {Promise} promise that fulfills when all nodes have been disposed, - * or rejects if an error occurs while disposing - */ -LinkedList.prototype.dispose = function () { - if (this.isEmpty()) { - return Promise.resolve(); - } - - var promises = []; - var x = this.head; - this.head = null; - this.length = 0; - - while (x !== null) { - promises.push(x.dispose()); - x = x.next; - } - - return Promise.all(promises); -}; -},{}],18:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isPromise = isPromise; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function isPromise(p) { - return p !== null && typeof p === 'object' && typeof p.then === 'function'; -} -},{}],19:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Queue; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -// Based on https://github.com/petkaantonov/deque - -function Queue(capPow2) { - this._capacity = capPow2 || 32; - this._length = 0; - this._head = 0; -} - -Queue.prototype.push = function (x) { - var len = this._length; - this._checkCapacity(len + 1); - - var i = this._head + len & this._capacity - 1; - this[i] = x; - this._length = len + 1; -}; - -Queue.prototype.shift = function () { - var head = this._head; - var x = this[head]; - - this[head] = void 0; - this._head = head + 1 & this._capacity - 1; - this._length--; - return x; -}; - -Queue.prototype.isEmpty = function () { - return this._length === 0; -}; - -Queue.prototype.length = function () { - return this._length; -}; - -Queue.prototype._checkCapacity = function (size) { - if (this._capacity < size) { - this._ensureCapacity(this._capacity << 1); - } -}; - -Queue.prototype._ensureCapacity = function (capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - - var last = this._head + this._length; - - if (last > oldCapacity) { - copy(this, 0, this, oldCapacity, last & oldCapacity - 1); - } -}; - -function copy(src, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src[j + srcIndex]; - src[j + srcIndex] = void 0; - } -} -},{}],20:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Stream; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Stream(source) { - this.source = source; -} -},{}],21:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.scan = scan; -exports.reduce = reduce; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _runSource = require('../runSource'); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Create a stream containing successive reduce results of applying f to - * the previous reduce result and the current stream item. - * @param {function(result:*, x:*):*} f reducer function - * @param {*} initial initial value - * @param {Stream} stream stream to scan - * @returns {Stream} new stream containing successive reduce results - */ -function scan(f, initial, stream) { - return new _Stream2.default(new Scan(f, initial, stream.source)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Scan(f, z, source) { - this.source = source; - this.f = f; - this.value = z; -} - -Scan.prototype.run = function (sink, scheduler) { - var d1 = scheduler.asap(_PropagateTask2.default.event(this.value, sink)); - var d2 = this.source.run(new ScanSink(this.f, this.value, sink), scheduler); - return dispose.all([d1, d2]); -}; - -function ScanSink(f, z, sink) { - this.f = f; - this.value = z; - this.sink = sink; -} - -ScanSink.prototype.event = function (t, x) { - var f = this.f; - this.value = f(this.value, x); - this.sink.event(t, this.value); -}; - -ScanSink.prototype.error = _Pipe2.default.prototype.error; -ScanSink.prototype.end = _Pipe2.default.prototype.end; - -/** -* Reduce a stream to produce a single result. Note that reducing an infinite -* stream will return a Promise that never fulfills, but that may reject if an error -* occurs. -* @param {function(result:*, x:*):*} f reducer function -* @param {*} initial initial value -* @param {Stream} stream to reduce -* @returns {Promise} promise for the file result of the reduce -*/ -function reduce(f, initial, stream) { - return (0, _runSource.withDefaultScheduler)(new Reduce(f, initial, stream.source)); -} - -function Reduce(f, z, source) { - this.source = source; - this.f = f; - this.value = z; -} - -Reduce.prototype.run = function (sink, scheduler) { - return this.source.run(new ReduceSink(this.f, this.value, sink), scheduler); -}; - -function ReduceSink(f, z, sink) { - this.f = f; - this.value = z; - this.sink = sink; -} - -ReduceSink.prototype.event = function (t, x) { - var f = this.f; - this.value = f(this.value, x); - this.sink.event(t, this.value); -}; - -ReduceSink.prototype.error = _Pipe2.default.prototype.error; - -ReduceSink.prototype.end = function (t) { - this.sink.end(t, this.value); -}; -},{"../Stream":20,"../disposable/dispose":48,"../runSource":58,"../scheduler/PropagateTask":60,"../sink/Pipe":67}],22:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ap = ap; - -var _combine = require('./combine'); - -var _prelude = require('@most/prelude'); - -/** - * Assume fs is a stream containing functions, and apply the latest function - * in fs to the latest value in xs. - * fs: --f---------g--------h------> - * xs: -a-------b-------c-------d--> - * ap(fs, xs): --fa-----fb-gb---gc--hc--hd-> - * @param {Stream} fs stream of functions to apply to the latest x - * @param {Stream} xs stream of values to which to apply all the latest f - * @returns {Stream} stream containing all the applications of fs to xs - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function ap(fs, xs) { - return (0, _combine.combine)(_prelude.apply, fs, xs); -} -},{"./combine":24,"@most/prelude":2}],23:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.cons = cons; -exports.concat = concat; - -var _core = require('../source/core'); - -var _continueWith = require('./continueWith'); - -/** - * @param {*} x value to prepend - * @param {Stream} stream - * @returns {Stream} new stream with x prepended - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function cons(x, stream) { - return concat((0, _core.of)(x), stream); -} - -/** -* @param {Stream} left -* @param {Stream} right -* @returns {Stream} new stream containing all events in left followed by all -* events in right. This *timeshifts* right to the end of left. -*/ -function concat(left, right) { - return (0, _continueWith.continueWith)(function () { - return right; - }, left); -} -},{"../source/core":71,"./continueWith":26}],24:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.combine = combine; -exports.combineArray = combineArray; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _transform = require('./transform'); - -var transform = _interopRequireWildcard(_transform); - -var _core = require('../source/core'); - -var core = _interopRequireWildcard(_core); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _IndexSink = require('../sink/IndexSink'); - -var _IndexSink2 = _interopRequireDefault(_IndexSink); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -var _invoke = require('../invoke'); - -var _invoke2 = _interopRequireDefault(_invoke); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -var map = base.map; -var tail = base.tail; - -/** - * Combine latest events from all input streams - * @param {function(...events):*} f function to combine most recent events - * @returns {Stream} stream containing the result of applying f to the most recent - * event of each input stream, whenever a new event arrives on any stream. - */ -function combine(f /*, ...streams */) { - return combineArray(f, tail(arguments)); -} - -/** -* Combine latest events from all input streams -* @param {function(...events):*} f function to combine most recent events -* @param {[Stream]} streams most recent events -* @returns {Stream} stream containing the result of applying f to the most recent -* event of each input stream, whenever a new event arrives on any stream. -*/ -function combineArray(f, streams) { - var l = streams.length; - return l === 0 ? core.empty() : l === 1 ? transform.map(f, streams[0]) : new _Stream2.default(combineSources(f, streams)); -} - -function combineSources(f, streams) { - return new Combine(f, map(getSource, streams)); -} - -function getSource(stream) { - return stream.source; -} - -function Combine(f, sources) { - this.f = f; - this.sources = sources; -} - -Combine.prototype.run = function (sink, scheduler) { - var this$1 = this; - - var l = this.sources.length; - var disposables = new Array(l); - var sinks = new Array(l); - - var mergeSink = new CombineSink(disposables, sinks, sink, this.f); - - for (var indexSink, i = 0; i < l; ++i) { - indexSink = sinks[i] = new _IndexSink2.default(i, mergeSink); - disposables[i] = this$1.sources[i].run(indexSink, scheduler); - } - - return dispose.all(disposables); -}; - -function CombineSink(disposables, sinks, sink, f) { - var this$1 = this; - - this.sink = sink; - this.disposables = disposables; - this.sinks = sinks; - this.f = f; - - var l = sinks.length; - this.awaiting = l; - this.values = new Array(l); - this.hasValue = new Array(l); - for (var i = 0; i < l; ++i) { - this$1.hasValue[i] = false; - } - - this.activeCount = sinks.length; -} - -CombineSink.prototype.error = _Pipe2.default.prototype.error; - -CombineSink.prototype.event = function (t, indexedValue) { - var i = indexedValue.index; - var awaiting = this._updateReady(i); - - this.values[i] = indexedValue.value; - if (awaiting === 0) { - this.sink.event(t, (0, _invoke2.default)(this.f, this.values)); - } -}; - -CombineSink.prototype._updateReady = function (index) { - if (this.awaiting > 0) { - if (!this.hasValue[index]) { - this.hasValue[index] = true; - this.awaiting -= 1; - } - } - return this.awaiting; -}; - -CombineSink.prototype.end = function (t, indexedValue) { - dispose.tryDispose(t, this.disposables[indexedValue.index], this.sink); - if (--this.activeCount === 0) { - this.sink.end(t, indexedValue.value); - } -}; -},{"../Stream":20,"../disposable/dispose":48,"../invoke":53,"../sink/IndexSink":66,"../sink/Pipe":67,"../source/core":71,"./transform":44,"@most/prelude":2}],25:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.concatMap = concatMap; - -var _mergeConcurrently = require('./mergeConcurrently'); - -/** - * Map each value in stream to a new stream, and concatenate them all - * stream: -a---b---cX - * f(a): 1-1-1-1X - * f(b): -2-2-2-2X - * f(c): -3-3-3-3X - * stream.concatMap(f): -1-1-1-1-2-2-2-2-3-3-3-3X - * @param {function(x:*):Stream} f function to map each value to a stream - * @param {Stream} stream - * @returns {Stream} new stream containing all events from each stream returned by f - */ -function concatMap(f, stream) { - return (0, _mergeConcurrently.mergeMapConcurrently)(f, 1, stream); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ -},{"./mergeConcurrently":34}],26:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.continueWith = continueWith; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function continueWith(f, stream) { - return new _Stream2.default(new ContinueWith(f, stream.source)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function ContinueWith(f, source) { - this.f = f; - this.source = source; -} - -ContinueWith.prototype.run = function (sink, scheduler) { - return new ContinueWithSink(this.f, this.source, sink, scheduler); -}; - -function ContinueWithSink(f, source, sink, scheduler) { - this.f = f; - this.sink = sink; - this.scheduler = scheduler; - this.active = true; - this.disposable = dispose.once(source.run(this, scheduler)); -} - -ContinueWithSink.prototype.error = _Pipe2.default.prototype.error; - -ContinueWithSink.prototype.event = function (t, x) { - if (!this.active) { - return; - } - this.sink.event(t, x); -}; - -ContinueWithSink.prototype.end = function (t, x) { - if (!this.active) { - return; - } - - dispose.tryDispose(t, this.disposable, this.sink); - this._startNext(t, x, this.sink); -}; - -ContinueWithSink.prototype._startNext = function (t, x, sink) { - try { - this.disposable = this._continue(this.f, x, sink); - } catch (e) { - sink.error(t, e); - } -}; - -ContinueWithSink.prototype._continue = function (f, x, sink) { - return f(x).source.run(sink, this.scheduler); -}; - -ContinueWithSink.prototype.dispose = function () { - this.active = false; - return this.disposable.dispose(); -}; -},{"../Stream":20,"../disposable/dispose":48,"../sink/Pipe":67}],27:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.delay = delay; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Number} delayTime milliseconds to delay each item - * @param {Stream} stream - * @returns {Stream} new stream containing the same items, but delayed by ms - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function delay(delayTime, stream) { - return delayTime <= 0 ? stream : new _Stream2.default(new Delay(delayTime, stream.source)); -} - -function Delay(dt, source) { - this.dt = dt; - this.source = source; -} - -Delay.prototype.run = function (sink, scheduler) { - var delaySink = new DelaySink(this.dt, sink, scheduler); - return dispose.all([delaySink, this.source.run(delaySink, scheduler)]); -}; - -function DelaySink(dt, sink, scheduler) { - this.dt = dt; - this.sink = sink; - this.scheduler = scheduler; -} - -DelaySink.prototype.dispose = function () { - var self = this; - this.scheduler.cancelAll(function (task) { - return task.sink === self.sink; - }); -}; - -DelaySink.prototype.event = function (t, x) { - this.scheduler.delay(this.dt, _PropagateTask2.default.event(x, this.sink)); -}; - -DelaySink.prototype.end = function (t, x) { - this.scheduler.delay(this.dt, _PropagateTask2.default.end(x, this.sink)); -}; - -DelaySink.prototype.error = _Pipe2.default.prototype.error; -},{"../Stream":20,"../disposable/dispose":48,"../scheduler/PropagateTask":60,"../sink/Pipe":67}],28:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.flatMapError = undefined; -exports.recoverWith = recoverWith; -exports.throwError = throwError; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _SafeSink = require('../sink/SafeSink'); - -var _SafeSink2 = _interopRequireDefault(_SafeSink); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _tryEvent = require('../source/tryEvent'); - -var tryEvent = _interopRequireWildcard(_tryEvent); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * If stream encounters an error, recover and continue with items from stream - * returned by f. - * @param {function(error:*):Stream} f function which returns a new stream - * @param {Stream} stream - * @returns {Stream} new stream which will recover from an error by calling f - */ -function recoverWith(f, stream) { - return new _Stream2.default(new RecoverWith(f, stream.source)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -var flatMapError = exports.flatMapError = recoverWith; - -/** - * Create a stream containing only an error - * @param {*} e error value, preferably an Error or Error subtype - * @returns {Stream} new stream containing only an error - */ -function throwError(e) { - return new _Stream2.default(new ErrorSource(e)); -} - -function ErrorSource(e) { - this.value = e; -} - -ErrorSource.prototype.run = function (sink, scheduler) { - return scheduler.asap(new _PropagateTask2.default(runError, this.value, sink)); -}; - -function runError(t, e, sink) { - sink.error(t, e); -} - -function RecoverWith(f, source) { - this.f = f; - this.source = source; -} - -RecoverWith.prototype.run = function (sink, scheduler) { - return new RecoverWithSink(this.f, this.source, sink, scheduler); -}; - -function RecoverWithSink(f, source, sink, scheduler) { - this.f = f; - this.sink = new _SafeSink2.default(sink); - this.scheduler = scheduler; - this.disposable = source.run(this, scheduler); -} - -RecoverWithSink.prototype.event = function (t, x) { - tryEvent.tryEvent(t, x, this.sink); -}; - -RecoverWithSink.prototype.end = function (t, x) { - tryEvent.tryEnd(t, x, this.sink); -}; - -RecoverWithSink.prototype.error = function (t, e) { - var nextSink = this.sink.disable(); - - dispose.tryDispose(t, this.disposable, this.sink); - this._startNext(t, e, nextSink); -}; - -RecoverWithSink.prototype._startNext = function (t, x, sink) { - try { - this.disposable = this._continue(this.f, x, sink); - } catch (e) { - sink.error(t, e); - } -}; - -RecoverWithSink.prototype._continue = function (f, x, sink) { - var stream = f(x); - return stream.source.run(sink, this.scheduler); -}; - -RecoverWithSink.prototype.dispose = function () { - return this.disposable.dispose(); -}; -},{"../Stream":20,"../disposable/dispose":48,"../scheduler/PropagateTask":60,"../sink/SafeSink":68,"../source/tryEvent":79}],29:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.filter = filter; -exports.skipRepeats = skipRepeats; -exports.skipRepeatsWith = skipRepeatsWith; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _Filter = require('../fusion/Filter'); - -var _Filter2 = _interopRequireDefault(_Filter); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Retain only items matching a predicate - * @param {function(x:*):boolean} p filtering predicate called for each item - * @param {Stream} stream stream to filter - * @returns {Stream} stream containing only items for which predicate returns truthy - */ -function filter(p, stream) { - return new _Stream2.default(_Filter2.default.create(p, stream.source)); -} - -/** - * Skip repeated events, using === to detect duplicates - * @param {Stream} stream stream from which to omit repeated events - * @returns {Stream} stream without repeated events - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function skipRepeats(stream) { - return skipRepeatsWith(same, stream); -} - -/** - * Skip repeated events using the provided equals function to detect duplicates - * @param {function(a:*, b:*):boolean} equals optional function to compare items - * @param {Stream} stream stream from which to omit repeated events - * @returns {Stream} stream without repeated events - */ -function skipRepeatsWith(equals, stream) { - return new _Stream2.default(new SkipRepeats(equals, stream.source)); -} - -function SkipRepeats(equals, source) { - this.equals = equals; - this.source = source; -} - -SkipRepeats.prototype.run = function (sink, scheduler) { - return this.source.run(new SkipRepeatsSink(this.equals, sink), scheduler); -}; - -function SkipRepeatsSink(equals, sink) { - this.equals = equals; - this.sink = sink; - this.value = void 0; - this.init = true; -} - -SkipRepeatsSink.prototype.end = _Pipe2.default.prototype.end; -SkipRepeatsSink.prototype.error = _Pipe2.default.prototype.error; - -SkipRepeatsSink.prototype.event = function (t, x) { - if (this.init) { - this.init = false; - this.value = x; - this.sink.event(t, x); - } else if (!this.equals(this.value, x)) { - this.value = x; - this.sink.event(t, x); - } -}; - -function same(a, b) { - return a === b; -} -},{"../Stream":20,"../fusion/Filter":50,"../sink/Pipe":67}],30:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.flatMap = flatMap; -exports.join = join; - -var _mergeConcurrently = require('./mergeConcurrently'); - -/** - * Map each value in the stream to a new stream, and merge it into the - * returned outer stream. Event arrival times are preserved. - * @param {function(x:*):Stream} f chaining function, must return a Stream - * @param {Stream} stream - * @returns {Stream} new stream containing all events from each stream returned by f - */ -function flatMap(f, stream) { - return (0, _mergeConcurrently.mergeMapConcurrently)(f, Infinity, stream); -} - -/** - * Monadic join. Flatten a Stream> to Stream by merging inner - * streams to the outer. Event arrival times are preserved. - * @param {Stream>} stream stream of streams - * @returns {Stream} new stream containing all events of all inner streams - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function join(stream) { - return (0, _mergeConcurrently.mergeConcurrently)(Infinity, stream); -} -},{"./mergeConcurrently":34}],31:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.throttle = throttle; -exports.debounce = debounce; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -var _Map = require('../fusion/Map'); - -var _Map2 = _interopRequireDefault(_Map); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Limit the rate of events by suppressing events that occur too often - * @param {Number} period time to suppress events - * @param {Stream} stream - * @returns {Stream} - */ -function throttle(period, stream) { - return new _Stream2.default(throttleSource(period, stream.source)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function throttleSource(period, source) { - return source instanceof _Map2.default ? commuteMapThrottle(period, source) : source instanceof Throttle ? fuseThrottle(period, source) : new Throttle(period, source); -} - -function commuteMapThrottle(period, source) { - return _Map2.default.create(source.f, throttleSource(period, source.source)); -} - -function fuseThrottle(period, source) { - return new Throttle(Math.max(period, source.period), source.source); -} - -function Throttle(period, source) { - this.period = period; - this.source = source; -} - -Throttle.prototype.run = function (sink, scheduler) { - return this.source.run(new ThrottleSink(this.period, sink), scheduler); -}; - -function ThrottleSink(period, sink) { - this.time = 0; - this.period = period; - this.sink = sink; -} - -ThrottleSink.prototype.event = function (t, x) { - if (t >= this.time) { - this.time = t + this.period; - this.sink.event(t, x); - } -}; - -ThrottleSink.prototype.end = _Pipe2.default.prototype.end; - -ThrottleSink.prototype.error = _Pipe2.default.prototype.error; - -/** - * Wait for a burst of events to subside and emit only the last event in the burst - * @param {Number} period events occuring more frequently than this - * will be suppressed - * @param {Stream} stream stream to debounce - * @returns {Stream} new debounced stream - */ -function debounce(period, stream) { - return new _Stream2.default(new Debounce(period, stream.source)); -} - -function Debounce(dt, source) { - this.dt = dt; - this.source = source; -} - -Debounce.prototype.run = function (sink, scheduler) { - return new DebounceSink(this.dt, this.source, sink, scheduler); -}; - -function DebounceSink(dt, source, sink, scheduler) { - this.dt = dt; - this.sink = sink; - this.scheduler = scheduler; - this.value = void 0; - this.timer = null; - - var sourceDisposable = source.run(this, scheduler); - this.disposable = dispose.all([this, sourceDisposable]); -} - -DebounceSink.prototype.event = function (t, x) { - this._clearTimer(); - this.value = x; - this.timer = this.scheduler.delay(this.dt, _PropagateTask2.default.event(x, this.sink)); -}; - -DebounceSink.prototype.end = function (t, x) { - if (this._clearTimer()) { - this.sink.event(t, this.value); - this.value = void 0; - } - this.sink.end(t, x); -}; - -DebounceSink.prototype.error = function (t, x) { - this._clearTimer(); - this.sink.error(t, x); -}; - -DebounceSink.prototype.dispose = function () { - this._clearTimer(); -}; - -DebounceSink.prototype._clearTimer = function () { - if (this.timer === null) { - return false; - } - this.timer.dispose(); - this.timer = null; - return true; -}; -},{"../Stream":20,"../disposable/dispose":48,"../fusion/Map":52,"../scheduler/PropagateTask":60,"../sink/Pipe":67}],32:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.loop = loop; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Generalized feedback loop. Call a stepper function for each event. The stepper - * will be called with 2 params: the current seed and the an event value. It must - * return a new { seed, value } pair. The `seed` will be fed back into the next - * invocation of stepper, and the `value` will be propagated as the event value. - * @param {function(seed:*, value:*):{seed:*, value:*}} stepper loop step function - * @param {*} seed initial seed value passed to first stepper call - * @param {Stream} stream event stream - * @returns {Stream} new stream whose values are the `value` field of the objects - * returned by the stepper - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function loop(stepper, seed, stream) { - return new _Stream2.default(new Loop(stepper, seed, stream.source)); -} - -function Loop(stepper, seed, source) { - this.step = stepper; - this.seed = seed; - this.source = source; -} - -Loop.prototype.run = function (sink, scheduler) { - return this.source.run(new LoopSink(this.step, this.seed, sink), scheduler); -}; - -function LoopSink(stepper, seed, sink) { - this.step = stepper; - this.seed = seed; - this.sink = sink; -} - -LoopSink.prototype.error = _Pipe2.default.prototype.error; - -LoopSink.prototype.event = function (t, x) { - var result = this.step(this.seed, x); - this.seed = result.seed; - this.sink.event(t, result.value); -}; - -LoopSink.prototype.end = function (t) { - this.sink.end(t, this.seed); -}; -},{"../Stream":20,"../sink/Pipe":67}],33:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.merge = merge; -exports.mergeArray = mergeArray; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _IndexSink = require('../sink/IndexSink'); - -var _IndexSink2 = _interopRequireDefault(_IndexSink); - -var _core = require('../source/core'); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -var copy = base.copy; -var reduce = base.reduce; - -/** - * @returns {Stream} stream containing events from all streams in the argument - * list in time order. If two events are simultaneous they will be merged in - * arbitrary order. - */ -function merge() /* ...streams*/{ - return mergeArray(copy(arguments)); -} - -/** - * @param {Array} streams array of stream to merge - * @returns {Stream} stream containing events from all input observables - * in time order. If two events are simultaneous they will be merged in - * arbitrary order. - */ -function mergeArray(streams) { - var l = streams.length; - return l === 0 ? (0, _core.empty)() : l === 1 ? streams[0] : new _Stream2.default(mergeSources(streams)); -} - -/** - * This implements fusion/flattening for merge. It will - * fuse adjacent merge operations. For example: - * - a.merge(b).merge(c) effectively becomes merge(a, b, c) - * - merge(a, merge(b, c)) effectively becomes merge(a, b, c) - * It does this by concatenating the sources arrays of - * any nested Merge sources, in effect "flattening" nested - * merge operations into a single merge. - */ -function mergeSources(streams) { - return new Merge(reduce(appendSources, [], streams)); -} - -function appendSources(sources, stream) { - var source = stream.source; - return source instanceof Merge ? sources.concat(source.sources) : sources.concat(source); -} - -function Merge(sources) { - this.sources = sources; -} - -Merge.prototype.run = function (sink, scheduler) { - var this$1 = this; - - var l = this.sources.length; - var disposables = new Array(l); - var sinks = new Array(l); - - var mergeSink = new MergeSink(disposables, sinks, sink); - - for (var indexSink, i = 0; i < l; ++i) { - indexSink = sinks[i] = new _IndexSink2.default(i, mergeSink); - disposables[i] = this$1.sources[i].run(indexSink, scheduler); - } - - return dispose.all(disposables); -}; - -function MergeSink(disposables, sinks, sink) { - this.sink = sink; - this.disposables = disposables; - this.activeCount = sinks.length; -} - -MergeSink.prototype.error = _Pipe2.default.prototype.error; - -MergeSink.prototype.event = function (t, indexValue) { - this.sink.event(t, indexValue.value); -}; - -MergeSink.prototype.end = function (t, indexedValue) { - dispose.tryDispose(t, this.disposables[indexedValue.index], this.sink); - if (--this.activeCount === 0) { - this.sink.end(t, indexedValue.value); - } -}; -},{"../Stream":20,"../disposable/dispose":48,"../sink/IndexSink":66,"../sink/Pipe":67,"../source/core":71,"@most/prelude":2}],34:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mergeConcurrently = mergeConcurrently; -exports.mergeMapConcurrently = mergeMapConcurrently; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _LinkedList = require('../LinkedList'); - -var _LinkedList2 = _interopRequireDefault(_LinkedList); - -var _prelude = require('@most/prelude'); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function mergeConcurrently(concurrency, stream) { - return mergeMapConcurrently(_prelude.id, concurrency, stream); -} - -function mergeMapConcurrently(f, concurrency, stream) { - return new _Stream2.default(new MergeConcurrently(f, concurrency, stream.source)); -} - -function MergeConcurrently(f, concurrency, source) { - this.f = f; - this.concurrency = concurrency; - this.source = source; -} - -MergeConcurrently.prototype.run = function (sink, scheduler) { - return new Outer(this.f, this.concurrency, this.source, sink, scheduler); -}; - -function Outer(f, concurrency, source, sink, scheduler) { - this.f = f; - this.concurrency = concurrency; - this.sink = sink; - this.scheduler = scheduler; - this.pending = []; - this.current = new _LinkedList2.default(); - this.disposable = dispose.once(source.run(this, scheduler)); - this.active = true; -} - -Outer.prototype.event = function (t, x) { - this._addInner(t, x); -}; - -Outer.prototype._addInner = function (t, x) { - if (this.current.length < this.concurrency) { - this._startInner(t, x); - } else { - this.pending.push(x); - } -}; - -Outer.prototype._startInner = function (t, x) { - try { - this._initInner(t, x); - } catch (e) { - this.error(t, e); - } -}; - -Outer.prototype._initInner = function (t, x) { - var innerSink = new Inner(t, this, this.sink); - innerSink.disposable = mapAndRun(this.f, x, innerSink, this.scheduler); - this.current.add(innerSink); -}; - -function mapAndRun(f, x, sink, scheduler) { - return f(x).source.run(sink, scheduler); -} - -Outer.prototype.end = function (t, x) { - this.active = false; - dispose.tryDispose(t, this.disposable, this.sink); - this._checkEnd(t, x); -}; - -Outer.prototype.error = function (t, e) { - this.active = false; - this.sink.error(t, e); -}; - -Outer.prototype.dispose = function () { - this.active = false; - this.pending.length = 0; - return Promise.all([this.disposable.dispose(), this.current.dispose()]); -}; - -Outer.prototype._endInner = function (t, x, inner) { - this.current.remove(inner); - dispose.tryDispose(t, inner, this); - - if (this.pending.length === 0) { - this._checkEnd(t, x); - } else { - this._startInner(t, this.pending.shift()); - } -}; - -Outer.prototype._checkEnd = function (t, x) { - if (!this.active && this.current.isEmpty()) { - this.sink.end(t, x); - } -}; - -function Inner(time, outer, sink) { - this.prev = this.next = null; - this.time = time; - this.outer = outer; - this.sink = sink; - this.disposable = void 0; -} - -Inner.prototype.event = function (t, x) { - this.sink.event(Math.max(t, this.time), x); -}; - -Inner.prototype.end = function (t, x) { - this.outer._endInner(Math.max(t, this.time), x, this); -}; - -Inner.prototype.error = function (t, e) { - this.outer.error(Math.max(t, this.time), e); -}; - -Inner.prototype.dispose = function () { - return this.disposable.dispose(); -}; -},{"../LinkedList":17,"../Stream":20,"../disposable/dispose":48,"@most/prelude":2}],35:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.observe = observe; -exports.drain = drain; - -var _runSource = require('../runSource'); - -var _transform = require('./transform'); - -/** - * Observe all the event values in the stream in time order. The - * provided function `f` will be called for each event value - * @param {function(x:T):*} f function to call with each event value - * @param {Stream} stream stream to observe - * @return {Promise} promise that fulfills after the stream ends without - * an error, or rejects if the stream ends with an error. - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function observe(f, stream) { - return drain((0, _transform.tap)(f, stream)); -} - -/** - * "Run" a stream by creating demand and consuming all events - * @param {Stream} stream stream to drain - * @return {Promise} promise that fulfills after the stream ends without - * an error, or rejects if the stream ends with an error. - */ -function drain(stream) { - return (0, _runSource.withDefaultScheduler)(stream.source); -} -},{"../runSource":58,"./transform":44}],36:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fromPromise = fromPromise; -exports.awaitPromises = awaitPromises; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _fatalError = require('../fatalError'); - -var _fatalError2 = _interopRequireDefault(_fatalError); - -var _core = require('../source/core'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Create a stream containing only the promise's fulfillment - * value at the time it fulfills. - * @param {Promise} p promise - * @return {Stream} stream containing promise's fulfillment value. - * If the promise rejects, the stream will error - */ -function fromPromise(p) { - return awaitPromises((0, _core.of)(p)); -} - -/** - * Turn a Stream> into Stream by awaiting each promise. - * Event order is preserved. - * @param {Stream>} stream - * @return {Stream} stream of fulfillment values. The stream will - * error if any promise rejects. - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function awaitPromises(stream) { - return new _Stream2.default(new Await(stream.source)); -} - -function Await(source) { - this.source = source; -} - -Await.prototype.run = function (sink, scheduler) { - return this.source.run(new AwaitSink(sink, scheduler), scheduler); -}; - -function AwaitSink(sink, scheduler) { - this.sink = sink; - this.scheduler = scheduler; - this.queue = Promise.resolve(); - var self = this; - - // Pre-create closures, to avoid creating them per event - this._eventBound = function (x) { - self.sink.event(self.scheduler.now(), x); - }; - - this._endBound = function (x) { - self.sink.end(self.scheduler.now(), x); - }; - - this._errorBound = function (e) { - self.sink.error(self.scheduler.now(), e); - }; -} - -AwaitSink.prototype.event = function (t, promise) { - var self = this; - this.queue = this.queue.then(function () { - return self._event(promise); - }).catch(this._errorBound); -}; - -AwaitSink.prototype.end = function (t, x) { - var self = this; - this.queue = this.queue.then(function () { - return self._end(x); - }).catch(this._errorBound); -}; - -AwaitSink.prototype.error = function (t, e) { - var self = this; - // Don't resolve error values, propagate directly - this.queue = this.queue.then(function () { - return self._errorBound(e); - }).catch(_fatalError2.default); -}; - -AwaitSink.prototype._event = function (promise) { - return promise.then(this._eventBound); -}; - -AwaitSink.prototype._end = function (x) { - return Promise.resolve(x).then(this._endBound); -}; -},{"../Stream":20,"../fatalError":49,"../source/core":71}],37:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sample = sample; -exports.sampleWith = sampleWith; -exports.sampleArray = sampleArray; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -var _invoke = require('../invoke'); - -var _invoke2 = _interopRequireDefault(_invoke); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * When an event arrives on sampler, emit the result of calling f with the latest - * values of all streams being sampled - * @param {function(...values):*} f function to apply to each set of sampled values - * @param {Stream} sampler streams will be sampled whenever an event arrives - * on sampler - * @returns {Stream} stream of sampled and transformed values - */ -function sample(f, sampler /*, ...streams */) { - return sampleArray(f, sampler, base.drop(2, arguments)); -} - -/** - * When an event arrives on sampler, emit the latest event value from stream. - * @param {Stream} sampler stream of events at whose arrival time - * stream's latest value will be propagated - * @param {Stream} stream stream of values - * @returns {Stream} sampled stream of values - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function sampleWith(sampler, stream) { - return new _Stream2.default(new Sampler(base.id, sampler.source, [stream.source])); -} - -function sampleArray(f, sampler, streams) { - return new _Stream2.default(new Sampler(f, sampler.source, base.map(getSource, streams))); -} - -function getSource(stream) { - return stream.source; -} - -function Sampler(f, sampler, sources) { - this.f = f; - this.sampler = sampler; - this.sources = sources; -} - -Sampler.prototype.run = function (sink, scheduler) { - var this$1 = this; - - var l = this.sources.length; - var disposables = new Array(l + 1); - var sinks = new Array(l); - - var sampleSink = new SampleSink(this.f, sinks, sink); - - for (var hold, i = 0; i < l; ++i) { - hold = sinks[i] = new Hold(sampleSink); - disposables[i] = this$1.sources[i].run(hold, scheduler); - } - - disposables[i] = this.sampler.run(sampleSink, scheduler); - - return dispose.all(disposables); -}; - -function Hold(sink) { - this.sink = sink; - this.hasValue = false; -} - -Hold.prototype.event = function (t, x) { - this.value = x; - this.hasValue = true; - this.sink._notify(this); -}; - -Hold.prototype.end = function () {}; -Hold.prototype.error = _Pipe2.default.prototype.error; - -function SampleSink(f, sinks, sink) { - this.f = f; - this.sinks = sinks; - this.sink = sink; - this.active = false; -} - -SampleSink.prototype._notify = function () { - if (!this.active) { - this.active = this.sinks.every(hasValue); - } -}; - -SampleSink.prototype.event = function (t) { - if (this.active) { - this.sink.event(t, (0, _invoke2.default)(this.f, base.map(getValue, this.sinks))); - } -}; - -SampleSink.prototype.end = _Pipe2.default.prototype.end; -SampleSink.prototype.error = _Pipe2.default.prototype.error; - -function hasValue(hold) { - return hold.hasValue; -} - -function getValue(hold) { - return hold.value; -} -},{"../Stream":20,"../disposable/dispose":48,"../invoke":53,"../sink/Pipe":67,"@most/prelude":2}],38:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.take = take; -exports.skip = skip; -exports.slice = slice; -exports.takeWhile = takeWhile; -exports.skipWhile = skipWhile; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _core = require('../source/core'); - -var core = _interopRequireWildcard(_core); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _Map = require('../fusion/Map'); - -var _Map2 = _interopRequireDefault(_Map); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {number} n - * @param {Stream} stream - * @returns {Stream} new stream containing only up to the first n items from stream - */ -function take(n, stream) { - return slice(0, n, stream); -} - -/** - * @param {number} n - * @param {Stream} stream - * @returns {Stream} new stream with the first n items removed - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function skip(n, stream) { - return slice(n, Infinity, stream); -} - -/** - * Slice a stream by index. Negative start/end indexes are not supported - * @param {number} start - * @param {number} end - * @param {Stream} stream - * @returns {Stream} stream containing items where start <= index < end - */ -function slice(start, end, stream) { - return end <= start ? core.empty() : new _Stream2.default(sliceSource(start, end, stream.source)); -} - -function sliceSource(start, end, source) { - return source instanceof _Map2.default ? commuteMapSlice(start, end, source) : source instanceof Slice ? fuseSlice(start, end, source) : new Slice(start, end, source); -} - -function commuteMapSlice(start, end, source) { - return _Map2.default.create(source.f, sliceSource(start, end, source.source)); -} - -function fuseSlice(start, end, source) { - start += source.min; - end = Math.min(end + source.min, source.max); - return new Slice(start, end, source.source); -} - -function Slice(min, max, source) { - this.source = source; - this.min = min; - this.max = max; -} - -Slice.prototype.run = function (sink, scheduler) { - return new SliceSink(this.min, this.max - this.min, this.source, sink, scheduler); -}; - -function SliceSink(skip, take, source, sink, scheduler) { - this.sink = sink; - this.skip = skip; - this.take = take; - this.disposable = dispose.once(source.run(this, scheduler)); -} - -SliceSink.prototype.end = _Pipe2.default.prototype.end; -SliceSink.prototype.error = _Pipe2.default.prototype.error; - -SliceSink.prototype.event = function (t, x) { - // eslint-disable-line complexity - if (this.skip > 0) { - this.skip -= 1; - return; - } - - if (this.take === 0) { - return; - } - - this.take -= 1; - this.sink.event(t, x); - if (this.take === 0) { - this.dispose(); - this.sink.end(t, x); - } -}; - -SliceSink.prototype.dispose = function () { - return this.disposable.dispose(); -}; - -function takeWhile(p, stream) { - return new _Stream2.default(new TakeWhile(p, stream.source)); -} - -function TakeWhile(p, source) { - this.p = p; - this.source = source; -} - -TakeWhile.prototype.run = function (sink, scheduler) { - return new TakeWhileSink(this.p, this.source, sink, scheduler); -}; - -function TakeWhileSink(p, source, sink, scheduler) { - this.p = p; - this.sink = sink; - this.active = true; - this.disposable = dispose.once(source.run(this, scheduler)); -} - -TakeWhileSink.prototype.end = _Pipe2.default.prototype.end; -TakeWhileSink.prototype.error = _Pipe2.default.prototype.error; - -TakeWhileSink.prototype.event = function (t, x) { - if (!this.active) { - return; - } - - var p = this.p; - this.active = p(x); - if (this.active) { - this.sink.event(t, x); - } else { - this.dispose(); - this.sink.end(t, x); - } -}; - -TakeWhileSink.prototype.dispose = function () { - return this.disposable.dispose(); -}; - -function skipWhile(p, stream) { - return new _Stream2.default(new SkipWhile(p, stream.source)); -} - -function SkipWhile(p, source) { - this.p = p; - this.source = source; -} - -SkipWhile.prototype.run = function (sink, scheduler) { - return this.source.run(new SkipWhileSink(this.p, sink), scheduler); -}; - -function SkipWhileSink(p, sink) { - this.p = p; - this.sink = sink; - this.skipping = true; -} - -SkipWhileSink.prototype.end = _Pipe2.default.prototype.end; -SkipWhileSink.prototype.error = _Pipe2.default.prototype.error; - -SkipWhileSink.prototype.event = function (t, x) { - if (this.skipping) { - var p = this.p; - this.skipping = p(x); - if (this.skipping) { - return; - } - } - - this.sink.event(t, x); -}; -},{"../Stream":20,"../disposable/dispose":48,"../fusion/Map":52,"../sink/Pipe":67,"../source/core":71}],39:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.switch = undefined; -exports.switchLatest = switchLatest; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Given a stream of streams, return a new stream that adopts the behavior - * of the most recent inner stream. - * @param {Stream} stream of streams on which to switch - * @returns {Stream} switching stream - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function switchLatest(stream) { - return new _Stream2.default(new Switch(stream.source)); -} - -exports.switch = switchLatest; - - -function Switch(source) { - this.source = source; -} - -Switch.prototype.run = function (sink, scheduler) { - var switchSink = new SwitchSink(sink, scheduler); - return dispose.all([switchSink, this.source.run(switchSink, scheduler)]); -}; - -function SwitchSink(sink, scheduler) { - this.sink = sink; - this.scheduler = scheduler; - this.current = null; - this.ended = false; -} - -SwitchSink.prototype.event = function (t, stream) { - this._disposeCurrent(t); // TODO: capture the result of this dispose - this.current = new Segment(t, Infinity, this, this.sink); - this.current.disposable = stream.source.run(this.current, this.scheduler); -}; - -SwitchSink.prototype.end = function (t, x) { - this.ended = true; - this._checkEnd(t, x); -}; - -SwitchSink.prototype.error = function (t, e) { - this.ended = true; - this.sink.error(t, e); -}; - -SwitchSink.prototype.dispose = function () { - return this._disposeCurrent(this.scheduler.now()); -}; - -SwitchSink.prototype._disposeCurrent = function (t) { - if (this.current !== null) { - return this.current._dispose(t); - } -}; - -SwitchSink.prototype._disposeInner = function (t, inner) { - inner._dispose(t); // TODO: capture the result of this dispose - if (inner === this.current) { - this.current = null; - } -}; - -SwitchSink.prototype._checkEnd = function (t, x) { - if (this.ended && this.current === null) { - this.sink.end(t, x); - } -}; - -SwitchSink.prototype._endInner = function (t, x, inner) { - this._disposeInner(t, inner); - this._checkEnd(t, x); -}; - -SwitchSink.prototype._errorInner = function (t, e, inner) { - this._disposeInner(t, inner); - this.sink.error(t, e); -}; - -function Segment(min, max, outer, sink) { - this.min = min; - this.max = max; - this.outer = outer; - this.sink = sink; - this.disposable = dispose.empty(); -} - -Segment.prototype.event = function (t, x) { - if (t < this.max) { - this.sink.event(Math.max(t, this.min), x); - } -}; - -Segment.prototype.end = function (t, x) { - this.outer._endInner(Math.max(t, this.min), x, this); -}; - -Segment.prototype.error = function (t, e) { - this.outer._errorInner(Math.max(t, this.min), e, this); -}; - -Segment.prototype._dispose = function (t) { - this.max = t; - dispose.tryDispose(t, this.disposable, this.sink); -}; -},{"../Stream":20,"../disposable/dispose":48}],40:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.thru = thru; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function thru(f, stream) { - return f(stream); -} -},{}],41:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.takeUntil = takeUntil; -exports.skipUntil = skipUntil; -exports.during = during; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _flatMap = require('../combinator/flatMap'); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function takeUntil(signal, stream) { - return new _Stream2.default(new Until(signal.source, stream.source)); -} - -function skipUntil(signal, stream) { - return new _Stream2.default(new Since(signal.source, stream.source)); -} - -function during(timeWindow, stream) { - return takeUntil((0, _flatMap.join)(timeWindow), skipUntil(timeWindow, stream)); -} - -function Until(maxSignal, source) { - this.maxSignal = maxSignal; - this.source = source; -} - -Until.prototype.run = function (sink, scheduler) { - var min = new Bound(-Infinity, sink); - var max = new UpperBound(this.maxSignal, sink, scheduler); - var disposable = this.source.run(new TimeWindowSink(min, max, sink), scheduler); - - return dispose.all([min, max, disposable]); -}; - -function Since(minSignal, source) { - this.minSignal = minSignal; - this.source = source; -} - -Since.prototype.run = function (sink, scheduler) { - var min = new LowerBound(this.minSignal, sink, scheduler); - var max = new Bound(Infinity, sink); - var disposable = this.source.run(new TimeWindowSink(min, max, sink), scheduler); - - return dispose.all([min, max, disposable]); -}; - -function Bound(value, sink) { - this.value = value; - this.sink = sink; -} - -Bound.prototype.error = _Pipe2.default.prototype.error; -Bound.prototype.event = noop; -Bound.prototype.end = noop; -Bound.prototype.dispose = noop; - -function TimeWindowSink(min, max, sink) { - this.min = min; - this.max = max; - this.sink = sink; -} - -TimeWindowSink.prototype.event = function (t, x) { - if (t >= this.min.value && t < this.max.value) { - this.sink.event(t, x); - } -}; - -TimeWindowSink.prototype.error = _Pipe2.default.prototype.error; -TimeWindowSink.prototype.end = _Pipe2.default.prototype.end; - -function LowerBound(signal, sink, scheduler) { - this.value = Infinity; - this.sink = sink; - this.disposable = signal.run(this, scheduler); -} - -LowerBound.prototype.event = function (t /*, x */) { - if (t < this.value) { - this.value = t; - } -}; - -LowerBound.prototype.end = noop; -LowerBound.prototype.error = _Pipe2.default.prototype.error; - -LowerBound.prototype.dispose = function () { - return this.disposable.dispose(); -}; - -function UpperBound(signal, sink, scheduler) { - this.value = Infinity; - this.sink = sink; - this.disposable = signal.run(this, scheduler); -} - -UpperBound.prototype.event = function (t, x) { - if (t < this.value) { - this.value = t; - this.sink.end(t, x); - } -}; - -UpperBound.prototype.end = noop; -UpperBound.prototype.error = _Pipe2.default.prototype.error; - -UpperBound.prototype.dispose = function () { - return this.disposable.dispose(); -}; - -function noop() {} -},{"../Stream":20,"../combinator/flatMap":30,"../disposable/dispose":48,"../sink/Pipe":67}],42:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.timestamp = timestamp; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function timestamp(stream) { - return new _Stream2.default(new Timestamp(stream.source)); -} - -function Timestamp(source) { - this.source = source; -} - -Timestamp.prototype.run = function (sink, scheduler) { - return this.source.run(new TimestampSink(sink), scheduler); -}; - -function TimestampSink(sink) { - this.sink = sink; -} - -TimestampSink.prototype.end = _Pipe2.default.prototype.end; -TimestampSink.prototype.error = _Pipe2.default.prototype.error; - -TimestampSink.prototype.event = function (t, x) { - this.sink.event(t, { time: t, value: x }); -}; -},{"../Stream":20,"../sink/Pipe":67}],43:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.transduce = transduce; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Transform a stream by passing its events through a transducer. - * @param {function} transducer transducer function - * @param {Stream} stream stream whose events will be passed through the - * transducer - * @return {Stream} stream of events transformed by the transducer - */ -function transduce(transducer, stream) { - return new _Stream2.default(new Transduce(transducer, stream.source)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Transduce(transducer, source) { - this.transducer = transducer; - this.source = source; -} - -Transduce.prototype.run = function (sink, scheduler) { - var xf = this.transducer(new Transformer(sink)); - return this.source.run(new TransduceSink(getTxHandler(xf), sink), scheduler); -}; - -function TransduceSink(adapter, sink) { - this.xf = adapter; - this.sink = sink; -} - -TransduceSink.prototype.event = function (t, x) { - var next = this.xf.step(t, x); - - return this.xf.isReduced(next) ? this.sink.end(t, this.xf.getResult(next)) : next; -}; - -TransduceSink.prototype.end = function (t, x) { - return this.xf.result(x); -}; - -TransduceSink.prototype.error = function (t, e) { - return this.sink.error(t, e); -}; - -function Transformer(sink) { - this.time = -Infinity; - this.sink = sink; -} - -Transformer.prototype['@@transducer/init'] = Transformer.prototype.init = function () {}; - -Transformer.prototype['@@transducer/step'] = Transformer.prototype.step = function (t, x) { - if (!isNaN(t)) { - this.time = Math.max(t, this.time); - } - return this.sink.event(this.time, x); -}; - -Transformer.prototype['@@transducer/result'] = Transformer.prototype.result = function (x) { - return this.sink.end(this.time, x); -}; - -/** -* Given an object supporting the new or legacy transducer protocol, -* create an adapter for it. -* @param {object} tx transform -* @returns {TxAdapter|LegacyTxAdapter} -*/ -function getTxHandler(tx) { - return typeof tx['@@transducer/step'] === 'function' ? new TxAdapter(tx) : new LegacyTxAdapter(tx); -} - -/** -* Adapter for new official transducer protocol -* @param {object} tx transform -* @constructor -*/ -function TxAdapter(tx) { - this.tx = tx; -} - -TxAdapter.prototype.step = function (t, x) { - return this.tx['@@transducer/step'](t, x); -}; -TxAdapter.prototype.result = function (x) { - return this.tx['@@transducer/result'](x); -}; -TxAdapter.prototype.isReduced = function (x) { - return x != null && x['@@transducer/reduced']; -}; -TxAdapter.prototype.getResult = function (x) { - return x['@@transducer/value']; -}; - -/** -* Adapter for older transducer protocol -* @param {object} tx transform -* @constructor -*/ -function LegacyTxAdapter(tx) { - this.tx = tx; -} - -LegacyTxAdapter.prototype.step = function (t, x) { - return this.tx.step(t, x); -}; -LegacyTxAdapter.prototype.result = function (x) { - return this.tx.result(x); -}; -LegacyTxAdapter.prototype.isReduced = function (x) { - return x != null && x.__transducers_reduced__; -}; -LegacyTxAdapter.prototype.getResult = function (x) { - return x.value; -}; -},{"../Stream":20}],44:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.map = map; -exports.constant = constant; -exports.tap = tap; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _Map = require('../fusion/Map'); - -var _Map2 = _interopRequireDefault(_Map); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Transform each value in the stream by applying f to each - * @param {function(*):*} f mapping function - * @param {Stream} stream stream to map - * @returns {Stream} stream containing items transformed by f - */ -function map(f, stream) { - return new _Stream2.default(_Map2.default.create(f, stream.source)); -} - -/** -* Replace each value in the stream with x -* @param {*} x -* @param {Stream} stream -* @returns {Stream} stream containing items replaced with x -*/ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function constant(x, stream) { - return map(function () { - return x; - }, stream); -} - -/** -* Perform a side effect for each item in the stream -* @param {function(x:*):*} f side effect to execute for each item. The -* return value will be discarded. -* @param {Stream} stream stream to tap -* @returns {Stream} new stream containing the same items as this stream -*/ -function tap(f, stream) { - return new _Stream2.default(new Tap(f, stream.source)); -} - -function Tap(f, source) { - this.source = source; - this.f = f; -} - -Tap.prototype.run = function (sink, scheduler) { - return this.source.run(new TapSink(this.f, sink), scheduler); -}; - -function TapSink(f, sink) { - this.sink = sink; - this.f = f; -} - -TapSink.prototype.end = _Pipe2.default.prototype.end; -TapSink.prototype.error = _Pipe2.default.prototype.error; - -TapSink.prototype.event = function (t, x) { - var f = this.f; - f(x); - this.sink.event(t, x); -}; -},{"../Stream":20,"../fusion/Map":52,"../sink/Pipe":67}],45:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.zip = zip; -exports.zipArray = zipArray; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _transform = require('./transform'); - -var transform = _interopRequireWildcard(_transform); - -var _core = require('../source/core'); - -var core = _interopRequireWildcard(_core); - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _IndexSink = require('../sink/IndexSink'); - -var _IndexSink2 = _interopRequireDefault(_IndexSink); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -var _invoke = require('../invoke'); - -var _invoke2 = _interopRequireDefault(_invoke); - -var _Queue = require('../Queue'); - -var _Queue2 = _interopRequireDefault(_Queue); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var map = base.map; /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -var tail = base.tail; - -/** - * Combine streams pairwise (or tuple-wise) by index by applying f to values - * at corresponding indices. The returned stream ends when any of the input - * streams ends. - * @param {function} f function to combine values - * @returns {Stream} new stream with items at corresponding indices combined - * using f - */ -function zip(f /*, ...streams */) { - return zipArray(f, tail(arguments)); -} - -/** -* Combine streams pairwise (or tuple-wise) by index by applying f to values -* at corresponding indices. The returned stream ends when any of the input -* streams ends. -* @param {function} f function to combine values -* @param {[Stream]} streams streams to zip using f -* @returns {Stream} new stream with items at corresponding indices combined -* using f -*/ -function zipArray(f, streams) { - return streams.length === 0 ? core.empty() : streams.length === 1 ? transform.map(f, streams[0]) : new _Stream2.default(new Zip(f, map(getSource, streams))); -} - -function getSource(stream) { - return stream.source; -} - -function Zip(f, sources) { - this.f = f; - this.sources = sources; -} - -Zip.prototype.run = function (sink, scheduler) { - var this$1 = this; - - var l = this.sources.length; - var disposables = new Array(l); - var sinks = new Array(l); - var buffers = new Array(l); - - var zipSink = new ZipSink(this.f, buffers, sinks, sink); - - for (var indexSink, i = 0; i < l; ++i) { - buffers[i] = new _Queue2.default(); - indexSink = sinks[i] = new _IndexSink2.default(i, zipSink); - disposables[i] = this$1.sources[i].run(indexSink, scheduler); - } - - return dispose.all(disposables); -}; - -function ZipSink(f, buffers, sinks, sink) { - this.f = f; - this.sinks = sinks; - this.sink = sink; - this.buffers = buffers; -} - -ZipSink.prototype.event = function (t, indexedValue) { - // eslint-disable-line complexity - var buffers = this.buffers; - var buffer = buffers[indexedValue.index]; - - buffer.push(indexedValue.value); - - if (buffer.length() === 1) { - if (!ready(this.buffers)) { - return; - } - - emitZipped(this.f, t, buffers, this.sink); - - if (ended(this.buffers, this.sinks)) { - this.sink.end(t, void 0); - } - } -}; - -ZipSink.prototype.end = function (t, indexedValue) { - var buffer = this.buffers[indexedValue.index]; - if (buffer.isEmpty()) { - this.sink.end(t, indexedValue.value); - } -}; - -ZipSink.prototype.error = _Pipe2.default.prototype.error; - -function emitZipped(f, t, buffers, sink) { - sink.event(t, (0, _invoke2.default)(f, map(head, buffers))); -} - -function head(buffer) { - return buffer.shift(); -} - -function ended(buffers, sinks) { - for (var i = 0, l = buffers.length; i < l; ++i) { - if (buffers[i].isEmpty() && !sinks[i].active) { - return true; - } - } - return false; -} - -function ready(buffers) { - for (var i = 0, l = buffers.length; i < l; ++i) { - if (buffers[i].isEmpty()) { - return false; - } - } - return true; -} -},{"../Queue":19,"../Stream":20,"../disposable/dispose":48,"../invoke":53,"../sink/IndexSink":66,"../sink/Pipe":67,"../source/core":71,"./transform":44,"@most/prelude":2}],46:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Disposable; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -/** - * Create a new Disposable which will dispose its underlying resource. - * @param {function} dispose function - * @param {*?} data any data to be passed to disposer function - * @constructor - */ -function Disposable(dispose, data) { - this._dispose = dispose; - this._data = data; -} - -Disposable.prototype.dispose = function () { - return this._dispose(this._data); -}; -},{}],47:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = SettableDisposable; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function SettableDisposable() { - this.disposable = void 0; - this.disposed = false; - this._resolve = void 0; - - var self = this; - this.result = new Promise(function (resolve) { - self._resolve = resolve; - }); -} - -SettableDisposable.prototype.setDisposable = function (disposable) { - if (this.disposable !== void 0) { - throw new Error('setDisposable called more than once'); - } - - this.disposable = disposable; - - if (this.disposed) { - this._resolve(disposable.dispose()); - } -}; - -SettableDisposable.prototype.dispose = function () { - if (this.disposed) { - return this.result; - } - - this.disposed = true; - - if (this.disposable !== void 0) { - this.result = this.disposable.dispose(); - } - - return this.result; -}; -},{}],48:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.tryDispose = tryDispose; -exports.create = create; -exports.empty = empty; -exports.all = all; -exports.promised = promised; -exports.settable = settable; -exports.once = once; - -var _Disposable = require('./Disposable'); - -var _Disposable2 = _interopRequireDefault(_Disposable); - -var _SettableDisposable = require('./SettableDisposable'); - -var _SettableDisposable2 = _interopRequireDefault(_SettableDisposable); - -var _Promise = require('../Promise'); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ -var map = base.map; -var identity = base.id; - -/** - * Call disposable.dispose. If it returns a promise, catch promise - * error and forward it through the provided sink. - * @param {number} t time - * @param {{dispose: function}} disposable - * @param {{error: function}} sink - * @return {*} result of disposable.dispose - */ -function tryDispose(t, disposable, sink) { - var result = disposeSafely(disposable); - return (0, _Promise.isPromise)(result) ? result.catch(function (e) { - sink.error(t, e); - }) : result; -} - -/** - * Create a new Disposable which will dispose its underlying resource - * at most once. - * @param {function} dispose function - * @param {*?} data any data to be passed to disposer function - * @return {Disposable} - */ -function create(dispose, data) { - return once(new _Disposable2.default(dispose, data)); -} - -/** - * Create a noop disposable. Can be used to satisfy a Disposable - * requirement when no actual resource needs to be disposed. - * @return {Disposable|exports|module.exports} - */ -function empty() { - return new _Disposable2.default(identity, void 0); -} - -/** - * Create a disposable that will dispose all input disposables in parallel. - * @param {Array} disposables - * @return {Disposable} - */ -function all(disposables) { - return create(disposeAll, disposables); -} - -function disposeAll(disposables) { - return Promise.all(map(disposeSafely, disposables)); -} - -function disposeSafely(disposable) { - try { - return disposable.dispose(); - } catch (e) { - return Promise.reject(e); - } -} - -/** - * Create a disposable from a promise for another disposable - * @param {Promise} disposablePromise - * @return {Disposable} - */ -function promised(disposablePromise) { - return create(disposePromise, disposablePromise); -} - -function disposePromise(disposablePromise) { - return disposablePromise.then(disposeOne); -} - -function disposeOne(disposable) { - return disposable.dispose(); -} - -/** - * Create a disposable proxy that allows its underlying disposable to - * be set later. - * @return {SettableDisposable} - */ -function settable() { - return new _SettableDisposable2.default(); -} - -/** - * Wrap an existing disposable (which may not already have been once()d) - * so that it will only dispose its underlying resource at most once. - * @param {{ dispose: function() }} disposable - * @return {Disposable} wrapped disposable - */ -function once(disposable) { - return new _Disposable2.default(disposeMemoized, memoized(disposable)); -} - -function disposeMemoized(memoized) { - if (!memoized.disposed) { - memoized.disposed = true; - memoized.value = disposeSafely(memoized.disposable); - memoized.disposable = void 0; - } - - return memoized.value; -} - -function memoized(disposable) { - return { disposed: false, disposable: disposable, value: void 0 }; -} -},{"../Promise":18,"./Disposable":46,"./SettableDisposable":47,"@most/prelude":2}],49:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = fatalError; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function fatalError(e) { - setTimeout(function () { - throw e; - }, 0); -} -},{}],50:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Filter; - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function Filter(p, source) { - this.p = p; - this.source = source; -} - -/** - * Create a filtered source, fusing adjacent filter.filter if possible - * @param {function(x:*):boolean} p filtering predicate - * @param {{run:function}} source source to filter - * @returns {Filter} filtered source - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -Filter.create = function createFilter(p, source) { - if (source instanceof Filter) { - return new Filter(and(source.p, p), source.source); - } - - return new Filter(p, source); -}; - -Filter.prototype.run = function (sink, scheduler) { - return this.source.run(new FilterSink(this.p, sink), scheduler); -}; - -function FilterSink(p, sink) { - this.p = p; - this.sink = sink; -} - -FilterSink.prototype.end = _Pipe2.default.prototype.end; -FilterSink.prototype.error = _Pipe2.default.prototype.error; - -FilterSink.prototype.event = function (t, x) { - var p = this.p; - p(x) && this.sink.event(t, x); -}; - -function and(p, q) { - return function (x) { - return p(x) && q(x); - }; -} -},{"../sink/Pipe":67}],51:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = FilterMap; - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function FilterMap(p, f, source) { - this.p = p; - this.f = f; - this.source = source; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -FilterMap.prototype.run = function (sink, scheduler) { - return this.source.run(new FilterMapSink(this.p, this.f, sink), scheduler); -}; - -function FilterMapSink(p, f, sink) { - this.p = p; - this.f = f; - this.sink = sink; -} - -FilterMapSink.prototype.event = function (t, x) { - var f = this.f; - var p = this.p; - p(x) && this.sink.event(t, f(x)); -}; - -FilterMapSink.prototype.end = _Pipe2.default.prototype.end; -FilterMapSink.prototype.error = _Pipe2.default.prototype.error; -},{"../sink/Pipe":67}],52:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Map; - -var _Pipe = require('../sink/Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -var _Filter = require('./Filter'); - -var _Filter2 = _interopRequireDefault(_Filter); - -var _FilterMap = require('./FilterMap'); - -var _FilterMap2 = _interopRequireDefault(_FilterMap); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Map(f, source) { - this.f = f; - this.source = source; -} - -/** - * Create a mapped source, fusing adjacent map.map, filter.map, - * and filter.map.map if possible - * @param {function(*):*} f mapping function - * @param {{run:function}} source source to map - * @returns {Map|FilterMap} mapped source, possibly fused - */ -Map.create = function createMap(f, source) { - if (source instanceof Map) { - return new Map(base.compose(f, source.f), source.source); - } - - if (source instanceof _Filter2.default) { - return new _FilterMap2.default(source.p, f, source.source); - } - - return new Map(f, source); -}; - -Map.prototype.run = function (sink, scheduler) { - // eslint-disable-line no-extend-native - return this.source.run(new MapSink(this.f, sink), scheduler); -}; - -function MapSink(f, sink) { - this.f = f; - this.sink = sink; -} - -MapSink.prototype.end = _Pipe2.default.prototype.end; -MapSink.prototype.error = _Pipe2.default.prototype.error; - -MapSink.prototype.event = function (t, x) { - var f = this.f; - this.sink.event(t, f(x)); -}; -},{"../sink/Pipe":67,"./Filter":50,"./FilterMap":51,"@most/prelude":2}],53:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = invoke; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function invoke(f, args) { - /*eslint complexity: [2,7]*/ - switch (args.length) { - case 0: - return f(); - case 1: - return f(args[0]); - case 2: - return f(args[0], args[1]); - case 3: - return f(args[0], args[1], args[2]); - case 4: - return f(args[0], args[1], args[2], args[3]); - case 5: - return f(args[0], args[1], args[2], args[3], args[4]); - default: - return f.apply(void 0, args); - } -} -},{}],54:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isIterable = isIterable; -exports.getIterator = getIterator; -exports.makeIterable = makeIterable; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -/*global Set, Symbol*/ -var iteratorSymbol; -// Firefox ships a partial implementation using the name @@iterator. -// https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14 -if (typeof Set === 'function' && typeof new Set()['@@iterator'] === 'function') { - iteratorSymbol = '@@iterator'; -} else { - iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator || '_es6shim_iterator_'; -} - -function isIterable(o) { - return typeof o[iteratorSymbol] === 'function'; -} - -function getIterator(o) { - return o[iteratorSymbol](); -} - -function makeIterable(f, o) { - o[iteratorSymbol] = f; - return o; -} -},{}],55:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fromObservable = fromObservable; -exports.ObservableSource = ObservableSource; -exports.SubscriberSink = SubscriberSink; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function fromObservable(observable) { - return new _Stream2.default(new ObservableSource(observable)); -} - -function ObservableSource(observable) { - this.observable = observable; -} - -ObservableSource.prototype.run = function (sink, scheduler) { - var sub = this.observable.subscribe(new SubscriberSink(sink, scheduler)); - if (typeof sub === 'function') { - return dispose.create(sub); - } else if (sub && typeof sub.unsubscribe === 'function') { - return dispose.create(unsubscribe, sub); - } - - throw new TypeError('Observable returned invalid subscription ' + String(sub)); -}; - -function SubscriberSink(sink, scheduler) { - this.sink = sink; - this.scheduler = scheduler; -} - -SubscriberSink.prototype.next = function (x) { - this.sink.event(this.scheduler.now(), x); -}; - -SubscriberSink.prototype.complete = function (x) { - this.sink.end(this.scheduler.now(), x); -}; - -SubscriberSink.prototype.error = function (e) { - this.sink.error(this.scheduler.now(), e); -}; - -function unsubscribe(subscription) { - return subscription.unsubscribe(); -} -},{"../Stream":20,"../disposable/dispose":48}],56:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = getObservable; - -var _symbolObservable = require('symbol-observable'); - -var _symbolObservable2 = _interopRequireDefault(_symbolObservable); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function getObservable(o) { - // eslint-disable-line complexity - var obs = null; - if (o) { - // Access foreign method only once - var method = o[_symbolObservable2.default]; - if (typeof method === 'function') { - obs = method.call(o); - if (!(obs && typeof obs.subscribe === 'function')) { - throw new TypeError('invalid observable ' + obs); - } - } - } - - return obs; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ -},{"symbol-observable":107}],57:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.subscribe = subscribe; -exports.SubscribeObserver = SubscribeObserver; -exports.Subscription = Subscription; - -var _defaultScheduler = require('../scheduler/defaultScheduler'); - -var _defaultScheduler2 = _interopRequireDefault(_defaultScheduler); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _fatalError = require('../fatalError'); - -var _fatalError2 = _interopRequireDefault(_fatalError); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function subscribe(subscriber, stream) { - if (subscriber == null || typeof subscriber !== 'object') { - throw new TypeError('subscriber must be an object'); - } - - var disposable = dispose.settable(); - var observer = new SubscribeObserver(_fatalError2.default, subscriber, disposable); - - disposable.setDisposable(stream.source.run(observer, _defaultScheduler2.default)); - - return new Subscription(disposable); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function SubscribeObserver(fatalError, subscriber, disposable) { - this.fatalError = fatalError; - this.subscriber = subscriber; - this.disposable = disposable; -} - -SubscribeObserver.prototype.event = function (t, x) { - if (!this.disposable.disposed && typeof this.subscriber.next === 'function') { - this.subscriber.next(x); - } -}; - -SubscribeObserver.prototype.end = function (t, x) { - var s = this.subscriber; - doDispose(this.fatalError, s, s.complete, s.error, this.disposable, x); -}; - -SubscribeObserver.prototype.error = function (t, e) { - var s = this.subscriber; - doDispose(this.fatalError, s, s.error, s.error, this.disposable, e); -}; - -function Subscription(disposable) { - this.disposable = disposable; -} - -Subscription.prototype.unsubscribe = function () { - this.disposable.dispose(); -}; - -function doDispose(fatal, subscriber, complete, error, disposable, x) { - Promise.resolve(disposable.dispose()).then(function () { - if (typeof complete === 'function') { - complete.call(subscriber, x); - } - }).catch(function (e) { - if (typeof error === 'function') { - error.call(subscriber, e); - } - }).catch(fatal); -} -},{"../disposable/dispose":48,"../fatalError":49,"../scheduler/defaultScheduler":64}],58:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.withDefaultScheduler = withDefaultScheduler; -exports.withScheduler = withScheduler; - -var _dispose = require('./disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _defaultScheduler = require('./scheduler/defaultScheduler'); - -var _defaultScheduler2 = _interopRequireDefault(_defaultScheduler); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function withDefaultScheduler(source) { - return withScheduler(source, _defaultScheduler2.default); -} - -function withScheduler(source, scheduler) { - return new Promise(function (resolve, reject) { - runSource(source, scheduler, resolve, reject); - }); -} - -function runSource(source, scheduler, resolve, reject) { - var disposable = dispose.settable(); - var observer = new Drain(resolve, reject, disposable); - - disposable.setDisposable(source.run(observer, scheduler)); -} - -function Drain(end, error, disposable) { - this._end = end; - this._error = error; - this._disposable = disposable; - this.active = true; -} - -Drain.prototype.event = function (t, x) {}; - -Drain.prototype.end = function (t, x) { - if (!this.active) { - return; - } - this.active = false; - disposeThen(this._end, this._error, this._disposable, x); -}; - -Drain.prototype.error = function (t, e) { - this.active = false; - disposeThen(this._error, this._error, this._disposable, e); -}; - -function disposeThen(end, error, disposable, x) { - Promise.resolve(disposable.dispose()).then(function () { - end(x); - }, error); -} -},{"./disposable/dispose":48,"./scheduler/defaultScheduler":64}],59:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ClockTimer; - -var _task = require('../task'); - -/*global setTimeout, clearTimeout*/ - -function ClockTimer() {} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -ClockTimer.prototype.now = Date.now; - -ClockTimer.prototype.setTimer = function (f, dt) { - return dt <= 0 ? runAsap(f) : setTimeout(f, dt); -}; - -ClockTimer.prototype.clearTimer = function (t) { - return t instanceof Asap ? t.cancel() : clearTimeout(t); -}; - -function Asap(f) { - this.f = f; - this.active = true; -} - -Asap.prototype.run = function () { - return this.active && this.f(); -}; - -Asap.prototype.error = function (e) { - throw e; -}; - -Asap.prototype.cancel = function () { - this.active = false; -}; - -function runAsap(f) { - var task = new Asap(f); - (0, _task.defer)(task); - return task; -} -},{"../task":81}],60:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = PropagateTask; - -var _fatalError = require('../fatalError'); - -var _fatalError2 = _interopRequireDefault(_fatalError); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function PropagateTask(run, value, sink) { - this._run = run; - this.value = value; - this.sink = sink; - this.active = true; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -PropagateTask.event = function (value, sink) { - return new PropagateTask(emit, value, sink); -}; - -PropagateTask.end = function (value, sink) { - return new PropagateTask(end, value, sink); -}; - -PropagateTask.error = function (value, sink) { - return new PropagateTask(error, value, sink); -}; - -PropagateTask.prototype.dispose = function () { - this.active = false; -}; - -PropagateTask.prototype.run = function (t) { - if (!this.active) { - return; - } - this._run(t, this.value, this.sink); -}; - -PropagateTask.prototype.error = function (t, e) { - if (!this.active) { - return (0, _fatalError2.default)(e); - } - this.sink.error(t, e); -}; - -function error(t, e, sink) { - sink.error(t, e); -} - -function emit(t, x, sink) { - sink.event(t, x); -} - -function end(t, x, sink) { - sink.end(t, x); -} -},{"../fatalError":49}],61:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ScheduledTask; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function ScheduledTask(delay, period, task, scheduler) { - this.time = delay; - this.period = period; - this.task = task; - this.scheduler = scheduler; - this.active = true; -} - -ScheduledTask.prototype.run = function () { - return this.task.run(this.time); -}; - -ScheduledTask.prototype.error = function (e) { - return this.task.error(this.time, e); -}; - -ScheduledTask.prototype.dispose = function () { - this.scheduler.cancel(this); - return this.task.dispose(); -}; -},{}],62:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Scheduler; - -var _ScheduledTask = require('./ScheduledTask'); - -var _ScheduledTask2 = _interopRequireDefault(_ScheduledTask); - -var _task = require('../task'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Scheduler(timer, timeline) { - this.timer = timer; - this.timeline = timeline; - - this._timer = null; - this._nextArrival = Infinity; - - var self = this; - this._runReadyTasksBound = function () { - self._runReadyTasks(self.now()); - }; -} - -Scheduler.prototype.now = function () { - return this.timer.now(); -}; - -Scheduler.prototype.asap = function (task) { - return this.schedule(0, -1, task); -}; - -Scheduler.prototype.delay = function (delay, task) { - return this.schedule(delay, -1, task); -}; - -Scheduler.prototype.periodic = function (period, task) { - return this.schedule(0, period, task); -}; - -Scheduler.prototype.schedule = function (delay, period, task) { - var now = this.now(); - var st = new _ScheduledTask2.default(now + Math.max(0, delay), period, task, this); - - this.timeline.add(st); - this._scheduleNextRun(now); - return st; -}; - -Scheduler.prototype.cancel = function (task) { - task.active = false; - if (this.timeline.remove(task)) { - this._reschedule(); - } -}; - -Scheduler.prototype.cancelAll = function (f) { - this.timeline.removeAll(f); - this._reschedule(); -}; - -Scheduler.prototype._reschedule = function () { - if (this.timeline.isEmpty()) { - this._unschedule(); - } else { - this._scheduleNextRun(this.now()); - } -}; - -Scheduler.prototype._unschedule = function () { - this.timer.clearTimer(this._timer); - this._timer = null; -}; - -Scheduler.prototype._scheduleNextRun = function (now) { - // eslint-disable-line complexity - if (this.timeline.isEmpty()) { - return; - } - - var nextArrival = this.timeline.nextArrival(); - - if (this._timer === null) { - this._scheduleNextArrival(nextArrival, now); - } else if (nextArrival < this._nextArrival) { - this._unschedule(); - this._scheduleNextArrival(nextArrival, now); - } -}; - -Scheduler.prototype._scheduleNextArrival = function (nextArrival, now) { - this._nextArrival = nextArrival; - var delay = Math.max(0, nextArrival - now); - this._timer = this.timer.setTimer(this._runReadyTasksBound, delay); -}; - -Scheduler.prototype._runReadyTasks = function (now) { - this._timer = null; - this.timeline.runTasks(now, _task.runTask); - this._scheduleNextRun(this.now()); -}; -},{"../task":81,"./ScheduledTask":61}],63:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Timeline; - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function Timeline() { - this.tasks = []; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -Timeline.prototype.nextArrival = function () { - return this.isEmpty() ? Infinity : this.tasks[0].time; -}; - -Timeline.prototype.isEmpty = function () { - return this.tasks.length === 0; -}; - -Timeline.prototype.add = function (st) { - insertByTime(st, this.tasks); -}; - -Timeline.prototype.remove = function (st) { - var i = binarySearch(st.time, this.tasks); - - if (i >= 0 && i < this.tasks.length) { - var at = base.findIndex(st, this.tasks[i].events); - if (at >= 0) { - this.tasks[i].events.splice(at, 1); - return true; - } - } - - return false; -}; - -Timeline.prototype.removeAll = function (f) { - var this$1 = this; - - for (var i = 0, l = this.tasks.length; i < l; ++i) { - removeAllFrom(f, this$1.tasks[i]); - } -}; - -Timeline.prototype.runTasks = function (t, runTask) { - var this$1 = this; - - var tasks = this.tasks; - var l = tasks.length; - var i = 0; - - while (i < l && tasks[i].time <= t) { - ++i; - } - - this.tasks = tasks.slice(i); - - // Run all ready tasks - for (var j = 0; j < i; ++j) { - this$1.tasks = runTasks(runTask, tasks[j], this$1.tasks); - } -}; - -function runTasks(runTask, timeslot, tasks) { - // eslint-disable-line complexity - var events = timeslot.events; - for (var i = 0; i < events.length; ++i) { - var task = events[i]; - - if (task.active) { - runTask(task); - - // Reschedule periodic repeating tasks - // Check active again, since a task may have canceled itself - if (task.period >= 0 && task.active) { - task.time = task.time + task.period; - insertByTime(task, tasks); - } - } - } - - return tasks; -} - -function insertByTime(task, timeslots) { - // eslint-disable-line complexity - var l = timeslots.length; - - if (l === 0) { - timeslots.push(newTimeslot(task.time, [task])); - return; - } - - var i = binarySearch(task.time, timeslots); - - if (i >= l) { - timeslots.push(newTimeslot(task.time, [task])); - } else if (task.time === timeslots[i].time) { - timeslots[i].events.push(task); - } else { - timeslots.splice(i, 0, newTimeslot(task.time, [task])); - } -} - -function removeAllFrom(f, timeslot) { - timeslot.events = base.removeAll(f, timeslot.events); -} - -function binarySearch(t, sortedArray) { - // eslint-disable-line complexity - var lo = 0; - var hi = sortedArray.length; - var mid, y; - - while (lo < hi) { - mid = Math.floor((lo + hi) / 2); - y = sortedArray[mid]; - - if (t === y.time) { - return mid; - } else if (t < y.time) { - hi = mid; - } else { - lo = mid + 1; - } - } - return hi; -} - -function newTimeslot(t, events) { - return { time: t, events: events }; -} -},{"@most/prelude":2}],64:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Scheduler = require('./Scheduler'); - -var _Scheduler2 = _interopRequireDefault(_Scheduler); - -var _ClockTimer = require('./ClockTimer'); - -var _ClockTimer2 = _interopRequireDefault(_ClockTimer); - -var _Timeline = require('./Timeline'); - -var _Timeline2 = _interopRequireDefault(_Timeline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var defaultScheduler = new _Scheduler2.default(new _ClockTimer2.default(), new _Timeline2.default()); /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -exports.default = defaultScheduler; -},{"./ClockTimer":59,"./Scheduler":62,"./Timeline":63}],65:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = DeferredSink; - -var _task = require('../task'); - -function DeferredSink(sink) { - this.sink = sink; - this.events = []; - this.active = true; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -DeferredSink.prototype.event = function (t, x) { - if (!this.active) { - return; - } - - if (this.events.length === 0) { - (0, _task.defer)(new PropagateAllTask(this.sink, t, this.events)); - } - - this.events.push({ time: t, value: x }); -}; - -DeferredSink.prototype.end = function (t, x) { - if (!this.active) { - return; - } - - this._end(new EndTask(t, x, this.sink)); -}; - -DeferredSink.prototype.error = function (t, e) { - this._end(new ErrorTask(t, e, this.sink)); -}; - -DeferredSink.prototype._end = function (task) { - this.active = false; - (0, _task.defer)(task); -}; - -function PropagateAllTask(sink, time, events) { - this.sink = sink; - this.events = events; - this.time = time; -} - -PropagateAllTask.prototype.run = function () { - var this$1 = this; - - var events = this.events; - var sink = this.sink; - var event; - - for (var i = 0, l = events.length; i < l; ++i) { - event = events[i]; - this$1.time = event.time; - sink.event(event.time, event.value); - } - - events.length = 0; -}; - -PropagateAllTask.prototype.error = function (e) { - this.sink.error(this.time, e); -}; - -function EndTask(t, x, sink) { - this.time = t; - this.value = x; - this.sink = sink; -} - -EndTask.prototype.run = function () { - this.sink.end(this.time, this.value); -}; - -EndTask.prototype.error = function (e) { - this.sink.error(this.time, e); -}; - -function ErrorTask(t, e, sink) { - this.time = t; - this.value = e; - this.sink = sink; -} - -ErrorTask.prototype.run = function () { - this.sink.error(this.time, this.value); -}; - -ErrorTask.prototype.error = function (e) { - throw e; -}; -},{"../task":81}],66:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = IndexSink; - -var _Pipe = require('./Pipe'); - -var _Pipe2 = _interopRequireDefault(_Pipe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function IndexSink(i, sink) { - this.sink = sink; - this.index = i; - this.active = true; - this.value = void 0; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -IndexSink.prototype.event = function (t, x) { - if (!this.active) { - return; - } - this.value = x; - this.sink.event(t, this); -}; - -IndexSink.prototype.end = function (t, x) { - if (!this.active) { - return; - } - this.active = false; - this.sink.end(t, { index: this.index, value: x }); -}; - -IndexSink.prototype.error = _Pipe2.default.prototype.error; -},{"./Pipe":67}],67:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = Pipe; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -/** - * A sink mixin that simply forwards event, end, and error to - * another sink. - * @param sink - * @constructor - */ -function Pipe(sink) { - this.sink = sink; -} - -Pipe.prototype.event = function (t, x) { - return this.sink.event(t, x); -}; - -Pipe.prototype.end = function (t, x) { - return this.sink.end(t, x); -}; - -Pipe.prototype.error = function (t, e) { - return this.sink.error(t, e); -}; -},{}],68:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = SafeSink; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function SafeSink(sink) { - this.sink = sink; - this.active = true; -} - -SafeSink.prototype.event = function (t, x) { - if (!this.active) { - return; - } - this.sink.event(t, x); -}; - -SafeSink.prototype.end = function (t, x) { - if (!this.active) { - return; - } - this.disable(); - this.sink.end(t, x); -}; - -SafeSink.prototype.error = function (t, e) { - this.disable(); - this.sink.error(t, e); -}; - -SafeSink.prototype.disable = function () { - this.active = false; - return this.sink; -}; -},{}],69:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = EventEmitterSource; - -var _DeferredSink = require('../sink/DeferredSink'); - -var _DeferredSink2 = _interopRequireDefault(_DeferredSink); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _tryEvent = require('./tryEvent'); - -var tryEvent = _interopRequireWildcard(_tryEvent); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function EventEmitterSource(event, source) { - this.event = event; - this.source = source; -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -EventEmitterSource.prototype.run = function (sink, scheduler) { - // NOTE: Because EventEmitter allows events in the same call stack as - // a listener is added, use a DeferredSink to buffer events - // until the stack clears, then propagate. This maintains most.js's - // invariant that no event will be delivered in the same call stack - // as an observer begins observing. - var dsink = new _DeferredSink2.default(sink); - - function addEventVariadic(a) { - var arguments$1 = arguments; - - var l = arguments.length; - if (l > 1) { - var arr = new Array(l); - for (var i = 0; i < l; ++i) { - arr[i] = arguments$1[i]; - } - tryEvent.tryEvent(scheduler.now(), arr, dsink); - } else { - tryEvent.tryEvent(scheduler.now(), a, dsink); - } - } - - this.source.addListener(this.event, addEventVariadic); - - return dispose.create(disposeEventEmitter, { target: this, addEvent: addEventVariadic }); -}; - -function disposeEventEmitter(info) { - var target = info.target; - target.source.removeListener(target.event, info.addEvent); -} -},{"../disposable/dispose":48,"../sink/DeferredSink":65,"./tryEvent":79}],70:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = EventTargetSource; - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _tryEvent = require('./tryEvent'); - -var tryEvent = _interopRequireWildcard(_tryEvent); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function EventTargetSource(event, source, capture) { - this.event = event; - this.source = source; - this.capture = capture; -} - -EventTargetSource.prototype.run = function (sink, scheduler) { - function addEvent(e) { - tryEvent.tryEvent(scheduler.now(), e, sink); - } - - this.source.addEventListener(this.event, addEvent, this.capture); - - return dispose.create(disposeEventTarget, { target: this, addEvent: addEvent }); -}; - -function disposeEventTarget(info) { - var target = info.target; - target.source.removeEventListener(target.event, info.addEvent, target.capture); -} -},{"../disposable/dispose":48,"./tryEvent":79}],71:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.of = of; -exports.empty = empty; -exports.never = never; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _dispose = require('../disposable/dispose'); - -var dispose = _interopRequireWildcard(_dispose); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Stream containing only x - * @param {*} x - * @returns {Stream} - */ -function of(x) { - return new _Stream2.default(new Just(x)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function Just(x) { - this.value = x; -} - -Just.prototype.run = function (sink, scheduler) { - return scheduler.asap(new _PropagateTask2.default(runJust, this.value, sink)); -}; - -function runJust(t, x, sink) { - sink.event(t, x); - sink.end(t, void 0); -} - -/** - * Stream containing no events and ends immediately - * @returns {Stream} - */ -function empty() { - return EMPTY; -} - -function EmptySource() {} - -EmptySource.prototype.run = function (sink, scheduler) { - var task = _PropagateTask2.default.end(void 0, sink); - scheduler.asap(task); - - return dispose.create(disposeEmpty, task); -}; - -function disposeEmpty(task) { - return task.dispose(); -} - -var EMPTY = new _Stream2.default(new EmptySource()); - -/** - * Stream containing no events and never ends - * @returns {Stream} - */ -function never() { - return NEVER; -} - -function NeverSource() {} - -NeverSource.prototype.run = function () { - return dispose.empty(); -}; - -var NEVER = new _Stream2.default(new NeverSource()); -},{"../Stream":20,"../disposable/dispose":48,"../scheduler/PropagateTask":60}],72:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.from = from; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _fromArray = require('./fromArray'); - -var _iterable = require('../iterable'); - -var _fromIterable = require('./fromIterable'); - -var _getObservable = require('../observable/getObservable'); - -var _getObservable2 = _interopRequireDefault(_getObservable); - -var _fromObservable = require('../observable/fromObservable'); - -var _prelude = require('@most/prelude'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function from(a) { - // eslint-disable-line complexity - if (a instanceof _Stream2.default) { - return a; - } - - var observable = (0, _getObservable2.default)(a); - if (observable != null) { - return (0, _fromObservable.fromObservable)(observable); - } - - if (Array.isArray(a) || (0, _prelude.isArrayLike)(a)) { - return (0, _fromArray.fromArray)(a); - } - - if ((0, _iterable.isIterable)(a)) { - return (0, _fromIterable.fromIterable)(a); - } - - throw new TypeError('from(x) must be observable, iterable, or array-like: ' + a); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ -},{"../Stream":20,"../iterable":54,"../observable/fromObservable":55,"../observable/getObservable":56,"./fromArray":73,"./fromIterable":75,"@most/prelude":2}],73:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fromArray = fromArray; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function fromArray(a) { - return new _Stream2.default(new ArraySource(a)); -} - -function ArraySource(a) { - this.array = a; -} - -ArraySource.prototype.run = function (sink, scheduler) { - return scheduler.asap(new _PropagateTask2.default(runProducer, this.array, sink)); -}; - -function runProducer(t, array, sink) { - for (var i = 0, l = array.length; i < l && this.active; ++i) { - sink.event(t, array[i]); - } - - this.active && end(t); - - function end(t) { - sink.end(t); - } -} -},{"../Stream":20,"../scheduler/PropagateTask":60}],74:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fromEvent = fromEvent; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _EventTargetSource = require('./EventTargetSource'); - -var _EventTargetSource2 = _interopRequireDefault(_EventTargetSource); - -var _EventEmitterSource = require('./EventEmitterSource'); - -var _EventEmitterSource2 = _interopRequireDefault(_EventEmitterSource); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Create a stream from an EventTarget, such as a DOM Node, or EventEmitter. - * @param {String} event event type name, e.g. 'click' - * @param {EventTarget|EventEmitter} source EventTarget or EventEmitter - * @param {*?} capture for DOM events, whether to use - * capturing--passed as 3rd parameter to addEventListener. - * @returns {Stream} stream containing all events of the specified type - * from the source. - */ -function fromEvent(event, source, capture) { - // eslint-disable-line complexity - var s; - - if (typeof source.addEventListener === 'function' && typeof source.removeEventListener === 'function') { - if (arguments.length < 3) { - capture = false; - } - - s = new _EventTargetSource2.default(event, source, capture); - } else if (typeof source.addListener === 'function' && typeof source.removeListener === 'function') { - s = new _EventEmitterSource2.default(event, source); - } else { - throw new Error('source must support addEventListener/removeEventListener or addListener/removeListener'); - } - - return new _Stream2.default(s); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ -},{"../Stream":20,"./EventEmitterSource":69,"./EventTargetSource":70}],75:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fromIterable = fromIterable; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _iterable = require('../iterable'); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function fromIterable(iterable) { - return new _Stream2.default(new IterableSource(iterable)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function IterableSource(iterable) { - this.iterable = iterable; -} - -IterableSource.prototype.run = function (sink, scheduler) { - return new IteratorProducer((0, _iterable.getIterator)(this.iterable), sink, scheduler); -}; - -function IteratorProducer(iterator, sink, scheduler) { - this.scheduler = scheduler; - this.iterator = iterator; - this.task = new _PropagateTask2.default(runProducer, this, sink); - scheduler.asap(this.task); -} - -IteratorProducer.prototype.dispose = function () { - return this.task.dispose(); -}; - -function runProducer(t, producer, sink) { - var x = producer.iterator.next(); - if (x.done) { - sink.end(t, x.value); - } else { - sink.event(t, x.value); - } - - producer.scheduler.asap(producer.task); -} -},{"../Stream":20,"../iterable":54,"../scheduler/PropagateTask":60}],76:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.generate = generate; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Compute a stream using an *async* generator, which yields promises - * to control event times. - * @param f - * @returns {Stream} - */ -/** @license MIT License (c) copyright 2010-2014 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function generate(f /*, ...args */) { - return new _Stream2.default(new GenerateSource(f, base.tail(arguments))); -} - -function GenerateSource(f, args) { - this.f = f; - this.args = args; -} - -GenerateSource.prototype.run = function (sink, scheduler) { - return new Generate(this.f.apply(void 0, this.args), sink, scheduler); -}; - -function Generate(iterator, sink, scheduler) { - this.iterator = iterator; - this.sink = sink; - this.scheduler = scheduler; - this.active = true; - - var self = this; - function err(e) { - self.sink.error(self.scheduler.now(), e); - } - - Promise.resolve(this).then(next).catch(err); -} - -function next(generate, x) { - return generate.active ? handle(generate, generate.iterator.next(x)) : x; -} - -function handle(generate, result) { - if (result.done) { - return generate.sink.end(generate.scheduler.now(), result.value); - } - - return Promise.resolve(result.value).then(function (x) { - return emit(generate, x); - }, function (e) { - return error(generate, e); - }); -} - -function emit(generate, x) { - generate.sink.event(generate.scheduler.now(), x); - return next(generate, x); -} - -function error(generate, e) { - return handle(generate, generate.iterator.throw(e)); -} - -Generate.prototype.dispose = function () { - this.active = false; -}; -},{"../Stream":20,"@most/prelude":2}],77:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.iterate = iterate; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Compute a stream by iteratively calling f to produce values - * Event times may be controlled by returning a Promise from f - * @param {function(x:*):*|Promise<*>} f - * @param {*} x initial value - * @returns {Stream} - */ -function iterate(f, x) { - return new _Stream2.default(new IterateSource(f, x)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function IterateSource(f, x) { - this.f = f; - this.value = x; -} - -IterateSource.prototype.run = function (sink, scheduler) { - return new Iterate(this.f, this.value, sink, scheduler); -}; - -function Iterate(f, initial, sink, scheduler) { - this.f = f; - this.sink = sink; - this.scheduler = scheduler; - this.active = true; - - var x = initial; - - var self = this; - function err(e) { - self.sink.error(self.scheduler.now(), e); - } - - function start(iterate) { - return stepIterate(iterate, x); - } - - Promise.resolve(this).then(start).catch(err); -} - -Iterate.prototype.dispose = function () { - this.active = false; -}; - -function stepIterate(iterate, x) { - iterate.sink.event(iterate.scheduler.now(), x); - - if (!iterate.active) { - return x; - } - - var f = iterate.f; - return Promise.resolve(f(x)).then(function (y) { - return continueIterate(iterate, y); - }); -} - -function continueIterate(iterate, x) { - return !iterate.active ? iterate.value : stepIterate(iterate, x); -} -},{"../Stream":20}],78:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.periodic = periodic; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _PropagateTask = require('../scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Create a stream that emits the current time periodically - * @param {Number} period periodicity of events in millis - * @param {*} value value to emit each period - * @returns {Stream} new stream that emits the current time every period - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function periodic(period, value) { - return new _Stream2.default(new Periodic(period, value)); -} - -function Periodic(period, value) { - this.period = period; - this.value = value; -} - -Periodic.prototype.run = function (sink, scheduler) { - return scheduler.periodic(this.period, _PropagateTask2.default.event(this.value, sink)); -}; -},{"../Stream":20,"../scheduler/PropagateTask":60}],79:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.tryEvent = tryEvent; -exports.tryEnd = tryEnd; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function tryEvent(t, x, sink) { - try { - sink.event(t, x); - } catch (e) { - sink.error(t, e); - } -} - -function tryEnd(t, x, sink) { - try { - sink.end(t, x); - } catch (e) { - sink.error(t, e); - } -} -},{}],80:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.unfold = unfold; - -var _Stream = require('../Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Compute a stream by unfolding tuples of future values from a seed value - * Event times may be controlled by returning a Promise from f - * @param {function(seed:*):{value:*, seed:*, done:boolean}|Promise<{value:*, seed:*, done:boolean}>} f unfolding function accepts - * a seed and returns a new tuple with a value, new seed, and boolean done flag. - * If tuple.done is true, the stream will end. - * @param {*} seed seed value - * @returns {Stream} stream containing all value of all tuples produced by the - * unfolding function. - */ -function unfold(f, seed) { - return new _Stream2.default(new UnfoldSource(f, seed)); -} /** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function UnfoldSource(f, seed) { - this.f = f; - this.value = seed; -} - -UnfoldSource.prototype.run = function (sink, scheduler) { - return new Unfold(this.f, this.value, sink, scheduler); -}; - -function Unfold(f, x, sink, scheduler) { - this.f = f; - this.sink = sink; - this.scheduler = scheduler; - this.active = true; - - var self = this; - function err(e) { - self.sink.error(self.scheduler.now(), e); - } - - function start(unfold) { - return stepUnfold(unfold, x); - } - - Promise.resolve(this).then(start).catch(err); -} - -Unfold.prototype.dispose = function () { - this.active = false; -}; - -function stepUnfold(unfold, x) { - var f = unfold.f; - return Promise.resolve(f(x)).then(function (tuple) { - return continueUnfold(unfold, tuple); - }); -} - -function continueUnfold(unfold, tuple) { - if (tuple.done) { - unfold.sink.end(unfold.scheduler.now(), tuple.value); - return tuple.value; - } - - unfold.sink.event(unfold.scheduler.now(), tuple.value); - - if (!unfold.active) { - return tuple.value; - } - return stepUnfold(unfold, tuple.seed); -} -},{"../Stream":20}],81:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.defer = defer; -exports.runTask = runTask; -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -function defer(task) { - return Promise.resolve(task).then(runTask); -} - -function runTask(task) { - try { - return task.run(); - } catch (e) { - return task.error(e); - } -} -},{}],82:[function(require,module,exports){ -'use strict'; -/* eslint-disable no-unused-vars */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (e) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],83:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -/** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. - */ - -function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - '=': '=0', - ':': '=2' - }; - var escapedString = ('' + key).replace(escapeRegex, function (match) { - return escaperLookup[match]; - }); - - return '$' + escapedString; -} - -/** - * Unescape and unwrap key for human-readable display - * - * @param {string} key to unescape. - * @return {string} the unescaped key. - */ -function unescape(key) { - var unescapeRegex = /(=0|=2)/g; - var unescaperLookup = { - '=0': '=', - '=2': ':' - }; - var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); - - return ('' + keySubstring).replace(unescapeRegex, function (match) { - return unescaperLookup[match]; - }); -} - -var KeyEscapeUtils = { - escape: escape, - unescape: unescape -}; - -module.exports = KeyEscapeUtils; -},{}],84:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var invariant = require('fbjs/lib/invariant'); - -/** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ -var oneArgumentPooler = function (copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } -}; - -var twoArgumentPooler = function (a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } -}; - -var threeArgumentPooler = function (a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } -}; - -var fourArgumentPooler = function (a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4); - return instance; - } else { - return new Klass(a1, a2, a3, a4); - } -}; - -var fiveArgumentPooler = function (a1, a2, a3, a4, a5) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4, a5); - return instance; - } else { - return new Klass(a1, a2, a3, a4, a5); - } -}; - -var standardReleaser = function (instance) { - var Klass = this; - !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; - instance.destructor(); - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } -}; - -var DEFAULT_POOL_SIZE = 10; -var DEFAULT_POOLER = oneArgumentPooler; - -/** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances. - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ -var addPoolingTo = function (CopyConstructor, pooler) { - // Casting as any so that flow ignores the actual implementation and trusts - // it to match the type we declared - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; - } - NewKlass.release = standardReleaser; - return NewKlass; -}; - -var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler, - fiveArgumentPooler: fiveArgumentPooler -}; - -module.exports = PooledClass; -}).call(this,require('_process')) -},{"./reactProdInvariant":105,"_process":110,"fbjs/lib/invariant":5}],85:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var ReactChildren = require('./ReactChildren'); -var ReactComponent = require('./ReactComponent'); -var ReactPureComponent = require('./ReactPureComponent'); -var ReactClass = require('./ReactClass'); -var ReactDOMFactories = require('./ReactDOMFactories'); -var ReactElement = require('./ReactElement'); -var ReactPropTypes = require('./ReactPropTypes'); -var ReactVersion = require('./ReactVersion'); - -var onlyChild = require('./onlyChild'); -var warning = require('fbjs/lib/warning'); - -var createElement = ReactElement.createElement; -var createFactory = ReactElement.createFactory; -var cloneElement = ReactElement.cloneElement; - -if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = require('./ReactElementValidator'); - createElement = ReactElementValidator.createElement; - createFactory = ReactElementValidator.createFactory; - cloneElement = ReactElementValidator.cloneElement; -} - -var __spread = _assign; - -if (process.env.NODE_ENV !== 'production') { - var warned = false; - __spread = function () { - process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0; - warned = true; - return _assign.apply(null, arguments); - }; -} - -var React = { - - // Modern - - Children: { - map: ReactChildren.map, - forEach: ReactChildren.forEach, - count: ReactChildren.count, - toArray: ReactChildren.toArray, - only: onlyChild - }, - - Component: ReactComponent, - PureComponent: ReactPureComponent, - - createElement: createElement, - cloneElement: cloneElement, - isValidElement: ReactElement.isValidElement, - - // Classic - - PropTypes: ReactPropTypes, - createClass: ReactClass.createClass, - createFactory: createFactory, - createMixin: function (mixin) { - // Currently a noop. Will be used to validate and trace mixins. - return mixin; - }, - - // This looks DOM specific but these are actually isomorphic helpers - // since they are just generating DOM strings. - DOM: ReactDOMFactories, - - version: ReactVersion, - - // Deprecated hook for JSX spread, don't use this for anything. - __spread: __spread -}; - -module.exports = React; -}).call(this,require('_process')) -},{"./ReactChildren":86,"./ReactClass":87,"./ReactComponent":88,"./ReactDOMFactories":91,"./ReactElement":92,"./ReactElementValidator":94,"./ReactPropTypes":97,"./ReactPureComponent":99,"./ReactVersion":100,"./onlyChild":104,"_process":110,"fbjs/lib/warning":6,"object-assign":82}],86:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var PooledClass = require('./PooledClass'); -var ReactElement = require('./ReactElement'); - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var traverseAllChildren = require('./traverseAllChildren'); - -var twoArgumentPooler = PooledClass.twoArgumentPooler; -var fourArgumentPooler = PooledClass.fourArgumentPooler; - -var userProvidedKeyEscapeRegex = /\/+/g; -function escapeUserProvidedKey(text) { - return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * traversal. Allows avoiding binding callbacks. - * - * @constructor ForEachBookKeeping - * @param {!function} forEachFunction Function to perform traversal with. - * @param {?*} forEachContext Context to perform context with. - */ -function ForEachBookKeeping(forEachFunction, forEachContext) { - this.func = forEachFunction; - this.context = forEachContext; - this.count = 0; -} -ForEachBookKeeping.prototype.destructor = function () { - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); - -function forEachSingleChild(bookKeeping, child, name) { - var func = bookKeeping.func, - context = bookKeeping.context; - - func.call(context, child, bookKeeping.count++); -} - -/** - * Iterates through children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ -function forEachChildren(children, forEachFunc, forEachContext) { - if (children == null) { - return children; - } - var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); - traverseAllChildren(children, forEachSingleChild, traverseContext); - ForEachBookKeeping.release(traverseContext); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * mapping. Allows avoiding binding callbacks. - * - * @constructor MapBookKeeping - * @param {!*} mapResult Object containing the ordered map of results. - * @param {!function} mapFunction Function to perform mapping with. - * @param {?*} mapContext Context to perform mapping with. - */ -function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { - this.result = mapResult; - this.keyPrefix = keyPrefix; - this.func = mapFunction; - this.context = mapContext; - this.count = 0; -} -MapBookKeeping.prototype.destructor = function () { - this.result = null; - this.keyPrefix = null; - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); - -function mapSingleChildIntoContext(bookKeeping, child, childKey) { - var result = bookKeeping.result, - keyPrefix = bookKeeping.keyPrefix, - func = bookKeeping.func, - context = bookKeeping.context; - - - var mappedChild = func.call(context, child, bookKeeping.count++); - if (Array.isArray(mappedChild)) { - mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); - } else if (mappedChild != null) { - if (ReactElement.isValidElement(mappedChild)) { - mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, - // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); - } - result.push(mappedChild); - } -} - -function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { - var escapedPrefix = ''; - if (prefix != null) { - escapedPrefix = escapeUserProvidedKey(prefix) + '/'; - } - var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); - traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); - MapBookKeeping.release(traverseContext); -} - -/** - * Maps children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map - * - * The provided mapFunction(child, key, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ -function mapChildren(children, func, context) { - if (children == null) { - return children; - } - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, func, context); - return result; -} - -function forEachSingleChildDummy(traverseContext, child, name) { - return null; -} - -/** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ -function countChildren(children, context) { - return traverseAllChildren(children, forEachSingleChildDummy, null); -} - -/** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray - */ -function toArray(children) { - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); - return result; -} - -var ReactChildren = { - forEach: forEachChildren, - map: mapChildren, - mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, - count: countChildren, - toArray: toArray -}; - -module.exports = ReactChildren; -},{"./PooledClass":84,"./ReactElement":92,"./traverseAllChildren":106,"fbjs/lib/emptyFunction":3}],87:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'), - _assign = require('object-assign'); - -var ReactComponent = require('./ReactComponent'); -var ReactElement = require('./ReactElement'); -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var emptyObject = require('fbjs/lib/emptyObject'); -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var MIXINS_KEY = 'mixins'; - -// Helper function to allow the creation of anonymous functions which do not -// have .name set to the name of the variable being assigned to. -function identity(fn) { - return fn; -} - -/** - * Policies that describe methods in `ReactClassInterface`. - */ - - -var injectedMixins = []; - -/** - * Composite components are higher-level components that compose other composite - * or host components. - * - * To create a new type of `ReactClass`, pass a specification of - * your new class to `React.createClass`. The only requirement of your class - * specification is that you implement a `render` method. - * - * var MyComponent = React.createClass({ - * render: function() { - * return
Hello World
; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ -var ReactClassInterface = { - - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @nosideeffects - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - -}; - -/** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ -var RESERVED_SPEC_KEYS = { - displayName: function (Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function (Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function (Constructor, childContextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes); - }, - contextTypes: function (Constructor, contextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function (Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function (Constructor, propTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function (Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function () {} }; - -function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an invariant so components - // don't show up in prod but only in __DEV__ - process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0; - } - } -} - -function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - !(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0; - } - - // Disallow defining methods more than once unless explicitly allowed. - if (isAlreadyDefined) { - !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0; - } -} - -/** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ -function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (process.env.NODE_ENV !== 'production') { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - process.env.NODE_ENV !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0; - } - - return; - } - - !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0; - !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0; - - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } - - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0; - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (process.env.NODE_ENV !== 'production') { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } -} - -function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0; - - var isInherited = name in Constructor; - !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0; - Constructor[name] = property; - } -} - -/** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ -function mergeIntoWithNoDuplicateKeys(one, two) { - !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0; - - for (var key in two) { - if (two.hasOwnProperty(key)) { - !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0; - one[key] = two[key]; - } - } - return one; -} - -/** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; -} - -/** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ -function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; -} - -/** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ -function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (process.env.NODE_ENV !== 'production') { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function (newThis) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0; - } else if (!args.length) { - process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0; - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; -} - -/** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ -function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } -} - -/** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ -var ReactClassMixin = { - - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function (newState, callback) { - this.updater.enqueueReplaceState(this, newState); - if (callback) { - this.updater.enqueueCallback(this, callback, 'replaceState'); - } - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function () { - return this.updater.isMounted(this); - } -}; - -var ReactClassComponent = function () {}; -_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); - -/** - * Module for creating composite components. - * - * @class ReactClass - */ -var ReactClass = { - - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - createClass: function (spec) { - // To keep our warnings more understandable, we'll use a little hack here to - // ensure that Constructor.name !== 'Constructor'. This makes sure we don't - // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function (props, context, updater) { - // This constructor gets overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0; - } - - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (process.env.NODE_ENV !== 'production') { - // We allow auto-mocks to proceed as if they're returning null. - if (initialState === undefined && this.getInitialState._isMockFunction) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0; - - this.state = initialState; - }); - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - Constructor.prototype.__reactAutoBindPairs = []; - - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - - mixSpecIntoComponent(Constructor, spec); - - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if (process.env.NODE_ENV !== 'production') { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0; - - if (process.env.NODE_ENV !== 'production') { - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0; - process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0; - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - return Constructor; - }, - - injection: { - injectMixin: function (mixin) { - injectedMixins.push(mixin); - } - } - -}; - -module.exports = ReactClass; -}).call(this,require('_process')) -},{"./ReactComponent":88,"./ReactElement":92,"./ReactNoopUpdateQueue":95,"./ReactPropTypeLocationNames":96,"./reactProdInvariant":105,"_process":110,"fbjs/lib/emptyObject":4,"fbjs/lib/invariant":5,"fbjs/lib/warning":6,"object-assign":82}],88:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var canDefineProperty = require('./canDefineProperty'); -var emptyObject = require('fbjs/lib/emptyObject'); -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -ReactComponent.prototype.isReactComponent = {}; - -/** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ -ReactComponent.prototype.setState = function (partialState, callback) { - !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; - this.updater.enqueueSetState(this, partialState); - if (callback) { - this.updater.enqueueCallback(this, callback, 'setState'); - } -}; - -/** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ -ReactComponent.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this); - if (callback) { - this.updater.enqueueCallback(this, callback, 'forceUpdate'); - } -}; - -/** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ -if (process.env.NODE_ENV !== 'production') { - var deprecatedAPIs = { - isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], - replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] - }; - var defineDeprecationWarning = function (methodName, info) { - if (canDefineProperty) { - Object.defineProperty(ReactComponent.prototype, methodName, { - get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0; - return undefined; - } - }); - } - }; - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } -} - -module.exports = ReactComponent; -}).call(this,require('_process')) -},{"./ReactNoopUpdateQueue":95,"./canDefineProperty":101,"./reactProdInvariant":105,"_process":110,"fbjs/lib/emptyObject":4,"fbjs/lib/invariant":5,"fbjs/lib/warning":6}],89:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); - -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -function isNative(fn) { - // Based on isNative() from Lodash - var funcToString = Function.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var reIsNative = RegExp('^' + funcToString - // Take an example native function source for comparison - .call(hasOwnProperty) - // Strip regex characters so we can use it for regex - .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - // Remove hasOwnProperty from the template to make it generic - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); - try { - var source = funcToString.call(fn); - return reIsNative.test(source); - } catch (err) { - return false; - } -} - -var canUseCollections = -// Array.from -typeof Array.from === 'function' && -// Map -typeof Map === 'function' && isNative(Map) && -// Map.prototype.keys -Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && -// Set -typeof Set === 'function' && isNative(Set) && -// Set.prototype.keys -Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); - -var setItem; -var getItem; -var removeItem; -var getItemIDs; -var addRoot; -var removeRoot; -var getRootIDs; - -if (canUseCollections) { - var itemMap = new Map(); - var rootIDSet = new Set(); - - setItem = function (id, item) { - itemMap.set(id, item); - }; - getItem = function (id) { - return itemMap.get(id); - }; - removeItem = function (id) { - itemMap['delete'](id); - }; - getItemIDs = function () { - return Array.from(itemMap.keys()); - }; - - addRoot = function (id) { - rootIDSet.add(id); - }; - removeRoot = function (id) { - rootIDSet['delete'](id); - }; - getRootIDs = function () { - return Array.from(rootIDSet.keys()); - }; -} else { - var itemByKey = {}; - var rootByKey = {}; - - // Use non-numeric keys to prevent V8 performance issues: - // https://github.com/facebook/react/pull/7232 - var getKeyFromID = function (id) { - return '.' + id; - }; - var getIDFromKey = function (key) { - return parseInt(key.substr(1), 10); - }; - - setItem = function (id, item) { - var key = getKeyFromID(id); - itemByKey[key] = item; - }; - getItem = function (id) { - var key = getKeyFromID(id); - return itemByKey[key]; - }; - removeItem = function (id) { - var key = getKeyFromID(id); - delete itemByKey[key]; - }; - getItemIDs = function () { - return Object.keys(itemByKey).map(getIDFromKey); - }; - - addRoot = function (id) { - var key = getKeyFromID(id); - rootByKey[key] = true; - }; - removeRoot = function (id) { - var key = getKeyFromID(id); - delete rootByKey[key]; - }; - getRootIDs = function () { - return Object.keys(rootByKey).map(getIDFromKey); - }; -} - -var unmountedIDs = []; - -function purgeDeep(id) { - var item = getItem(id); - if (item) { - var childIDs = item.childIDs; - - removeItem(id); - childIDs.forEach(purgeDeep); - } -} - -function describeComponentFrame(name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); -} - -function getDisplayName(element) { - if (element == null) { - return '#empty'; - } else if (typeof element === 'string' || typeof element === 'number') { - return '#text'; - } else if (typeof element.type === 'string') { - return element.type; - } else { - return element.type.displayName || element.type.name || 'Unknown'; - } -} - -function describeID(id) { - var name = ReactComponentTreeHook.getDisplayName(id); - var element = ReactComponentTreeHook.getElement(id); - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var ownerName; - if (ownerID) { - ownerName = ReactComponentTreeHook.getDisplayName(ownerID); - } - process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; - return describeComponentFrame(name, element && element._source, ownerName); -} - -var ReactComponentTreeHook = { - onSetChildren: function (id, nextChildIDs) { - var item = getItem(id); - !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.childIDs = nextChildIDs; - - for (var i = 0; i < nextChildIDs.length; i++) { - var nextChildID = nextChildIDs[i]; - var nextChild = getItem(nextChildID); - !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; - !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; - !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; - if (nextChild.parentID == null) { - nextChild.parentID = id; - // TODO: This shouldn't be necessary but mounting a new root during in - // componentWillMount currently causes not-yet-mounted components to - // be purged from our tree data so their parent id is missing. - } - !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; - } - }, - onBeforeMountComponent: function (id, element, parentID) { - var item = { - element: element, - parentID: parentID, - text: null, - childIDs: [], - isMounted: false, - updateCount: 0 - }; - setItem(id, item); - }, - onBeforeUpdateComponent: function (id, element) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.element = element; - }, - onMountComponent: function (id) { - var item = getItem(id); - !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.isMounted = true; - var isRoot = item.parentID === 0; - if (isRoot) { - addRoot(id); - } - }, - onUpdateComponent: function (id) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.updateCount++; - }, - onUnmountComponent: function (id) { - var item = getItem(id); - if (item) { - // We need to check if it exists. - // `item` might not exist if it is inside an error boundary, and a sibling - // error boundary child threw while mounting. Then this instance never - // got a chance to mount, but it still gets an unmounting event during - // the error boundary cleanup. - item.isMounted = false; - var isRoot = item.parentID === 0; - if (isRoot) { - removeRoot(id); - } - } - unmountedIDs.push(id); - }, - purgeUnmountedComponents: function () { - if (ReactComponentTreeHook._preventPurging) { - // Should only be used for testing. - return; - } - - for (var i = 0; i < unmountedIDs.length; i++) { - var id = unmountedIDs[i]; - purgeDeep(id); - } - unmountedIDs.length = 0; - }, - isMounted: function (id) { - var item = getItem(id); - return item ? item.isMounted : false; - }, - getCurrentStackAddendum: function (topElement) { - var info = ''; - if (topElement) { - var name = getDisplayName(topElement); - var owner = topElement._owner; - info += describeComponentFrame(name, topElement._source, owner && owner.getName()); - } - - var currentOwner = ReactCurrentOwner.current; - var id = currentOwner && currentOwner._debugID; - - info += ReactComponentTreeHook.getStackAddendumByID(id); - return info; - }, - getStackAddendumByID: function (id) { - var info = ''; - while (id) { - info += describeID(id); - id = ReactComponentTreeHook.getParentID(id); - } - return info; - }, - getChildIDs: function (id) { - var item = getItem(id); - return item ? item.childIDs : []; - }, - getDisplayName: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element) { - return null; - } - return getDisplayName(element); - }, - getElement: function (id) { - var item = getItem(id); - return item ? item.element : null; - }, - getOwnerID: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element || !element._owner) { - return null; - } - return element._owner._debugID; - }, - getParentID: function (id) { - var item = getItem(id); - return item ? item.parentID : null; - }, - getSource: function (id) { - var item = getItem(id); - var element = item ? item.element : null; - var source = element != null ? element._source : null; - return source; - }, - getText: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (typeof element === 'string') { - return element; - } else if (typeof element === 'number') { - return '' + element; - } else { - return null; - } - }, - getUpdateCount: function (id) { - var item = getItem(id); - return item ? item.updateCount : 0; - }, - - - getRootIDs: getRootIDs, - getRegisteredIDs: getItemIDs -}; - -module.exports = ReactComponentTreeHook; -}).call(this,require('_process')) -},{"./ReactCurrentOwner":90,"./reactProdInvariant":105,"_process":110,"fbjs/lib/invariant":5,"fbjs/lib/warning":6}],90:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -/** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ -var ReactCurrentOwner = { - - /** - * @internal - * @type {ReactComponent} - */ - current: null - -}; - -module.exports = ReactCurrentOwner; -},{}],91:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var ReactElement = require('./ReactElement'); - -/** - * Create a factory that creates HTML tag elements. - * - * @private - */ -var createDOMFactory = ReactElement.createFactory; -if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = require('./ReactElementValidator'); - createDOMFactory = ReactElementValidator.createFactory; -} - -/** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * This is also accessible via `React.DOM`. - * - * @public - */ -var ReactDOMFactories = { - a: createDOMFactory('a'), - abbr: createDOMFactory('abbr'), - address: createDOMFactory('address'), - area: createDOMFactory('area'), - article: createDOMFactory('article'), - aside: createDOMFactory('aside'), - audio: createDOMFactory('audio'), - b: createDOMFactory('b'), - base: createDOMFactory('base'), - bdi: createDOMFactory('bdi'), - bdo: createDOMFactory('bdo'), - big: createDOMFactory('big'), - blockquote: createDOMFactory('blockquote'), - body: createDOMFactory('body'), - br: createDOMFactory('br'), - button: createDOMFactory('button'), - canvas: createDOMFactory('canvas'), - caption: createDOMFactory('caption'), - cite: createDOMFactory('cite'), - code: createDOMFactory('code'), - col: createDOMFactory('col'), - colgroup: createDOMFactory('colgroup'), - data: createDOMFactory('data'), - datalist: createDOMFactory('datalist'), - dd: createDOMFactory('dd'), - del: createDOMFactory('del'), - details: createDOMFactory('details'), - dfn: createDOMFactory('dfn'), - dialog: createDOMFactory('dialog'), - div: createDOMFactory('div'), - dl: createDOMFactory('dl'), - dt: createDOMFactory('dt'), - em: createDOMFactory('em'), - embed: createDOMFactory('embed'), - fieldset: createDOMFactory('fieldset'), - figcaption: createDOMFactory('figcaption'), - figure: createDOMFactory('figure'), - footer: createDOMFactory('footer'), - form: createDOMFactory('form'), - h1: createDOMFactory('h1'), - h2: createDOMFactory('h2'), - h3: createDOMFactory('h3'), - h4: createDOMFactory('h4'), - h5: createDOMFactory('h5'), - h6: createDOMFactory('h6'), - head: createDOMFactory('head'), - header: createDOMFactory('header'), - hgroup: createDOMFactory('hgroup'), - hr: createDOMFactory('hr'), - html: createDOMFactory('html'), - i: createDOMFactory('i'), - iframe: createDOMFactory('iframe'), - img: createDOMFactory('img'), - input: createDOMFactory('input'), - ins: createDOMFactory('ins'), - kbd: createDOMFactory('kbd'), - keygen: createDOMFactory('keygen'), - label: createDOMFactory('label'), - legend: createDOMFactory('legend'), - li: createDOMFactory('li'), - link: createDOMFactory('link'), - main: createDOMFactory('main'), - map: createDOMFactory('map'), - mark: createDOMFactory('mark'), - menu: createDOMFactory('menu'), - menuitem: createDOMFactory('menuitem'), - meta: createDOMFactory('meta'), - meter: createDOMFactory('meter'), - nav: createDOMFactory('nav'), - noscript: createDOMFactory('noscript'), - object: createDOMFactory('object'), - ol: createDOMFactory('ol'), - optgroup: createDOMFactory('optgroup'), - option: createDOMFactory('option'), - output: createDOMFactory('output'), - p: createDOMFactory('p'), - param: createDOMFactory('param'), - picture: createDOMFactory('picture'), - pre: createDOMFactory('pre'), - progress: createDOMFactory('progress'), - q: createDOMFactory('q'), - rp: createDOMFactory('rp'), - rt: createDOMFactory('rt'), - ruby: createDOMFactory('ruby'), - s: createDOMFactory('s'), - samp: createDOMFactory('samp'), - script: createDOMFactory('script'), - section: createDOMFactory('section'), - select: createDOMFactory('select'), - small: createDOMFactory('small'), - source: createDOMFactory('source'), - span: createDOMFactory('span'), - strong: createDOMFactory('strong'), - style: createDOMFactory('style'), - sub: createDOMFactory('sub'), - summary: createDOMFactory('summary'), - sup: createDOMFactory('sup'), - table: createDOMFactory('table'), - tbody: createDOMFactory('tbody'), - td: createDOMFactory('td'), - textarea: createDOMFactory('textarea'), - tfoot: createDOMFactory('tfoot'), - th: createDOMFactory('th'), - thead: createDOMFactory('thead'), - time: createDOMFactory('time'), - title: createDOMFactory('title'), - tr: createDOMFactory('tr'), - track: createDOMFactory('track'), - u: createDOMFactory('u'), - ul: createDOMFactory('ul'), - 'var': createDOMFactory('var'), - video: createDOMFactory('video'), - wbr: createDOMFactory('wbr'), - - // SVG - circle: createDOMFactory('circle'), - clipPath: createDOMFactory('clipPath'), - defs: createDOMFactory('defs'), - ellipse: createDOMFactory('ellipse'), - g: createDOMFactory('g'), - image: createDOMFactory('image'), - line: createDOMFactory('line'), - linearGradient: createDOMFactory('linearGradient'), - mask: createDOMFactory('mask'), - path: createDOMFactory('path'), - pattern: createDOMFactory('pattern'), - polygon: createDOMFactory('polygon'), - polyline: createDOMFactory('polyline'), - radialGradient: createDOMFactory('radialGradient'), - rect: createDOMFactory('rect'), - stop: createDOMFactory('stop'), - svg: createDOMFactory('svg'), - text: createDOMFactory('text'), - tspan: createDOMFactory('tspan') -}; - -module.exports = ReactDOMFactories; -}).call(this,require('_process')) -},{"./ReactElement":92,"./ReactElementValidator":94,"_process":110}],92:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); - -var warning = require('fbjs/lib/warning'); -var canDefineProperty = require('./canDefineProperty'); -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); - -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; - -var specialPropKeyWarningShown, specialPropRefWarningShown; - -function hasValidRef(config) { - if (process.env.NODE_ENV !== 'production') { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.ref !== undefined; -} - -function hasValidKey(config) { - if (process.env.NODE_ENV !== 'production') { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.key !== undefined; -} - -function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); -} - -function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - }; - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); -} - -/** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, no instanceof check - * will work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} key - * @param {string|object} ref - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @param {*} owner - * @param {*} props - * @internal - */ -var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allow us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - - // Record the component responsible for creating this element. - _owner: owner - }; - - if (process.env.NODE_ENV !== 'production') { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; - - // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - if (canDefineProperty) { - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); - // self and source are DEV only properties. - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); - // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - } else { - element._store.validated = false; - element._self = self; - element._source = source; - } - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; -}; - -/** - * Create and return a new ReactElement of the given type. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement - */ -ReactElement.createElement = function (type, config, children) { - var propName; - - // Reserved names are extracted - var props = {}; - - var key = null; - var ref = null; - var self = null; - var source = null; - - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - } - if (hasValidKey(config)) { - key = '' + config.key; - } - - self = config.__self === undefined ? null : config.__self; - source = config.__source === undefined ? null : config.__source; - // Remaining properties are added to a new props object - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - if (process.env.NODE_ENV !== 'production') { - if (Object.freeze) { - Object.freeze(childArray); - } - } - props.children = childArray; - } - - // Resolve default props - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - if (process.env.NODE_ENV !== 'production') { - if (key || ref) { - if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - } - } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); -}; - -/** - * Return a function that produces ReactElements of a given type. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory - */ -ReactElement.createFactory = function (type) { - var factory = ReactElement.createElement.bind(null, type); - // Expose the type on the factory and the prototype so that it can be - // easily accessed on elements. E.g. `.type === Foo`. - // This should not be named `constructor` since this may not be the function - // that created the element, and it may not even be a constructor. - // Legacy hook TODO: Warn if this is accessed - factory.type = type; - return factory; -}; - -ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { - var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - - return newElement; -}; - -/** - * Clone and return a new ReactElement using element as the starting point. - * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement - */ -ReactElement.cloneElement = function (element, config, children) { - var propName; - - // Original props are copied - var props = _assign({}, element.props); - - // Reserved names are extracted - var key = element.key; - var ref = element.ref; - // Self is preserved since the owner is preserved. - var self = element._self; - // Source is preserved since cloneElement is unlikely to be targeted by a - // transpiler, and the original source is probably a better indicator of the - // true owner. - var source = element._source; - - // Owner will be preserved, unless ref is overridden - var owner = element._owner; - - if (config != null) { - if (hasValidRef(config)) { - // Silently steal the ref from the parent. - ref = config.ref; - owner = ReactCurrentOwner.current; - } - if (hasValidKey(config)) { - key = '' + config.key; - } - - // Remaining properties override existing props - var defaultProps; - if (element.type && element.type.defaultProps) { - defaultProps = element.type.defaultProps; - } - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - if (config[propName] === undefined && defaultProps !== undefined) { - // Resolve default props - props[propName] = defaultProps[propName]; - } else { - props[propName] = config[propName]; - } - } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - props.children = childArray; - } - - return ReactElement(element.type, key, ref, self, source, owner, props); -}; - -/** - * Verifies the object is a ReactElement. - * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a valid component. - * @final - */ -ReactElement.isValidElement = function (object) { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; -}; - -module.exports = ReactElement; -}).call(this,require('_process')) -},{"./ReactCurrentOwner":90,"./ReactElementSymbol":93,"./canDefineProperty":101,"_process":110,"fbjs/lib/warning":6,"object-assign":82}],93:[function(require,module,exports){ -/** - * Copyright 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -// The Symbol used to tag the ReactElement type. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. - -var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; - -module.exports = REACT_ELEMENT_TYPE; -},{}],94:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -/** - * ReactElementValidator provides a wrapper around a element factory - * which validates the props passed to the element. This is intended to be - * used only in DEV and could be replaced by a static type checker for languages - * that support it. - */ - -'use strict'; - -var ReactCurrentOwner = require('./ReactCurrentOwner'); -var ReactComponentTreeHook = require('./ReactComponentTreeHook'); -var ReactElement = require('./ReactElement'); - -var checkReactTypeSpec = require('./checkReactTypeSpec'); - -var canDefineProperty = require('./canDefineProperty'); -var getIteratorFn = require('./getIteratorFn'); -var warning = require('fbjs/lib/warning'); - -function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; -} - -/** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ -var ownerHasKeyUseWarning = {}; - -function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - if (parentName) { - info = ' Check the top-level render call using <' + parentName + '>.'; - } - } - return info; -} - -/** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ -function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) { - return; - } - element._store.validated = true; - - var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); - - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (memoizer[currentComponentErrorInfo]) { - return; - } - memoizer[currentComponentErrorInfo] = true; - - // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - var childOwner = ''; - if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - // Give the component that originally created this child. - childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; - } - - process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; -} - -/** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ -function validateChildKeys(node, parentType) { - if (typeof node !== 'object') { - return; - } - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - if (ReactElement.isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (ReactElement.isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - // Entry iterators provide implicit keys. - if (iteratorFn) { - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) { - if (ReactElement.isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } -} - -/** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ -function validatePropTypes(element) { - var componentClass = element.type; - if (typeof componentClass !== 'function') { - return; - } - var name = componentClass.displayName || componentClass.name; - if (componentClass.propTypes) { - checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); - } - if (typeof componentClass.getDefaultProps === 'function') { - process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; - } -} - -var ReactElementValidator = { - - createElement: function (type, props, children) { - var validType = typeof type === 'string' || typeof type === 'function'; - // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - if (!validType) { - process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; - } - - var element = ReactElement.createElement.apply(this, arguments); - - // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - if (element == null) { - return element; - } - - // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - if (validType) { - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); - } - } - - validatePropTypes(element); - - return element; - }, - - createFactory: function (type) { - var validatedFactory = ReactElementValidator.createElement.bind(null, type); - // Legacy hook TODO: Warn if this is accessed - validatedFactory.type = type; - - if (process.env.NODE_ENV !== 'production') { - if (canDefineProperty) { - Object.defineProperty(validatedFactory, 'type', { - enumerable: false, - get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; - Object.defineProperty(this, 'type', { - value: type - }); - return type; - } - }); - } - } - - return validatedFactory; - }, - - cloneElement: function (element, props, children) { - var newElement = ReactElement.cloneElement.apply(this, arguments); - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - validatePropTypes(newElement); - return newElement; - } - -}; - -module.exports = ReactElementValidator; -}).call(this,require('_process')) -},{"./ReactComponentTreeHook":89,"./ReactCurrentOwner":90,"./ReactElement":92,"./canDefineProperty":101,"./checkReactTypeSpec":102,"./getIteratorFn":103,"_process":110,"fbjs/lib/warning":6}],95:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var warning = require('fbjs/lib/warning'); - -function warnNoop(publicInstance, callerName) { - if (process.env.NODE_ENV !== 'production') { - var constructor = publicInstance.constructor; - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; - } -} - -/** - * This is the abstract API for an update queue. - */ -var ReactNoopUpdateQueue = { - - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function (publicInstance) { - return false; - }, - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @internal - */ - enqueueCallback: function (publicInstance, callback) {}, - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @internal - */ - enqueueForceUpdate: function (publicInstance) { - warnNoop(publicInstance, 'forceUpdate'); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState) { - warnNoop(publicInstance, 'replaceState'); - }, - - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @internal - */ - enqueueSetState: function (publicInstance, partialState) { - warnNoop(publicInstance, 'setState'); - } -}; - -module.exports = ReactNoopUpdateQueue; -}).call(this,require('_process')) -},{"_process":110,"fbjs/lib/warning":6}],96:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -var ReactPropTypeLocationNames = {}; - -if (process.env.NODE_ENV !== 'production') { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} - -module.exports = ReactPropTypeLocationNames; -}).call(this,require('_process')) -},{"_process":110}],97:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var ReactElement = require('./ReactElement'); -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactPropTypesSecret = require('./ReactPropTypesSecret'); - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var getIteratorFn = require('./getIteratorFn'); -var warning = require('fbjs/lib/warning'); - -/** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - -var ANONYMOUS = '<>'; - -var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker -}; - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -/*eslint-disable no-self-compare*/ -function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} -/*eslint-enable no-self-compare*/ - -/** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ -function PropTypeError(message) { - this.message = message; - this.stack = ''; -} -// Make `instanceof Error` still work for returned errors. -PropTypeError.prototype = Error.prototype; - -function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - if (process.env.NODE_ENV !== 'production') { - if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { - var cacheKey = componentName + ':' + propName; - if (!manualPropTypeCallCache[cacheKey]) { - process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; - manualPropTypeCallCache[cacheKey] = true; - } - } - } - if (props[propName] == null) { - var locationName = ReactPropTypeLocationNames[location]; - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; -} - -function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - var locationName = ReactPropTypeLocationNames[location]; - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturns(null)); -} - -function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var locationName = ReactPropTypeLocationNames[location]; - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!ReactElement.isValidElement(propValue)) { - var locationName = ReactPropTypeLocationNames[location]; - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var locationName = ReactPropTypeLocationNames[location]; - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var locationName = ReactPropTypeLocationNames[location]; - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); -} - -function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); -} - -function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || ReactElement.isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } -} - -function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; -} - -// Equivalent of `typeof` but with special handling for array and regexp. -function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; -} - -// This handles more types than `getPropType`. Only used for error messages. -// See `createPrimitiveTypeChecker`. -function getPreciseType(propValue) { - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; -} - -// Returns class name of the object, if any. -function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; -} - -module.exports = ReactPropTypes; -}).call(this,require('_process')) -},{"./ReactElement":92,"./ReactPropTypeLocationNames":96,"./ReactPropTypesSecret":98,"./getIteratorFn":103,"_process":110,"fbjs/lib/emptyFunction":3,"fbjs/lib/warning":6}],98:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; -},{}],99:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var ReactComponent = require('./ReactComponent'); -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var emptyObject = require('fbjs/lib/emptyObject'); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactPureComponent(props, context, updater) { - // Duplicated from ReactComponent. - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -function ComponentDummy() {} -ComponentDummy.prototype = ReactComponent.prototype; -ReactPureComponent.prototype = new ComponentDummy(); -ReactPureComponent.prototype.constructor = ReactPureComponent; -// Avoid an extra prototype jump for these methods. -_assign(ReactPureComponent.prototype, ReactComponent.prototype); -ReactPureComponent.prototype.isPureReactComponent = true; - -module.exports = ReactPureComponent; -},{"./ReactComponent":88,"./ReactNoopUpdateQueue":95,"fbjs/lib/emptyObject":4,"object-assign":82}],100:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -module.exports = '15.4.1'; -},{}],101:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -var canDefineProperty = false; -if (process.env.NODE_ENV !== 'production') { - try { - // $FlowFixMe https://github.com/facebook/flow/issues/285 - Object.defineProperty({}, 'x', { get: function () {} }); - canDefineProperty = true; - } catch (x) { - // IE will fail on defineProperty - } -} - -module.exports = canDefineProperty; -}).call(this,require('_process')) -},{"_process":110}],102:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactPropTypesSecret = require('./ReactPropTypesSecret'); - -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = require('./ReactComponentTreeHook'); -} - -var loggedTypeFailures = {}; - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?object} element The React element that is being type-checked - * @param {?number} debugID The React component instance that is being type-checked - * @private - */ -function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var componentStackInfo = ''; - - if (process.env.NODE_ENV !== 'production') { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = require('./ReactComponentTreeHook'); - } - if (debugID !== null) { - componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); - } else if (element !== null) { - componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); - } - } - - process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; - } - } - } -} - -module.exports = checkReactTypeSpec; -}).call(this,require('_process')) -},{"./ReactComponentTreeHook":89,"./ReactPropTypeLocationNames":96,"./ReactPropTypesSecret":98,"./reactProdInvariant":105,"_process":110,"fbjs/lib/invariant":5,"fbjs/lib/warning":6}],103:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ - -'use strict'; - -/* global Symbol */ - -var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - -/** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ -function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } -} - -module.exports = getIteratorFn; -},{}],104:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactElement = require('./ReactElement'); - -var invariant = require('fbjs/lib/invariant'); - -/** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only - * - * The current implementation of this function assumes that a single child gets - * passed without a wrapper, but the purpose of this helper function is to - * abstract away the particular structure of children. - * - * @param {?object} children Child collection structure. - * @return {ReactElement} The first and only `ReactElement` contained in the - * structure. - */ -function onlyChild(children) { - !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; - return children; -} - -module.exports = onlyChild; -}).call(this,require('_process')) -},{"./ReactElement":92,"./reactProdInvariant":105,"_process":110,"fbjs/lib/invariant":5}],105:[function(require,module,exports){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ -'use strict'; - -/** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. - */ - -function reactProdInvariant(code) { - var argCount = arguments.length - 1; - - var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; - - for (var argIdx = 0; argIdx < argCount; argIdx++) { - message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); - } - - message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; - - var error = new Error(message); - error.name = 'Invariant Violation'; - error.framesToPop = 1; // we don't care about reactProdInvariant's own frame - - throw error; -} - -module.exports = reactProdInvariant; -},{}],106:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); -var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); - -var getIteratorFn = require('./getIteratorFn'); -var invariant = require('fbjs/lib/invariant'); -var KeyEscapeUtils = require('./KeyEscapeUtils'); -var warning = require('fbjs/lib/warning'); - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; - -/** - * This is inlined from ReactElement since this file is shared between - * isomorphic and renderers. We could extract this to a - * - */ - -/** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - -var didWarnAboutMaps = false; - -/** - * Generate a key string that identifies a component within a set. - * - * @param {*} component A component that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ -function getComponentKey(component, index) { - // Do some typechecking here since we call this blindly. We want to ensure - // that we don't block potential future ES APIs. - if (component && typeof component === 'object' && component.key != null) { - // Explicit key - return KeyEscapeUtils.escape(component.key); - } - // Implicit key determined by the index in the set - return index.toString(36); -} - -/** - * @param {?*} children Children tree container. - * @param {!string} nameSoFar Name of the key path so far. - * @param {!function} callback Callback to invoke with each child found. - * @param {?*} traverseContext Used to pass information throughout the traversal - * process. - * @return {!number} The number of children in this subtree. - */ -function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { - var type = typeof children; - - if (type === 'undefined' || type === 'boolean') { - // All of the above are perceived as null. - children = null; - } - - if (children === null || type === 'string' || type === 'number' || - // The following is inlined from ReactElement. This means we can optimize - // some checks. React Fiber also inlines this logic for similar purposes. - type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { - callback(traverseContext, children, - // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows. - nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); - return 1; - } - - var child; - var nextName; - var subtreeCount = 0; // Count of children found in the current subtree. - var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; - - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getComponentKey(child, i); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - var iteratorFn = getIteratorFn(children); - if (iteratorFn) { - var iterator = iteratorFn.call(children); - var step; - if (iteratorFn !== children.entries) { - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getComponentKey(child, ii++); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - if (process.env.NODE_ENV !== 'production') { - var mapsAsChildrenAddendum = ''; - if (ReactCurrentOwner.current) { - var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); - if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; - } - } - process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; - didWarnAboutMaps = true; - } - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - child = entry[1]; - nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } - } - } else if (type === 'object') { - var addendum = ''; - if (process.env.NODE_ENV !== 'production') { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; - if (children._isReactElement) { - addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.'; - } - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - addendum += ' Check the render method of `' + name + '`.'; - } - } - } - var childrenString = String(children); - !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; - } - } - - return subtreeCount; -} - -/** - * Traverses children that are typically specified as `props.children`, but - * might also be specified through attributes: - * - * - `traverseAllChildren(this.props.children, ...)` - * - `traverseAllChildren(this.props.leftPanelChildren, ...)` - * - * The `traverseContext` is an optional argument that is passed through the - * entire traversal. It can be used to store accumulations or anything else that - * the callback might find relevant. - * - * @param {?*} children Children tree object. - * @param {!function} callback To invoke upon traversing each child. - * @param {?*} traverseContext Context for traversal. - * @return {!number} The number of children in this subtree. - */ -function traverseAllChildren(children, callback, traverseContext) { - if (children == null) { - return 0; - } - - return traverseAllChildrenImpl(children, '', callback, traverseContext); -} - -module.exports = traverseAllChildren; -}).call(this,require('_process')) -},{"./KeyEscapeUtils":83,"./ReactCurrentOwner":90,"./ReactElementSymbol":93,"./getIteratorFn":103,"./reactProdInvariant":105,"_process":110,"fbjs/lib/invariant":5,"fbjs/lib/warning":6}],107:[function(require,module,exports){ -module.exports = require('./lib/index'); - -},{"./lib/index":108}],108:[function(require,module,exports){ -(function (global){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _ponyfill = require('./ponyfill'); - -var _ponyfill2 = _interopRequireDefault(_ponyfill); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var root; /* global window */ - - -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (typeof module !== 'undefined') { - root = module; -} else { - root = Function('return this')(); -} - -var result = (0, _ponyfill2['default'])(root); -exports['default'] = result; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./ponyfill":109}],109:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = symbolObservablePonyfill; -function symbolObservablePonyfill(root) { - var result; - var _Symbol = root.Symbol; - - if (typeof _Symbol === 'function') { - if (_Symbol.observable) { - result = _Symbol.observable; - } else { - result = _Symbol('observable'); - _Symbol.observable = result; - } - } else { - result = '@@observable'; - } - - return result; -}; -},{}],110:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],"most-subject":[function(require,module,exports){ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -__export(require('./sources')); -__export(require('./subjects')); -__export(require('./combinators')); - -},{"./combinators":10,"./sources":13,"./subjects":15}],"most":[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PropagateTask = exports.defaultScheduler = exports.multicast = exports.throwError = exports.flatMapError = exports.recoverWith = exports.await = exports.awaitPromises = exports.fromPromise = exports.debounce = exports.throttle = exports.timestamp = exports.delay = exports.during = exports.since = exports.skipUntil = exports.until = exports.takeUntil = exports.skipWhile = exports.takeWhile = exports.slice = exports.skip = exports.take = exports.distinctBy = exports.skipRepeatsWith = exports.distinct = exports.skipRepeats = exports.filter = exports.switch = exports.switchLatest = exports.zipArray = exports.zip = exports.sampleWith = exports.sampleArray = exports.sample = exports.combineArray = exports.combine = exports.mergeArray = exports.merge = exports.mergeConcurrently = exports.concatMap = exports.flatMapEnd = exports.continueWith = exports.join = exports.chain = exports.flatMap = exports.transduce = exports.ap = exports.tap = exports.constant = exports.map = exports.startWith = exports.concat = exports.generate = exports.iterate = exports.unfold = exports.reduce = exports.scan = exports.loop = exports.drain = exports.forEach = exports.observe = exports.fromEvent = exports.periodic = exports.from = exports.never = exports.empty = exports.just = exports.of = exports.Stream = undefined; - -var _fromEvent = require('./source/fromEvent'); - -Object.defineProperty(exports, 'fromEvent', { - enumerable: true, - get: function () { - return _fromEvent.fromEvent; - } -}); - -var _unfold = require('./source/unfold'); - -Object.defineProperty(exports, 'unfold', { - enumerable: true, - get: function () { - return _unfold.unfold; - } -}); - -var _iterate = require('./source/iterate'); - -Object.defineProperty(exports, 'iterate', { - enumerable: true, - get: function () { - return _iterate.iterate; - } -}); - -var _generate = require('./source/generate'); - -Object.defineProperty(exports, 'generate', { - enumerable: true, - get: function () { - return _generate.generate; - } -}); - -var _Stream = require('./Stream'); - -var _Stream2 = _interopRequireDefault(_Stream); - -var _prelude = require('@most/prelude'); - -var base = _interopRequireWildcard(_prelude); - -var _core = require('./source/core'); - -var _from = require('./source/from'); - -var _periodic = require('./source/periodic'); - -var _symbolObservable = require('symbol-observable'); - -var _symbolObservable2 = _interopRequireDefault(_symbolObservable); - -var _subscribe = require('./observable/subscribe'); - -var _thru = require('./combinator/thru'); - -var _observe = require('./combinator/observe'); - -var _loop = require('./combinator/loop'); - -var _accumulate = require('./combinator/accumulate'); - -var _build = require('./combinator/build'); - -var _transform = require('./combinator/transform'); - -var _applicative = require('./combinator/applicative'); - -var _transduce = require('./combinator/transduce'); - -var _flatMap = require('./combinator/flatMap'); - -var _continueWith = require('./combinator/continueWith'); - -var _concatMap = require('./combinator/concatMap'); - -var _mergeConcurrently = require('./combinator/mergeConcurrently'); - -var _merge = require('./combinator/merge'); - -var _combine = require('./combinator/combine'); - -var _sample = require('./combinator/sample'); - -var _zip = require('./combinator/zip'); - -var _switch = require('./combinator/switch'); - -var _filter = require('./combinator/filter'); - -var _slice = require('./combinator/slice'); - -var _timeslice = require('./combinator/timeslice'); - -var _delay = require('./combinator/delay'); - -var _timestamp = require('./combinator/timestamp'); - -var _limit = require('./combinator/limit'); - -var _promises = require('./combinator/promises'); - -var _errors = require('./combinator/errors'); - -var _multicast = require('@most/multicast'); - -var _multicast2 = _interopRequireDefault(_multicast); - -var _defaultScheduler = require('./scheduler/defaultScheduler'); - -var _defaultScheduler2 = _interopRequireDefault(_defaultScheduler); - -var _PropagateTask = require('./scheduler/PropagateTask'); - -var _PropagateTask2 = _interopRequireDefault(_PropagateTask); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Core stream type - * @type {Stream} - */ -/** @license MIT License (c) copyright 2010-2016 original author or authors */ -/** @author Brian Cavalier */ -/** @author John Hann */ - -exports.Stream = _Stream2.default; - -// Add of and empty to constructor for fantasy-land compat - -_Stream2.default.of = _core.of; -_Stream2.default.empty = _core.empty; -// Add from to constructor for ES Observable compat -_Stream2.default.from = _from.from; -exports.of = _core.of; -exports.just = _core.of; -exports.empty = _core.empty; -exports.never = _core.never; -exports.from = _from.from; -exports.periodic = _periodic.periodic; - -// ----------------------------------------------------------------------- -// Draft ES Observable proposal interop -// https://github.com/zenparsing/es-observable - -_Stream2.default.prototype.subscribe = function (subscriber) { - return (0, _subscribe.subscribe)(subscriber, this); -}; - -_Stream2.default.prototype[_symbolObservable2.default] = function () { - return this; -}; - -// ----------------------------------------------------------------------- -// Fluent adapter - -/** - * Adapt a functional stream transform to fluent style. - * It applies f to the this stream object - * @param {function(s: Stream): Stream} f function that - * receives the stream itself and must return a new stream - * @return {Stream} - */ -_Stream2.default.prototype.thru = function (f) { - return (0, _thru.thru)(f, this); -}; - -// ----------------------------------------------------------------------- -// Adapting other sources - -/** - * Create a stream of events from the supplied EventTarget or EventEmitter - * @param {String} event event name - * @param {EventTarget|EventEmitter} source EventTarget or EventEmitter. The source - * must support either addEventListener/removeEventListener (w3c EventTarget: - * http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget), - * or addListener/removeListener (node EventEmitter: http://nodejs.org/api/events.html) - * @returns {Stream} stream of events of the specified type from the source - */ - - -// ----------------------------------------------------------------------- -// Observing - -exports.observe = _observe.observe; -exports.forEach = _observe.observe; -exports.drain = _observe.drain; - -/** - * Process all the events in the stream - * @returns {Promise} promise that fulfills when the stream ends, or rejects - * if the stream fails with an unhandled error. - */ - -_Stream2.default.prototype.observe = _Stream2.default.prototype.forEach = function (f) { - return (0, _observe.observe)(f, this); -}; - -/** - * Consume all events in the stream, without providing a function to process each. - * This causes a stream to become active and begin emitting events, and is useful - * in cases where all processing has been setup upstream via other combinators, and - * there is no need to process the terminal events. - * @returns {Promise} promise that fulfills when the stream ends, or rejects - * if the stream fails with an unhandled error. - */ -_Stream2.default.prototype.drain = function () { - return (0, _observe.drain)(this); -}; - -// ------------------------------------------------------- - -exports.loop = _loop.loop; - -/** - * Generalized feedback loop. Call a stepper function for each event. The stepper - * will be called with 2 params: the current seed and the an event value. It must - * return a new { seed, value } pair. The `seed` will be fed back into the next - * invocation of stepper, and the `value` will be propagated as the event value. - * @param {function(seed:*, value:*):{seed:*, value:*}} stepper loop step function - * @param {*} seed initial seed value passed to first stepper call - * @returns {Stream} new stream whose values are the `value` field of the objects - * returned by the stepper - */ - -_Stream2.default.prototype.loop = function (stepper, seed) { - return (0, _loop.loop)(stepper, seed, this); -}; - -// ------------------------------------------------------- - -exports.scan = _accumulate.scan; -exports.reduce = _accumulate.reduce; - -/** - * Create a stream containing successive reduce results of applying f to - * the previous reduce result and the current stream item. - * @param {function(result:*, x:*):*} f reducer function - * @param {*} initial initial value - * @returns {Stream} new stream containing successive reduce results - */ - -_Stream2.default.prototype.scan = function (f, initial) { - return (0, _accumulate.scan)(f, initial, this); -}; - -/** - * Reduce the stream to produce a single result. Note that reducing an infinite - * stream will return a Promise that never fulfills, but that may reject if an error - * occurs. - * @param {function(result:*, x:*):*} f reducer function - * @param {*} initial optional initial value - * @returns {Promise} promise for the file result of the reduce - */ -_Stream2.default.prototype.reduce = function (f, initial) { - return (0, _accumulate.reduce)(f, initial, this); -}; - -// ----------------------------------------------------------------------- -// Building and extending - -exports.concat = _build.concat; -exports.startWith = _build.cons; - -/** - * @param {Stream} tail - * @returns {Stream} new stream containing all items in this followed by - * all items in tail - */ - -_Stream2.default.prototype.concat = function (tail) { - return (0, _build.concat)(this, tail); -}; - -/** - * @param {*} x value to prepend - * @returns {Stream} a new stream with x prepended - */ -_Stream2.default.prototype.startWith = function (x) { - return (0, _build.cons)(x, this); -}; - -// ----------------------------------------------------------------------- -// Transforming - -exports.map = _transform.map; -exports.constant = _transform.constant; -exports.tap = _transform.tap; -exports.ap = _applicative.ap; - -/** - * Transform each value in the stream by applying f to each - * @param {function(*):*} f mapping function - * @returns {Stream} stream containing items transformed by f - */ - -_Stream2.default.prototype.map = function (f) { - return (0, _transform.map)(f, this); -}; - -/** - * Assume this stream contains functions, and apply each function to each item - * in the provided stream. This generates, in effect, a cross product. - * @param {Stream} xs stream of items to which - * @returns {Stream} stream containing the cross product of items - */ -_Stream2.default.prototype.ap = function (xs) { - return (0, _applicative.ap)(this, xs); -}; - -/** - * Replace each value in the stream with x - * @param {*} x - * @returns {Stream} stream containing items replaced with x - */ -_Stream2.default.prototype.constant = function (x) { - return (0, _transform.constant)(x, this); -}; - -/** - * Perform a side effect for each item in the stream - * @param {function(x:*):*} f side effect to execute for each item. The - * return value will be discarded. - * @returns {Stream} new stream containing the same items as this stream - */ -_Stream2.default.prototype.tap = function (f) { - return (0, _transform.tap)(f, this); -}; - -// ----------------------------------------------------------------------- -// Transducer support - -exports.transduce = _transduce.transduce; - -/** - * Transform this stream by passing its events through a transducer. - * @param {function} transducer transducer function - * @return {Stream} stream of events transformed by the transducer - */ - -_Stream2.default.prototype.transduce = function (transducer) { - return (0, _transduce.transduce)(transducer, this); -}; - -// ----------------------------------------------------------------------- -// FlatMapping - -exports.flatMap = _flatMap.flatMap; -exports.chain = _flatMap.flatMap; -exports.join = _flatMap.join; - -/** - * Map each value in the stream to a new stream, and merge it into the - * returned outer stream. Event arrival times are preserved. - * @param {function(x:*):Stream} f chaining function, must return a Stream - * @returns {Stream} new stream containing all events from each stream returned by f - */ - -_Stream2.default.prototype.flatMap = _Stream2.default.prototype.chain = function (f) { - return (0, _flatMap.flatMap)(f, this); -}; - -/** - * Monadic join. Flatten a Stream> to Stream by merging inner - * streams to the outer. Event arrival times are preserved. - * @returns {Stream} new stream containing all events of all inner streams - */ -_Stream2.default.prototype.join = function () { - return (0, _flatMap.join)(this); -}; - -exports.continueWith = _continueWith.continueWith; -exports.flatMapEnd = _continueWith.continueWith; - -/** - * Map the end event to a new stream, and begin emitting its values. - * @param {function(x:*):Stream} f function that receives the end event value, - * and *must* return a new Stream to continue with. - * @returns {Stream} new stream that emits all events from the original stream, - * followed by all events from the stream returned by f. - */ - -_Stream2.default.prototype.continueWith = _Stream2.default.prototype.flatMapEnd = function (f) { - return (0, _continueWith.continueWith)(f, this); -}; - -exports.concatMap = _concatMap.concatMap; - - -_Stream2.default.prototype.concatMap = function (f) { - return (0, _concatMap.concatMap)(f, this); -}; - -// ----------------------------------------------------------------------- -// Concurrent merging - -exports.mergeConcurrently = _mergeConcurrently.mergeConcurrently; - -/** - * Flatten a Stream> to Stream by merging inner - * streams to the outer, limiting the number of inner streams that may - * be active concurrently. - * @param {number} concurrency at most this many inner streams will be - * allowed to be active concurrently. - * @return {Stream} new stream containing all events of all inner - * streams, with limited concurrency. - */ - -_Stream2.default.prototype.mergeConcurrently = function (concurrency) { - return (0, _mergeConcurrently.mergeConcurrently)(concurrency, this); -}; - -// ----------------------------------------------------------------------- -// Merging - -exports.merge = _merge.merge; -exports.mergeArray = _merge.mergeArray; - -/** - * Merge this stream and all the provided streams - * @returns {Stream} stream containing items from this stream and s in time - * order. If two events are simultaneous they will be merged in - * arbitrary order. - */ - -_Stream2.default.prototype.merge = function () /* ...streams*/{ - return (0, _merge.mergeArray)(base.cons(this, arguments)); -}; - -// ----------------------------------------------------------------------- -// Combining - -exports.combine = _combine.combine; -exports.combineArray = _combine.combineArray; - -/** - * Combine latest events from all input streams - * @param {function(...events):*} f function to combine most recent events - * @returns {Stream} stream containing the result of applying f to the most recent - * event of each input stream, whenever a new event arrives on any stream. - */ - -_Stream2.default.prototype.combine = function (f /*, ...streams*/) { - return (0, _combine.combineArray)(f, base.replace(this, 0, arguments)); -}; - -// ----------------------------------------------------------------------- -// Sampling - -exports.sample = _sample.sample; -exports.sampleArray = _sample.sampleArray; -exports.sampleWith = _sample.sampleWith; - -/** - * When an event arrives on sampler, emit the latest event value from stream. - * @param {Stream} sampler stream of events at whose arrival time - * signal's latest value will be propagated - * @returns {Stream} sampled stream of values - */ - -_Stream2.default.prototype.sampleWith = function (sampler) { - return (0, _sample.sampleWith)(sampler, this); -}; - -/** - * When an event arrives on this stream, emit the result of calling f with the latest - * values of all streams being sampled - * @param {function(...values):*} f function to apply to each set of sampled values - * @returns {Stream} stream of sampled and transformed values - */ -_Stream2.default.prototype.sample = function (f /* ...streams */) { - return (0, _sample.sampleArray)(f, this, base.tail(arguments)); -}; - -// ----------------------------------------------------------------------- -// Zipping - -exports.zip = _zip.zip; -exports.zipArray = _zip.zipArray; - -/** - * Pair-wise combine items with those in s. Given 2 streams: - * [1,2,3] zipWith f [4,5,6] -> [f(1,4),f(2,5),f(3,6)] - * Note: zip causes fast streams to buffer and wait for slow streams. - * @param {function(a:Stream, b:Stream, ...):*} f function to combine items - * @returns {Stream} new stream containing pairs - */ - -_Stream2.default.prototype.zip = function (f /*, ...streams*/) { - return (0, _zip.zipArray)(f, base.replace(this, 0, arguments)); -}; - -// ----------------------------------------------------------------------- -// Switching - -exports.switchLatest = _switch.switchLatest; -exports.switch = _switch.switchLatest; - -/** - * Given a stream of streams, return a new stream that adopts the behavior - * of the most recent inner stream. - * @returns {Stream} switching stream - */ - -_Stream2.default.prototype.switch = _Stream2.default.prototype.switchLatest = function () { - return (0, _switch.switchLatest)(this); -}; - -// ----------------------------------------------------------------------- -// Filtering - -exports.filter = _filter.filter; -exports.skipRepeats = _filter.skipRepeats; -exports.distinct = _filter.skipRepeats; -exports.skipRepeatsWith = _filter.skipRepeatsWith; -exports.distinctBy = _filter.skipRepeatsWith; - -/** - * Retain only items matching a predicate - * stream: -12345678- - * filter(x => x % 2 === 0, stream): --2-4-6-8- - * @param {function(x:*):boolean} p filtering predicate called for each item - * @returns {Stream} stream containing only items for which predicate returns truthy - */ - -_Stream2.default.prototype.filter = function (p) { - return (0, _filter.filter)(p, this); -}; - -/** - * Skip repeated events, using === to compare items - * stream: -abbcd- - * distinct(stream): -ab-cd- - * @returns {Stream} stream with no repeated events - */ -_Stream2.default.prototype.skipRepeats = function () { - return (0, _filter.skipRepeats)(this); -}; - -/** - * Skip repeated events, using supplied equals function to compare items - * @param {function(a:*, b:*):boolean} equals function to compare items - * @returns {Stream} stream with no repeated events - */ -_Stream2.default.prototype.skipRepeatsWith = function (equals) { - return (0, _filter.skipRepeatsWith)(equals, this); -}; - -// ----------------------------------------------------------------------- -// Slicing - -exports.take = _slice.take; -exports.skip = _slice.skip; -exports.slice = _slice.slice; -exports.takeWhile = _slice.takeWhile; -exports.skipWhile = _slice.skipWhile; - -/** - * stream: -abcd- - * take(2, stream): -ab| - * @param {Number} n take up to this many events - * @returns {Stream} stream containing at most the first n items from this stream - */ - -_Stream2.default.prototype.take = function (n) { - return (0, _slice.take)(n, this); -}; - -/** - * stream: -abcd-> - * skip(2, stream): ---cd-> - * @param {Number} n skip this many events - * @returns {Stream} stream not containing the first n events - */ -_Stream2.default.prototype.skip = function (n) { - return (0, _slice.skip)(n, this); -}; - -/** - * Slice a stream by event index. Equivalent to, but more efficient than - * stream.take(end).skip(start); - * NOTE: Negative start and end are not supported - * @param {Number} start skip all events before the start index - * @param {Number} end allow all events from the start index to the end index - * @returns {Stream} stream containing items where start <= index < end - */ -_Stream2.default.prototype.slice = function (start, end) { - return (0, _slice.slice)(start, end, this); -}; - -/** - * stream: -123451234-> - * takeWhile(x => x < 5, stream): -1234| - * @param {function(x:*):boolean} p predicate - * @returns {Stream} stream containing items up to, but not including, the - * first item for which p returns falsy. - */ -_Stream2.default.prototype.takeWhile = function (p) { - return (0, _slice.takeWhile)(p, this); -}; - -/** - * stream: -123451234-> - * skipWhile(x => x < 5, stream): -----51234-> - * @param {function(x:*):boolean} p predicate - * @returns {Stream} stream containing items following *and including* the - * first item for which p returns falsy. - */ -_Stream2.default.prototype.skipWhile = function (p) { - return (0, _slice.skipWhile)(p, this); -}; - -// ----------------------------------------------------------------------- -// Time slicing - -exports.takeUntil = _timeslice.takeUntil; -exports.until = _timeslice.takeUntil; -exports.skipUntil = _timeslice.skipUntil; -exports.since = _timeslice.skipUntil; -exports.during = _timeslice.during; - -/** - * stream: -a-b-c-d-e-f-g-> - * signal: -------x - * takeUntil(signal, stream): -a-b-c-| - * @param {Stream} signal retain only events in stream before the first - * event in signal - * @returns {Stream} new stream containing only events that occur before - * the first event in signal. - */ - -_Stream2.default.prototype.until = _Stream2.default.prototype.takeUntil = function (signal) { - return (0, _timeslice.takeUntil)(signal, this); -}; - -/** - * stream: -a-b-c-d-e-f-g-> - * signal: -------x - * takeUntil(signal, stream): -------d-e-f-g-> - * @param {Stream} signal retain only events in stream at or after the first - * event in signal - * @returns {Stream} new stream containing only events that occur after - * the first event in signal. - */ -_Stream2.default.prototype.since = _Stream2.default.prototype.skipUntil = function (signal) { - return (0, _timeslice.skipUntil)(signal, this); -}; - -/** - * stream: -a-b-c-d-e-f-g-> - * timeWindow: -----s - * s: -----t - * stream.during(timeWindow): -----c-d-e-| - * @param {Stream} timeWindow a stream whose first event (s) represents - * the window start time. That event (s) is itself a stream whose first event (t) - * represents the window end time - * @returns {Stream} new stream containing only events within the provided timespan - */ -_Stream2.default.prototype.during = function (timeWindow) { - return (0, _timeslice.during)(timeWindow, this); -}; - -// ----------------------------------------------------------------------- -// Delaying - -exports.delay = _delay.delay; - -/** - * @param {Number} delayTime milliseconds to delay each item - * @returns {Stream} new stream containing the same items, but delayed by ms - */ - -_Stream2.default.prototype.delay = function (delayTime) { - return (0, _delay.delay)(delayTime, this); -}; - -// ----------------------------------------------------------------------- -// Getting event timestamp - -exports.timestamp = _timestamp.timestamp; - -/** - * Expose event timestamps into the stream. Turns a Stream into - * Stream<{time:t, value:X}> - * @returns {Stream<{time:number, value:*}>} - */ - -_Stream2.default.prototype.timestamp = function () { - return (0, _timestamp.timestamp)(this); -}; - -// ----------------------------------------------------------------------- -// Rate limiting - -exports.throttle = _limit.throttle; -exports.debounce = _limit.debounce; - -/** - * Limit the rate of events - * stream: abcd----abcd---- - * throttle(2, stream): a-c-----a-c----- - * @param {Number} period time to suppress events - * @returns {Stream} new stream that skips events for throttle period - */ - -_Stream2.default.prototype.throttle = function (period) { - return (0, _limit.throttle)(period, this); -}; - -/** - * Wait for a burst of events to subside and emit only the last event in the burst - * stream: abcd----abcd---- - * debounce(2, stream): -----d-------d-- - * @param {Number} period events occuring more frequently than this - * on the provided scheduler will be suppressed - * @returns {Stream} new debounced stream - */ -_Stream2.default.prototype.debounce = function (period) { - return (0, _limit.debounce)(period, this); -}; - -// ----------------------------------------------------------------------- -// Awaiting Promises - -exports.fromPromise = _promises.fromPromise; -exports.awaitPromises = _promises.awaitPromises; -exports.await = _promises.awaitPromises; - -/** - * Await promises, turning a Stream> into Stream. Preserves - * event order, but timeshifts events based on promise resolution time. - * @returns {Stream} stream containing non-promise values - */ - -_Stream2.default.prototype.await = function () { - return (0, _promises.awaitPromises)(this); -}; - -// ----------------------------------------------------------------------- -// Error handling - -exports.recoverWith = _errors.recoverWith; -exports.flatMapError = _errors.flatMapError; -exports.throwError = _errors.throwError; - -/** - * If this stream encounters an error, recover and continue with items from stream - * returned by f. - * stream: -a-b-c-X- - * f(X): d-e-f-g- - * flatMapError(f, stream): -a-b-c-d-e-f-g- - * @param {function(error:*):Stream} f function which returns a new stream - * @returns {Stream} new stream which will recover from an error by calling f - */ - -_Stream2.default.prototype.recoverWith = _Stream2.default.prototype.flatMapError = function (f) { - return (0, _errors.flatMapError)(f, this); -}; - -// ----------------------------------------------------------------------- -// Multicasting - -exports.multicast = _multicast2.default; - -/** - * Transform the stream into multicast stream. That means that many subscribers - * to the stream will not cause multiple invocations of the internal machinery. - * @returns {Stream} new stream which will multicast events to all observers. - */ - -_Stream2.default.prototype.multicast = function () { - return (0, _multicast2.default)(this); -}; - -// export the instance of the defaultScheduler for third-party libraries -exports.defaultScheduler = _defaultScheduler2.default; - -// export an implementation of Task used internally for third-party libraries - -exports.PropagateTask = _PropagateTask2.default; -},{"./Stream":20,"./combinator/accumulate":21,"./combinator/applicative":22,"./combinator/build":23,"./combinator/combine":24,"./combinator/concatMap":25,"./combinator/continueWith":26,"./combinator/delay":27,"./combinator/errors":28,"./combinator/filter":29,"./combinator/flatMap":30,"./combinator/limit":31,"./combinator/loop":32,"./combinator/merge":33,"./combinator/mergeConcurrently":34,"./combinator/observe":35,"./combinator/promises":36,"./combinator/sample":37,"./combinator/slice":38,"./combinator/switch":39,"./combinator/thru":40,"./combinator/timeslice":41,"./combinator/timestamp":42,"./combinator/transduce":43,"./combinator/transform":44,"./combinator/zip":45,"./observable/subscribe":57,"./scheduler/PropagateTask":60,"./scheduler/defaultScheduler":64,"./source/core":71,"./source/from":72,"./source/fromEvent":74,"./source/generate":76,"./source/iterate":77,"./source/periodic":78,"./source/unfold":80,"@most/multicast":1,"@most/prelude":2,"symbol-observable":107}],"react":[function(require,module,exports){ -'use strict'; - -module.exports = require('./lib/React'); - -},{"./lib/React":85}]},{},[]); diff --git a/lib/history.ts b/lib/history.ts index 3121c67..2dee1e3 100644 --- a/lib/history.ts +++ b/lib/history.ts @@ -1,13 +1,13 @@ import { from, Stream } from 'most' - +import { EngineSubject } from './engine/most' export interface Path extends Stream { send: (fn: T) => void } export class Traveler { cursor: number - path: Path<(n: number) => number> + path: EngineSubject<(n: number) => number> history: Stream[]> - constructor(history:Stream[]>, path:Path<(n: number) => number>) { + constructor(history: Stream[]>, path: EngineSubject<(n: number) => number>) { this.history = history this.path = path } @@ -37,15 +37,13 @@ export interface Stamp { value: S time: number } -export default function initHistory(contextHistory: History): [Stream[]>, Traveler] { - let history = from(contextHistory.history) +export default function initHistory(engineHistory: EngineSubject, engineTravel: EngineSubject<(n: number) => number>): Traveler { + let history = from(engineHistory) .timestamp() .scan((acc: Stamp[], state: Stamp) => { acc.push(state) return acc; }, []) .multicast() - - - return [history, new Traveler(history, contextHistory.path)] + return new Traveler(history, engineTravel) } diff --git a/lib/react-most.js b/lib/react-most.js index cc73ea7..874f134 100644 --- a/lib/react-most.js +++ b/lib/react-most.js @@ -1,190 +1,201 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import initHistory from './history'; -import { from } from 'most'; -import mostEngine from './engine/most'; +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var react_1 = require("react"); +var prop_types_1 = require("prop-types"); +var history_1 = require("./history"); +var most_1 = require("most"); +var most_2 = require("./engine/most"); // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign -export const INTENT_STREAM = '@@reactive-react/react-most.intentStream'; -export const HISTORY_STREAM = '@@reactive-react/react-most.historyStream'; -const MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve'; - -const CONTEXT_TYPE = { - [INTENT_STREAM]: PropTypes.object, - [HISTORY_STREAM]: PropTypes.object, - [MERGE_OBSERVE]: PropTypes.func, -}; - -function pick(names, obj) { - let result = {}; - for (let name of names) { - if (obj[name]) result[name] = obj[name]; - } - return result; -} -const h = React.createElement; -export function connect(main, opts = {}) { - return function(WrappedComponent) { - let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; - if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - class Connect extends React.PureComponent { - constructor(props, context) { - super(props, context); - let [actions, sink$] = actionsAndSinks( - main(context[INTENT_STREAM], props), - this - ); - this.sink$ = sink$.concat(props.sink$ || []); - this.actions = Object.assign({}, actions, props.actions); - } - render() { - return h( - WrappedComponent, - Object.assign({}, this.props, opts, { - sink$: this.sink$, - actions: this.actions, - }) - ); - } - } - Connect.contextTypes = CONTEXT_TYPE; - Connect.displayName = connectDisplayName; - return Connect; - } else { - class Connect extends React.PureComponent { - constructor(props, context) { - super(props, context); - if (opts.history || props.history) { - opts.history = initHistory(context[HISTORY_STREAM]); - opts.history.travel.forEach(state => { - return this.setState(state); - }); - } - - let [actions, sink$] = actionsAndSinks( - main(context[INTENT_STREAM], props), - this - ); - this.sink$ = sink$.concat(props.sink$ || []); - this.actions = Object.assign({}, actions, props.actions); - let defaultKey = Object.keys(WrappedComponent.defaultProps); - this.state = Object.assign( - {}, - WrappedComponent.defaultProps, - pick(defaultKey, props) - ); - } - componentWillReceiveProps(nextProps) { - this.setState(state => pick(Object.keys(state), nextProps)); +exports.INTENT_STREAM = '@@reactive-react/react-most.intentStream'; +exports.HISTORY_STREAM = '@@reactive-react/react-most.historyStream'; +var MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve'; +var CONTEXT_TYPE = (_a = {}, + _a[exports.INTENT_STREAM] = prop_types_1.default.object, + _a[exports.HISTORY_STREAM] = prop_types_1.default.object, + _a[MERGE_OBSERVE] = prop_types_1.default.func, + _a); +var h = react_1.default.createElement; +function connect(main, opts) { + if (opts === void 0) { opts = { history: false }; } + return function (WrappedComponent) { + var connectDisplayName = "Connect(" + getDisplayName(WrappedComponent) + ")"; + if (WrappedComponent.contextTypes === CONTEXT_TYPE) { + return _a = (function (_super) { + __extends(ConnectNode, _super); + function ConnectNode(props, context) { + var _this = _super.call(this, props, context) || this; + var _a = main(context[exports.INTENT_STREAM], props), actions = _a.actions, sink$ = _a.sink$; + _this.sink$ = sink$; + _this.actions = Object.assign({}, actions, props.actions); + return _this; + } + ConnectNode.prototype.render = function () { + return h(WrappedComponent, Object.assign({}, this.props, opts, { + sink$: this.sink$, + actions: this.actions, + })); + }; + return ConnectNode; + }(react_1.default.PureComponent)), + _a.contextTypes = CONTEXT_TYPE, + _a.displayName = connectDisplayName, + _a; } - componentDidMount() { - this.subscriptions = this.context[MERGE_OBSERVE]( - this.sink$, - action => { - if (action instanceof Function) { - this.setState((prevState, props) => { - let newState = action.call(this, prevState, props); - if (opts.history && newState != prevState) { - opts.history.cursor = -1; - this.context[HISTORY_STREAM].send(prevState); - } - return newState; - }); - } else { - /* istanbul ignore next */ - console.warn( - 'action', - action, - 'need to be a Function which map from current state to new state' - ); - } - } - ); - } - componentWillUnmount() { - this.subscriptions.unsubscribe(); - } - render() { - return h( - WrappedComponent, - Object.assign({}, this.props, this.state, opts, { - actions: this.actions, - }) - ); + else { + var ConnectLeaf = (function (_super) { + __extends(ConnectLeaf, _super); + function ConnectLeaf(props, context) { + var _this = _super.call(this, props, context) || this; + if (opts.history || props.history) { + opts.history = history_1.default(context[exports.HISTORY_STREAM]); + opts.history.travel.forEach(function (state) { + return _this.setState(state); + }); + } + var _a = actionsAndSinks(main(context[exports.INTENT_STREAM], props), _this), actions = _a[0], sink$ = _a[1]; + _this.sink$ = sink$.concat(props.sink$ || []); + _this.actions = Object.assign({}, actions, props.actions); + var defaultKey = Object.keys(WrappedComponent.defaultProps); + _this.state = Object.assign({}, WrappedComponent.defaultProps, pick(defaultKey, props)); + return _this; + } + ConnectLeaf.prototype.componentWillReceiveProps = function (nextProps) { + this.setState(function (state) { return pick(Object.keys(state), nextProps); }); + }; + ConnectLeaf.prototype.componentDidMount = function () { + var _this = this; + this.subscriptions = this.context[MERGE_OBSERVE](this.sink$, function (action) { + if (action instanceof Function) { + _this.setState(function (prevState, props) { + var newState = action.call(_this, prevState, props); + if (opts.history && newState != prevState) { + opts.history.cursor = -1; + _this.context[exports.HISTORY_STREAM].send(prevState); + } + return newState; + }); + } + else { + /* istanbul ignore next */ + console.warn('action', action, 'need to be a Function which map from current state to new state'); + } + }); + }; + ConnectLeaf.prototype.componentWillUnmount = function () { + this.subscriptions.unsubscribe(); + }; + ConnectLeaf.prototype.render = function () { + return h(WrappedComponent, Object.assign({}, this.props, this.state, opts, { + actions: this.actions, + })); + }; + return ConnectLeaf; + }(react_1.default.PureComponent)); + Connect.contextTypes = CONTEXT_TYPE; + Connect.displayName = connectDisplayName; + return Connect; } - } - Connect.contextTypes = CONTEXT_TYPE; - Connect.displayName = connectDisplayName; - return Connect; - } - }; + var _a; + }; } - -export default class Most extends React.PureComponent { - getChildContext() { - let engineClass = (this.props && this.props.engine) || mostEngine; - let engine = engineClass(); - /* istanbul ignore if */ - if (process.env.NODE_ENV === 'debug') { - inspect(engine); +var Most = (function (_super) { + __extends(Most, _super); + function Most() { + return _super !== null && _super.apply(this, arguments) || this; } - return { - [INTENT_STREAM]: engine.intentStream, - [MERGE_OBSERVE]: engine.mergeObserve, - [HISTORY_STREAM]: engine.historyStream, + Most.prototype.getChildContext = function () { + var engineClass = (this.props && this.props.engine) || most_2.default; + var engine = engineClass(); + /* istanbul ignore if */ + if (process.env.NODE_ENV === 'debug') { + inspect(engine); + } + return _a = {}, + _a[exports.INTENT_STREAM] = engine.intentStream, + _a[MERGE_OBSERVE] = engine.mergeObserve, + _a[exports.HISTORY_STREAM] = engine.historyStream, + _a; + var _a; }; - } - render() { - return React.Children.only(this.props.children); - } -} + Most.prototype.render = function () { + return react_1.default.Children.only(this.props.children); + }; + return Most; +}(react_1.default.PureComponent)); +exports.default = Most; Most.childContextTypes = CONTEXT_TYPE; - function observable(obj) { - return !!obj.subscribe; + return !!obj.subscribe; } - /* istanbul ignore next */ function inspect(engine) { - from(engine.intentStream) - .timestamp() - .observe(stamp => - console.log(`[${new Date(stamp.time).toJSON()}][INTENT]:}`, stamp.value) - ); - from(engine.historyStream) - .timestamp() - .observe(stamp => - console.log(`[${new Date(stamp.time).toJSON()}][STATE]:}`, stamp.value) - ); + most_1.from(engine.intentStream) + .timestamp() + .observe(function (stamp) { + return console.log("[" + new Date(stamp.time).toJSON() + "][INTENT]:}", stamp.value); + }); + most_1.from(engine.historyStream) + .timestamp() + .observe(function (stamp) { + return console.log("[" + new Date(stamp.time).toJSON() + "][STATE]:}", stamp.value); + }); } - function actionsAndSinks(sinks, self) { - let _sinks = []; - let _actions = { - fromEvent(e, f = x => x) { - return self.context[INTENT_STREAM].send(f(e)); - }, - fromPromise(p) { - return p.then(x => self.context[INTENT_STREAM].send(x)); - }, - }; - for (let name in sinks) { - let value = sinks[name]; - if (observable(value)) { - _sinks.push(value); - } else if (value instanceof Function) { - _actions[name] = (...args) => { - return self.context[INTENT_STREAM].send(value.apply(self, args)); - }; - } else if (name === 'actions') { - for (let a in value) - _actions[a] = (...args) => { - return self.context[INTENT_STREAM].send(value[a].apply(self, args)); - }; + var _sinks = []; + var _actions = { + fromEvent: function (e, f) { + if (f === void 0) { f = function (x) { return x; }; } + return self.context[exports.INTENT_STREAM].send(f(e)); + }, + fromPromise: function (p) { + return p.then(function (x) { return self.context[exports.INTENT_STREAM].send(x); }); + }, + }; + var _loop_1 = function (name) { + var value = sinks[name]; + if (observable(value)) { + _sinks.push(value); + } + else if (value instanceof Function) { + _actions[name] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return self.context[exports.INTENT_STREAM].send(value.apply(self, args)); + }; + } + else if (name === 'actions') { + var _loop_2 = function (a) { + _actions[a] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return self.context[exports.INTENT_STREAM].send(value[a].apply(self, args)); + }; + }; + for (var a in value) { + _loop_2(a); + } + } + }; + for (var name in sinks) { + _loop_1(name); } - } - return [_actions, _sinks]; + return [_actions, _sinks]; } - function getDisplayName(WrappedComponent) { - return WrappedComponent.displayName || WrappedComponent.name || 'Component'; + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; } +var _a; diff --git a/lib/react-most.ts b/lib/react-most.ts index b9e5ee5..cd1dd12 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,17 +1,13 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import initHistory from './history'; +import initHistory, { Traveler } from './history'; import { from, Stream } from 'most'; -import mostEngine from './engine/most'; +import { Engine, EngineSubject } from './engine/most'; // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign -export const INTENT_STREAM = '@@reactive-react/react-most.intentStream'; -export const HISTORY_STREAM = '@@reactive-react/react-most.historyStream'; -const MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve'; +export const REACT_MOST_ENGINE = '@@reactive-react/react-most.engine'; const CONTEXT_TYPE = { - [INTENT_STREAM]: PropTypes.object, - [HISTORY_STREAM]: PropTypes.object, - [MERGE_OBSERVE]: PropTypes.func, + [REACT_MOST_ENGINE]: PropTypes.object }; interface History extends Stream { @@ -27,14 +23,14 @@ interface Props { [propName: string]: any } interface Plan { - (intent: Stream, props?: Props): Process + (intent: EngineSubject, props?: Props): Process } interface Update { (current: S): S } interface Process { actions: Actions, - sink$: Stream> + updates: Stream> } interface ConnectProps { @@ -52,46 +48,44 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon if (WrappedComponent.contextTypes === CONTEXT_TYPE) { return class ConnectNode extends React.PureComponent, any>{ actions: Actions - sink$: Stream> + updates: Stream> props: ConnectProps static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName constructor(props: ConnectProps, context) { super(props, context); - let { actions, sink$ } = main(context[INTENT_STREAM], props) - this.sink$ = sink$ + let { actions, updates } = main(context[REACT_MOST_ENGINE].historyStream, props) + this.updates = updates this.actions = Object.assign({}, actions, props.actions); } render() { return h( WrappedComponent, Object.assign({}, this.props, opts, { - sink$: this.sink$, + updates: this.updates, actions: this.actions, }) ); } } } else { - return class ConnectLeaf extends React.PureComponent, any> { + return class ConnectLeaf extends React.PureComponent, S> { actions: Actions - sink$: Stream> + updates: Stream> props: ConnectProps - history: History + traveler: Traveler constructor(props, context) { super(props, context); + let engine: Engine = context[REACT_MOST_ENGINE] if (opts.history || props.history) { - [this.history, travel] = initHistory(context[HISTORY_STREAM], context[HISTORY_STREAM].travel); - this.history.travel.forEach(state => { + this.traveler = initHistory(engine.historyStream, engine.travelStream); + this.traveler.travel.forEach(state => { return this.setState(state); }); } - let [actions, sink$] = actionsAndSinks( - main(context[INTENT_STREAM], props), - this - ); - this.sink$ = sink$.concat(props.sink$ || []); + let { actions, updates } = main(engine.intentStream, props) + this.updates = updates.merge(props.updates) this.actions = Object.assign({}, actions, props.actions); let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( @@ -104,15 +98,15 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon this.setState(state => pick(Object.keys(state), nextProps)); } componentDidMount() { - this.subscriptions = this.context[MERGE_OBSERVE]( - this.sink$, + this.subscriptions = this.context[REACT_MOST_ENGINE].observe( + this.updates, action => { if (action instanceof Function) { this.setState((prevState, props) => { let newState = action.call(this, prevState, props); if (opts.history && newState != prevState) { opts.history.cursor = -1; - this.context[HISTORY_STREAM].send(prevState); + this.context[REACT_MOST_ENGINE].historyStream.send(prevState); } return newState; }); @@ -139,32 +133,32 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon ); } } - Connect.contextTypes = CONTEXT_TYPE; - Connect.displayName = connectDisplayName; - return Connect; } }; } -export default class Most extends React.PureComponent { - getChildContext() { - let engineClass = (this.props && this.props.engine) || mostEngine; - let engine = engineClass(); +export interface MostProps { + engine?: Engine +} +export interface MostEngine { + [x: string]: Engine +} +export default class Most extends React.PureComponent, S> { + static childContextTypes = CONTEXT_TYPE + getChildContext(): MostEngine { + let engine: Engine = (this.props && this.props.engine && new this.props.engine) || new Engine(); /* istanbul ignore if */ if (process.env.NODE_ENV === 'debug') { inspect(engine); } return { - [INTENT_STREAM]: engine.intentStream, - [MERGE_OBSERVE]: engine.mergeObserve, - [HISTORY_STREAM]: engine.historyStream, + [REACT_MOST_ENGINE]: engine }; } render() { return React.Children.only(this.props.children); } } -Most.childContextTypes = CONTEXT_TYPE; function observable(obj) { return !!obj.subscribe; @@ -184,32 +178,12 @@ function inspect(engine) { ); } -function actionsAndSinks(sinks: Stream>, self) { - let _sinks = []; - let _actions = { - fromEvent(e, f = x => x) { - return self.context[INTENT_STREAM].send(f(e)); - }, - fromPromise(p) { - return p.then(x => self.context[INTENT_STREAM].send(x)); - }, - }; - for (let name in sinks) { - let value = sinks[name]; - if (observable(value)) { - _sinks.push(value); - } else if (value instanceof Function) { - _actions[name] = (...args) => { - return self.context[INTENT_STREAM].send(value.apply(self, args)); - }; - } else if (name === 'actions') { - for (let a in value) - _actions[a] = (...args) => { - return self.context[INTENT_STREAM].send(value[a].apply(self, args)); - }; - } +function pick(names, obj) { + let result = {}; + for (let name of names) { + if (obj[name]) result[name] = obj[name]; } - return [_actions, _sinks]; + return result; } function getDisplayName(WrappedComponent) { diff --git a/tsconfig.json b/tsconfig.json index 507a4cc..8ac4b49 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ ], "compilerOptions": { "module": "commonjs", - "lib": ["es2015"], + "lib": ["es2015", "dom", "node"], "target": "es5", "outDir": "dist", "declarationDir": "types", diff --git a/yarn.lock b/yarn.lock index 5d537d5..97bf939 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,9 +12,9 @@ version "1.4.1" resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.4.1.tgz#b940b5563096f27637401618a5351f42466ea8f3" -"@types/react@^15.0.22": - version "15.0.22" - resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.22.tgz#50803cde8d89f60a9b034f2dd0d619bc5f0273b5" +"@types/react@^15.0.23": + version "15.0.23" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.23.tgz#f3facbef5290610f54242f00308759d3a3c27346" abab@^1.0.3: version "1.0.3" From 698589511f95d595b4fa41e117fcc93d1871995a Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Fri, 5 May 2017 17:50:19 +0800 Subject: [PATCH 07/19] add most.ts --- lib/engine/most.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/engine/most.ts diff --git a/lib/engine/most.ts b/lib/engine/most.ts new file mode 100644 index 0000000..1345ae3 --- /dev/null +++ b/lib/engine/most.ts @@ -0,0 +1,38 @@ +import { from, of, mergeArray, Stream, never, Subscription } from 'most' +import { async as subject, AsyncSubject } from 'most-subject' + +export interface EngineSubject extends AsyncSubject { + send(x: T): this +} + +export interface Update { + (current: S): S +} + +export class Engine { + intentStream: EngineSubject + historyStream: EngineSubject + travelStream: EngineSubject<(n: number) => number> + constructor() { + this.intentStream = subject() as EngineSubject + this.intentStream.send = this.intentStream.next.bind(this.intentStream) + this.historyStream = subject() as EngineSubject + this.historyStream.send = this.historyStream.next.bind(this.historyStream) + this.travelStream = subject() as EngineSubject<(n: number) => number>; + this.travelStream.send = this.travelStream.next.bind(this.historyStream) + } + + observe(actionsSinks: Stream>[], f): Subscription { + let subscriptions = mergeArray(actionsSinks) + .recoverWith(e => { + // console.error('There is Error in your reducer:', e, e.stack) + return of(x => x) + }) + .subscribe({ + next: f, + error: (e) => console.error('Something is Wrong:', e, e.stack), + complete: f + }); + return subscriptions; + } +} From 60416e637d45dce251ed6a3de45feddd17d276e9 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Sat, 6 May 2017 00:07:38 +0800 Subject: [PATCH 08/19] finnaly fix all type check --- lib/history.ts | 6 ++--- lib/react-most.ts | 66 +++++++++++++++++++---------------------------- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/lib/history.ts b/lib/history.ts index 2dee1e3..4ad8958 100644 --- a/lib/history.ts +++ b/lib/history.ts @@ -1,8 +1,6 @@ import { from, Stream } from 'most' import { EngineSubject } from './engine/most' -export interface Path extends Stream { - send: (fn: T) => void -} + export class Traveler { cursor: number path: EngineSubject<(n: number) => number> @@ -29,7 +27,7 @@ export class Traveler { } export interface History { - path: Path<(n: number) => number> + path: EngineSubject<(n: number) => number> history: Stream } diff --git a/lib/react-most.ts b/lib/react-most.ts index cd1dd12..fccb110 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import initHistory, { Traveler } from './history'; -import { from, Stream } from 'most'; +import { from, Stream, Subscription } from 'most'; import { Engine, EngineSubject } from './engine/most'; // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign export const REACT_MOST_ENGINE = '@@reactive-react/react-most.engine'; @@ -10,49 +10,35 @@ const CONTEXT_TYPE = { [REACT_MOST_ENGINE]: PropTypes.object }; -interface History extends Stream { - cursor: number - travel: Stream - forward: () => void - backward: () => void -} interface Actions { [propName: string]: (...v: any[]) => T } -interface Props { - [propName: string]: any -} -interface Plan { - (intent: EngineSubject, props?: Props): Process + +interface Plan { + (intent: EngineSubject, props?: {}): Process } interface Update { (current: S): S } -interface Process { - actions: Actions, - updates: Stream> +interface Process { + actions: Actions, + updates: Stream> } -interface ConnectProps { - actions: Actions -} -interface ReactClass { } -interface Connect { - contextTypes?: any - new (props?, context?): any +interface ConnectProps { + actions: Actions } const h = React.createElement; -function connect(main: Plan, opts = { history: false }): (rc: React.ComponentClass) => React.ComponentClass> { - return function(WrappedComponent: React.ComponentClass) { +function connect(main: Plan, opts = { history: false }) { + return function(WrappedComponent: React.ComponentClass) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - return class ConnectNode extends React.PureComponent, any>{ - actions: Actions - updates: Stream> - props: ConnectProps + return class ConnectNode extends React.PureComponent, any>{ + actions: Actions + updates: Stream> static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName - constructor(props: ConnectProps, context) { + constructor(props: ConnectProps, context) { super(props, context); let { actions, updates } = main(context[REACT_MOST_ENGINE].historyStream, props) this.updates = updates @@ -69,14 +55,14 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon } } } else { - return class ConnectLeaf extends React.PureComponent, S> { - actions: Actions - updates: Stream> - props: ConnectProps + return class ConnectLeaf extends React.PureComponent, S> { + actions: Actions + updates: Stream> traveler: Traveler + subscription: Subscription constructor(props, context) { super(props, context); - let engine: Engine = context[REACT_MOST_ENGINE] + let engine: Engine = context[REACT_MOST_ENGINE] if (opts.history || props.history) { this.traveler = initHistory(engine.historyStream, engine.travelStream); this.traveler.travel.forEach(state => { @@ -84,8 +70,8 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon }); } - let { actions, updates } = main(engine.intentStream, props) - this.updates = updates.merge(props.updates) + let { actions, updates } = main(context[REACT_MOST_ENGINE].engine.intentStream, props) + this.updates = props.updates?updates.merge(props.updates) : updates this.actions = Object.assign({}, actions, props.actions); let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( @@ -98,14 +84,14 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon this.setState(state => pick(Object.keys(state), nextProps)); } componentDidMount() { - this.subscriptions = this.context[REACT_MOST_ENGINE].observe( + this.subscription = this.context[REACT_MOST_ENGINE].observe( this.updates, action => { if (action instanceof Function) { this.setState((prevState, props) => { let newState = action.call(this, prevState, props); if (opts.history && newState != prevState) { - opts.history.cursor = -1; + this.traveler.cursor = -1; this.context[REACT_MOST_ENGINE].historyStream.send(prevState); } return newState; @@ -122,7 +108,7 @@ function connect(main: Plan, opts = { history: false }): (rc: React.Compon ); } componentWillUnmount() { - this.subscriptions.unsubscribe(); + this.subscription.unsubscribe(); } render() { return h( @@ -146,7 +132,7 @@ export interface MostEngine { export default class Most extends React.PureComponent, S> { static childContextTypes = CONTEXT_TYPE getChildContext(): MostEngine { - let engine: Engine = (this.props && this.props.engine && new this.props.engine) || new Engine(); + let engine: Engine = (this.props && this.props.engine) || new Engine(); /* istanbul ignore if */ if (process.env.NODE_ENV === 'debug') { inspect(engine); From bfbd637a7868d33a487328bcdfd69aeb6d03b1d2 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Sun, 7 May 2017 23:31:10 +0800 Subject: [PATCH 09/19] export type from react-most.ts --- lib/__tests__/react-most-test.jsx | 2 +- lib/react-most.ts | 29 ++++++++++++++++++----------- package.json | 6 ++++-- tsconfig.json | 2 +- yarn.lock | 14 +++++++++++--- 5 files changed, 35 insertions(+), 18 deletions(-) diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index 539482d..fb221c4 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import * as most from 'most'; -import Most, {connect} from '../react-most'; +import Most, {connect} from '../../dist/react-most'; import {stateStreamOf, stateHistoryOf, intentStreamOf, intentHistoryOf, run, dispatch, diff --git a/lib/react-most.ts b/lib/react-most.ts index fccb110..8dd1728 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import PropTypes from 'prop-types'; +import { PropTypes } from 'prop-types'; import initHistory, { Traveler } from './history'; import { from, Stream, Subscription } from 'most'; import { Engine, EngineSubject } from './engine/most'; @@ -10,30 +10,37 @@ const CONTEXT_TYPE = { [REACT_MOST_ENGINE]: PropTypes.object }; -interface Actions { +export interface Actions { [propName: string]: (...v: any[]) => T } -interface Plan { - (intent: EngineSubject, props?: {}): Process +export interface Plan { + (intent: EngineSubject, props?: {}): Process } -interface Update { +export interface Update { (current: S): S } -interface Process { +export interface Process { actions: Actions, updates: Stream> } -interface ConnectProps { +export interface ConnectProps { actions: Actions } const h = React.createElement; -function connect(main: Plan, opts = { history: false }) { +export class Connect extends React.PureComponent, S> { + actions: Actions + updates: Stream> +} +export interface ConnectClass { + new (props?: ConnectProps, context?: any): Connect; +} +export function connect(main: Plan, opts = { history: false }): (WrappedComponent: React.ComponentClass) => ConnectClass { return function(WrappedComponent: React.ComponentClass) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - return class ConnectNode extends React.PureComponent, any>{ + return class ConnectNode extends Connect{ actions: Actions updates: Stream> static contextTypes = CONTEXT_TYPE @@ -55,7 +62,7 @@ function connect(main: Plan, opts = { history: false }) { } } } else { - return class ConnectLeaf extends React.PureComponent, S> { + return class ConnectLeaf extends Connect { actions: Actions updates: Stream> traveler: Traveler @@ -71,7 +78,7 @@ function connect(main: Plan, opts = { history: false }) { } let { actions, updates } = main(context[REACT_MOST_ENGINE].engine.intentStream, props) - this.updates = props.updates?updates.merge(props.updates) : updates + this.updates = props.updates ? updates.merge(props.updates) : updates this.actions = Object.assign({}, actions, props.actions); let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( diff --git a/package.json b/package.json index a82fcca..70fd889 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ ], "scripts": { "license": "(cat LICENSE.txt; cat react-most.js) > react-most.licensed.js && mv react-most.licensed.js react-most.js", - "build": "babel lib -d ./ --ignore '__tests__' && npm run license", + "build": "tsc -p .", "prebrowser": "npm run build", "browser": "browserify -r react -r most -r most-subject -o dist/vendor.js && browserify -s Most -x react -x most -x most-subject react-most.js -o dist/react-most.js", "test": "jest --coverage", @@ -35,6 +35,7 @@ "react": "^15.5.4" }, "devDependencies": { + "@types/node": "^7.0.18", "@types/react": "^15.0.22", "babel": "^6.1.18", "babel-cli": "^6.2.0", @@ -49,7 +50,8 @@ "react-addons-test-utils": "^15.2.0", "react-dom": "^15.5.4", "react-most-spec": "^0.2.3", - "redux": "^3.0.4" + "redux": "^3.0.4", + "typescript": "^2.3.2" }, "jest": { "moduleFileExtensions": [ diff --git a/tsconfig.json b/tsconfig.json index 8ac4b49..625a7c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ ], "compilerOptions": { "module": "commonjs", - "lib": ["es2015", "dom", "node"], + "lib": ["es2015","dom"], "target": "es5", "outDir": "dist", "declarationDir": "types", diff --git a/yarn.lock b/yarn.lock index 97bf939..dd160da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,9 +12,13 @@ version "1.4.1" resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.4.1.tgz#b940b5563096f27637401618a5351f42466ea8f3" -"@types/react@^15.0.23": - version "15.0.23" - resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.23.tgz#f3facbef5290610f54242f00308759d3a3c27346" +"@types/node@^7.0.18": + version "7.0.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173" + +"@types/react@^15.0.22": + version "15.0.24" + resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.24.tgz#8a75299dc37906df327c18ca918bf97a55e7123b" abab@^1.0.3: version "1.0.3" @@ -3026,6 +3030,10 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +typescript@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984" + ua-parser-js@^0.7.9: version "0.7.12" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" From 3dff8b4b62de48bca7b6918caee21d05d27a7e3f Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Mon, 8 May 2017 17:50:24 +0800 Subject: [PATCH 10/19] extract interface to seperated file --- lib/__tests__/react-most-test.jsx | 15 ++++++----- lib/engine/most.ts | 10 +------ lib/history.ts | 30 ++++++++------------- lib/interfaces.ts | 45 +++++++++++++++++++++++++++++++ lib/react-most.ts | 44 +++++++----------------------- package.json | 2 +- 6 files changed, 76 insertions(+), 70 deletions(-) create mode 100644 lib/interfaces.ts diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index fb221c4..a4968e8 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -28,7 +28,7 @@ CounterView.defaultProps = {count: 0, overwritedProps: 'inner'} const counterWrapper = connect(intent$=>{ return { - sink$: intent$.map(intent=>{ + updates: intent$.map(intent=>{ switch(intent.type) { case 'inc': return state=>({count:state.count+1}) case 'dec': @@ -43,10 +43,12 @@ const counterWrapper = connect(intent$=>{ return state=>state } }), - inc: ()=>({type:'inc'}), - dec: ()=>({type:'dec'}), - changeWrapperProps: (value)=>({type:'changeWrapperProps', value}), - changeDefaultProps: (value)=>({type:'changeDefaultProps', value}), + actions:{ + inc: ()=>({type:'inc'}), + dec: ()=>({type:'dec'}), + changeWrapperProps: (value)=>({type:'changeWrapperProps', value}), + changeDefaultProps: (value)=>({type:'changeDefaultProps', value}), + } } }) @@ -54,7 +56,7 @@ const Counter = counterWrapper(CounterView) describe('react-most', () => { describe('actions', ()=>{ - it('add intent to intent$ and go through sink$', ()=> { + it.only('add intent to intent$ and go through sink$', ()=> { let counterWrapper = TestUtils.renderIntoDocument( @@ -64,6 +66,7 @@ describe('react-most', () => { counter.actions.inc() counter.actions.inc() counter.actions.inc() + console.log(stateHistoryOf(counter)); expect(stateHistoryOf(counter)[2].count).toBe(3) }) diff --git a/lib/engine/most.ts b/lib/engine/most.ts index 1345ae3..2619cd7 100644 --- a/lib/engine/most.ts +++ b/lib/engine/most.ts @@ -1,14 +1,6 @@ import { from, of, mergeArray, Stream, never, Subscription } from 'most' import { async as subject, AsyncSubject } from 'most-subject' - -export interface EngineSubject extends AsyncSubject { - send(x: T): this -} - -export interface Update { - (current: S): S -} - +import { EngineSubject, Update } from '../interfaces' export class Engine { intentStream: EngineSubject historyStream: EngineSubject diff --git a/lib/history.ts b/lib/history.ts index 4ad8958..7875cad 100644 --- a/lib/history.ts +++ b/lib/history.ts @@ -1,13 +1,22 @@ import { from, Stream } from 'most' -import { EngineSubject } from './engine/most' - +import { Stamp, EngineSubject } from './interfaces' export class Traveler { cursor: number path: EngineSubject<(n: number) => number> history: Stream[]> + travel: Stream constructor(history: Stream[]>, path: EngineSubject<(n: number) => number>) { this.history = history this.path = path + this.travel = from(this.path) + .sample((offset: (n: number) => number, states: Stamp[]) => { + let cursor = offset(states.length + this.cursor) + if (cursor < states.length && cursor >= 0) { + this.cursor = offset(this.cursor) + return states[cursor].value; + } + }, this.path, this.history) + .filter(x => !!x) } forward() { this.path.send(x => x + 1) @@ -15,25 +24,8 @@ export class Traveler { backward() { this.path.send(x => x - 1) } - travel = from(this.path) - .sample((offset: (n: number) => number, states: Stamp[]) => { - let cursor = offset(states.length + this.cursor) - if (cursor < states.length && cursor >= 0) { - this.cursor = offset(this.cursor) - return states[cursor].value; - } - }, this.path, this.history) - .filter(x => !!x) -} -export interface History { - path: EngineSubject<(n: number) => number> - history: Stream -} -export interface Stamp { - value: S - time: number } export default function initHistory(engineHistory: EngineSubject, engineTravel: EngineSubject<(n: number) => number>): Traveler { let history = from(engineHistory) diff --git a/lib/interfaces.ts b/lib/interfaces.ts new file mode 100644 index 0000000..e54ee49 --- /dev/null +++ b/lib/interfaces.ts @@ -0,0 +1,45 @@ +import { Stream } from 'most' +import * as React from 'react' +import { AsyncSubject } from 'most-subject' + +export interface Actions { + [propName: string]: (...v: any[]) => T +} + +export interface Plan { + (intent: EngineSubject, props?: {}): Process +} +export interface Update { + (current: S): S +} +export interface Process { + actions: Actions, + updates: Stream> +} + +export interface ConnectProps { + actions?: Actions +} + +export class Connect extends React.PureComponent, S> { + actions: Actions + updates: Stream> +} + +export interface ConnectClass { + new (props?: ConnectProps, context?: any): Connect; +} + +export interface History { + path: EngineSubject<(n: number) => number> + history: Stream +} + +export interface Stamp { + value: S + time: number +} + +export interface EngineSubject extends AsyncSubject { + send(x: T): this +} diff --git a/lib/react-most.ts b/lib/react-most.ts index 8dd1728..19bcb8c 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,41 +1,17 @@ import * as React from 'react'; import { PropTypes } from 'prop-types'; import initHistory, { Traveler } from './history'; +import { Plan, Actions, Connect, ConnectProps, EngineSubject, Update, ConnectClass } from './interfaces' import { from, Stream, Subscription } from 'most'; -import { Engine, EngineSubject } from './engine/most'; +import { Engine } from './engine/most'; + // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign export const REACT_MOST_ENGINE = '@@reactive-react/react-most.engine'; - +const h = React.createElement; const CONTEXT_TYPE = { [REACT_MOST_ENGINE]: PropTypes.object }; -export interface Actions { - [propName: string]: (...v: any[]) => T -} - -export interface Plan { - (intent: EngineSubject, props?: {}): Process -} -export interface Update { - (current: S): S -} -export interface Process { - actions: Actions, - updates: Stream> -} - -export interface ConnectProps { - actions: Actions -} -const h = React.createElement; -export class Connect extends React.PureComponent, S> { - actions: Actions - updates: Stream> -} -export interface ConnectClass { - new (props?: ConnectProps, context?: any): Connect; -} export function connect(main: Plan, opts = { history: false }): (WrappedComponent: React.ComponentClass) => ConnectClass { return function(WrappedComponent: React.ComponentClass) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; @@ -67,6 +43,8 @@ export function connect(main: Plan, opts = { history: false }): (Wra updates: Stream> traveler: Traveler subscription: Subscription + static contextTypes = CONTEXT_TYPE + static displayName = connectDisplayName constructor(props, context) { super(props, context); let engine: Engine = context[REACT_MOST_ENGINE] @@ -77,7 +55,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra }); } - let { actions, updates } = main(context[REACT_MOST_ENGINE].engine.intentStream, props) + let { actions, updates } = main(context[REACT_MOST_ENGINE].intentStream, props) this.updates = props.updates ? updates.merge(props.updates) : updates this.actions = Object.assign({}, actions, props.actions); let defaultKey = Object.keys(WrappedComponent.defaultProps); @@ -131,7 +109,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra } export interface MostProps { - engine?: Engine + engine?: new () => Engine } export interface MostEngine { [x: string]: Engine @@ -139,7 +117,7 @@ export interface MostEngine { export default class Most extends React.PureComponent, S> { static childContextTypes = CONTEXT_TYPE getChildContext(): MostEngine { - let engine: Engine = (this.props && this.props.engine) || new Engine(); + let engine: Engine = (this.props && this.props.engine && new this.props.engine()) || new Engine(); /* istanbul ignore if */ if (process.env.NODE_ENV === 'debug') { inspect(engine); @@ -153,10 +131,6 @@ export default class Most extends React.PureComponent, } } -function observable(obj) { - return !!obj.subscribe; -} - /* istanbul ignore next */ function inspect(engine) { from(engine.intentStream) diff --git a/package.json b/package.json index 70fd889..9d0163e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "git+https://github.com/jcouyang/react-most.git" }, - "main": "react-most.js", + "main": "dist/react-most.js", "directories": { "doc": "./docs", "lib": "./lib" From 8b29628bb6b16fa95c2ace782edbd9c6d2633e23 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Mon, 8 May 2017 23:49:18 +0800 Subject: [PATCH 11/19] fix 99% testing --- lib/__tests__/react-most-test.jsx | 52 ++++++++++++++++++------------- lib/engine/most.ts | 8 ++--- lib/interfaces.ts | 5 +-- lib/react-most.ts | 45 +++++++++++++++++--------- 4 files changed, 68 insertions(+), 42 deletions(-) diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index a4968e8..8e8eba3 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import * as most from 'most'; -import Most, {connect} from '../../dist/react-most'; +import Most, {connect,REACT_MOST_ENGINE} from '../../dist/react-most'; import {stateStreamOf, stateHistoryOf, intentStreamOf, intentHistoryOf, run, dispatch, @@ -17,8 +17,8 @@ const CounterView = React.createClass({ {this.props.count} {this.props.wrapperProps} {this.props.overwritedProps} - - - + + - + + ) } @@ -28,9 +28,10 @@ CounterView.defaultProps = {count: 0, overwritedProps: 'inner'} const counterWrapper = connect(intent$=>{ return { - updates: intent$.map(intent=>{ + update$: intent$.map(intent=>{ switch(intent.type) { - case 'inc': return state=>({count:state.count+1}) + case 'inc': + return state=>({count:state.count+1}) case 'dec': intent$.send({type:'dec triggered'}) return state=>({count:state.count-1}) @@ -56,7 +57,7 @@ const Counter = counterWrapper(CounterView) describe('react-most', () => { describe('actions', ()=>{ - it.only('add intent to intent$ and go through sink$', ()=> { + it('add intent to intent$ and go through sink$', ()=> { let counterWrapper = TestUtils.renderIntoDocument( @@ -66,7 +67,6 @@ describe('react-most', () => { counter.actions.inc() counter.actions.inc() counter.actions.inc() - console.log(stateHistoryOf(counter)); expect(stateHistoryOf(counter)[2].count).toBe(3) }) @@ -182,7 +182,7 @@ describe('react-most', () => { describe('composable', ()=>{ const counterWrapper2 = connect(intent$=>{ return { - sink$: intent$.map(intent=>{ + update$: intent$.map(intent=>{ switch(intent.type) { case 'inc2': return state=>({count:state.count+2}) @@ -192,31 +192,40 @@ describe('react-most', () => { return state=>state } }), - inc2: ()=>({type:'inc2'}), - dec2: ()=>({type:'dec2'}), + actions: { + inc2: ()=>({type:'inc2'}), + dec2: ()=>({type:'dec2'}), + } } }) let counterWrapper21 = compose(counterWrapper2)(counterWrapper) const Counter2 = counterWrapper21(CounterView) - it('counter add inc2, dec2', ()=>{ - let counterWrapper = TestUtils.renderIntoDocument( + xit('counter add inc2, dec2', (done)=>{ + let counterWrapperr = TestUtils.renderIntoDocument( ) - let counterView = TestUtils.findRenderedComponentWithType(counterWrapper, CounterView) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter2) + let counterView = TestUtils.findRenderedComponentWithType(counterWrapperr, CounterView) + /* let counter = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter)*/ + let counter2 = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter2) counterView.props.actions.inc() - counterView.props.actions.inc2() - counterView.props.actions.dec() - expect(stateHistoryOf(counter)[2].count).toBe(2) + console.log(counterView.props.actions.inc.toString()) + /* counterView.props.actions.inc2()*/ + /* counterView.props.actions.dec()*/ + + expect(stateHistoryOf(counter2)).toBe(2) + /* expect(stateHistoryOf(counter +)).toBe(2)*/ + return intentStreamOf(counter2).take(1).observe(x=>console.log(x)).then(x=>expect(false).toBe(true)).then(done) + }) }) describe('convension default to `action` field in sinks', ()=>{ const Counter = connect(intent$=>{ return { - sink$: intent$.map(intent=>{ + update$: intent$.map(intent=>{ switch(intent.type) { case 'inc3': return state=>({count:state.count+3}) @@ -246,7 +255,7 @@ describe('react-most', () => { describe('ERROR', ()=>{ const Counter = connect(intent$=>{ return { - sink$: intent$.map(intent=>{ + update$: intent$.map(intent=>{ switch(intent.type) { case 'exception': throw 'exception in reducer' @@ -298,15 +307,14 @@ describe('react-most', () => { return _=>_ }) return { - incForever$, - sink$: intent$.map(intent=>{ + update$: intent$.map(intent=>{ switch(intent.type) { case 'inc': return state=>({count:state.count+1}) default: return state=>state } - }) + }).merge(incForever$) } })(CounterView) diff --git a/lib/engine/most.ts b/lib/engine/most.ts index 2619cd7..d4aa135 100644 --- a/lib/engine/most.ts +++ b/lib/engine/most.ts @@ -14,10 +14,10 @@ export class Engine { this.travelStream.send = this.travelStream.next.bind(this.historyStream) } - observe(actionsSinks: Stream>[], f): Subscription { - let subscriptions = mergeArray(actionsSinks) - .recoverWith(e => { - // console.error('There is Error in your reducer:', e, e.stack) + observe(actionsSinks: Stream>, f): Subscription { + let subscriptions = actionsSinks + .recoverWith((e: Error) => { + console.error('There is Error in your reducer:', e, e.stack) return of(x => x) }) .subscribe({ diff --git a/lib/interfaces.ts b/lib/interfaces.ts index e54ee49..cf25d09 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -14,16 +14,17 @@ export interface Update { } export interface Process { actions: Actions, - updates: Stream> + update$: Stream> } export interface ConnectProps { actions?: Actions + history?: boolean } export class Connect extends React.PureComponent, S> { actions: Actions - updates: Stream> + update$: Stream> } export interface ConnectClass { diff --git a/lib/react-most.ts b/lib/react-most.ts index 19bcb8c..57d8be4 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -18,20 +18,20 @@ export function connect(main: Plan, opts = { history: false }): (Wra if (WrappedComponent.contextTypes === CONTEXT_TYPE) { return class ConnectNode extends Connect{ actions: Actions - updates: Stream> + update$: Stream> static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName - constructor(props: ConnectProps, context) { + constructor(props, context) { super(props, context); - let { actions, updates } = main(context[REACT_MOST_ENGINE].historyStream, props) - this.updates = updates - this.actions = Object.assign({}, actions, props.actions); + let { actions, update$ } = main(context[REACT_MOST_ENGINE].historyStream, props) + this.update$ = props.update$ ? update$.merge(props.update$) : update$ + this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), props.actions); } render() { return h( WrappedComponent, - Object.assign({}, this.props, opts, { - updates: this.updates, + Object.assign({}, opts, this.props, { + update$: this.update$, actions: this.actions, }) ); @@ -40,7 +40,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra } else { return class ConnectLeaf extends Connect { actions: Actions - updates: Stream> + update$: Stream> traveler: Traveler subscription: Subscription static contextTypes = CONTEXT_TYPE @@ -55,9 +55,9 @@ export function connect(main: Plan, opts = { history: false }): (Wra }); } - let { actions, updates } = main(context[REACT_MOST_ENGINE].intentStream, props) - this.updates = props.updates ? updates.merge(props.updates) : updates - this.actions = Object.assign({}, actions, props.actions); + let { actions, update$ } = main(context[REACT_MOST_ENGINE].intentStream, props) + this.update$ = props.update$ ? props.update$.merge(update$) : update$ + this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), props.actions); let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( {}, @@ -70,12 +70,12 @@ export function connect(main: Plan, opts = { history: false }): (Wra } componentDidMount() { this.subscription = this.context[REACT_MOST_ENGINE].observe( - this.updates, + this.update$, action => { if (action instanceof Function) { this.setState((prevState, props) => { let newState = action.call(this, prevState, props); - if (opts.history && newState != prevState) { + if ((opts.history || props.history) && newState != prevState) { this.traveler.cursor = -1; this.context[REACT_MOST_ENGINE].historyStream.send(prevState); } @@ -98,8 +98,9 @@ export function connect(main: Plan, opts = { history: false }): (Wra render() { return h( WrappedComponent, - Object.assign({}, this.props, this.state, opts, { + Object.assign({}, opts, this.props, this.state, { actions: this.actions, + traveler: this.traveler }) ); } @@ -144,7 +145,23 @@ function inspect(engine) { console.log(`[${new Date(stamp.time).toJSON()}][STATE]:}`, stamp.value) ); } +function bindActions(actions, intent$, self) { + let _actions = { + fromEvent(e, f = x => x) { + return intent$.send(f(e)); + }, + fromPromise(p) { + return p.then(x => intent$.send(x)); + }, + }; + for (let a in actions) { + _actions[a] = (...args) => { + return intent$.send(actions[a].apply(self, args)); + }; + } + return _actions; +} function pick(names, obj) { let result = {}; for (let name of names) { From 7da091703ae0748aae87e7c5a0f68a5ba94bc9f3 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 17:54:41 +0800 Subject: [PATCH 12/19] es5 mixing style instead of HoC --- lib/__tests__/react-most-test.jsx | 2 ++ lib/interfaces.ts | 2 ++ lib/react-most.ts | 22 ++++++++-------------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index 8e8eba3..cfea611 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -200,6 +200,8 @@ describe('react-most', () => { }) let counterWrapper21 = compose(counterWrapper2)(counterWrapper) const Counter2 = counterWrapper21(CounterView) + //counterWrapper2(counterWrapper(CounterView)) + console.log(Counter2); xit('counter add inc2, dec2', (done)=>{ let counterWrapperr = TestUtils.renderIntoDocument( diff --git a/lib/interfaces.ts b/lib/interfaces.ts index cf25d09..4c41345 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -28,6 +28,8 @@ export class Connect extends React.PureComponent, S> { } export interface ConnectClass { + contextTypes?: any + defaultProps?: any new (props?: ConnectProps, context?: any): Connect; } diff --git a/lib/react-most.ts b/lib/react-most.ts index 57d8be4..5f28352 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -13,28 +13,21 @@ const CONTEXT_TYPE = { }; export function connect(main: Plan, opts = { history: false }): (WrappedComponent: React.ComponentClass) => ConnectClass { - return function(WrappedComponent: React.ComponentClass) { + return function(WrappedComponent: ConnectClass) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - return class ConnectNode extends Connect{ + return class ConnectNode extends WrappedComponent { actions: Actions update$: Stream> + main: Plan static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName constructor(props, context) { super(props, context); let { actions, update$ } = main(context[REACT_MOST_ENGINE].historyStream, props) - this.update$ = props.update$ ? update$.merge(props.update$) : update$ - this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), props.actions); - } - render() { - return h( - WrappedComponent, - Object.assign({}, opts, this.props, { - update$: this.update$, - actions: this.actions, - }) - ); + let { actions: preActions, update$: preUpdates } = this.main(context[REACT_MOST_ENGINE].historyStream, props) + this.update$ = preUpdates ? update$.merge(preUpdates) : update$ + this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), preActions); } } } else { @@ -43,6 +36,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra update$: Stream> traveler: Traveler subscription: Subscription + main: Plan static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName constructor(props, context) { @@ -54,7 +48,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra return this.setState(state); }); } - + this.main = main let { actions, update$ } = main(context[REACT_MOST_ENGINE].intentStream, props) this.update$ = props.update$ ? props.update$.merge(update$) : update$ this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), props.actions); From 3a1480ebf8cbfbef444595c77c977093ecb06a88 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 21:08:09 +0800 Subject: [PATCH 13/19] fix compose test --- lib/__tests__/react-most-test.jsx | 16 ++++------------ lib/react-most.ts | 16 +++++++--------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index cfea611..b61da8f 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -201,26 +201,18 @@ describe('react-most', () => { let counterWrapper21 = compose(counterWrapper2)(counterWrapper) const Counter2 = counterWrapper21(CounterView) //counterWrapper2(counterWrapper(CounterView)) - console.log(Counter2); - xit('counter add inc2, dec2', (done)=>{ + it('counter add inc2, dec2', ()=>{ let counterWrapperr = TestUtils.renderIntoDocument( ) let counterView = TestUtils.findRenderedComponentWithType(counterWrapperr, CounterView) - /* let counter = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter)*/ let counter2 = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter2) counterView.props.actions.inc() - console.log(counterView.props.actions.inc.toString()) - /* counterView.props.actions.inc2()*/ - /* counterView.props.actions.dec()*/ - - expect(stateHistoryOf(counter2)).toBe(2) - /* expect(stateHistoryOf(counter -)).toBe(2)*/ - return intentStreamOf(counter2).take(1).observe(x=>console.log(x)).then(x=>expect(false).toBe(true)).then(done) - + counterView.props.actions.inc2() + counterView.props.actions.dec() + expect(stateHistoryOf(counter2)[2].count).toBe(2) }) }) diff --git a/lib/react-most.ts b/lib/react-most.ts index 5f28352..c807606 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { PropTypes } from 'prop-types'; import initHistory, { Traveler } from './history'; import { Plan, Actions, Connect, ConnectProps, EngineSubject, Update, ConnectClass } from './interfaces' -import { from, Stream, Subscription } from 'most'; +import { from, Stream, Subscription, mergeArray } from 'most'; import { Engine } from './engine/most'; // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign @@ -24,10 +24,9 @@ export function connect(main: Plan, opts = { history: false }): (Wra static displayName = connectDisplayName constructor(props, context) { super(props, context); - let { actions, update$ } = main(context[REACT_MOST_ENGINE].historyStream, props) - let { actions: preActions, update$: preUpdates } = this.main(context[REACT_MOST_ENGINE].historyStream, props) - this.update$ = preUpdates ? update$.merge(preUpdates) : update$ - this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), preActions); + let { actions, update$ } = main(context[REACT_MOST_ENGINE].intentStream, props) + this.update$ = this.update$.merge(update$) + this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), this.actions); } } } else { @@ -48,10 +47,9 @@ export function connect(main: Plan, opts = { history: false }): (Wra return this.setState(state); }); } - this.main = main - let { actions, update$ } = main(context[REACT_MOST_ENGINE].intentStream, props) - this.update$ = props.update$ ? props.update$.merge(update$) : update$ - this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), props.actions); + let { actions, update$ } = main(engine.intentStream, props) + this.actions = bindActions(actions, engine.intentStream, this) + this.update$ = update$ let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( {}, From aa7ac5c3e6382e5e9c51ec4e276a63e05b9e147e Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 22:20:00 +0800 Subject: [PATCH 14/19] extract update and actions as machine --- lib/__tests__/react-most-test.jsx | 32 ++++++++++++------------- lib/interfaces.ts | 13 ++++++----- lib/react-most.ts | 39 ++++++++++++++++--------------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/__tests__/react-most-test.jsx b/lib/__tests__/react-most-test.jsx index b61da8f..d60cb48 100644 --- a/lib/__tests__/react-most-test.jsx +++ b/lib/__tests__/react-most-test.jsx @@ -64,9 +64,9 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.inc() - counter.actions.inc() - counter.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() expect(stateHistoryOf(counter)[2].count).toBe(3) }) @@ -77,9 +77,9 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.inc(); - counter.actions.fromEvent({type:'inc'}); - return counter.actions.fromPromise(Promise.resolve({type:'inc'})) + counter.machine.actions.inc(); + counter.machine.actions.fromEvent({type:'inc'}); + return counter.machine.actions.fromPromise(Promise.resolve({type:'inc'})) .then(()=>{ expect(stateHistoryOf(counter)[2].count).toBe(3) }) @@ -94,7 +94,7 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.dec() + counter.machine.actions.dec() expect(intentHistoryOf(counter)[1].type).toBe('dec triggered') }) @@ -105,7 +105,7 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.inc(); + counter.machine.actions.inc(); expect(stateHistoryOf(counter)[0].count).toBe(10) }) @@ -133,8 +133,8 @@ describe('react-most', () => { ) let counterWrapper = TestUtils.findRenderedComponentWithType(counterMostWrapper, CounterWrapper) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.changeWrapperProps('miao') - counter.actions.changeDefaultProps(19) + counter.machine.actions.changeWrapperProps('miao') + counter.machine.actions.changeDefaultProps(19) let wrapperProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'wrapperProps') let overwritedProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'overwritedProps') let count = TestUtils.findRenderedDOMComponentWithClass(counter, 'count') @@ -158,9 +158,9 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.inc() - counter.actions.inc() - counter.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() let backward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'backward') TestUtils.Simulate.click(backward) TestUtils.Simulate.click(backward) @@ -240,8 +240,8 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.actions.inc3() - counter.actions.inc3() + counter.machine.actions.inc3() + counter.machine.actions.inc3() expect(stateHistoryOf(counter)[1].count).toBe(6) }) }) @@ -288,7 +288,7 @@ describe('react-most', () => { ) let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) expect(()=>{ - counter.actions.throwExeption() + counter.machine.actions.throwExeption() }).toThrow('exception in reducer') }) }) diff --git a/lib/interfaces.ts b/lib/interfaces.ts index 4c41345..b5b7de5 100644 --- a/lib/interfaces.ts +++ b/lib/interfaces.ts @@ -1,18 +1,18 @@ -import { Stream } from 'most' +import { Stream, Subscription } from 'most' import * as React from 'react' import { AsyncSubject } from 'most-subject' - +import { Traveler } from './history' export interface Actions { [propName: string]: (...v: any[]) => T } export interface Plan { - (intent: EngineSubject, props?: {}): Process + (intent: EngineSubject, props?: {}): Machine } export interface Update { (current: S): S } -export interface Process { +export interface Machine { actions: Actions, update$: Stream> } @@ -23,8 +23,9 @@ export interface ConnectProps { } export class Connect extends React.PureComponent, S> { - actions: Actions - update$: Stream> + machine: Machine + traveler: Traveler + subscription: Subscription } export interface ConnectClass { diff --git a/lib/react-most.ts b/lib/react-most.ts index c807606..67d416a 100644 --- a/lib/react-most.ts +++ b/lib/react-most.ts @@ -1,8 +1,8 @@ import * as React from 'react'; import { PropTypes } from 'prop-types'; import initHistory, { Traveler } from './history'; -import { Plan, Actions, Connect, ConnectProps, EngineSubject, Update, ConnectClass } from './interfaces' -import { from, Stream, Subscription, mergeArray } from 'most'; +import { Plan, Connect, ConnectClass } from './interfaces' +import { from, Stream, Subscription } from 'most'; import { Engine } from './engine/most'; // unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign @@ -12,30 +12,29 @@ const CONTEXT_TYPE = { [REACT_MOST_ENGINE]: PropTypes.object }; -export function connect(main: Plan, opts = { history: false }): (WrappedComponent: React.ComponentClass) => ConnectClass { - return function(WrappedComponent: ConnectClass) { +function isConnectClass(ComponentClass: ConnectClass | React.ComponentClass): ComponentClass is ConnectClass { + return (>ComponentClass).contextTypes == CONTEXT_TYPE; +} +export type ConnectOrReactComponent = ConnectClass | React.ComponentClass + +export function connect(main: Plan, opts = { history: false }): (WrappedComponent: ConnectOrReactComponent) => ConnectClass { + return function(WrappedComponent: ConnectOrReactComponent) { let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`; - if (WrappedComponent.contextTypes === CONTEXT_TYPE) { + if (isConnectClass(WrappedComponent)) { return class ConnectNode extends WrappedComponent { - actions: Actions - update$: Stream> - main: Plan static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName constructor(props, context) { super(props, context); let { actions, update$ } = main(context[REACT_MOST_ENGINE].intentStream, props) - this.update$ = this.update$.merge(update$) - this.actions = Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), this.actions); + this.machine = { + update$: this.machine.update$.merge(update$), + actions: Object.assign({}, bindActions(actions, context[REACT_MOST_ENGINE].intentStream, this), this.machine.actions) + } } } } else { return class ConnectLeaf extends Connect { - actions: Actions - update$: Stream> - traveler: Traveler - subscription: Subscription - main: Plan static contextTypes = CONTEXT_TYPE static displayName = connectDisplayName constructor(props, context) { @@ -48,8 +47,10 @@ export function connect(main: Plan, opts = { history: false }): (Wra }); } let { actions, update$ } = main(engine.intentStream, props) - this.actions = bindActions(actions, engine.intentStream, this) - this.update$ = update$ + this.machine = { + actions: bindActions(actions, engine.intentStream, this), + update$: update$ + } let defaultKey = Object.keys(WrappedComponent.defaultProps); this.state = Object.assign( {}, @@ -62,7 +63,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra } componentDidMount() { this.subscription = this.context[REACT_MOST_ENGINE].observe( - this.update$, + this.machine.update$, action => { if (action instanceof Function) { this.setState((prevState, props) => { @@ -91,7 +92,7 @@ export function connect(main: Plan, opts = { history: false }): (Wra return h( WrappedComponent, Object.assign({}, opts, this.props, this.state, { - actions: this.actions, + actions: this.machine.actions, traveler: this.traveler }) ); From dc8fb08818bade27a8b104cce1ee8be15a8c6862 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 22:21:24 +0800 Subject: [PATCH 15/19] rm js file --- lib/engine/most.js | 25 ------ lib/history.js | 28 ------- lib/react-most.js | 201 --------------------------------------------- lib/test-utils.js | 27 ------ 4 files changed, 281 deletions(-) delete mode 100644 lib/engine/most.js delete mode 100644 lib/history.js delete mode 100644 lib/react-most.js delete mode 100644 lib/test-utils.js diff --git a/lib/engine/most.js b/lib/engine/most.js deleted file mode 100644 index e45f22a..0000000 --- a/lib/engine/most.js +++ /dev/null @@ -1,25 +0,0 @@ -import {from, of, mergeArray} from 'most' -import {async as subject} from 'most-subject' -export default function Engine() { - const intentStream = subject(), - historyStream = subject(), - travelStream = subject(); - intentStream.send = intentStream.next.bind(intentStream); - historyStream.send = historyStream.next.bind(historyStream); - travelStream.send = travelStream.next.bind(travelStream); - - function mergeObserve(actionsSinks, f){ - let subscriptions = mergeArray(actionsSinks) - .recoverWith(e => { - console.error('There is Error in your reducer:',e, e.stack) - return of(x=>x) - }) - .subscribe({ - next:f, - error: (e)=>console.error('Something is Wrong:',e, e.stack), - }); - return subscriptions; - } - historyStream.travel = travelStream; - return {intentStream, mergeObserve, historyStream} -} diff --git a/lib/history.js b/lib/history.js deleted file mode 100644 index 6bae61d..0000000 --- a/lib/history.js +++ /dev/null @@ -1,28 +0,0 @@ -import {from} from 'most' -export default function initHistory(contextHistory){ - let history =from(contextHistory) - .timestamp() - .scan((acc,state)=>{ - acc.push(state) - return acc; - }, []) - .multicast() - let travel = contextHistory.travel - history.cursor = -1 - history.travel = from(travel) - .sample((offset,states)=>{ - let cursor = offset(states.length+history.cursor) - if(cursor=0){ - history.cursor=offset(history.cursor) - return states[cursor].value; - } - }, travel, history) - .filter(x=>!!x) - history.forward = function(){ - travel.send(x=>x+1) - }; - history.backward = function(){ - travel.send(x=>x-1) - } - return history; -} diff --git a/lib/react-most.js b/lib/react-most.js deleted file mode 100644 index 874f134..0000000 --- a/lib/react-most.js +++ /dev/null @@ -1,201 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var react_1 = require("react"); -var prop_types_1 = require("prop-types"); -var history_1 = require("./history"); -var most_1 = require("most"); -var most_2 = require("./engine/most"); -// unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign -exports.INTENT_STREAM = '@@reactive-react/react-most.intentStream'; -exports.HISTORY_STREAM = '@@reactive-react/react-most.historyStream'; -var MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve'; -var CONTEXT_TYPE = (_a = {}, - _a[exports.INTENT_STREAM] = prop_types_1.default.object, - _a[exports.HISTORY_STREAM] = prop_types_1.default.object, - _a[MERGE_OBSERVE] = prop_types_1.default.func, - _a); -var h = react_1.default.createElement; -function connect(main, opts) { - if (opts === void 0) { opts = { history: false }; } - return function (WrappedComponent) { - var connectDisplayName = "Connect(" + getDisplayName(WrappedComponent) + ")"; - if (WrappedComponent.contextTypes === CONTEXT_TYPE) { - return _a = (function (_super) { - __extends(ConnectNode, _super); - function ConnectNode(props, context) { - var _this = _super.call(this, props, context) || this; - var _a = main(context[exports.INTENT_STREAM], props), actions = _a.actions, sink$ = _a.sink$; - _this.sink$ = sink$; - _this.actions = Object.assign({}, actions, props.actions); - return _this; - } - ConnectNode.prototype.render = function () { - return h(WrappedComponent, Object.assign({}, this.props, opts, { - sink$: this.sink$, - actions: this.actions, - })); - }; - return ConnectNode; - }(react_1.default.PureComponent)), - _a.contextTypes = CONTEXT_TYPE, - _a.displayName = connectDisplayName, - _a; - } - else { - var ConnectLeaf = (function (_super) { - __extends(ConnectLeaf, _super); - function ConnectLeaf(props, context) { - var _this = _super.call(this, props, context) || this; - if (opts.history || props.history) { - opts.history = history_1.default(context[exports.HISTORY_STREAM]); - opts.history.travel.forEach(function (state) { - return _this.setState(state); - }); - } - var _a = actionsAndSinks(main(context[exports.INTENT_STREAM], props), _this), actions = _a[0], sink$ = _a[1]; - _this.sink$ = sink$.concat(props.sink$ || []); - _this.actions = Object.assign({}, actions, props.actions); - var defaultKey = Object.keys(WrappedComponent.defaultProps); - _this.state = Object.assign({}, WrappedComponent.defaultProps, pick(defaultKey, props)); - return _this; - } - ConnectLeaf.prototype.componentWillReceiveProps = function (nextProps) { - this.setState(function (state) { return pick(Object.keys(state), nextProps); }); - }; - ConnectLeaf.prototype.componentDidMount = function () { - var _this = this; - this.subscriptions = this.context[MERGE_OBSERVE](this.sink$, function (action) { - if (action instanceof Function) { - _this.setState(function (prevState, props) { - var newState = action.call(_this, prevState, props); - if (opts.history && newState != prevState) { - opts.history.cursor = -1; - _this.context[exports.HISTORY_STREAM].send(prevState); - } - return newState; - }); - } - else { - /* istanbul ignore next */ - console.warn('action', action, 'need to be a Function which map from current state to new state'); - } - }); - }; - ConnectLeaf.prototype.componentWillUnmount = function () { - this.subscriptions.unsubscribe(); - }; - ConnectLeaf.prototype.render = function () { - return h(WrappedComponent, Object.assign({}, this.props, this.state, opts, { - actions: this.actions, - })); - }; - return ConnectLeaf; - }(react_1.default.PureComponent)); - Connect.contextTypes = CONTEXT_TYPE; - Connect.displayName = connectDisplayName; - return Connect; - } - var _a; - }; -} -var Most = (function (_super) { - __extends(Most, _super); - function Most() { - return _super !== null && _super.apply(this, arguments) || this; - } - Most.prototype.getChildContext = function () { - var engineClass = (this.props && this.props.engine) || most_2.default; - var engine = engineClass(); - /* istanbul ignore if */ - if (process.env.NODE_ENV === 'debug') { - inspect(engine); - } - return _a = {}, - _a[exports.INTENT_STREAM] = engine.intentStream, - _a[MERGE_OBSERVE] = engine.mergeObserve, - _a[exports.HISTORY_STREAM] = engine.historyStream, - _a; - var _a; - }; - Most.prototype.render = function () { - return react_1.default.Children.only(this.props.children); - }; - return Most; -}(react_1.default.PureComponent)); -exports.default = Most; -Most.childContextTypes = CONTEXT_TYPE; -function observable(obj) { - return !!obj.subscribe; -} -/* istanbul ignore next */ -function inspect(engine) { - most_1.from(engine.intentStream) - .timestamp() - .observe(function (stamp) { - return console.log("[" + new Date(stamp.time).toJSON() + "][INTENT]:}", stamp.value); - }); - most_1.from(engine.historyStream) - .timestamp() - .observe(function (stamp) { - return console.log("[" + new Date(stamp.time).toJSON() + "][STATE]:}", stamp.value); - }); -} -function actionsAndSinks(sinks, self) { - var _sinks = []; - var _actions = { - fromEvent: function (e, f) { - if (f === void 0) { f = function (x) { return x; }; } - return self.context[exports.INTENT_STREAM].send(f(e)); - }, - fromPromise: function (p) { - return p.then(function (x) { return self.context[exports.INTENT_STREAM].send(x); }); - }, - }; - var _loop_1 = function (name) { - var value = sinks[name]; - if (observable(value)) { - _sinks.push(value); - } - else if (value instanceof Function) { - _actions[name] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return self.context[exports.INTENT_STREAM].send(value.apply(self, args)); - }; - } - else if (name === 'actions') { - var _loop_2 = function (a) { - _actions[a] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return self.context[exports.INTENT_STREAM].send(value[a].apply(self, args)); - }; - }; - for (var a in value) { - _loop_2(a); - } - } - }; - for (var name in sinks) { - _loop_1(name); - } - return [_actions, _sinks]; -} -function getDisplayName(WrappedComponent) { - return WrappedComponent.displayName || WrappedComponent.name || 'Component'; -} -var _a; diff --git a/lib/test-utils.js b/lib/test-utils.js deleted file mode 100644 index b3a5b16..0000000 --- a/lib/test-utils.js +++ /dev/null @@ -1,27 +0,0 @@ -import {from } from 'most' -import {INTENT_STREAM, HISTORY_STREAM} from './react-most' -console.warn('react-most/test-utils is DEPRETICATED, please use react-most-spec instead.') -function getStreamOf(component, name) { - let s = from(component.context[name]); - s.take$ = n => s.take(n).forEach(_=>_) - return s -} - -function historyStreamOf(component) { - return getStreamOf(component, HISTORY_STREAM) -} - -function intentStreamOf(component) { - return getStreamOf(component, INTENT_STREAM) -} - -function do$(listOfActions) { - return from(listOfActions).forEach(x=>x()) -} - -function dispatch(listOfIntent, component) { - let s = component.context[INTENT_STREAM] - return from(listOfIntent).forEach(i=>s.send(i)) -} - -export {do$, historyStreamOf, intentStreamOf, dispatch} From 4196911efb536e1725c6b0ab223ca72c5d2f842b Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 22:23:44 +0800 Subject: [PATCH 16/19] mv typescript source file to src and compile to lib --- lib/engine/most.js | 29 ++++ lib/history.js | 38 +++++ lib/interfaces.js | 21 +++ lib/react-most.js | 184 +++++++++++++++++++++ package.json | 10 +- {lib => src}/__tests__/react-most-test.jsx | 0 {lib => src}/browser.js | 0 {lib => src}/engine/most.ts | 0 {lib => src}/engine/rx.js | 0 {lib => src}/history.ts | 0 {lib => src}/interfaces.ts | 0 {lib => src}/react-most.ts | 0 tsconfig.json | 4 +- 13 files changed, 276 insertions(+), 10 deletions(-) create mode 100644 lib/engine/most.js create mode 100644 lib/history.js create mode 100644 lib/interfaces.js create mode 100644 lib/react-most.js rename {lib => src}/__tests__/react-most-test.jsx (100%) rename {lib => src}/browser.js (100%) rename {lib => src}/engine/most.ts (100%) rename {lib => src}/engine/rx.js (100%) rename {lib => src}/history.ts (100%) rename {lib => src}/interfaces.ts (100%) rename {lib => src}/react-most.ts (100%) diff --git a/lib/engine/most.js b/lib/engine/most.js new file mode 100644 index 0000000..0c2737e --- /dev/null +++ b/lib/engine/most.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var most_1 = require("most"); +var most_subject_1 = require("most-subject"); +var Engine = (function () { + function Engine() { + this.intentStream = most_subject_1.async(); + this.intentStream.send = this.intentStream.next.bind(this.intentStream); + this.historyStream = most_subject_1.async(); + this.historyStream.send = this.historyStream.next.bind(this.historyStream); + this.travelStream = most_subject_1.async(); + this.travelStream.send = this.travelStream.next.bind(this.historyStream); + } + Engine.prototype.observe = function (actionsSinks, f) { + var subscriptions = actionsSinks + .recoverWith(function (e) { + console.error('There is Error in your reducer:', e, e.stack); + return most_1.of(function (x) { return x; }); + }) + .subscribe({ + next: f, + error: function (e) { return console.error('Something is Wrong:', e, e.stack); }, + complete: f + }); + return subscriptions; + }; + return Engine; +}()); +exports.Engine = Engine; diff --git a/lib/history.js b/lib/history.js new file mode 100644 index 0000000..13097a6 --- /dev/null +++ b/lib/history.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var most_1 = require("most"); +var Traveler = (function () { + function Traveler(history, path) { + var _this = this; + this.history = history; + this.path = path; + this.travel = most_1.from(this.path) + .sample(function (offset, states) { + var cursor = offset(states.length + _this.cursor); + if (cursor < states.length && cursor >= 0) { + _this.cursor = offset(_this.cursor); + return states[cursor].value; + } + }, this.path, this.history) + .filter(function (x) { return !!x; }); + } + Traveler.prototype.forward = function () { + this.path.send(function (x) { return x + 1; }); + }; + Traveler.prototype.backward = function () { + this.path.send(function (x) { return x - 1; }); + }; + return Traveler; +}()); +exports.Traveler = Traveler; +function initHistory(engineHistory, engineTravel) { + var history = most_1.from(engineHistory) + .timestamp() + .scan(function (acc, state) { + acc.push(state); + return acc; + }, []) + .multicast(); + return new Traveler(history, engineTravel); +} +exports.default = initHistory; diff --git a/lib/interfaces.js b/lib/interfaces.js new file mode 100644 index 0000000..d644137 --- /dev/null +++ b/lib/interfaces.js @@ -0,0 +1,21 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var React = require("react"); +var Connect = (function (_super) { + __extends(Connect, _super); + function Connect() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Connect; +}(React.PureComponent)); +exports.Connect = Connect; diff --git a/lib/react-most.js b/lib/react-most.js new file mode 100644 index 0000000..1a419f8 --- /dev/null +++ b/lib/react-most.js @@ -0,0 +1,184 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var React = require("react"); +var prop_types_1 = require("prop-types"); +var history_1 = require("./history"); +var interfaces_1 = require("./interfaces"); +var most_1 = require("most"); +var most_2 = require("./engine/most"); +// unfortunately React doesn't support symbol as context key yet, so let me just preteding using Symbol until react implement the Symbol version of Object.assign +exports.REACT_MOST_ENGINE = '@@reactive-react/react-most.engine'; +var h = React.createElement; +var CONTEXT_TYPE = (_a = {}, + _a[exports.REACT_MOST_ENGINE] = prop_types_1.PropTypes.object, + _a); +function isConnectClass(ComponentClass) { + return ComponentClass.contextTypes == CONTEXT_TYPE; +} +function connect(main, opts) { + if (opts === void 0) { opts = { history: false }; } + return function (WrappedComponent) { + var connectDisplayName = "Connect(" + getDisplayName(WrappedComponent) + ")"; + if (isConnectClass(WrappedComponent)) { + return _a = (function (_super) { + __extends(ConnectNode, _super); + function ConnectNode(props, context) { + var _this = _super.call(this, props, context) || this; + var _a = main(context[exports.REACT_MOST_ENGINE].intentStream, props), actions = _a.actions, update$ = _a.update$; + _this.machine = { + update$: _this.machine.update$.merge(update$), + actions: Object.assign({}, bindActions(actions, context[exports.REACT_MOST_ENGINE].intentStream, _this), _this.machine.actions) + }; + return _this; + } + return ConnectNode; + }(WrappedComponent)), + _a.contextTypes = CONTEXT_TYPE, + _a.displayName = connectDisplayName, + _a; + } + else { + return _b = (function (_super) { + __extends(ConnectLeaf, _super); + function ConnectLeaf(props, context) { + var _this = _super.call(this, props, context) || this; + var engine = context[exports.REACT_MOST_ENGINE]; + if (opts.history || props.history) { + _this.traveler = history_1.default(engine.historyStream, engine.travelStream); + _this.traveler.travel.forEach(function (state) { + return _this.setState(state); + }); + } + var _a = main(engine.intentStream, props), actions = _a.actions, update$ = _a.update$; + _this.machine = { + actions: bindActions(actions, engine.intentStream, _this), + update$: update$ + }; + var defaultKey = Object.keys(WrappedComponent.defaultProps); + _this.state = Object.assign({}, WrappedComponent.defaultProps, pick(defaultKey, props)); + return _this; + } + ConnectLeaf.prototype.componentWillReceiveProps = function (nextProps) { + this.setState(function (state) { return pick(Object.keys(state), nextProps); }); + }; + ConnectLeaf.prototype.componentDidMount = function () { + var _this = this; + this.subscription = this.context[exports.REACT_MOST_ENGINE].observe(this.machine.update$, function (action) { + if (action instanceof Function) { + _this.setState(function (prevState, props) { + var newState = action.call(_this, prevState, props); + if ((opts.history || props.history) && newState != prevState) { + _this.traveler.cursor = -1; + _this.context[exports.REACT_MOST_ENGINE].historyStream.send(prevState); + } + return newState; + }); + } + else { + /* istanbul ignore next */ + console.warn('action', action, 'need to be a Function which map from current state to new state'); + } + }); + }; + ConnectLeaf.prototype.componentWillUnmount = function () { + this.subscription.unsubscribe(); + }; + ConnectLeaf.prototype.render = function () { + return h(WrappedComponent, Object.assign({}, opts, this.props, this.state, { + actions: this.machine.actions, + traveler: this.traveler + })); + }; + return ConnectLeaf; + }(interfaces_1.Connect)), + _b.contextTypes = CONTEXT_TYPE, + _b.displayName = connectDisplayName, + _b; + } + var _a, _b; + }; +} +exports.connect = connect; +var Most = (function (_super) { + __extends(Most, _super); + function Most() { + return _super !== null && _super.apply(this, arguments) || this; + } + Most.prototype.getChildContext = function () { + var engine = (this.props && this.props.engine && new this.props.engine()) || new most_2.Engine(); + /* istanbul ignore if */ + if (process.env.NODE_ENV === 'debug') { + inspect(engine); + } + return _a = {}, + _a[exports.REACT_MOST_ENGINE] = engine, + _a; + var _a; + }; + Most.prototype.render = function () { + return React.Children.only(this.props.children); + }; + return Most; +}(React.PureComponent)); +Most.childContextTypes = CONTEXT_TYPE; +exports.default = Most; +/* istanbul ignore next */ +function inspect(engine) { + most_1.from(engine.intentStream) + .timestamp() + .observe(function (stamp) { + return console.log("[" + new Date(stamp.time).toJSON() + "][INTENT]:}", stamp.value); + }); + most_1.from(engine.historyStream) + .timestamp() + .observe(function (stamp) { + return console.log("[" + new Date(stamp.time).toJSON() + "][STATE]:}", stamp.value); + }); +} +function bindActions(actions, intent$, self) { + var _actions = { + fromEvent: function (e, f) { + if (f === void 0) { f = function (x) { return x; }; } + return intent$.send(f(e)); + }, + fromPromise: function (p) { + return p.then(function (x) { return intent$.send(x); }); + }, + }; + var _loop_1 = function (a) { + _actions[a] = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return intent$.send(actions[a].apply(self, args)); + }; + }; + for (var a in actions) { + _loop_1(a); + } + return _actions; +} +function pick(names, obj) { + var result = {}; + for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { + var name_1 = names_1[_i]; + if (obj[name_1]) + result[name_1] = obj[name_1]; + } + return result; +} +function getDisplayName(WrappedComponent) { + return WrappedComponent.displayName || WrappedComponent.name || 'Component'; +} +var _a; diff --git a/package.json b/package.json index 9d0163e..553a827 100644 --- a/package.json +++ b/package.json @@ -6,16 +6,10 @@ "type": "git", "url": "git+https://github.com/jcouyang/react-most.git" }, - "main": "dist/react-most.js", + "main": "lib/react-most.js", "directories": { - "doc": "./docs", "lib": "./lib" }, - "files": [ - "engine", - "lib", - "test-utils.js" - ], "scripts": { "license": "(cat LICENSE.txt; cat react-most.js) > react-most.licensed.js && mv react-most.licensed.js react-most.js", "build": "tsc -p .", @@ -60,7 +54,7 @@ "es6" ], "roots": [ - "lib" + "src" ], "coverageDirectory": "./coverage/", "collectCoverage": true diff --git a/lib/__tests__/react-most-test.jsx b/src/__tests__/react-most-test.jsx similarity index 100% rename from lib/__tests__/react-most-test.jsx rename to src/__tests__/react-most-test.jsx diff --git a/lib/browser.js b/src/browser.js similarity index 100% rename from lib/browser.js rename to src/browser.js diff --git a/lib/engine/most.ts b/src/engine/most.ts similarity index 100% rename from lib/engine/most.ts rename to src/engine/most.ts diff --git a/lib/engine/rx.js b/src/engine/rx.js similarity index 100% rename from lib/engine/rx.js rename to src/engine/rx.js diff --git a/lib/history.ts b/src/history.ts similarity index 100% rename from lib/history.ts rename to src/history.ts diff --git a/lib/interfaces.ts b/src/interfaces.ts similarity index 100% rename from lib/interfaces.ts rename to src/interfaces.ts diff --git a/lib/react-most.ts b/src/react-most.ts similarity index 100% rename from lib/react-most.ts rename to src/react-most.ts diff --git a/tsconfig.json b/tsconfig.json index 625a7c7..5afac54 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,12 @@ { "include": [ - "lib/*.ts" + "src/*.ts" ], "compilerOptions": { "module": "commonjs", "lib": ["es2015","dom"], "target": "es5", - "outDir": "dist", + "outDir": "lib", "declarationDir": "types", "declaration": true, "noImplicitAny": false, From d3c6cbb21cfe1cb33a3768f687631bc2cab51fd4 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 22:24:06 +0800 Subject: [PATCH 17/19] type d files --- types/engine/most.d.ts | 9 +++++++++ types/history.d.ts | 12 ++++++++++++ types/interfaces.d.ts | 43 ++++++++++++++++++++++++++++++++++++++++++ types/react-most.d.ts | 22 +++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 types/engine/most.d.ts create mode 100644 types/history.d.ts create mode 100644 types/interfaces.d.ts create mode 100644 types/react-most.d.ts diff --git a/types/engine/most.d.ts b/types/engine/most.d.ts new file mode 100644 index 0000000..abe9466 --- /dev/null +++ b/types/engine/most.d.ts @@ -0,0 +1,9 @@ +import { Stream, Subscription } from 'most'; +import { EngineSubject, Update } from '../interfaces'; +export declare class Engine { + intentStream: EngineSubject; + historyStream: EngineSubject; + travelStream: EngineSubject<(n: number) => number>; + constructor(); + observe(actionsSinks: Stream>, f: any): Subscription; +} diff --git a/types/history.d.ts b/types/history.d.ts new file mode 100644 index 0000000..d150551 --- /dev/null +++ b/types/history.d.ts @@ -0,0 +1,12 @@ +import { Stream } from 'most'; +import { Stamp, EngineSubject } from './interfaces'; +export declare class Traveler { + cursor: number; + path: EngineSubject<(n: number) => number>; + history: Stream[]>; + travel: Stream; + constructor(history: Stream[]>, path: EngineSubject<(n: number) => number>); + forward(): void; + backward(): void; +} +export default function initHistory(engineHistory: EngineSubject, engineTravel: EngineSubject<(n: number) => number>): Traveler; diff --git a/types/interfaces.d.ts b/types/interfaces.d.ts new file mode 100644 index 0000000..3b84def --- /dev/null +++ b/types/interfaces.d.ts @@ -0,0 +1,43 @@ +/// +import { Stream, Subscription } from 'most'; +import * as React from 'react'; +import { AsyncSubject } from 'most-subject'; +import { Traveler } from './history'; +export interface Actions { + [propName: string]: (...v: any[]) => T; +} +export interface Plan { + (intent: EngineSubject, props?: {}): Machine; +} +export interface Update { + (current: S): S; +} +export interface Machine { + actions: Actions; + update$: Stream>; +} +export interface ConnectProps { + actions?: Actions; + history?: boolean; +} +export declare class Connect extends React.PureComponent, S> { + machine: Machine; + traveler: Traveler; + subscription: Subscription; +} +export interface ConnectClass { + contextTypes?: any; + defaultProps?: any; + new (props?: ConnectProps, context?: any): Connect; +} +export interface History { + path: EngineSubject<(n: number) => number>; + history: Stream; +} +export interface Stamp { + value: S; + time: number; +} +export interface EngineSubject extends AsyncSubject { + send(x: T): this; +} diff --git a/types/react-most.d.ts b/types/react-most.d.ts new file mode 100644 index 0000000..831424e --- /dev/null +++ b/types/react-most.d.ts @@ -0,0 +1,22 @@ +/// +import * as React from 'react'; +import { Plan, ConnectClass } from './interfaces'; +import { Engine } from './engine/most'; +export declare const REACT_MOST_ENGINE = "@@reactive-react/react-most.engine"; +export declare type ConnectOrReactComponent = ConnectClass | React.ComponentClass; +export declare function connect(main: Plan, opts?: { + history: boolean; +}): (WrappedComponent: ConnectOrReactComponent) => ConnectClass; +export interface MostProps { + engine?: new () => Engine; +} +export interface MostEngine { + [x: string]: Engine; +} +export default class Most extends React.PureComponent, S> { + static childContextTypes: { + [x: string]: any; + }; + getChildContext(): MostEngine; + render(): React.ReactElement; +} From 942a5f7c402391a38ce9e1456de0fe064e3695bd Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 23:22:53 +0800 Subject: [PATCH 18/19] typescriptify test --- .babelrc | 8 - .gitignore | 1 + package.json | 36 +- src/__tests__/react-most-test.jsx | 337 ---- src/__tests__/react-most-test.tsx | 345 ++++ src/interfaces.ts | 3 +- tsconfig.json | 1 + types/__tests__/react-most-test.d.ts | 0 types/interfaces.d.ts | 5 +- yarn.lock | 2328 +++++++++----------------- 10 files changed, 1122 insertions(+), 1942 deletions(-) delete mode 100644 .babelrc delete mode 100644 src/__tests__/react-most-test.jsx create mode 100644 src/__tests__/react-most-test.tsx create mode 100644 types/__tests__/react-most-test.d.ts diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 7e7f0bc..0000000 --- a/.babelrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "presets": [ - "es2015" - ], - "plugins": [ - "transform-react-jsx" - ] -} diff --git a/.gitignore b/.gitignore index 1f602a6..27b5593 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ public/app.js gh-pages/ wiki/ dist +lib diff --git a/package.json b/package.json index 553a827..44a7536 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,16 @@ "url": "git+https://github.com/jcouyang/react-most.git" }, "main": "lib/react-most.js", - "directories": { - "lib": "./lib" - }, + "typings": "types/react-most.d.ts", + "files": [ + "src", + "lib", + "types" + ], "scripts": { "license": "(cat LICENSE.txt; cat react-most.js) > react-most.licensed.js && mv react-most.licensed.js react-most.js", "build": "tsc -p .", - "prebrowser": "npm run build", - "browser": "browserify -r react -r most -r most-subject -o dist/vendor.js && browserify -s Most -x react -x most -x most-subject react-most.js -o dist/react-most.js", - "test": "jest --coverage", + "test": "jest", "prepublish": "npm run build", "testWDebugger": "node --harmony $(which bugger) ./node_modules/jest-cli/bin/jest.js --runInBand" }, @@ -29,29 +30,30 @@ "react": "^15.5.4" }, "devDependencies": { + "@types/jest": "^19.2.3", "@types/node": "^7.0.18", "@types/react": "^15.0.22", - "babel": "^6.1.18", - "babel-cli": "^6.2.0", - "babel-jest": "^19.0.0", - "babel-plugin-transform-react-jsx": "^6.1.18", - "babel-preset-es2015": "^6.1.18", - "babelify": "^7.2.0", - "jest": "^19.0.0", - "jest-cli": "^19.0.1", + "jest": "^20.0.0", "lodash": "^4.0.0", "react": "^15.5.4", "react-addons-test-utils": "^15.2.0", "react-dom": "^15.5.4", "react-most-spec": "^0.2.3", "redux": "^3.0.4", + "ts-jest": "^20.0.2", "typescript": "^2.3.2" }, "jest": { + "transform": { + "^.+\\.(tsx|ts)$": "/node_modules/ts-jest/preprocessor.js" + }, "moduleFileExtensions": [ - "js", - "jsx", - "es6" + "ts", + "tsx", + "js" + ], + "testMatch": [ + "**/__tests__/*.(ts|tsx|js)" ], "roots": [ "src" diff --git a/src/__tests__/react-most-test.jsx b/src/__tests__/react-most-test.jsx deleted file mode 100644 index d60cb48..0000000 --- a/src/__tests__/react-most-test.jsx +++ /dev/null @@ -1,337 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import TestUtils from 'react-addons-test-utils'; -import * as most from 'most'; - -import Most, {connect,REACT_MOST_ENGINE} from '../../dist/react-most'; -import {stateStreamOf, stateHistoryOf, - intentStreamOf, intentHistoryOf, - run, dispatch, - Engine } from 'react-most-spec'; -const compose = f => g => x => g(f(x)); - -const CounterView = React.createClass({ - render(){ - return ( -
- {this.props.count} - {this.props.wrapperProps} - {this.props.overwritedProps} - - - + -
- ) - } -}) - -CounterView.defaultProps = {count: 0, overwritedProps: 'inner'} - -const counterWrapper = connect(intent$=>{ - return { - update$: intent$.map(intent=>{ - switch(intent.type) { - case 'inc': - return state=>({count:state.count+1}) - case 'dec': - intent$.send({type:'dec triggered'}) - return state=>({count:state.count-1}) - case 'changeWrapperProps': - return state=>({wrapperProps: intent.value, - overwritedProps: intent.value}) - case 'changeDefaultProps': - return state=>({count: intent.value}) - default: - return state=>state - } - }), - actions:{ - inc: ()=>({type:'inc'}), - dec: ()=>({type:'dec'}), - changeWrapperProps: (value)=>({type:'changeWrapperProps', value}), - changeDefaultProps: (value)=>({type:'changeDefaultProps', value}), - } - } -}) - -const Counter = counterWrapper(CounterView) - -describe('react-most', () => { - describe('actions', ()=>{ - it('add intent to intent$ and go through sink$', ()=> { - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.inc() - counter.machine.actions.inc() - counter.machine.actions.inc() - expect(stateHistoryOf(counter)[2].count).toBe(3) - }) - - it('async action', ()=> { - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.inc(); - counter.machine.actions.fromEvent({type:'inc'}); - return counter.machine.actions.fromPromise(Promise.resolve({type:'inc'})) - .then(()=>{ - expect(stateHistoryOf(counter)[2].count).toBe(3) - }) - - }) - - it('sink can also generate intent', ()=> { - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - - counter.machine.actions.dec() - expect(intentHistoryOf(counter)[1].type).toBe('dec triggered') - }) - - it('props will overwirte components default props', ()=>{ - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.inc(); - expect(stateHistoryOf(counter)[0].count).toBe(10) - }) - - it('props that not overlap with views defaultProps can not be changed', ()=>{ - let CounterWrapper = React.createClass({ - getInitialState(){ - return { - wrapperProps: 'heheda', - overwritedProps: 'hoho', - count: 0, - } - }, - render(){ - return - } - }) - let counterMostWrapper = TestUtils.renderIntoDocument( - - - - ) - let counterWrapper = TestUtils.findRenderedComponentWithType(counterMostWrapper, CounterWrapper) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.changeWrapperProps('miao') - counter.machine.actions.changeDefaultProps(19) - let wrapperProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'wrapperProps') - let overwritedProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'overwritedProps') - let count = TestUtils.findRenderedDOMComponentWithClass(counter, 'count') - expect(counter.props.wrapperProps).toBe('heheda') - expect(wrapperProps.textContent).toBe('miao') - expect(overwritedProps.textContent).toBe('miao') - expect(count.textContent).toBe('19') - counterWrapper.setState({overwritedProps: 'wrapper', count: 1}) - overwritedProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'overwritedProps') - count = TestUtils.findRenderedDOMComponentWithClass(counter, 'count') - expect(overwritedProps.textContent).toBe('wrapper') - expect(count.textContent).toBe('1') - }) - }); - - describe('history', ()=>{ - it('can undo', ()=> { - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.inc() - counter.machine.actions.inc() - counter.machine.actions.inc() - let backward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'backward') - TestUtils.Simulate.click(backward) - TestUtils.Simulate.click(backward) - TestUtils.Simulate.click(backward) - let count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') - expect(count.textContent).toBe('1') - let forward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'forward') - TestUtils.Simulate.click(forward) - count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') - expect(count.textContent).toBe('2') - forward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'forward') - TestUtils.Simulate.click(forward) - TestUtils.Simulate.click(forward) - count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') - expect(count.textContent).toBe('3') - }) - }) - - describe('composable', ()=>{ - const counterWrapper2 = connect(intent$=>{ - return { - update$: intent$.map(intent=>{ - switch(intent.type) { - case 'inc2': - return state=>({count:state.count+2}) - case 'dec2': - return state=>({count:state.count-2}) - default: - return state=>state - } - }), - actions: { - inc2: ()=>({type:'inc2'}), - dec2: ()=>({type:'dec2'}), - } - } - }) - let counterWrapper21 = compose(counterWrapper2)(counterWrapper) - const Counter2 = counterWrapper21(CounterView) - //counterWrapper2(counterWrapper(CounterView)) - it('counter add inc2, dec2', ()=>{ - let counterWrapperr = TestUtils.renderIntoDocument( - - - - ) - let counterView = TestUtils.findRenderedComponentWithType(counterWrapperr, CounterView) - let counter2 = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter2) - counterView.props.actions.inc() - counterView.props.actions.inc2() - counterView.props.actions.dec() - expect(stateHistoryOf(counter2)[2].count).toBe(2) - }) - }) - - describe('convension default to `action` field in sinks', ()=>{ - const Counter = connect(intent$=>{ - return { - update$: intent$.map(intent=>{ - switch(intent.type) { - case 'inc3': - return state=>({count:state.count+3}) - default: - return state=>state - } - }), - actions: { - inc3: ()=>({type: 'inc3'}) - }, - } - })(CounterView) - - it('counter inc 3', ()=>{ - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - counter.machine.actions.inc3() - counter.machine.actions.inc3() - expect(stateHistoryOf(counter)[1].count).toBe(6) - }) - }) - - describe('ERROR', ()=>{ - const Counter = connect(intent$=>{ - return { - update$: intent$.map(intent=>{ - switch(intent.type) { - case 'exception': - throw 'exception in reducer' - case 'inc': - return state=>({count:state.count+1}) - default: - return state=>state - } - }), - actions: { - throwExeption: ()=>({type: 'exception'}), - }, - } - })(CounterView) - - it('should recover to identity stream and log exception', ()=>{ - spyOn(console, 'error') - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - return run(intentStreamOf(counter), - dispatch([{type: 'exception'}], counter), - [ - state=>expect(console.error).toBeCalledWith('There is Error in your reducer:', 'exception in reducer', undefined) - ]) - }) - - it('should able to catch error in sync mode', ()=>{ - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - expect(()=>{ - counter.machine.actions.throwExeption() - }).toThrow('exception in reducer') - }) - }) - - describe('unsubscribe when component unmounted', ()=>{ - it('unsubscribe', (done)=>{ - const Counter = connect(intent$=>{ - let incForever$ = most.periodic(100, {type:'inc'}).map(intent=>{ - done.fail('should not send intent any more') - return _=>_ - }) - return { - update$: intent$.map(intent=>{ - switch(intent.type) { - case 'inc': - return state=>({count:state.count+1}) - default: - return state=>state - } - }).merge(incForever$) - } - })(CounterView) - - const TogglableMount = React.createClass({ - getInitialState(){ - return { - mount: true - } - }, - render(){ - return this.state.mount && - } - }) - spyOn(console, 'error') - let counterWrapper = TestUtils.renderIntoDocument( - - - - ) - let toggle = TestUtils.findRenderedComponentWithType(counterWrapper, TogglableMount) - let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) - toggle.setState({mount:false}) - done() - }) - }) -}) diff --git a/src/__tests__/react-most-test.tsx b/src/__tests__/react-most-test.tsx new file mode 100644 index 0000000..928153e --- /dev/null +++ b/src/__tests__/react-most-test.tsx @@ -0,0 +1,345 @@ +import * as React from 'react'; +import ReactDOM from 'react-dom'; +import * as TestUtils from 'react-addons-test-utils'; +import * as most from 'most'; + +import Most, { connect, REACT_MOST_ENGINE } from '../../src/react-most'; +import { EngineSubject } from '../../src/interfaces' +import { + stateStreamOf, stateHistoryOf, + intentStreamOf, intentHistoryOf, + run, dispatch, + Engine +} from 'react-most-spec'; +const compose = f => g => x => g(f(x)); + +const CounterView = React.createClass({ + render() { + return ( +
+ {this.props.count} + {this.props.wrapperProps} + {this.props.overwritedProps} + - + + +
+ ) + } +}) + +CounterView.defaultProps = { count: 0, overwritedProps: 'inner' } +interface Intent { + type: string + value?: any +} +const counterWrapper = connect((intent$: EngineSubject) => { + return { + update$: intent$.map((intent: Intent) => { + switch (intent.type) { + case 'inc': + return state => ({ count: state.count + 1 }) + case 'dec': + intent$.send({ type: 'dec triggered' }) + return state => ({ count: state.count - 1 }) + case 'changeWrapperProps': + return state => ({ + wrapperProps: intent.value, + overwritedProps: intent.value + }) + case 'changeDefaultProps': + return state => ({ count: intent.value }) + default: + return state => state + } + }), + actions: { + inc: () => ({ type: 'inc' }), + dec: () => ({ type: 'dec' }), + changeWrapperProps: (value) => ({ type: 'changeWrapperProps', value }), + changeDefaultProps: (value) => ({ type: 'changeDefaultProps', value }), + } + } +}) + +const Counter = counterWrapper(CounterView) + +describe('react-most', () => { + describe('actions', () => { + it('add intent to intent$ and go through sink$', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() + expect(stateHistoryOf(counter)[2].count).toBe(3) + }) + + it('async action', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.inc(); + counter.machine.actions.fromEvent({ type: 'inc' }); + return counter.machine.actions.fromPromise(Promise.resolve({ type: 'inc' })) + .then(() => { + expect(stateHistoryOf(counter)[2].count).toBe(3) + }) + + }) + + it('sink can also generate intent', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + + counter.machine.actions.dec() + expect(intentHistoryOf(counter)[1].type).toBe('dec triggered') + }) + + it('props will overwirte components default props', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.inc(); + expect(stateHistoryOf(counter)[0].count).toBe(10) + }) + + it('props that not overlap with views defaultProps can not be changed', () => { + let CounterWrapper = React.createClass({ + getInitialState() { + return { + wrapperProps: 'heheda', + overwritedProps: 'hoho', + count: 0, + } + }, + render() { + return + } + }) + let counterMostWrapper = TestUtils.renderIntoDocument( + + + + ) + let counterWrapper = TestUtils.findRenderedComponentWithType(counterMostWrapper, CounterWrapper) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.changeWrapperProps('miao') + counter.machine.actions.changeDefaultProps(19) + let wrapperProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'wrapperProps') + let overwritedProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'overwritedProps') + let count = TestUtils.findRenderedDOMComponentWithClass(counter, 'count') + expect(counter.props.wrapperProps).toBe('heheda') + expect(wrapperProps.textContent).toBe('miao') + expect(overwritedProps.textContent).toBe('miao') + expect(count.textContent).toBe('19') + counterWrapper.setState({ overwritedProps: 'wrapper', count: 1 }) + overwritedProps = TestUtils.findRenderedDOMComponentWithClass(counter, 'overwritedProps') + count = TestUtils.findRenderedDOMComponentWithClass(counter, 'count') + expect(overwritedProps.textContent).toBe('wrapper') + expect(count.textContent).toBe('1') + }) + }); + + describe('history', () => { + it('can undo', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.inc() + counter.machine.actions.inc() + counter.machine.actions.inc() + let backward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'backward') + TestUtils.Simulate.click(backward) + TestUtils.Simulate.click(backward) + TestUtils.Simulate.click(backward) + let count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') + expect(count.textContent).toBe('1') + let forward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'forward') + TestUtils.Simulate.click(forward) + count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') + expect(count.textContent).toBe('2') + forward = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'forward') + TestUtils.Simulate.click(forward) + TestUtils.Simulate.click(forward) + count = TestUtils.findRenderedDOMComponentWithClass(counterWrapper, 'count') + expect(count.textContent).toBe('3') + }) + }) + + describe('composable', () => { + const counterWrapper2 = connect((intent$: EngineSubject) => { + return { + update$: intent$.map(intent => { + switch (intent.type) { + case 'inc2': + return state => ({ count: state.count + 2 }) + case 'dec2': + return state => ({ count: state.count - 2 }) + default: + return state => state + } + }), + actions: { + inc2: () => ({ type: 'inc2' }), + dec2: () => ({ type: 'dec2' }), + } + } + }) + let counterWrapper21 = compose(counterWrapper2)(counterWrapper) + const Counter2 = counterWrapper21(CounterView) + //counterWrapper2(counterWrapper(CounterView)) + it('counter add inc2, dec2', () => { + let counterWrapperr = TestUtils.renderIntoDocument( + + + + ) + let counterView = TestUtils.findRenderedComponentWithType(counterWrapperr, CounterView) + let counter2 = TestUtils.findRenderedComponentWithType(counterWrapperr, Counter2) + counterView.props.actions.inc() + counterView.props.actions.inc2() + counterView.props.actions.dec() + expect(stateHistoryOf(counter2)[2].count).toBe(2) + }) + }) + + describe('convension default to `action` field in sinks', () => { + const Counter = connect((intent$: EngineSubject) => { + return { + update$: intent$.map(intent => { + switch (intent.type) { + case 'inc3': + return state => ({ count: state.count + 3 }) + default: + return state => state + } + }), + actions: { + inc3: () => ({ type: 'inc3' }) + }, + } + })(CounterView) + + it('counter inc 3', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + counter.machine.actions.inc3() + counter.machine.actions.inc3() + expect(stateHistoryOf(counter)[1].count).toBe(6) + }) + }) + + describe('ERROR', () => { + const Counter = connect((intent$: EngineSubject) => { + return { + update$: intent$.map(intent => { + switch (intent.type) { + case 'exception': + throw 'exception in reducer' + case 'inc': + return state => ({ count: state.count + 1 }) + default: + return state => state + } + }), + actions: { + throwExeption: () => ({ type: 'exception' }), + }, + } + })(CounterView) + + it('should recover to identity stream and log exception', () => { + spyOn(console, 'error') + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + return run(intentStreamOf(counter), + dispatch([{ type: 'exception' }], counter), + [ + state => expect(console.error).toBeCalledWith('There is Error in your reducer:', 'exception in reducer', undefined) + ]) + }) + + it('should able to catch error in sync mode', () => { + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + expect(() => { + counter.machine.actions.throwExeption() + }).toThrow('exception in reducer') + }) + }) + + describe('unsubscribe when component unmounted', () => { + it('unsubscribe', (done) => { + const Counter = connect((intent$: EngineSubject) => { + let incForever$ = most.periodic(100, { type: 'inc' }).map(intent => { + done.fail('should not send intent any more') + return _ => _ + }) + return { + update$: intent$.map(intent => { + switch (intent.type) { + case 'inc': + return state => ({ count: state.count + 1 }) + default: + return state => state + } + }).merge(incForever$) + } + })(CounterView) + + const TogglableMount = React.createClass({ + getInitialState() { + return { + mount: true + } + }, + render() { + return this.state.mount && + } + }) + spyOn(console, 'error') + let counterWrapper = TestUtils.renderIntoDocument( + + + + ) + let toggle = TestUtils.findRenderedComponentWithType(counterWrapper, TogglableMount) + let counter = TestUtils.findRenderedComponentWithType(counterWrapper, Counter) + toggle.setState({ mount: false }) + done() + }) + }) +}) diff --git a/src/interfaces.ts b/src/interfaces.ts index b5b7de5..4bfdcf3 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -13,13 +13,14 @@ export interface Update { (current: S): S } export interface Machine { - actions: Actions, + actions?: Actions, update$: Stream> } export interface ConnectProps { actions?: Actions history?: boolean + [propName: string]: any; } export class Connect extends React.PureComponent, S> { diff --git a/tsconfig.json b/tsconfig.json index 5afac54..fe4333c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "lib": ["es2015","dom"], "target": "es5", "outDir": "lib", + "jsx": "react", "declarationDir": "types", "declaration": true, "noImplicitAny": false, diff --git a/types/__tests__/react-most-test.d.ts b/types/__tests__/react-most-test.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/types/interfaces.d.ts b/types/interfaces.d.ts index 3b84def..c450602 100644 --- a/types/interfaces.d.ts +++ b/types/interfaces.d.ts @@ -13,12 +13,13 @@ export interface Update { (current: S): S; } export interface Machine { - actions: Actions; - update$: Stream>; + actions?: Actions; + update$?: Stream>; } export interface ConnectProps { actions?: Actions; history?: boolean; + [propName: string]: any; } export declare class Connect extends React.PureComponent, S> { machine: Machine; diff --git a/yarn.lock b/yarn.lock index dd160da..6a1201e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,8 +9,12 @@ "@most/prelude" "^1.4.0" "@most/prelude@^1.4.0", "@most/prelude@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.4.1.tgz#b940b5563096f27637401618a5351f42466ea8f3" + version "1.6.0" + resolved "https://registry.yarnpkg.com/@most/prelude/-/prelude-1.6.0.tgz#4256e3a902ddf04c1f07afca2267526195072e13" + +"@types/jest@^19.2.3": + version "19.2.3" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-19.2.3.tgz#61748040e8589a891dfc2ec1d16a2dd74482980e" "@types/node@^7.0.18": version "7.0.18" @@ -24,10 +28,6 @@ abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" -abbrev@1: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - acorn-globals@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" @@ -38,6 +38,13 @@ acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -55,8 +62,8 @@ ansi-escapes@^1.4.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" ansi-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" ansi-styles@^2.2.1: version "2.2.1" @@ -68,10 +75,6 @@ ansi-styles@^3.0.0: dependencies: color-convert "^1.0.0" -ansicolors@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0cdbcdb62bd87aef" - anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -85,17 +88,6 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" -aproba@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" - -are-we-there-yet@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.0 || ^1.1.13" - argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -109,27 +101,13 @@ arr-diff@^2.0.0: arr-flatten "^1.0.1" arr-flatten@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" - -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -146,32 +124,24 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - -assert-plus@^1.0.0: +assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -async@^1.4.0, async@^1.4.2: +async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" + version "2.4.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" dependencies: lodash "^4.14.0" -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -181,51 +151,30 @@ aws-sign2@~0.6.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" aws4@^1.2.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" - -babel-cli@^6.2.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.18.0.tgz#92117f341add9dead90f6fa7d0a97c0cc08ec186" - dependencies: - babel-core "^6.18.0" - babel-polyfill "^6.16.0" - babel-register "^6.18.0" - babel-runtime "^6.9.0" - commander "^2.8.1" - convert-source-map "^1.1.0" - fs-readdir-recursive "^1.0.0" - glob "^5.0.5" - lodash "^4.2.0" - output-file-sync "^1.1.0" - path-is-absolute "^1.0.0" - slash "^1.0.0" - source-map "^0.5.0" - v8flags "^2.0.10" - optionalDependencies: - chokidar "^1.0.0" + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-code-frame@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.16.0.tgz#f90e60da0862909d3ce098733b5d3987c97cb8de" +babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: chalk "^1.1.0" esutils "^2.0.2" - js-tokens "^2.0.0" - -babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.18.0: - version "6.18.2" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.18.2.tgz#d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b" - dependencies: - babel-code-frame "^6.16.0" - babel-generator "^6.18.0" - babel-helpers "^6.16.0" - babel-messages "^6.8.0" - babel-register "^6.18.0" - babel-runtime "^6.9.1" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + js-tokens "^3.0.0" + +babel-core@^6.0.0, babel-core@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.24.1" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -237,496 +186,149 @@ babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.18.0: slash "^1.0.0" source-map "^0.5.0" -babel-generator@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.19.0.tgz#9b2f244204777a3d6810ec127c673c87b349fac5" +babel-generator@^6.18.0, babel-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" dependencies: - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.19.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" source-map "^0.5.0" + trim-right "^1.0.1" -babel-helper-builder-react-jsx@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.18.0.tgz#ab02f19a2eb7ace936dd87fa55896d02be59bf71" - dependencies: - babel-runtime "^6.9.0" - babel-types "^6.18.0" - esutils "^2.0.0" - lodash "^4.2.0" - -babel-helper-call-delegate@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" - dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - -babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" - dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.9.0" - babel-types "^6.18.0" - lodash "^4.2.0" - -babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" - dependencies: - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - -babel-helper-get-function-arity@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.18.0.tgz#a5b19695fd3f9cdfc328398b47dafcd7094f9f24" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" - -babel-helper-hoist-variables@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" - -babel-helper-optimise-call-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" - -babel-helper-regex@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" - dependencies: - babel-runtime "^6.9.0" - babel-types "^6.18.0" - lodash "^4.2.0" - -babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" - dependencies: - babel-helper-optimise-call-expression "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - -babel-helpers@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" dependencies: - babel-runtime "^6.0.0" - babel-template "^6.16.0" - -babel-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-18.0.0.tgz#17ebba8cb3285c906d859e8707e4e79795fb65e3" - dependencies: - babel-core "^6.0.0" - babel-plugin-istanbul "^3.0.0" - babel-preset-jest "^18.0.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" -babel-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" +babel-jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.0.tgz#05ae371102ee8e30c9d61ffdf3f61c738a87741f" dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^19.0.0" - -babel-messages@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" - dependencies: - babel-runtime "^6.0.0" + babel-preset-jest "^20.0.0" -babel-plugin-check-es2015-constants@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: - babel-runtime "^6.0.0" - -babel-plugin-istanbul@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.0.0.tgz#da7324520ae0b8a44b6a078e72e883374a9fab76" - dependencies: - find-up "^1.1.2" - istanbul-lib-instrument "^1.1.4" - object-assign "^4.1.0" - test-exclude "^3.2.2" + babel-runtime "^6.22.0" babel-plugin-istanbul@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" + version "4.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" dependencies: find-up "^2.1.0" - istanbul-lib-instrument "^1.4.2" - test-exclude "^4.0.0" - -babel-plugin-jest-hoist@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-18.0.0.tgz#4150e70ecab560e6e7344adc849498072d34e12a" - -babel-plugin-jest-hoist@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" - -babel-plugin-syntax-jsx@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - -babel-plugin-transform-es2015-arrow-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-block-scoping@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.18.0.tgz#3bfdcfec318d46df22525cdea88f1978813653af" - dependencies: - babel-runtime "^6.9.0" - babel-template "^6.15.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - lodash "^4.2.0" - -babel-plugin-transform-es2015-classes@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" - dependencies: - babel-helper-define-map "^6.18.0" - babel-helper-function-name "^6.18.0" - babel-helper-optimise-call-expression "^6.18.0" - babel-helper-replace-supers "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-template "^6.14.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - -babel-plugin-transform-es2015-computed-properties@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" - dependencies: - babel-helper-define-map "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - -babel-plugin-transform-es2015-destructuring@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" - dependencies: - babel-runtime "^6.9.0" - -babel-plugin-transform-es2015-duplicate-keys@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.8.0" - -babel-plugin-transform-es2015-for-of@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-function-name@^6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" - dependencies: - babel-helper-function-name "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.9.0" - -babel-plugin-transform-es2015-literals@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-modules-amd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" - dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - -babel-plugin-transform-es2015-modules-commonjs@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" - dependencies: - babel-plugin-transform-strict-mode "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-types "^6.18.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" - dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.11.6" - babel-template "^6.14.0" - -babel-plugin-transform-es2015-modules-umd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - -babel-plugin-transform-es2015-object-super@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" - dependencies: - babel-helper-replace-supers "^6.8.0" - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-parameters@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.18.0.tgz#9b2cfe238c549f1635ba27fc1daa858be70608b1" - dependencies: - babel-helper-call-delegate "^6.18.0" - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.9.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - -babel-plugin-transform-es2015-shorthand-properties@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" - -babel-plugin-transform-es2015-spread@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-sticky-regex@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" - dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" - babel-types "^6.8.0" + istanbul-lib-instrument "^1.7.1" + test-exclude "^4.1.0" -babel-plugin-transform-es2015-template-literals@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" - dependencies: - babel-runtime "^6.0.0" - -babel-plugin-transform-es2015-typeof-symbol@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" - dependencies: - babel-runtime "^6.0.0" +babel-plugin-jest-hoist@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.0.tgz#d2afe94fa6aea3b8bfa5d61d8028f633c898d86d" -babel-plugin-transform-es2015-unicode-regex@^6.3.13: - version "6.11.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" - regexpu-core "^2.0.0" + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" -babel-plugin-transform-react-jsx@^6.1.18: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.8.0.tgz#94759942f70af18c617189aa7f3593f1644a71ab" +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" dependencies: - babel-helper-builder-react-jsx "^6.8.0" - babel-plugin-syntax-jsx "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" -babel-plugin-transform-regenerator@^6.16.0: - version "6.16.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.16.1.tgz#a75de6b048a14154aae14b0122756c5bed392f59" +babel-preset-jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.0.tgz#16b992c9351c2525e87a19fd36ba14e47df51bad" dependencies: - babel-runtime "^6.9.0" - babel-types "^6.16.0" - private "~0.1.5" - -babel-plugin-transform-strict-mode@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-plugin-jest-hoist "^20.0.0" -babel-polyfill@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.16.0.tgz#2d45021df87e26a374b6d4d1a9c65964d17f2422" +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" dependencies: - babel-runtime "^6.9.1" - core-js "^2.4.0" - regenerator-runtime "^0.9.5" - -babel-preset-es2015@^6.1.18: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312" - dependencies: - babel-plugin-check-es2015-constants "^6.3.13" - babel-plugin-transform-es2015-arrow-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoping "^6.18.0" - babel-plugin-transform-es2015-classes "^6.18.0" - babel-plugin-transform-es2015-computed-properties "^6.3.13" - babel-plugin-transform-es2015-destructuring "^6.18.0" - babel-plugin-transform-es2015-duplicate-keys "^6.6.0" - babel-plugin-transform-es2015-for-of "^6.18.0" - babel-plugin-transform-es2015-function-name "^6.9.0" - babel-plugin-transform-es2015-literals "^6.3.13" - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-plugin-transform-es2015-modules-systemjs "^6.18.0" - babel-plugin-transform-es2015-modules-umd "^6.18.0" - babel-plugin-transform-es2015-object-super "^6.3.13" - babel-plugin-transform-es2015-parameters "^6.18.0" - babel-plugin-transform-es2015-shorthand-properties "^6.18.0" - babel-plugin-transform-es2015-spread "^6.3.13" - babel-plugin-transform-es2015-sticky-regex "^6.3.13" - babel-plugin-transform-es2015-template-literals "^6.6.0" - babel-plugin-transform-es2015-typeof-symbol "^6.18.0" - babel-plugin-transform-es2015-unicode-regex "^6.3.13" - babel-plugin-transform-regenerator "^6.16.0" - -babel-preset-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-18.0.0.tgz#84faf8ca3ec65aba7d5e3f59bbaed935ab24049e" - dependencies: - babel-plugin-jest-hoist "^18.0.0" - -babel-preset-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" - dependencies: - babel-plugin-jest-hoist "^19.0.0" - -babel-register@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" - dependencies: - babel-core "^6.18.0" - babel-runtime "^6.11.6" + babel-core "^6.24.1" + babel-runtime "^6.22.0" core-js "^2.4.0" home-or-tmp "^2.0.0" lodash "^4.2.0" mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.18.0.tgz#0f4177ffd98492ef13b9f823e9994a02584c9078" +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" - regenerator-runtime "^0.9.5" + regenerator-runtime "^0.10.0" -babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.8.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" +babel-template@^6.16.0, babel-template@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" dependencies: - babel-runtime "^6.9.0" - babel-traverse "^6.16.0" - babel-types "^6.16.0" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.19.0.tgz#68363fb821e26247d52a519a84b2ceab8df4f55a" +babel-traverse@^6.18.0, babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" dependencies: - babel-code-frame "^6.16.0" - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.19.0" - babylon "^6.11.0" + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8.0, babel-types@^6.9.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9" +babel-types@^6.18.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" dependencies: - babel-runtime "^6.9.1" + babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babel@^6.1.18: - version "6.5.2" - resolved "https://registry.yarnpkg.com/babel/-/babel-6.5.2.tgz#59140607438270920047ff56f02b2d8630c2d129" - -babelify@^7.2.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - dependencies: - babel-core "^6.0.14" - object-assign "^4.0.0" - -babylon@^6.11.0, babylon@^6.13.0: - version "6.14.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" +babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: + version "6.17.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" bcrypt-pbkdf@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" dependencies: tweetnacl "^0.14.3" -binary-extensions@^1.0.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" - -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - dependencies: - inherits "~2.0.0" - boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" dependencies: hoek "2.x.x" -brace-expansion@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" +brace-expansion@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" dependencies: balanced-match "^0.4.1" concat-map "0.0.1" @@ -745,7 +347,7 @@ browser-resolve@^1.11.2: dependencies: resolve "1.1.7" -bser@^1.0.2: +bser@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" dependencies: @@ -757,10 +359,6 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -777,16 +375,13 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -cardinal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-1.0.0.tgz#50e21c1b0aa37729f9377def196b5a9cec932ee9" - dependencies: - ansicolors "~0.2.1" - redeyed "~1.0.0" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" center-align@^0.1.1: version "0.1.3" @@ -795,7 +390,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.1.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -805,38 +400,10 @@ chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" -cli-table@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" - dependencies: - colors "1.0.3" - -cli-usage@^0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/cli-usage/-/cli-usage-0.1.4.tgz#7c01e0dc706c234b39c933838c8e20b2175776e2" - dependencies: - marked "^0.3.6" - marked-terminal "^1.6.2" - cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -853,6 +420,10 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -864,12 +435,8 @@ color-convert@^1.0.0: color-name "^1.1.1" color-name@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" - -colors@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" @@ -877,27 +444,17 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.8.1, commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" -convert-source-map@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" +convert-source-map@^1.1.0, convert-source-map@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" core-js@^1.0.0: version "1.2.7" @@ -907,9 +464,12 @@ core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" cryptiles@2.x.x: version "2.0.5" @@ -933,26 +493,16 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@^2.1.1, debug@^2.2.0: - version "2.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c" +debug@^2.1.1, debug@^2.2.0, debug@^2.6.3: + version "2.6.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.6.tgz#a9fa6fbe9ca43cf1e79f73b75c0189cbb7d6db5a" dependencies: - ms "0.7.2" - -debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" + ms "0.7.3" decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-extend@~0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -967,19 +517,15 @@ delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" dependencies: repeating "^2.0.0" -diff@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.1.0.tgz#9406c73a401e6c2b3ba901c5e2c44eb6a60c5385" +diff@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" ecc-jsbn@~0.1.1: version "0.1.1" @@ -1000,8 +546,8 @@ encoding@^0.1.11: prr "~0.0.0" error-ex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" @@ -1028,15 +574,11 @@ esprima@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" -esprima@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.0.0.tgz#53cf247acda77313e551c3aa2e73342d3fb4f7d9" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -esutils@^2.0.0, esutils@^2.0.2: +esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1046,6 +588,18 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.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" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1059,8 +613,8 @@ expand-range@^1.8.1: fill-range "^2.1.0" extend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" extglob@^0.3.1: version "0.3.2" @@ -1073,14 +627,14 @@ extsprintf@1.0.2: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" fast-levenshtein@~2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.5.tgz#bd33145744519ab1c36c3ee9f31f08e9079b67f2" + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fb-watchman@^1.8.0, fb-watchman@^1.9.0: - version "1.9.0" - resolved "http://registry.npmjs.org/fb-watchman/-/fb-watchman-1.9.0.tgz#6f268f1f347a6b3c875d1e89da7e1ed79adfc0ec" +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" dependencies: - bser "^1.0.2" + bser "1.0.2" fb-watchman@^2.0.0: version "2.0.0" @@ -1088,7 +642,7 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fbjs@^0.8.9: +fbjs@^0.8.4, fbjs@^0.8.9: version "0.8.12" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04" dependencies: @@ -1101,8 +655,8 @@ fbjs@^0.8.9: ua-parser-js "^0.7.9" filename-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" fileset@^2.0.2: version "2.0.3" @@ -1121,107 +675,77 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-up@^1.0.0, find-up@^1.1.2: +find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.1.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: locate-path "^2.0.0" -for-in@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - for-in "^0.1.5" + for-in "^1.0.1" forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" form-data@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" dependencies: asynckit "^0.4.0" combined-stream "^1.0.5" mime-types "^2.1.12" -fs-readdir-recursive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" +fs-extra@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^3.0.0" + universalify "^0.1.0" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: - version "1.0.15" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.15.tgz#fa63f590f3c2ad91275e4972a6cea545fb0aae44" - dependencies: - nan "^2.3.0" - node-pre-gyp "^0.6.29" - -fstream-ignore@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" - dependencies: - fstream "^1.0.0" - inherits "2" - minimatch "^3.0.0" - -fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - -gauge@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - supports-color "^0.2.0" - wide-align "^1.1.0" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + getpass@^0.1.1: - version "0.1.6" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" +glob-all@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab" + dependencies: + glob "^7.0.5" + yargs "~1.2.6" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1235,17 +759,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^5.0.5: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.0.5: +glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -1257,24 +771,20 @@ glob@^7.0.3, glob@^7.0.5: path-is-absolute "^1.0.0" globals@^9.0.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" -graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - -growly@^1.2.0, growly@^1.3.0: +growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" handlebars@^4.0.3: - version "4.0.6" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" + version "4.0.8" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.8.tgz#22b875cd3f0e6cbea30314f144e82bc7a72ff420" dependencies: async "^1.4.0" optimist "^0.6.1" @@ -1282,14 +792,16 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" + ajv "^4.9.1" + har-schema "^1.0.5" has-ansi@^2.0.0: version "2.0.0" @@ -1301,10 +813,6 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -1326,8 +834,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" html-encoding-sniffer@^1.0.1: version "1.0.1" @@ -1343,10 +851,14 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@0.4.13, iconv-lite@~0.4.13: +iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" +iconv-lite@~0.4.13: + version "0.4.17" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.17.tgz#4fdaa3b38acbc2c031b045d0edcdfe1ecab18c8d" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1354,14 +866,10 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1: +inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@~1.3.0: - version "1.3.4" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" - invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -1376,15 +884,9 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.0.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" is-builtin-module@^1.0.0: version "1.0.0" @@ -1392,7 +894,7 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" -is-ci@^1.0.9: +is-ci@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" dependencies: @@ -1428,21 +930,16 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" dependencies: is-extglob "^1.0.0" -is-my-json-valid@^2.12.4: - version "2.15.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-number@^2.0.2, is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -1457,11 +954,7 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-stream@^1.0.1: +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -1473,13 +966,13 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isexe@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" isobject@^2.0.0: version "2.1.0" @@ -1498,458 +991,278 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-api@^1.0.0-aplha.10, istanbul-api@^1.1.0-alpha.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.1.tgz#d36e2f1560d1a43ce304c4ff7338182de61c8f73" +istanbul-api@^1.1.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.0.0" - istanbul-lib-hook "^1.0.0" - istanbul-lib-instrument "^1.3.0" - istanbul-lib-report "^1.0.0-alpha.3" - istanbul-lib-source-maps "^1.1.0" - istanbul-reports "^1.0.0" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.0.0-alpha, istanbul-lib-coverage@^1.0.0-alpha.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.0.tgz#c3f9b6d226da12424064cce87fce0fb57fdfa7a2" +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" -istanbul-lib-hook@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0.tgz#fc5367ee27f59268e8f060b0c7aaf051d9c425c5" +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.3.0.tgz#19f0a973397454989b98330333063a5b56df0e58" - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.13.0" - istanbul-lib-coverage "^1.0.0" - semver "^5.3.0" - -istanbul-lib-instrument@^1.1.4, istanbul-lib-instrument@^1.3.0, istanbul-lib-instrument@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.4.2.tgz#0e2fdfac93c1dabf2e31578637dc78a19089f43e" +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.0.0" + istanbul-lib-coverage "^1.1.0" semver "^5.3.0" -istanbul-lib-report@^1.0.0-alpha.3: - version "1.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz#32d5f6ec7f33ca3a602209e278b2e6ff143498af" +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" dependencies: - async "^1.4.2" - istanbul-lib-coverage "^1.0.0-alpha" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" path-parse "^1.0.5" - rimraf "^2.4.3" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.0.tgz#9d429218f35b823560ea300a96ff0c3bbdab785f" +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" dependencies: - istanbul-lib-coverage "^1.0.0-alpha.0" + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" - rimraf "^2.4.4" + rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.1.tgz#9a17176bc4a6cbebdae52b2f15961d52fa623fbc" +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" dependencies: handlebars "^4.0.3" -jest: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-18.0.0.tgz#ef12f70befe0fcb30f1c61c0ae58748706267d4b" - dependencies: - jest-cli "^18.0.0" - -jest-changed-files@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-17.0.2.tgz#f5657758736996f590a51b87e5c9369d904ba7b7" - -jest-changed-files@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-19.0.0.tgz#8c1a43a4ffccbcb8ae12e819104585adf2ed93a6" +jest-changed-files@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.0.tgz#2ad82870a815b40ce3f4bf4555581d387b21022c" -jest-cli@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-18.0.0.tgz#11d141f5e9158d4f02c5c303815b5280f6887c55" +jest-cli@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.0.tgz#72664e0723bd099a0bade5bd4bf960fd54876069" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" - chalk "^1.1.1" - graceful-fs "^4.1.6" - is-ci "^1.0.9" - istanbul-api "^1.0.0-aplha.10" - istanbul-lib-coverage "^1.0.0" - istanbul-lib-instrument "^1.1.1" - jest-changed-files "^17.0.2" - jest-config "^18.0.0" - jest-environment-jsdom "^18.0.0" - jest-file-exists "^17.0.0" - jest-haste-map "^18.0.0" - jest-jasmine2 "^18.0.0" - jest-mock "^18.0.0" - jest-resolve "^18.0.0" - jest-resolve-dependencies "^18.0.0" - jest-runtime "^18.0.0" - jest-snapshot "^18.0.0" - jest-util "^18.0.0" - json-stable-stringify "^1.0.0" - node-notifier "^4.6.1" - sane "~1.4.1" - strip-ansi "^3.0.1" - throat "^3.0.0" - which "^1.1.1" - worker-farm "^1.3.1" - yargs "^6.3.0" - -jest-cli@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-19.0.1.tgz#79630200c3a33a0b15e81b369cf60c35552722c8" - dependencies: - ansi-escapes "^1.4.0" - callsites "^2.0.0" - chalk "^1.1.1" - graceful-fs "^4.1.6" - is-ci "^1.0.9" - istanbul-api "^1.1.0-alpha.1" - istanbul-lib-coverage "^1.0.0" - istanbul-lib-instrument "^1.1.1" - jest-changed-files "^19.0.0" - jest-config "^19.0.1" - jest-environment-jsdom "^19.0.1" - jest-haste-map "^19.0.0" - jest-jasmine2 "^19.0.1" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" - jest-resolve-dependencies "^19.0.0" - jest-runtime "^19.0.1" - jest-snapshot "^19.0.1" - jest-util "^19.0.1" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.0" + jest-config "^20.0.0" + jest-docblock "^20.0.0" + jest-environment-jsdom "^20.0.0" + jest-haste-map "^20.0.0" + jest-jasmine2 "^20.0.0" + jest-message-util "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve-dependencies "^20.0.0" + jest-runtime "^20.0.0" + jest-snapshot "^20.0.0" + jest-util "^20.0.0" micromatch "^2.3.11" - node-notifier "^5.0.1" + node-notifier "^5.0.2" + pify "^2.3.0" slash "^1.0.0" string-length "^1.0.1" throat "^3.0.0" - which "^1.1.1" + which "^1.2.12" worker-farm "^1.3.1" - yargs "^6.3.0" - -jest-config@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-18.0.0.tgz#21473ab68fef2fa79760d05419859b3c320e55e9" - dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^18.0.0" - jest-environment-node "^18.0.0" - jest-jasmine2 "^18.0.0" - jest-mock "^18.0.0" - jest-resolve "^18.0.0" - jest-util "^18.0.0" - json-stable-stringify "^1.0.0" - -jest-config@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.1.tgz#a50698aca3b70949ff4e3898d339a13e166d8fb8" - dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^19.0.1" - jest-environment-node "^19.0.1" - jest-jasmine2 "^19.0.1" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.0" - jest-validate "^19.0.0" - pretty-format "^19.0.0" - -jest-diff@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-18.0.0.tgz#f24b6f8bedaae425548511ab45edbfb9fee930b7" - dependencies: - chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^18.0.0" - pretty-format "^18.0.0" + yargs "^7.0.2" -jest-diff@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" +jest-config@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.0.tgz#295fe937a377f79a8eea240ad29546bf43acbbec" dependencies: chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^19.0.0" - pretty-format "^19.0.0" - -jest-environment-jsdom@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-18.0.0.tgz#7341266285abce09f13f60e9b49de899802b76c5" + glob "^7.1.1" + jest-environment-jsdom "^20.0.0" + jest-environment-node "^20.0.0" + jest-jasmine2 "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve "^20.0.0" + jest-validate "^20.0.0" + pretty-format "^20.0.0" + +jest-diff@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.0.tgz#d6e9190b57e0333c6706ef28d62b1cb23042d7eb" dependencies: - jest-mock "^18.0.0" - jest-util "^18.0.0" - jsdom "^9.8.1" + chalk "^1.1.3" + diff "^3.2.0" + jest-matcher-utils "^20.0.0" + pretty-format "^20.0.0" -jest-environment-jsdom@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.1.tgz#baf16bb10cbd54f3b9a3edb8fd88d11282b11f99" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.1" - jsdom "^9.11.0" +jest-docblock@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.0.tgz#5b647c4af36f52dae74df1949a8cb418d146ad3a" -jest-environment-node@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-18.0.0.tgz#6f4947b324d6b4e17df20b1998f532c161a2821d" +jest-environment-jsdom@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.0.tgz#a688499d817e33cdea6400c502d8d5f4aa01c808" dependencies: - jest-mock "^18.0.0" - jest-util "^18.0.0" + jest-mock "^20.0.0" + jest-util "^20.0.0" + jsdom "^9.12.0" -jest-environment-node@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.1.tgz#5a9170437bb8b99da139d79f01de20e8e37a3e34" +jest-environment-node@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.0.tgz#7016d8d1270cbc1ed71a10f242c78324297e1db8" dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.1" - -jest-file-exists@^17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-17.0.0.tgz#7f63eb73a1c43a13f461be261768b45af2cdd169" + jest-mock "^20.0.0" + jest-util "^20.0.0" -jest-file-exists@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" - -jest-haste-map@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-18.0.0.tgz#707d3b5ae3bcbda971c39e8b911d20ad8502c748" - dependencies: - fb-watchman "^1.9.0" - graceful-fs "^4.1.6" - multimatch "^2.1.0" - sane "~1.4.1" - worker-farm "^1.3.1" - -jest-haste-map@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.0.tgz#adde00b62b1fe04432a104b3254fc5004514b55e" +jest-haste-map@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.0.tgz#3b8d9255dfe2a6a96e516fe71dafd415e1b5d65f" dependencies: fb-watchman "^2.0.0" - graceful-fs "^4.1.6" + graceful-fs "^4.1.11" + jest-docblock "^20.0.0" micromatch "^2.3.11" - sane "~1.5.0" + sane "~1.6.0" worker-farm "^1.3.1" -jest-jasmine2@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-18.0.0.tgz#05a35ee8cf61dd6d6d04826aa0e5915a2167a877" - dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^18.0.0" - jest-matchers "^18.0.0" - jest-snapshot "^18.0.0" - jest-util "^18.0.0" - -jest-jasmine2@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.1.tgz#9a9ee34573fc15c4856ec32e65a0865ee878756e" - dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^19.0.0" - jest-matchers "^19.0.0" - jest-message-util "^19.0.0" - jest-snapshot "^19.0.1" - -jest-matcher-utils@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-18.0.0.tgz#74ad046aeb9414094fc6cd0d313847e4311f8538" +jest-jasmine2@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.0.tgz#2a0aba92ed36ec132901cfc2a552fd7cee6fde3d" dependencies: chalk "^1.1.3" - pretty-format "^18.0.0" + graceful-fs "^4.1.11" + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-matchers "^20.0.0" + jest-message-util "^20.0.0" + jest-snapshot "^20.0.0" + once "^1.4.0" + p-map "^1.1.1" -jest-matcher-utils@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" +jest-matcher-utils@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.0.tgz#2c5d9dd11670c5418ffc78baecf9094db9e91e09" dependencies: chalk "^1.1.3" - pretty-format "^19.0.0" - -jest-matchers@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-18.0.0.tgz#d081e2dfd556a0c9f11c7fdc26dc1702fad50189" - dependencies: - jest-diff "^18.0.0" - jest-matcher-utils "^18.0.0" - jest-util "^18.0.0" + pretty-format "^20.0.0" -jest-matchers@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" +jest-matchers@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.0.tgz#55498637bbb58f164d97c73610fb8d016dfac770" dependencies: - jest-diff "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-message-util "^20.0.0" + jest-regex-util "^20.0.0" -jest-message-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" +jest-message-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.0.tgz#060bac1980bd5e11134e8e1c19c94863d937c727" dependencies: - chalk "^1.1.1" + chalk "^1.1.3" micromatch "^2.3.11" + slash "^1.0.0" -jest-mock@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-18.0.0.tgz#5c248846ea33fa558b526f5312ab4a6765e489b3" - -jest-mock@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" - -jest-regex-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" - -jest-resolve-dependencies@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-18.0.0.tgz#a2980a634ae2554d8ed5922686883a2988979b70" - dependencies: - jest-file-exists "^17.0.0" - jest-resolve "^18.0.0" +jest-mock@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.0.tgz#3c54b94fe502ed57f2e602fab22ab196a7aa4b95" -jest-resolve-dependencies@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-19.0.0.tgz#a741ad1fa094140e64ecf2642a504f834ece22ee" - dependencies: - jest-file-exists "^19.0.0" +jest-regex-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.0.tgz#7f6051e9d00fdcccca52bade50aabdd9919bcfd2" -jest-resolve@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-18.0.0.tgz#a47b0b939d8c53fc79e907db0a5110384432f3c8" +jest-resolve-dependencies@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.0.tgz#616c6976c52e49d13e6420b1bcc8f380e701408f" dependencies: - browser-resolve "^1.11.2" - jest-file-exists "^17.0.0" - jest-haste-map "^18.0.0" - resolve "^1.1.6" + jest-regex-util "^20.0.0" -jest-resolve@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.0.tgz#83e6166d58ad9e31c8503e54b215e30ca56cb5ae" +jest-resolve@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.0.tgz#f9bfdfa31109aee2decfc3a07c2c354608cc5e1d" dependencies: browser-resolve "^1.11.2" - jest-haste-map "^19.0.0" - resolve "^1.2.0" + is-builtin-module "^1.0.0" + resolve "^1.3.2" -jest-runtime@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-18.0.0.tgz#fff982dffe061b89bbea5c3b6f4d3fbf7b3cf56e" - dependencies: - babel-core "^6.0.0" - babel-jest "^18.0.0" - babel-plugin-istanbul "^3.0.0" - chalk "^1.1.3" - graceful-fs "^4.1.6" - jest-config "^18.0.0" - jest-file-exists "^17.0.0" - jest-haste-map "^18.0.0" - jest-mock "^18.0.0" - jest-resolve "^18.0.0" - jest-snapshot "^18.0.0" - jest-util "^18.0.0" - json-stable-stringify "^1.0.0" - multimatch "^2.1.0" - yargs "^6.3.0" - -jest-runtime@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.1.tgz#7b584cbc690a500d9da148aba6a109bc9266a6b1" +jest-runtime@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.0.tgz#4c78c08573ffaeba9b8ceb096f705b75d5fb54a1" dependencies: babel-core "^6.0.0" - babel-jest "^19.0.0" + babel-jest "^20.0.0" babel-plugin-istanbul "^4.0.0" chalk "^1.1.3" - graceful-fs "^4.1.6" - jest-config "^19.0.1" - jest-file-exists "^19.0.0" - jest-haste-map "^19.0.0" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.0" - jest-util "^19.0.1" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.0" + jest-haste-map "^20.0.0" + jest-regex-util "^20.0.0" + jest-resolve "^20.0.0" + jest-util "^20.0.0" json-stable-stringify "^1.0.1" micromatch "^2.3.11" strip-bom "3.0.0" - yargs "^6.3.0" - -jest-snapshot@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-18.0.0.tgz#3602c6b13cbf5788fd101bf0d73fc76104b88486" - dependencies: - jest-diff "^18.0.0" - jest-file-exists "^17.0.0" - jest-matcher-utils "^18.0.0" - jest-util "^18.0.0" - natural-compare "^1.4.0" - pretty-format "^18.0.0" + yargs "^7.0.2" -jest-snapshot@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.1.tgz#5b8161f737b63b6973f7e6e222b473970b5a69d1" +jest-snapshot@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.0.tgz#fbe51d94ed1c6cd23808bb7ef82e58ca12a0ccf7" dependencies: chalk "^1.1.3" - jest-diff "^19.0.0" - jest-file-exists "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-util "^19.0.1" + jest-diff "^20.0.0" + jest-matcher-utils "^20.0.0" + jest-util "^20.0.0" natural-compare "^1.4.0" - pretty-format "^19.0.0" + pretty-format "^20.0.0" -jest-util@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-18.0.0.tgz#4ef7c397ad7e1ac8f9c63a482c12a31df5e376a7" +jest-util@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.0.tgz#5421322f196e884e962bc8b8bac4b009733caed9" dependencies: - chalk "^1.1.1" - diff "^3.0.0" - graceful-fs "^4.1.6" - jest-file-exists "^17.0.0" - jest-mock "^18.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.0" + jest-mock "^20.0.0" + jest-validate "^20.0.0" + leven "^2.1.0" mkdirp "^0.5.1" -jest-util@^19.0.1: - version "19.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.1.tgz#27235211a21280b42bc7c84d8f69e4e07c72cf9f" +jest-validate@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.0.tgz#c0832e8210190b6d5b39a46b8df536083131a7d7" dependencies: - chalk "^1.1.1" - graceful-fs "^4.1.6" - jest-file-exists "^19.0.0" - jest-message-util "^19.0.0" - jest-mock "^19.0.0" - jest-validate "^19.0.0" - leven "^2.0.0" - mkdirp "^0.5.1" + chalk "^1.1.3" + jest-matcher-utils "^20.0.0" + leven "^2.1.0" + pretty-format "^20.0.0" -jest-validate@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" +jest@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.0.tgz#58cf6abf328f2a2e3c4203890131cbe89d3b0769" dependencies: - chalk "^1.1.1" - jest-matcher-utils "^19.0.0" - leven "^2.0.0" - pretty-format "^19.0.0" + jest-cli "^20.0.0" jodid25519@^1.0.0: version "1.0.2" @@ -1957,24 +1270,24 @@ jodid25519@^1.0.0: dependencies: jsbn "~0.1.0" -js-tokens@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.7.0: - version "3.8.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" jsbn@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^9.11.0, jsdom@^9.8.1: - version "9.11.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.11.0.tgz#a95b0304e521a2ca5a63c6ea47bf7708a7a84591" +jsdom@^9.12.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" dependencies: abab "^1.0.3" acorn "^4.0.4" @@ -2000,15 +1313,11 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -2022,27 +1331,30 @@ json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +jsonfile@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" -jsonpointer@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" - jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" dependencies: + assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" kind-of@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" + version "3.2.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.0.tgz#b58abe4d5c044ad33726a8c1525b48cf891bff07" dependencies: - is-buffer "^1.0.2" + is-buffer "^1.1.5" lazy-cache@^1.0.3: version "1.0.4" @@ -2054,7 +1366,7 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -leven@^2.0.0: +leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -2075,6 +1387,15 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -2083,91 +1404,29 @@ locate-path@^2.0.0: path-exists "^3.0.0" lodash-es@^4.2.1: - version "4.17.2" - resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.2.tgz#59011b585166e613eb9dd5fc256b2cd1a30f3712" - -lodash._arraycopy@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1" - -lodash._arrayeach@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz#bab156b2a90d3f1bbd5c653403349e5e5933ef9e" - -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._baseclone@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz#303519bf6393fe7e42f34d8b630ef7794e3542b7" - dependencies: - lodash._arraycopy "^3.0.0" - lodash._arrayeach "^3.0.0" - lodash._baseassign "^3.0.0" - lodash._basefor "^3.0.0" - lodash.isarray "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basefor@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basefor/-/lodash._basefor-3.0.3.tgz#7550b4e9218ef09fad24343b612021c79b4c20c2" - -lodash._bindcallback@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash.assign@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - -lodash.clonedeep@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz#a0a1e40d82a5ea89ff5b147b8444ed63d92827db" - dependencies: - lodash._baseclone "^3.0.0" - lodash._bindcallback "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7" lodash@^4.0.0, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1: - version "4.17.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: - js-tokens "^2.0.0" + pseudomap "^1.0.1" + yallist "^2.0.0" makeerror@1.0.x: version "1.0.11" @@ -2175,19 +1434,11 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -marked-terminal@^1.6.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-1.7.0.tgz#c8c460881c772c7604b64367007ee5f77f125904" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" dependencies: - cardinal "^1.0.0" - chalk "^1.1.3" - cli-table "^0.3.1" - lodash.assign "^4.2.0" - node-emoji "^1.4.1" - -marked@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7" + mimic-fn "^1.0.0" merge@^1.1.3: version "1.2.0" @@ -2211,83 +1462,68 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.25.0: - version "1.25.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.25.0.tgz#c18dbd7c73a5dbf6f44a024dc0d165a1e7b1c392" +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.13" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.13.tgz#e07aaa9c6c6b9a7ca3012c69003ad25a39e92a88" + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" dependencies: - mime-db "~1.25.0" + mime-db "~1.27.0" + +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +minimatch@^3.0.2, minimatch@^3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.1, minimist@^1.2.0: +minimist@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" + +minimist@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.1: +mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -most, most@^1.1.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/most/-/most-1.2.2.tgz#8f12e434ad6195ed2e1efb3ec217e0cbcf3e1de8" - dependencies: - "@most/multicast" "^1.2.5" - "@most/prelude" "^1.4.0" - symbol-observable "^1.0.2" - most-subject@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/most-subject/-/most-subject-5.2.0.tgz#4976c169589ceaca08be77d49b95885238bc8373" + version "5.3.0" + resolved "https://registry.yarnpkg.com/most-subject/-/most-subject-5.3.0.tgz#3a6e3efd436fa93bd8b33c2a239c9088230a6102" dependencies: "@most/multicast" "^1.2.4" "@most/prelude" "^1.4.1" most "^1.1.0" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - -multimatch@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" +most@^1.1.0, most@^1.2.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/most/-/most-1.3.0.tgz#148f96c311ce26cace63a179d10dd61dacee58f4" dependencies: - array-differ "^1.0.0" - array-union "^1.0.1" - arrify "^1.0.0" - minimatch "^3.0.0" + "@most/multicast" "^1.2.5" + "@most/prelude" "^1.4.0" + symbol-observable "^1.0.2" -nan@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" +ms@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -node-emoji@^1.4.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.4.3.tgz#5272f70b823c4df6d7c39f84fd8203f35b3e5d36" - dependencies: - string.prototype.codepointat "^0.2.0" - node-fetch@^1.0.1: version "1.6.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" @@ -2299,50 +1535,18 @@ node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" -node-notifier@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-4.6.1.tgz#056d14244f3dcc1ceadfe68af9cff0c5473a33f3" - dependencies: - cli-usage "^0.1.1" - growly "^1.2.0" - lodash.clonedeep "^3.0.0" - minimist "^1.1.1" - semver "^5.1.0" - shellwords "^0.1.0" - which "^1.0.5" - -node-notifier@^5.0.1: - version "5.0.2" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.0.2.tgz#4438449fe69e321f941cef943986b0797032701b" +node-notifier@^5.0.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" dependencies: growly "^1.3.0" semver "^5.3.0" shellwords "^0.1.0" which "^1.2.12" -node-pre-gyp@^0.6.29: - version "0.6.32" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" - dependencies: - mkdirp "~0.5.1" - nopt "~3.0.6" - npmlog "^4.0.1" - rc "~1.1.6" - request "^2.79.0" - rimraf "~2.5.4" - semver "~5.3.0" - tar "~2.2.1" - tar-pack "~3.3.0" - -nopt@~3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - dependencies: - abbrev "1" - normalize-package-data@^2.3.2: - version "2.3.5" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -2350,17 +1554,16 @@ normalize-package-data@^2.3.2: validate-npm-package-license "^3.0.1" normalize-path@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" -npmlog@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.1.tgz#d14f503b4cd79710375553004ba96e6662fbc0b8" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.1" - set-blocking "~2.0.0" + path-key "^2.0.0" number-is-nan@^1.0.0: version "1.0.1" @@ -2374,9 +1577,9 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.0.0, object-assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" object.omit@^2.0.0: version "2.0.1" @@ -2391,12 +1594,6 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" -once@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -2425,17 +1622,21 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" +os-locale@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" + dependencies: + execa "^0.5.0" + lcid "^1.0.0" + mem "^1.1.0" + os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -output-file-sync@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" p-limit@^1.1.0: version "1.1.0" @@ -2447,6 +1648,10 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2480,6 +1685,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -2492,7 +1701,17 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -pify@^2.0.0: +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -2506,6 +1725,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2514,25 +1739,15 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-18.0.0.tgz#5f45c59fe2ed6749d46765429679670b08b21137" - dependencies: - ansi-styles "^2.2.1" - -pretty-format@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" +pretty-format@^20.0.0: + version "20.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.0.tgz#bd100f330e707e4f49fef3f234d6e915242a6e7e" dependencies: ansi-styles "^3.0.0" -private@^0.1.6, private@~0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +private@^0.1.6: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" promise@^7.1.1: version "7.1.1" @@ -2541,22 +1756,27 @@ promise@^7.1.1: asap "~2.0.3" prop-types@^15.5.7, prop-types@^15.5.8, prop-types@~15.5.7: - version "15.5.8" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394" + version "15.5.9" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.9.tgz#d478eef0e761396942f70c78e772f76e8be747c9" dependencies: fbjs "^0.8.9" + loose-envify "^1.3.1" prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@~6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" randomatic@^1.1.3: version "1.1.6" @@ -2565,18 +1785,12 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -rc@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" - dependencies: - deep-extend "~0.4.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~1.0.4" - react-addons-test-utils@^15.2.0: - version "15.4.1" - resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.4.1.tgz#1e4caab151bf27cce26df5f9cb714f4fd8359ae1" + version "15.5.1" + resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.5.1.tgz#e0d258cda2a122ad0dff69f838260d0c3958f5f7" + dependencies: + fbjs "^0.8.4" + object-assign "^4.1.0" react-dom@^15.5.4: version "15.5.4" @@ -2607,6 +1821,13 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -2615,44 +1836,13 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - -redeyed@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-1.0.1.tgz#e96c193b40c0816b00aec842698e61185e55498a" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" dependencies: - esprima "~3.0.0" + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" redux@^3.0.4: version "3.6.0" @@ -2663,13 +1853,9 @@ redux@^3.0.4: loose-envify "^1.1.0" symbol-observable "^1.0.2" -regenerate@^1.2.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" - -regenerator-runtime@^0.9.5: - version "0.9.6" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.9.6.tgz#d33eb95d0d2001a4be39659707c51b0cb71ce029" +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" regex-cache@^0.4.2: version "0.4.3" @@ -2678,23 +1864,9 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" -regexpu-core@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" - -regjsgen@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - -regjsparser@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - dependencies: - jsesc "~0.5.0" +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" repeat-element@^1.1.2: version "1.1.2" @@ -2711,17 +1883,17 @@ repeating@^2.0.0: is-finite "^1.0.0" request@^2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: aws-sign2 "~0.6.0" aws4 "^1.2.1" - caseless "~0.11.0" + caseless "~0.12.0" combined-stream "~1.0.5" extend "~3.0.0" forever-agent "~0.6.1" form-data "~2.1.1" - har-validator "~2.0.6" + har-validator "~4.2.1" hawk "~3.1.3" http-signature "~1.1.0" is-typedarray "~1.0.0" @@ -2729,10 +1901,12 @@ request@^2.79.0: json-stringify-safe "~5.0.1" mime-types "~2.1.7" oauth-sign "~0.8.1" - qs "~6.3.0" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" stringstream "~0.0.4" tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" + tunnel-agent "^0.6.0" uuid "^3.0.0" require-directory@^2.1.1: @@ -2743,13 +1917,15 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -resolve@1.1.7, resolve@^1.1.6: +resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" +resolve@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" right-align@^0.1.1: version "0.1.3" @@ -2757,32 +1933,25 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" +rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" rxjs@^5.0.0-rc.4: - version "5.0.0-rc.5" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.0.0-rc.5.tgz#8cbd17fc242a54c07ef9116da23b0ec8e7d5cea9" + version "5.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.0.tgz#a7db14ab157f9d7aac6a56e655e7a3860d39bf26" dependencies: symbol-observable "^1.0.1" -sane@~1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.4.1.tgz#88f763d74040f5f0c256b6163db399bf110ac715" - dependencies: - exec-sh "^0.2.0" - fb-watchman "^1.8.0" - minimatch "^3.0.2" - minimist "^1.1.1" - walker "~1.0.5" - watch "~0.10.0" +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" -sane@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" dependencies: anymatch "^1.3.0" exec-sh "^0.2.0" @@ -2796,18 +1965,14 @@ sax@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -2830,11 +1995,11 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -source-map-support@^0.4.2: - version "0.4.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.6.tgz#32552aa64b458392a85eab3b0b5ee61527167aeb" +source-map-support@^0.4.2, source-map-support@^0.4.4: + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" dependencies: - source-map "^0.5.3" + source-map "^0.5.6" source-map@^0.4.4: version "0.4.4" @@ -2842,7 +2007,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -2871,8 +2036,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" + version "1.13.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -2899,13 +2064,12 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string.prototype.codepointat@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/string.prototype.codepointat/-/string.prototype.codepointat-0.2.0.tgz#6b26e9bd3afcaa7be3b4269b526de1b82000ac78" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" stringstream@~0.0.4: version "0.0.5" @@ -2917,7 +2081,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@3.0.0: +strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -2927,21 +2091,21 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" -strip-json-comments@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" +strip-json-comments@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" supports-color@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: has-flag "^1.0.0" @@ -2953,40 +2117,9 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -tar-pack@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" - dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" - -tar@~2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" - -test-exclude@^3.2.2: - version "3.3.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - -test-exclude@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.0.tgz#0ddc0100b8ae7e88b34eb4fd98a907e961991900" +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -3003,8 +2136,8 @@ tmpl@1.0.x: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" to-fast-properties@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" @@ -3016,13 +2149,41 @@ tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-jest@^20.0.2: + version "20.0.2" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-20.0.2.tgz#d22a48d3da305259e7e1bbbaf3f8c4bfd0b5aea7" + dependencies: + babel-jest "^20.0.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + fs-extra "^3.0.0" + glob-all "^3.1.0" + jest-config "^20.0.0" + jest-util "^20.0.0" + pkg-dir "^2.0.0" + source-map-support "^0.4.4" + tsconfig "^6.0.0" + yargs "^8.0.1" + +tsconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" + dependencies: + strip-bom "^3.0.0" + strip-json-comments "^2.0.0" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.4" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.4.tgz#8c9dbfb52795686f166cd2023794bcf103d13c2b" + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" type-check@~0.3.2: version "0.3.2" @@ -3039,40 +2200,26 @@ ua-parser-js@^0.7.9: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" uglify-js@^2.6: - version "2.7.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" + version "2.8.23" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.23.tgz#8230dd9783371232d62a7821e2cf9a817270a8a0" dependencies: - async "~0.2.6" source-map "~0.5.1" - uglify-to-browserify "~1.0.0" yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uid-number@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +universalify@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" -v8flags@^2.0.10: - version "2.0.11" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881" - dependencies: - user-home "^1.1.1" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" @@ -3111,12 +2258,12 @@ whatwg-encoding@^1.0.1: iconv-lite "0.4.13" whatwg-fetch@>=0.10.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.1.tgz#078b9461bbe91cea73cbce8bb122a05f9e92b772" + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" whatwg-url@^4.3.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.5.0.tgz#79bb6f0e370a4dda1cbc8f3062a490cf8bbb09ea" + version "4.7.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -3125,26 +2272,20 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.0.5, which@^1.1.1, which@^1.2.12: - version "1.2.12" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" - dependencies: - isexe "^1.1.1" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -wide-align@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" +which@^1.2.12, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: - string-width "^1.0.1" + isexe "^2.0.0" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -window-size@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" @@ -3179,7 +2320,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0: +"xtend@>=4.0.0 <4.1.0-0": version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -3187,15 +2328,25 @@ y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" -yargs-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.0.tgz#6ced869cd05a3dca6a1eaee38b68aeed4b0b4101" +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" dependencies: camelcase "^3.0.0" -yargs@^6.3.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.5.0.tgz#a902e23a1f0fe912b2a03f6131b7ed740c9718ff" +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + dependencies: + camelcase "^4.1.0" + +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" dependencies: camelcase "^3.0.0" cliui "^3.2.0" @@ -3208,9 +2359,32 @@ yargs@^6.3.0: set-blocking "^2.0.0" string-width "^1.0.2" which-module "^1.0.0" - window-size "^0.2.0" y18n "^3.2.1" - yargs-parser "^4.2.0" + yargs-parser "^5.0.0" + +yargs@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa" + dependencies: + camelcase "^4.1.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + read-pkg-up "^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 "^7.0.0" + +yargs@~1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b" + dependencies: + minimist "^0.1.0" yargs@~3.10.0: version "3.10.0" From 276c4928f7c954ab95053d05673e69808ccaf67c Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Wed, 10 May 2017 23:28:12 +0800 Subject: [PATCH 19/19] bump react-most spec to 1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 44a7536..db5df84 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "react": "^15.5.4", "react-addons-test-utils": "^15.2.0", "react-dom": "^15.5.4", - "react-most-spec": "^0.2.3", + "react-most-spec": "^1.0.0", "redux": "^3.0.4", "ts-jest": "^20.0.2", "typescript": "^2.3.2"