diff --git a/CHANGELOG b/CHANGELOG index eaff725b77..a11757a157 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +v0.5.0 +Sat, 26 Jul 2014 22:38:36 GMT + +5af49d4 [changed] Split component from + + v0.4.2 Sat, 26 Jul 2014 18:23:43 GMT diff --git a/bower.json b/bower.json index 0994171e92..5fb0dc70d0 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "0.4.2", + "version": "0.5.0", "homepage": "https://github.com/rackt/react-router", "authors": [ "Ryan Florence", diff --git a/dist/react-router.js b/dist/react-router.js index 7026b68439..ceb0999a83 100644 --- a/dist/react-router.js +++ b/dist/react-router.js @@ -18,7 +18,7 @@ function Router(route) { module.exports = Router; -},{"react/lib/warning":50}],2:[function(_dereq_,module,exports){ +},{"react/lib/warning":51}],2:[function(_dereq_,module,exports){ var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null); var ActiveState = _dereq_('../mixins/ActiveState'); var withoutProperties = _dereq_('../helpers/withoutProperties'); @@ -156,20 +156,9 @@ function isModifiedEvent(event) { module.exports = Link; -},{"../helpers/makeHref":7,"../helpers/transitionTo":11,"../helpers/withoutProperties":12,"../mixins/ActiveState":14}],3:[function(_dereq_,module,exports){ +},{"../helpers/makeHref":8,"../helpers/transitionTo":12,"../helpers/withoutProperties":13,"../mixins/ActiveState":15}],3:[function(_dereq_,module,exports){ var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null); -var warning = _dereq_('react/lib/warning'); -var ExecutionEnvironment = _dereq_('react/lib/ExecutionEnvironment'); -var mergeProperties = _dereq_('../helpers/mergeProperties'); -var goBack = _dereq_('../helpers/goBack'); -var replaceWith = _dereq_('../helpers/replaceWith'); -var transitionTo = _dereq_('../helpers/transitionTo'); var withoutProperties = _dereq_('../helpers/withoutProperties'); -var Path = _dereq_('../helpers/Path'); -var ActiveStore = _dereq_('../stores/ActiveStore'); -var RouteStore = _dereq_('../stores/RouteStore'); -var URLStore = _dereq_('../stores/URLStore'); -var Promise = _dereq_('es6-promise').Promise; /** * A map of component props that are reserved for use by the @@ -177,18 +166,12 @@ var Promise = _dereq_('es6-promise').Promise; * are passed through to the route handler. */ var RESERVED_PROPS = { - location: true, handler: true, name: true, path: true, children: true // ReactChildren }; -/** - * The ref name that can be used to reference the active route component. - */ -var REF_NAME = '__activeRoute__'; - /** * components specify components that are rendered to the page when the * URL matches a given pattern. @@ -207,18 +190,18 @@ var REF_NAME = '__activeRoute__'; * a great way to visualize how routes are laid out in an application. * * React.renderComponent(( - * + * * * * - * + * * ), document.body); * * If you don't use JSX, you can also assemble a Router programmatically using * the standard React component JavaScript API. * * React.renderComponent(( - * Route({ handler: App }, + * Routes({ handler: App }, * Route({ name: 'login', handler: Login }), * Route({ name: 'logout', handler: Logout }), * Route({ name: 'about', handler: About }) @@ -241,6 +224,60 @@ var REF_NAME = '__activeRoute__'; var Route = React.createClass({ displayName: 'Route', + statics: { + + getUnreservedProps: function (props) { + return withoutProperties(props, RESERVED_PROPS); + }, + + }, + + propTypes: { + handler: React.PropTypes.any.isRequired, + path: React.PropTypes.string, + name: React.PropTypes.string + }, + + render: function () { + throw new Error( + 'The component should not be rendered directly. You may be ' + + 'missing a wrapper around your list of routes.'); + } + +}); + +module.exports = Route; + +},{"../helpers/withoutProperties":13}],4:[function(_dereq_,module,exports){ +var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null); +var warning = _dereq_('react/lib/warning'); +var ExecutionEnvironment = _dereq_('react/lib/ExecutionEnvironment'); +var mergeProperties = _dereq_('../helpers/mergeProperties'); +var goBack = _dereq_('../helpers/goBack'); +var replaceWith = _dereq_('../helpers/replaceWith'); +var transitionTo = _dereq_('../helpers/transitionTo'); +var withoutProperties = _dereq_('../helpers/withoutProperties'); +var Route = _dereq_('../components/Route'); +var Path = _dereq_('../helpers/Path'); +var ActiveStore = _dereq_('../stores/ActiveStore'); +var RouteStore = _dereq_('../stores/RouteStore'); +var URLStore = _dereq_('../stores/URLStore'); +var Promise = _dereq_('es6-promise').Promise; + +/** + * The ref name that can be used to reference the active route component. + */ +var REF_NAME = '__activeRoute__'; + +/** + * The component configures the route hierarchy and renders the + * route matching the current location when rendered into a document. + * + * See the component for more details. + */ +var Routes = React.createClass({ + displayName: 'Routes', + statics: { getUnreservedProps: function (props) { @@ -259,7 +296,7 @@ var Route = React.createClass({ * Handles cancelled transitions. By default, redirects replace the * current URL and aborts roll it back. */ - handleCancelledTransition: function (transition, route) { + handleCancelledTransition: function (transition, routes) { var reason = transition.cancelReason; if (reason instanceof Redirect) { @@ -273,9 +310,6 @@ var Route = React.createClass({ propTypes: { location: React.PropTypes.oneOf([ 'hash', 'history' ]).isRequired, - handler: React.PropTypes.any.isRequired, - path: React.PropTypes.string, - name: React.PropTypes.string }, getDefaultProps: function () { @@ -289,7 +323,9 @@ var Route = React.createClass({ }, componentWillMount: function () { - RouteStore.registerRoute(this); + React.Children.forEach(this.props.children, function (child) { + RouteStore.registerRoute(child); + }); if (!URLStore.isSetup() && ExecutionEnvironment.canUseDOM) URLStore.setup(this.props.location); @@ -316,18 +352,26 @@ var Route = React.createClass({ * object that contains the URL parameters relevant to that route. Returns * null if no route in the tree matches the path. * - * ( + * ( * * * * - * + * * ).match('/posts/123'); => [ { route: , params: {} }, * { route: , params: {} }, * { route: , params: { id: '123' } } ] */ match: function (path) { - return findMatches(Path.withoutQuery(path), this); + var rootRoutes = this.props.children; + if (!Array.isArray(rootRoutes)) { + rootRoutes = [rootRoutes]; + } + var matches = null; + for (var i = 0; matches == null && i < rootRoutes.length; i++) { + matches = findMatches(Path.withoutQuery(path), rootRoutes[i]); + } + return matches; }, /** @@ -356,11 +400,11 @@ var Route = React.createClass({ */ dispatch: function (path, returnRejectedPromise) { var transition = new Transition(path); - var route = this; + var routes = this; - var promise = syncWithTransition(route, transition).then(function (newState) { + var promise = syncWithTransition(routes, transition).then(function (newState) { if (transition.isCancelled) { - Route.handleCancelledTransition(transition, route); + Routes.handleCancelledTransition(transition, routes); } else if (newState) { ActiveStore.updateState(newState); } @@ -372,7 +416,7 @@ var Route = React.createClass({ promise = promise.then(undefined, function (error) { // Use setTimeout to break the promise chain. setTimeout(function () { - Route.handleAsyncError(error, route); + Routes.handleAsyncError(error, routes); }); }); } @@ -384,7 +428,13 @@ var Route = React.createClass({ if (!this.state.path) return null; - return this.props.handler(computeHandlerProps(this.state.matches || [], this.state.activeQuery)); + var matches = this.state.matches; + if (matches.length) { + // matches[0] corresponds to the top-most match + return matches[0].route.props.handler(computeHandlerProps(matches, this.state.activeQuery)); + } else { + return null; + } } }); @@ -492,12 +542,12 @@ function updateMatchComponents(matches, refs) { * if they all pass successfully. Returns a promise that resolves to the new * state if it needs to be updated, or undefined if not. */ -function syncWithTransition(route, transition) { - if (route.state.path === transition.path) +function syncWithTransition(routes, transition) { + if (routes.state.path === transition.path) return Promise.resolve(); // Nothing to do! - var currentMatches = route.state.matches; - var nextMatches = route.match(transition.path); + var currentMatches = routes.state.matches; + var nextMatches = routes.match(transition.path); warning( nextMatches, @@ -510,7 +560,7 @@ function syncWithTransition(route, transition) { var fromMatches, toMatches; if (currentMatches) { - updateMatchComponents(currentMatches, route.refs); + updateMatchComponents(currentMatches, routes.refs); fromMatches = currentMatches.filter(function (match) { return !hasMatch(nextMatches, match); @@ -545,7 +595,7 @@ function syncWithTransition(route, transition) { }) }; - route.setState(state); + routes.setState(state); return state; }); @@ -594,8 +644,8 @@ function checkTransitionToHooks(matches, transition) { } /** - * Returns a props object for a component that renders the routes in the - * given matches. + * Given an array of matches as returned by findMatches, return a descriptor for + * the handler hierarchy specified by the route. */ function computeHandlerProps(matches, query) { var props = { @@ -642,9 +692,9 @@ function reversedArray(array) { return array.slice(0).reverse(); } -module.exports = Route; +module.exports = Routes; -},{"../helpers/Path":4,"../helpers/goBack":6,"../helpers/mergeProperties":9,"../helpers/replaceWith":10,"../helpers/transitionTo":11,"../helpers/withoutProperties":12,"../stores/ActiveStore":15,"../stores/RouteStore":16,"../stores/URLStore":17,"es6-promise":21,"react/lib/ExecutionEnvironment":46,"react/lib/warning":50}],4:[function(_dereq_,module,exports){ +},{"../components/Route":3,"../helpers/Path":5,"../helpers/goBack":7,"../helpers/mergeProperties":10,"../helpers/replaceWith":11,"../helpers/transitionTo":12,"../helpers/withoutProperties":13,"../stores/ActiveStore":16,"../stores/RouteStore":17,"../stores/URLStore":18,"es6-promise":22,"react/lib/ExecutionEnvironment":47,"react/lib/warning":51}],5:[function(_dereq_,module,exports){ var invariant = _dereq_('react/lib/invariant'); var qs = _dereq_('querystring'); var mergeProperties = _dereq_('./mergeProperties'); @@ -688,6 +738,9 @@ var Path = { * pattern does not match the given path. */ extractParams: function (pattern, path) { + if (!pattern) + return null; + if (!isDynamicPattern(pattern)) { if (pattern === URL.decode(path)) return {}; // No dynamic segments, but the paths match. @@ -714,6 +767,8 @@ var Path = { * Returns an array of the names of all parameters in the given pattern. */ extractParamNames: function (pattern) { + if (!pattern) + return []; return compilePattern(pattern).paramNames; }, @@ -722,6 +777,9 @@ var Path = { * if there is a dynamic segment of the route path for which there is no param. */ injectParams: function (pattern, params) { + if (!pattern) + return null; + if (!isDynamicPattern(pattern)) return pattern; @@ -785,7 +843,7 @@ var Path = { module.exports = Path; -},{"./URL":5,"./mergeProperties":9,"querystring":20,"react/lib/invariant":49}],5:[function(_dereq_,module,exports){ +},{"./URL":6,"./mergeProperties":10,"querystring":21,"react/lib/invariant":50}],6:[function(_dereq_,module,exports){ var urlEncodedSpaceRE = /\+/g; var encodedSpaceRE = /%20/g; @@ -809,7 +867,7 @@ var URL = { module.exports = URL; -},{}],6:[function(_dereq_,module,exports){ +},{}],7:[function(_dereq_,module,exports){ var URLStore = _dereq_('../stores/URLStore'); function goBack() { @@ -818,7 +876,7 @@ function goBack() { module.exports = goBack; -},{"../stores/URLStore":17}],7:[function(_dereq_,module,exports){ +},{"../stores/URLStore":18}],8:[function(_dereq_,module,exports){ var URLStore = _dereq_('../stores/URLStore'); var makePath = _dereq_('./makePath'); @@ -837,7 +895,7 @@ function makeHref(routeName, params, query) { module.exports = makeHref; -},{"../stores/URLStore":17,"./makePath":8}],8:[function(_dereq_,module,exports){ +},{"../stores/URLStore":18,"./makePath":9}],9:[function(_dereq_,module,exports){ var invariant = _dereq_('react/lib/invariant'); var RouteStore = _dereq_('../stores/RouteStore'); var Path = _dereq_('./Path'); @@ -867,7 +925,7 @@ function makePath(to, params, query) { module.exports = makePath; -},{"../stores/RouteStore":16,"./Path":4,"react/lib/invariant":49}],9:[function(_dereq_,module,exports){ +},{"../stores/RouteStore":17,"./Path":5,"react/lib/invariant":50}],10:[function(_dereq_,module,exports){ function mergeProperties(object, properties) { for (var property in properties) { if (properties.hasOwnProperty(property)) @@ -879,7 +937,7 @@ function mergeProperties(object, properties) { module.exports = mergeProperties; -},{}],10:[function(_dereq_,module,exports){ +},{}],11:[function(_dereq_,module,exports){ var URLStore = _dereq_('../stores/URLStore'); var makePath = _dereq_('./makePath'); @@ -893,7 +951,7 @@ function replaceWith(to, params, query) { module.exports = replaceWith; -},{"../stores/URLStore":17,"./makePath":8}],11:[function(_dereq_,module,exports){ +},{"../stores/URLStore":18,"./makePath":9}],12:[function(_dereq_,module,exports){ var URLStore = _dereq_('../stores/URLStore'); var makePath = _dereq_('./makePath'); @@ -907,7 +965,7 @@ function transitionTo(to, params, query) { module.exports = transitionTo; -},{"../stores/URLStore":17,"./makePath":8}],12:[function(_dereq_,module,exports){ +},{"../stores/URLStore":18,"./makePath":9}],13:[function(_dereq_,module,exports){ function withoutProperties(object, properties) { var result = {}; @@ -921,9 +979,10 @@ function withoutProperties(object, properties) { module.exports = withoutProperties; -},{}],13:[function(_dereq_,module,exports){ +},{}],14:[function(_dereq_,module,exports){ exports.Link = _dereq_('./components/Link'); exports.Route = _dereq_('./components/Route'); +exports.Routes = _dereq_('./components/Routes'); exports.goBack = _dereq_('./helpers/goBack'); exports.replaceWith = _dereq_('./helpers/replaceWith'); @@ -935,7 +994,7 @@ exports.ActiveState = _dereq_('./mixins/ActiveState'); // remove this when we ship 1.0. exports.Router = _dereq_('./Router'); -},{"./Router":1,"./components/Link":2,"./components/Route":3,"./helpers/goBack":6,"./helpers/replaceWith":10,"./helpers/transitionTo":11,"./mixins/ActiveState":14}],14:[function(_dereq_,module,exports){ +},{"./Router":1,"./components/Link":2,"./components/Route":3,"./components/Routes":4,"./helpers/goBack":7,"./helpers/replaceWith":11,"./helpers/transitionTo":12,"./mixins/ActiveState":15}],15:[function(_dereq_,module,exports){ var ActiveStore = _dereq_('../stores/ActiveStore'); /** @@ -1002,7 +1061,7 @@ var ActiveState = { module.exports = ActiveState; -},{"../stores/ActiveStore":15}],15:[function(_dereq_,module,exports){ +},{"../stores/ActiveStore":16}],16:[function(_dereq_,module,exports){ var _activeRoutes = []; var _activeParams = {}; var _activeQuery = {}; @@ -1090,9 +1149,10 @@ var ActiveStore = { module.exports = ActiveStore; -},{"event-emitter":31}],16:[function(_dereq_,module,exports){ +},{"event-emitter":32}],17:[function(_dereq_,module,exports){ var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null); var invariant = _dereq_('react/lib/invariant'); +var warning = _dereq_('react/lib/warning'); var Path = _dereq_('../helpers/Path'); var _namedRoutes = {}; @@ -1180,7 +1240,7 @@ var RouteStore = { module.exports = RouteStore; -},{"../helpers/Path":4,"react/lib/invariant":49}],17:[function(_dereq_,module,exports){ +},{"../helpers/Path":5,"react/lib/invariant":50,"react/lib/warning":51}],18:[function(_dereq_,module,exports){ var ExecutionEnvironment = _dereq_('react/lib/ExecutionEnvironment'); var invariant = _dereq_('react/lib/invariant'); var warning = _dereq_('react/lib/warning'); @@ -1367,7 +1427,7 @@ var URLStore = { module.exports = URLStore; -},{"event-emitter":31,"react/lib/ExecutionEnvironment":46,"react/lib/invariant":49,"react/lib/warning":50}],18:[function(_dereq_,module,exports){ +},{"event-emitter":32,"react/lib/ExecutionEnvironment":47,"react/lib/invariant":50,"react/lib/warning":51}],19:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -1453,7 +1513,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],19:[function(_dereq_,module,exports){ +},{}],20:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -1540,19 +1600,19 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],20:[function(_dereq_,module,exports){ +},{}],21:[function(_dereq_,module,exports){ 'use strict'; exports.decode = exports.parse = _dereq_('./decode'); exports.encode = exports.stringify = _dereq_('./encode'); -},{"./decode":18,"./encode":19}],21:[function(_dereq_,module,exports){ +},{"./decode":19,"./encode":20}],22:[function(_dereq_,module,exports){ "use strict"; var Promise = _dereq_("./promise/promise").Promise; var polyfill = _dereq_("./promise/polyfill").polyfill; exports.Promise = Promise; exports.polyfill = polyfill; -},{"./promise/polyfill":25,"./promise/promise":26}],22:[function(_dereq_,module,exports){ +},{"./promise/polyfill":26,"./promise/promise":27}],23:[function(_dereq_,module,exports){ "use strict"; /* global toString */ @@ -1646,7 +1706,7 @@ function all(promises) { } exports.all = all; -},{"./utils":30}],23:[function(_dereq_,module,exports){ +},{"./utils":31}],24:[function(_dereq_,module,exports){ "use strict"; var browserGlobal = (typeof window !== 'undefined') ? window : {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; @@ -1708,7 +1768,7 @@ function asap(callback, arg) { } exports.asap = asap; -},{}],24:[function(_dereq_,module,exports){ +},{}],25:[function(_dereq_,module,exports){ "use strict"; var config = { instrument: false @@ -1724,7 +1784,7 @@ function configure(name, value) { exports.config = config; exports.configure = configure; -},{}],25:[function(_dereq_,module,exports){ +},{}],26:[function(_dereq_,module,exports){ "use strict"; /*global self*/ var RSVPPromise = _dereq_("./promise").Promise; @@ -1763,7 +1823,7 @@ function polyfill() { } exports.polyfill = polyfill; -},{"./promise":26,"./utils":30}],26:[function(_dereq_,module,exports){ +},{"./promise":27,"./utils":31}],27:[function(_dereq_,module,exports){ "use strict"; var config = _dereq_("./config").config; var configure = _dereq_("./config").configure; @@ -1975,7 +2035,7 @@ function publishRejection(promise) { } exports.Promise = Promise; -},{"./all":22,"./asap":23,"./config":24,"./race":27,"./reject":28,"./resolve":29,"./utils":30}],27:[function(_dereq_,module,exports){ +},{"./all":23,"./asap":24,"./config":25,"./race":28,"./reject":29,"./resolve":30,"./utils":31}],28:[function(_dereq_,module,exports){ "use strict"; /* global toString */ var isArray = _dereq_("./utils").isArray; @@ -2065,7 +2125,7 @@ function race(promises) { } exports.race = race; -},{"./utils":30}],28:[function(_dereq_,module,exports){ +},{"./utils":31}],29:[function(_dereq_,module,exports){ "use strict"; /** `RSVP.reject` returns a promise that will become rejected with the passed @@ -2113,7 +2173,7 @@ function reject(reason) { } exports.reject = reject; -},{}],29:[function(_dereq_,module,exports){ +},{}],30:[function(_dereq_,module,exports){ "use strict"; function resolve(value) { /*jshint validthis:true */ @@ -2129,7 +2189,7 @@ function resolve(value) { } exports.resolve = resolve; -},{}],30:[function(_dereq_,module,exports){ +},{}],31:[function(_dereq_,module,exports){ "use strict"; function objectOrFunction(x) { return isFunction(x) || (typeof x === "object" && x !== null); @@ -2152,7 +2212,7 @@ exports.objectOrFunction = objectOrFunction; exports.isFunction = isFunction; exports.isArray = isArray; exports.now = now; -},{}],31:[function(_dereq_,module,exports){ +},{}],32:[function(_dereq_,module,exports){ 'use strict'; var d = _dereq_('d') @@ -2286,7 +2346,7 @@ module.exports = exports = function (o) { }; exports.methods = methods; -},{"d":32,"es5-ext/object/valid-callable":41}],32:[function(_dereq_,module,exports){ +},{"d":33,"es5-ext/object/valid-callable":42}],33:[function(_dereq_,module,exports){ 'use strict'; var assign = _dereq_('es5-ext/object/assign') @@ -2351,14 +2411,14 @@ d.gs = function (dscr, get, set/*, options*/) { return !options ? desc : assign(normalizeOpts(options), desc); }; -},{"es5-ext/object/assign":33,"es5-ext/object/is-callable":36,"es5-ext/object/normalize-options":40,"es5-ext/string/#/contains":43}],33:[function(_dereq_,module,exports){ +},{"es5-ext/object/assign":34,"es5-ext/object/is-callable":37,"es5-ext/object/normalize-options":41,"es5-ext/string/#/contains":44}],34:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./is-implemented')() ? Object.assign : _dereq_('./shim'); -},{"./is-implemented":34,"./shim":35}],34:[function(_dereq_,module,exports){ +},{"./is-implemented":35,"./shim":36}],35:[function(_dereq_,module,exports){ 'use strict'; module.exports = function () { @@ -2369,7 +2429,7 @@ module.exports = function () { return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy'; }; -},{}],35:[function(_dereq_,module,exports){ +},{}],36:[function(_dereq_,module,exports){ 'use strict'; var keys = _dereq_('../keys') @@ -2393,21 +2453,21 @@ module.exports = function (dest, src/*, …srcn*/) { return dest; }; -},{"../keys":37,"../valid-value":42}],36:[function(_dereq_,module,exports){ +},{"../keys":38,"../valid-value":43}],37:[function(_dereq_,module,exports){ // Deprecated 'use strict'; module.exports = function (obj) { return typeof obj === 'function'; }; -},{}],37:[function(_dereq_,module,exports){ +},{}],38:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./is-implemented')() ? Object.keys : _dereq_('./shim'); -},{"./is-implemented":38,"./shim":39}],38:[function(_dereq_,module,exports){ +},{"./is-implemented":39,"./shim":40}],39:[function(_dereq_,module,exports){ 'use strict'; module.exports = function () { @@ -2417,7 +2477,7 @@ module.exports = function () { } catch (e) { return false; } }; -},{}],39:[function(_dereq_,module,exports){ +},{}],40:[function(_dereq_,module,exports){ 'use strict'; var keys = Object.keys; @@ -2426,7 +2486,7 @@ module.exports = function (object) { return keys(object == null ? object : Object(object)); }; -},{}],40:[function(_dereq_,module,exports){ +},{}],41:[function(_dereq_,module,exports){ 'use strict'; var assign = _dereq_('./assign') @@ -2450,7 +2510,7 @@ module.exports = function (options/*, …options*/) { return result; }; -},{"./assign":33}],41:[function(_dereq_,module,exports){ +},{"./assign":34}],42:[function(_dereq_,module,exports){ 'use strict'; module.exports = function (fn) { @@ -2458,7 +2518,7 @@ module.exports = function (fn) { return fn; }; -},{}],42:[function(_dereq_,module,exports){ +},{}],43:[function(_dereq_,module,exports){ 'use strict'; module.exports = function (value) { @@ -2466,14 +2526,14 @@ module.exports = function (value) { return value; }; -},{}],43:[function(_dereq_,module,exports){ +},{}],44:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./is-implemented')() ? String.prototype.contains : _dereq_('./shim'); -},{"./is-implemented":44,"./shim":45}],44:[function(_dereq_,module,exports){ +},{"./is-implemented":45,"./shim":46}],45:[function(_dereq_,module,exports){ 'use strict'; var str = 'razdwatrzy'; @@ -2483,7 +2543,7 @@ module.exports = function () { return ((str.contains('dwa') === true) && (str.contains('foo') === false)); }; -},{}],45:[function(_dereq_,module,exports){ +},{}],46:[function(_dereq_,module,exports){ 'use strict'; var indexOf = String.prototype.indexOf; @@ -2492,7 +2552,7 @@ module.exports = function (searchString/*, position*/) { return indexOf.call(this, searchString, arguments[1]) > -1; }; -},{}],46:[function(_dereq_,module,exports){ +},{}],47:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2544,7 +2604,7 @@ var ExecutionEnvironment = { module.exports = ExecutionEnvironment; -},{}],47:[function(_dereq_,module,exports){ +},{}],48:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2600,7 +2660,7 @@ function copyProperties(obj, a, b, c, d, e, f) { module.exports = copyProperties; -},{}],48:[function(_dereq_,module,exports){ +},{}],49:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2645,7 +2705,7 @@ copyProperties(emptyFunction, { module.exports = emptyFunction; -},{"./copyProperties":47}],49:[function(_dereq_,module,exports){ +},{"./copyProperties":48}],50:[function(_dereq_,module,exports){ /** * Copyright 2013-2014 Facebook, Inc. * @@ -2707,7 +2767,7 @@ var invariant = function(condition, format, a, b, c, d, e, f) { module.exports = invariant; -},{}],50:[function(_dereq_,module,exports){ +},{}],51:[function(_dereq_,module,exports){ /** * Copyright 2014 Facebook, Inc. * @@ -2757,6 +2817,6 @@ if ("production" !== "production") { module.exports = warning; -},{"./emptyFunction":48}]},{},[13]) -(13) +},{"./emptyFunction":49}]},{},[14]) +(14) }); \ No newline at end of file diff --git a/dist/react-router.min.js b/dist/react-router.min.js index 5cd70b9ff8..dfdc4bed11 100644 --- a/dist/react-router.min.js +++ b/dist/react-router.min.js @@ -1,2 +1,2 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.ReactRouter=e()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o).renderComponent(container) interface is deprecated and will be removed soon. Use React.renderComponent(, container) instead"),{renderComponent:function(container,callback){return React.renderComponent(route,container,callback)}}}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning");module.exports=Router},{"react/lib/warning":50}],2:[function(_dereq_,module){function isModifiedEvent(event){return!!(event.metaKey||event.ctrlKey||event.shiftKey)}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,ActiveState=_dereq_("../mixins/ActiveState"),withoutProperties=_dereq_("../helpers/withoutProperties"),transitionTo=_dereq_("../helpers/transitionTo"),makeHref=_dereq_("../helpers/makeHref"),RESERVED_PROPS={to:!0,className:!0,activeClassName:!0,query:!0,children:!0},Link=React.createClass({displayName:"Link",mixins:[ActiveState],statics:{getUnreservedProps:function(props){return withoutProperties(props,RESERVED_PROPS)}},propTypes:{to:React.PropTypes.string.isRequired,activeClassName:React.PropTypes.string.isRequired,query:React.PropTypes.object},getDefaultProps:function(){return{activeClassName:"active"}},getInitialState:function(){return{isActive:!1}},getParams:function(){return Link.getUnreservedProps(this.props)},getHref:function(){return makeHref(this.props.to,this.getParams(),this.props.query)},getClassName:function(){var className=this.props.className||"";return this.state.isActive?className+" "+this.props.activeClassName:className},componentWillReceiveProps:function(nextProps){var params=Link.getUnreservedProps(nextProps);this.setState({isActive:Link.isActive(nextProps.to,params,nextProps.query)})},updateActiveState:function(){this.setState({isActive:Link.isActive(this.props.to,this.getParams(),this.props.query)})},handleClick:function(event){isModifiedEvent(event)||(event.preventDefault(),transitionTo(this.props.to,this.getParams(),this.props.query))},render:function(){var props={href:this.getHref(),className:this.getClassName(),onClick:this.handleClick};return React.DOM.a(props,this.props.children)}});module.exports=Link},{"../helpers/makeHref":7,"../helpers/transitionTo":11,"../helpers/withoutProperties":12,"../mixins/ActiveState":14}],3:[function(_dereq_,module){function Transition(path){this.path=path,this.cancelReason=null,this.isCancelled=!1}function Abort(){}function Redirect(to,params,query){this.to=to,this.params=params,this.query=query}function findMatches(path,route){var matches,params,children=route.props.children;if(Array.isArray(children))for(var i=0,len=children.length;null==matches&&len>i;++i)matches=findMatches(path,children[i]);else children&&(matches=findMatches(path,children));if(matches){var rootParams=getRootMatch(matches).params;return params={},Path.extractParamNames(route.props.path).forEach(function(paramName){params[paramName]=rootParams[paramName]}),matches.unshift(makeMatch(route,params)),matches}return params=Path.extractParams(route.props.path,path),params?[makeMatch(route,params)]:null}function makeMatch(route,params){return{route:route,params:params}}function hasMatch(matches,match){return matches.some(function(m){if(m.route!==match.route)return!1;for(var property in m.params)if(m.params[property]!==match.params[property])return!1;return!0})}function getRootMatch(matches){return matches[matches.length-1]}function updateMatchComponents(matches,refs){for(var component,i=0;component=refs[REF_NAME];)matches[i++].component=component,refs=component.refs}function syncWithTransition(route,transition){if(route.state.path===transition.path)return Promise.resolve();var currentMatches=route.state.matches,nextMatches=route.match(transition.path);warning(nextMatches,'No route matches path "'+transition.path+'". Make sure you have somewhere in your routes'),nextMatches||(nextMatches=[]);var fromMatches,toMatches;return currentMatches?(updateMatchComponents(currentMatches,route.refs),fromMatches=currentMatches.filter(function(match){return!hasMatch(nextMatches,match)}),toMatches=nextMatches.filter(function(match){return!hasMatch(currentMatches,match)})):(fromMatches=[],toMatches=nextMatches),checkTransitionFromHooks(fromMatches,transition).then(function(){return transition.isCancelled?void 0:checkTransitionToHooks(toMatches,transition).then(function(){if(!transition.isCancelled){var rootMatch=getRootMatch(nextMatches),params=rootMatch&&rootMatch.params||{},query=Path.extractQuery(transition.path)||{},state={path:transition.path,matches:nextMatches,activeParams:params,activeQuery:query,activeRoutes:nextMatches.map(function(match){return match.route})};return route.setState(state),state}})})}function checkTransitionFromHooks(matches,transition){var promise=Promise.resolve();return reversedArray(matches).forEach(function(match){promise=promise.then(function(){var handler=match.route.props.handler;return!transition.isCancelled&&handler.willTransitionFrom?handler.willTransitionFrom(transition,match.component):void 0})}),promise}function checkTransitionToHooks(matches,transition){var promise=Promise.resolve();return matches.forEach(function(match){promise=promise.then(function(){var handler=match.route.props.handler;return!transition.isCancelled&&handler.willTransitionTo?handler.willTransitionTo(transition,match.params):void 0})}),promise}function computeHandlerProps(matches,query){var childHandler,props={ref:null,key:null,params:null,query:null,activeRouteHandler:returnNull};return reversedArray(matches).forEach(function(match){var route=match.route;props=Route.getUnreservedProps(route.props),props.ref=REF_NAME,props.key=Path.injectParams(route.props.path,match.params),props.params=match.params,props.query=query,props.activeRouteHandler=childHandler?childHandler:returnNull,childHandler=function(props,addedProps){if(arguments.length>2&&"undefined"!=typeof arguments[2])throw new Error("Passing children to a route handler is not supported");return route.props.handler(mergeProperties(props,addedProps))}.bind(this,props)}),props}function returnNull(){return null}function reversedArray(array){return array.slice(0).reverse()}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),ExecutionEnvironment=_dereq_("react/lib/ExecutionEnvironment"),mergeProperties=_dereq_("../helpers/mergeProperties"),goBack=_dereq_("../helpers/goBack"),replaceWith=_dereq_("../helpers/replaceWith"),transitionTo=_dereq_("../helpers/transitionTo"),withoutProperties=_dereq_("../helpers/withoutProperties"),Path=_dereq_("../helpers/Path"),ActiveStore=_dereq_("../stores/ActiveStore"),RouteStore=_dereq_("../stores/RouteStore"),URLStore=_dereq_("../stores/URLStore"),Promise=_dereq_("es6-promise").Promise,RESERVED_PROPS={location:!0,handler:!0,name:!0,path:!0,children:!0},REF_NAME="__activeRoute__",Route=React.createClass({displayName:"Route",statics:{getUnreservedProps:function(props){return withoutProperties(props,RESERVED_PROPS)},handleAsyncError:function(error){throw error},handleCancelledTransition:function(transition){var reason=transition.cancelReason;reason instanceof Redirect?replaceWith(reason.to,reason.params,reason.query):reason instanceof Abort&&goBack()}},propTypes:{location:React.PropTypes.oneOf(["hash","history"]).isRequired,handler:React.PropTypes.any.isRequired,path:React.PropTypes.string,name:React.PropTypes.string},getDefaultProps:function(){return{location:"hash"}},getInitialState:function(){return{}},componentWillMount:function(){RouteStore.registerRoute(this),!URLStore.isSetup()&&ExecutionEnvironment.canUseDOM&&URLStore.setup(this.props.location),URLStore.addChangeListener(this.handleRouteChange)},componentDidMount:function(){this.dispatch(URLStore.getCurrentPath())},componentWillUnmount:function(){URLStore.removeChangeListener(this.handleRouteChange)},handleRouteChange:function(){this.dispatch(URLStore.getCurrentPath())},match:function(path){return findMatches(Path.withoutQuery(path),this)},dispatch:function(path,returnRejectedPromise){var transition=new Transition(path),route=this,promise=syncWithTransition(route,transition).then(function(newState){return transition.isCancelled?Route.handleCancelledTransition(transition,route):newState&&ActiveStore.updateState(newState),transition});return returnRejectedPromise||(promise=promise.then(void 0,function(error){setTimeout(function(){Route.handleAsyncError(error,route)})})),promise},render:function(){return this.state.path?this.props.handler(computeHandlerProps(this.state.matches||[],this.state.activeQuery)):null}});mergeProperties(Transition.prototype,{abort:function(){this.cancelReason=new Abort,this.isCancelled=!0},redirect:function(to,params,query){this.cancelReason=new Redirect(to,params,query),this.isCancelled=!0},retry:function(){transitionTo(this.path)}}),module.exports=Route},{"../helpers/Path":4,"../helpers/goBack":6,"../helpers/mergeProperties":9,"../helpers/replaceWith":10,"../helpers/transitionTo":11,"../helpers/withoutProperties":12,"../stores/ActiveStore":15,"../stores/RouteStore":16,"../stores/URLStore":17,"es6-promise":21,"react/lib/ExecutionEnvironment":46,"react/lib/warning":50}],4:[function(_dereq_,module){function getParamName(pathSegment){return"*"===pathSegment?"splat":pathSegment.substr(1)}function compilePattern(pattern){if(_compiledPatterns[pattern])return _compiledPatterns[pattern];var compiled=_compiledPatterns[pattern]={},paramNames=compiled.paramNames=[],source=pattern.replace(paramMatcher,function(match,pathSegment){return paramNames.push(getParamName(pathSegment)),"*"===pathSegment?"(.*?)":"([^/?#]+)"});return compiled.matcher=new RegExp("^"+source+"$","i"),compiled}function isDynamicPattern(pattern){return-1!==pattern.indexOf(":")||-1!==pattern.indexOf("*")}var invariant=_dereq_("react/lib/invariant"),qs=_dereq_("querystring"),mergeProperties=_dereq_("./mergeProperties"),URL=_dereq_("./URL"),paramMatcher=/((?::[a-z_$][a-z0-9_$]*)|\*)/gi,queryMatcher=/\?(.+)/,_compiledPatterns={},Path={extractParams:function(pattern,path){if(!isDynamicPattern(pattern))return pattern===URL.decode(path)?{}:null;var compiled=compilePattern(pattern),match=URL.decode(path).match(compiled.matcher);if(!match)return null;var params={};return compiled.paramNames.forEach(function(paramName,index){params[paramName]=match[index+1]}),params},extractParamNames:function(pattern){return compilePattern(pattern).paramNames},injectParams:function(pattern,params){return isDynamicPattern(pattern)?(params=params||{},pattern.replace(paramMatcher,function(match,pathSegment){var paramName=getParamName(pathSegment);return invariant(null!=params[paramName],'Missing "'+paramName+'" parameter for path "'+pattern+'"'),String(params[paramName]).split("/").map(URL.encode).join("/")})):pattern},extractQuery:function(path){var match=path.match(queryMatcher);return match&&qs.parse(match[1])},withoutQuery:function(path){return path.replace(queryMatcher,"")},withQuery:function(path,query){var existingQuery=Path.extractQuery(path);existingQuery&&(query=query?mergeProperties(existingQuery,query):existingQuery);var queryString=query&&qs.stringify(query);return queryString?Path.withoutQuery(path)+"?"+queryString:path},normalize:function(path){return path.replace(/^\/*/,"/")}};module.exports=Path},{"./URL":5,"./mergeProperties":9,querystring:20,"react/lib/invariant":49}],5:[function(_dereq_,module){var urlEncodedSpaceRE=/\+/g,encodedSpaceRE=/%20/g,URL={decode:function(str){return str=str.replace(urlEncodedSpaceRE," "),decodeURIComponent(str)},encode:function(str){return str=encodeURIComponent(str),str.replace(encodedSpaceRE,"+")}};module.exports=URL},{}],6:[function(_dereq_,module){function goBack(){URLStore.back()}var URLStore=_dereq_("../stores/URLStore");module.exports=goBack},{"../stores/URLStore":17}],7:[function(_dereq_,module){function makeHref(routeName,params,query){var path=makePath(routeName,params,query);return"hash"===URLStore.getLocation()?"#"+path:path}var URLStore=_dereq_("../stores/URLStore"),makePath=_dereq_("./makePath");module.exports=makeHref},{"../stores/URLStore":17,"./makePath":8}],8:[function(_dereq_,module){function makePath(to,params,query){var path;if("/"===to.charAt(0))path=Path.normalize(to);else{var route=RouteStore.getRouteByName(to);invariant(route,'Unable to find a route named "'+to+'". Make sure you have a defined somewhere in your routes'),path=route.props.path}return Path.withQuery(Path.injectParams(path,params),query)}var invariant=_dereq_("react/lib/invariant"),RouteStore=_dereq_("../stores/RouteStore"),Path=_dereq_("./Path");module.exports=makePath},{"../stores/RouteStore":16,"./Path":4,"react/lib/invariant":49}],9:[function(_dereq_,module){function mergeProperties(object,properties){for(var property in properties)properties.hasOwnProperty(property)&&(object[property]=properties[property]);return object}module.exports=mergeProperties},{}],10:[function(_dereq_,module){function replaceWith(to,params,query){URLStore.replace(makePath(to,params,query))}var URLStore=_dereq_("../stores/URLStore"),makePath=_dereq_("./makePath");module.exports=replaceWith},{"../stores/URLStore":17,"./makePath":8}],11:[function(_dereq_,module){function transitionTo(to,params,query){URLStore.push(makePath(to,params,query))}var URLStore=_dereq_("../stores/URLStore"),makePath=_dereq_("./makePath");module.exports=transitionTo},{"../stores/URLStore":17,"./makePath":8}],12:[function(_dereq_,module){function withoutProperties(object,properties){var result={};for(var property in object)object.hasOwnProperty(property)&&!properties[property]&&(result[property]=object[property]);return result}module.exports=withoutProperties},{}],13:[function(_dereq_,module,exports){exports.Link=_dereq_("./components/Link"),exports.Route=_dereq_("./components/Route"),exports.goBack=_dereq_("./helpers/goBack"),exports.replaceWith=_dereq_("./helpers/replaceWith"),exports.transitionTo=_dereq_("./helpers/transitionTo"),exports.ActiveState=_dereq_("./mixins/ActiveState"),exports.Router=_dereq_("./Router")},{"./Router":1,"./components/Link":2,"./components/Route":3,"./helpers/goBack":6,"./helpers/replaceWith":10,"./helpers/transitionTo":11,"./mixins/ActiveState":14}],14:[function(_dereq_,module){var ActiveStore=_dereq_("../stores/ActiveStore"),ActiveState={statics:{isActive:ActiveStore.isActive},componentWillMount:function(){ActiveStore.addChangeListener(this.handleActiveStateChange)},componentDidMount:function(){this.updateActiveState&&this.updateActiveState()},componentWillUnmount:function(){ActiveStore.removeChangeListener(this.handleActiveStateChange)},handleActiveStateChange:function(){this.isMounted()&&this.updateActiveState&&this.updateActiveState()}};module.exports=ActiveState},{"../stores/ActiveStore":15}],15:[function(_dereq_,module){function routeIsActive(routeName){return _activeRoutes.some(function(route){return route.props.name===routeName})}function paramsAreActive(params){for(var property in params)if(_activeParams[property]!==String(params[property]))return!1;return!0}function queryIsActive(query){for(var property in query)if(_activeQuery[property]!==String(query[property]))return!1;return!0}function notifyChange(){_events.emit("change")}var _activeRoutes=[],_activeParams={},_activeQuery={},EventEmitter=_dereq_("event-emitter"),_events=EventEmitter(),ActiveStore={addChangeListener:function(listener){_events.on("change",listener)},removeChangeListener:function(listener){_events.off("change",listener)},updateState:function(state){state=state||{},_activeRoutes=state.activeRoutes||[],_activeParams=state.activeParams||{},_activeQuery=state.activeQuery||{},notifyChange()},isActive:function(routeName,params,query){var isActive=routeIsActive(routeName)&¶msAreActive(params);return query?isActive&&queryIsActive(query):isActive}};module.exports=ActiveStore},{"event-emitter":31}],16:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,invariant=_dereq_("react/lib/invariant"),Path=_dereq_("../helpers/Path"),_namedRoutes={},RouteStore={registerRoute:function(route,_parentRoute){if(route.props.path=route.props.path||route.props.name?Path.normalize(route.props.path||route.props.name):"/",invariant(React.isValidClass(route.props.handler),'The handler for Route "'+(route.props.name||route.props.path)+'" must be a valid React component'),_parentRoute){var paramNames=Path.extractParamNames(route.props.path);Path.extractParamNames(_parentRoute.props.path).forEach(function(paramName){invariant(-1!==paramNames.indexOf(paramName),'The nested route path "'+route.props.path+'" is missing the "'+paramName+'" parameter of its parent path "'+_parentRoute.props.path+'"')})}if(route.props.name){var existingRoute=_namedRoutes[route.props.name];invariant(!existingRoute||route===existingRoute,'You cannot use the name "'+route.props.name+'" for more than one route'),_namedRoutes[route.props.name]=route}React.Children.forEach(route.props.children,function(child){RouteStore.registerRoute(child,route)})},unregisterRoute:function(route){route.props.name&&delete _namedRoutes[route.props.name],React.Children.forEach(route.props.children,function(){RouteStore.unregisterRoute(route)})},getRouteByName:function(routeName){return _namedRoutes[routeName]||null}};module.exports=RouteStore},{"../helpers/Path":4,"react/lib/invariant":49}],17:[function(_dereq_,module){function getWindowPath(){return window.location.pathname+window.location.search}function notifyChange(){_events.emit("change")}var _location,ExecutionEnvironment=_dereq_("react/lib/ExecutionEnvironment"),invariant=_dereq_("react/lib/invariant"),warning=_dereq_("react/lib/warning"),CHANGE_EVENTS={hash:window.addEventListener?"hashchange":"onhashchange",history:"popstate"},_currentPath="/",_lastPath=null,EventEmitter=_dereq_("event-emitter"),_events=EventEmitter(),URLStore={addChangeListener:function(listener){_events.on("change",listener)},removeChangeListener:function(listener){_events.off("change",listener)},getLocation:function(){return _location||"hash"},getCurrentPath:function(){return"history"===_location?getWindowPath():"hash"===_location?window.location.hash.substr(1):_currentPath},push:function(path){"history"===_location?(window.history.pushState({path:path},"",path),notifyChange()):"hash"===_location?window.location.hash=path:(_lastPath=_currentPath,_currentPath=path,notifyChange())},replace:function(path){"history"===_location?(window.history.replaceState({path:path},"",path),notifyChange()):"hash"===_location?window.location.replace(getWindowPath()+"#"+path):(_currentPath=path,notifyChange())},back:function(){null!=_location?window.history.back():(invariant(_lastPath,"You cannot make the URL store go back more than once when it does not use the DOM"),_currentPath=_lastPath,_lastPath=null,notifyChange())},isSetup:function(){return null!=_location},setup:function(location){if(invariant(ExecutionEnvironment.canUseDOM,"You cannot setup the URL store in an environment with no DOM"),null!=_location)return void warning(_location===location,"The URL store was already setup using "+_location+" location. You cannot use "+location+" location on the same page");var changeEvent=CHANGE_EVENTS[location];invariant(changeEvent,'The URL store location "'+location+'" is not valid. It must be either "hash" or "history"'),_location=location,"hash"===location&&""===window.location.hash&&URLStore.replace("/"),window.addEventListener?window.addEventListener(changeEvent,notifyChange,!1):window.attachEvent(changeEvent,notifyChange),notifyChange()},teardown:function(){if(null!=_location){var changeEvent=CHANGE_EVENTS[_location];window.removeEventListener?window.removeEventListener(changeEvent,notifyChange,!1):window.detachEvent(changeEvent,notifyChange),_location=null}}};module.exports=URLStore},{"event-emitter":31,"react/lib/ExecutionEnvironment":46,"react/lib/invariant":49,"react/lib/warning":50}],18:[function(_dereq_,module){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;len>i;++i){var kstr,vstr,k,v,x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq);idx>=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},{}],19:[function(_dereq_,module){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;ii;++i)args[i-1]=arguments[i];for(listeners=listeners.slice(),i=0;listener=listeners[i];++i)apply.call(listener,this,args)}else switch(arguments.length){case 1:call.call(listeners,this);break;case 2:call.call(listeners,this,arguments[1]);break;case 3:call.call(listeners,this,arguments[1],arguments[2]);break;default:for(l=arguments.length,args=new Array(l-1),i=1;l>i;++i)args[i-1]=arguments[i];apply.call(listeners,this,args)}},methods={on:on,once:once,off:off,emit:emit},descriptors={on:d(on),once:d(once),off:d(off),emit:d(emit)},base=defineProperties({},descriptors),module.exports=exports=function(o){return null==o?create(base):defineProperties(Object(o),descriptors)},exports.methods=methods},{d:32,"es5-ext/object/valid-callable":41}],32:[function(_dereq_,module){"use strict";var d,assign=_dereq_("es5-ext/object/assign"),normalizeOpts=_dereq_("es5-ext/object/normalize-options"),isCallable=_dereq_("es5-ext/object/is-callable"),contains=_dereq_("es5-ext/string/#/contains");d=module.exports=function(dscr,value){var c,e,w,options,desc;return arguments.length<2||"string"!=typeof dscr?(options=value,value=dscr,dscr=null):options=arguments[2],null==dscr?(c=w=!0,e=!1):(c=contains.call(dscr,"c"),e=contains.call(dscr,"e"),w=contains.call(dscr,"w")),desc={value:value,configurable:c,enumerable:e,writable:w},options?assign(normalizeOpts(options),desc):desc},d.gs=function(dscr,get,set){var c,e,options,desc;return"string"!=typeof dscr?(options=set,set=get,get=dscr,dscr=null):options=arguments[3],null==get?get=void 0:isCallable(get)?null==set?set=void 0:isCallable(set)||(options=set,set=void 0):(options=get,get=set=void 0),null==dscr?(c=!0,e=!1):(c=contains.call(dscr,"c"),e=contains.call(dscr,"e")),desc={get:get,set:set,configurable:c,enumerable:e},options?assign(normalizeOpts(options),desc):desc}},{"es5-ext/object/assign":33,"es5-ext/object/is-callable":36,"es5-ext/object/normalize-options":40,"es5-ext/string/#/contains":43}],33:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?Object.assign:_dereq_("./shim")},{"./is-implemented":34,"./shim":35}],34:[function(_dereq_,module){"use strict";module.exports=function(){var obj,assign=Object.assign;return"function"!=typeof assign?!1:(obj={foo:"raz"},assign(obj,{bar:"dwa"},{trzy:"trzy"}),obj.foo+obj.bar+obj.trzy==="razdwatrzy")}},{}],35:[function(_dereq_,module){"use strict";var keys=_dereq_("../keys"),value=_dereq_("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,assign,l=max(arguments.length,2);for(dest=Object(value(dest)),assign=function(key){try{dest[key]=src[key]}catch(e){error||(error=e)}},i=1;l>i;++i)src=arguments[i],keys(src).forEach(assign);if(void 0!==error)throw error;return dest}},{"../keys":37,"../valid-value":42}],36:[function(_dereq_,module){"use strict";module.exports=function(obj){return"function"==typeof obj}},{}],37:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?Object.keys:_dereq_("./shim")},{"./is-implemented":38,"./shim":39}],38:[function(_dereq_,module){"use strict";module.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],39:[function(_dereq_,module){"use strict";var keys=Object.keys;module.exports=function(object){return keys(null==object?object:Object(object))}},{}],40:[function(_dereq_,module){"use strict";var process,assign=_dereq_("./assign"),forEach=Array.prototype.forEach,create=Object.create,getPrototypeOf=Object.getPrototypeOf;process=function(src,obj){var proto=getPrototypeOf(src);return assign(proto?process(proto,obj):obj,src)},module.exports=function(){var result=create(null);return forEach.call(arguments,function(options){null!=options&&process(Object(options),result)}),result}},{"./assign":33}],41:[function(_dereq_,module){"use strict";module.exports=function(fn){if("function"!=typeof fn)throw new TypeError(fn+" is not a function");return fn}},{}],42:[function(_dereq_,module){"use strict";module.exports=function(value){if(null==value)throw new TypeError("Cannot use null or undefined");return value}},{}],43:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?String.prototype.contains:_dereq_("./shim")},{"./is-implemented":44,"./shim":45}],44:[function(_dereq_,module){"use strict";var str="razdwatrzy";module.exports=function(){return"function"!=typeof str.contains?!1:str.contains("dwa")===!0&&str.contains("foo")===!1}},{}],45:[function(_dereq_,module){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],46:[function(_dereq_,module){"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment},{}],47:[function(_dereq_,module){function copyProperties(obj,a,b,c,d,e,f){obj=obj||{};for(var v,args=[a,b,c,d,e],ii=0;args[ii];){v=args[ii++];for(var k in v)obj[k]=v[k];v.hasOwnProperty&&v.hasOwnProperty("toString")&&"undefined"!=typeof v.toString&&obj.toString!==v.toString&&(obj.toString=v.toString)}return obj}module.exports=copyProperties},{}],48:[function(_dereq_,module){function makeEmptyFunction(arg){return function(){return arg}}function emptyFunction(){}var copyProperties=_dereq_("./copyProperties");copyProperties(emptyFunction,{thatReturns:makeEmptyFunction,thatReturnsFalse:makeEmptyFunction(!1),thatReturnsTrue:makeEmptyFunction(!0),thatReturnsNull:makeEmptyFunction(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(arg){return arg}}),module.exports=emptyFunction},{"./copyProperties":47}],49:[function(_dereq_,module){"use strict";var invariant=function(condition,format,a,b,c,d,e,f){if(!condition){var error;if(void 0===format)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],argIndex=0;error=new Error("Invariant Violation: "+format.replace(/%s/g,function(){return args[argIndex++]}))}throw error.framesToPop=1,error}};module.exports=invariant},{}],50:[function(_dereq_,module){"use strict";var emptyFunction=_dereq_("./emptyFunction"),warning=emptyFunction;module.exports=warning},{"./emptyFunction":48}]},{},[13])(13)}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.ReactRouter=e()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o).renderComponent(container) interface is deprecated and will be removed soon. Use React.renderComponent(, container) instead"),{renderComponent:function(container,callback){return React.renderComponent(route,container,callback)}}}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning");module.exports=Router},{"react/lib/warning":51}],2:[function(_dereq_,module){function isModifiedEvent(event){return!!(event.metaKey||event.ctrlKey||event.shiftKey)}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,ActiveState=_dereq_("../mixins/ActiveState"),withoutProperties=_dereq_("../helpers/withoutProperties"),transitionTo=_dereq_("../helpers/transitionTo"),makeHref=_dereq_("../helpers/makeHref"),RESERVED_PROPS={to:!0,className:!0,activeClassName:!0,query:!0,children:!0},Link=React.createClass({displayName:"Link",mixins:[ActiveState],statics:{getUnreservedProps:function(props){return withoutProperties(props,RESERVED_PROPS)}},propTypes:{to:React.PropTypes.string.isRequired,activeClassName:React.PropTypes.string.isRequired,query:React.PropTypes.object},getDefaultProps:function(){return{activeClassName:"active"}},getInitialState:function(){return{isActive:!1}},getParams:function(){return Link.getUnreservedProps(this.props)},getHref:function(){return makeHref(this.props.to,this.getParams(),this.props.query)},getClassName:function(){var className=this.props.className||"";return this.state.isActive?className+" "+this.props.activeClassName:className},componentWillReceiveProps:function(nextProps){var params=Link.getUnreservedProps(nextProps);this.setState({isActive:Link.isActive(nextProps.to,params,nextProps.query)})},updateActiveState:function(){this.setState({isActive:Link.isActive(this.props.to,this.getParams(),this.props.query)})},handleClick:function(event){isModifiedEvent(event)||(event.preventDefault(),transitionTo(this.props.to,this.getParams(),this.props.query))},render:function(){var props={href:this.getHref(),className:this.getClassName(),onClick:this.handleClick};return React.DOM.a(props,this.props.children)}});module.exports=Link},{"../helpers/makeHref":8,"../helpers/transitionTo":12,"../helpers/withoutProperties":13,"../mixins/ActiveState":15}],3:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,withoutProperties=_dereq_("../helpers/withoutProperties"),RESERVED_PROPS={handler:!0,name:!0,path:!0,children:!0},Route=React.createClass({displayName:"Route",statics:{getUnreservedProps:function(props){return withoutProperties(props,RESERVED_PROPS)}},propTypes:{handler:React.PropTypes.any.isRequired,path:React.PropTypes.string,name:React.PropTypes.string},render:function(){throw new Error("The component should not be rendered directly. You may be missing a wrapper around your list of routes.")}});module.exports=Route},{"../helpers/withoutProperties":13}],4:[function(_dereq_,module){function Transition(path){this.path=path,this.cancelReason=null,this.isCancelled=!1}function Abort(){}function Redirect(to,params,query){this.to=to,this.params=params,this.query=query}function findMatches(path,route){var matches,params,children=route.props.children;if(Array.isArray(children))for(var i=0,len=children.length;null==matches&&len>i;++i)matches=findMatches(path,children[i]);else children&&(matches=findMatches(path,children));if(matches){var rootParams=getRootMatch(matches).params;return params={},Path.extractParamNames(route.props.path).forEach(function(paramName){params[paramName]=rootParams[paramName]}),matches.unshift(makeMatch(route,params)),matches}return params=Path.extractParams(route.props.path,path),params?[makeMatch(route,params)]:null}function makeMatch(route,params){return{route:route,params:params}}function hasMatch(matches,match){return matches.some(function(m){if(m.route!==match.route)return!1;for(var property in m.params)if(m.params[property]!==match.params[property])return!1;return!0})}function getRootMatch(matches){return matches[matches.length-1]}function updateMatchComponents(matches,refs){for(var component,i=0;component=refs[REF_NAME];)matches[i++].component=component,refs=component.refs}function syncWithTransition(routes,transition){if(routes.state.path===transition.path)return Promise.resolve();var currentMatches=routes.state.matches,nextMatches=routes.match(transition.path);warning(nextMatches,'No route matches path "'+transition.path+'". Make sure you have somewhere in your routes'),nextMatches||(nextMatches=[]);var fromMatches,toMatches;return currentMatches?(updateMatchComponents(currentMatches,routes.refs),fromMatches=currentMatches.filter(function(match){return!hasMatch(nextMatches,match)}),toMatches=nextMatches.filter(function(match){return!hasMatch(currentMatches,match)})):(fromMatches=[],toMatches=nextMatches),checkTransitionFromHooks(fromMatches,transition).then(function(){return transition.isCancelled?void 0:checkTransitionToHooks(toMatches,transition).then(function(){if(!transition.isCancelled){var rootMatch=getRootMatch(nextMatches),params=rootMatch&&rootMatch.params||{},query=Path.extractQuery(transition.path)||{},state={path:transition.path,matches:nextMatches,activeParams:params,activeQuery:query,activeRoutes:nextMatches.map(function(match){return match.route})};return routes.setState(state),state}})})}function checkTransitionFromHooks(matches,transition){var promise=Promise.resolve();return reversedArray(matches).forEach(function(match){promise=promise.then(function(){var handler=match.route.props.handler;return!transition.isCancelled&&handler.willTransitionFrom?handler.willTransitionFrom(transition,match.component):void 0})}),promise}function checkTransitionToHooks(matches,transition){var promise=Promise.resolve();return matches.forEach(function(match){promise=promise.then(function(){var handler=match.route.props.handler;return!transition.isCancelled&&handler.willTransitionTo?handler.willTransitionTo(transition,match.params):void 0})}),promise}function computeHandlerProps(matches,query){var childHandler,props={ref:null,key:null,params:null,query:null,activeRouteHandler:returnNull};return reversedArray(matches).forEach(function(match){var route=match.route;props=Route.getUnreservedProps(route.props),props.ref=REF_NAME,props.key=Path.injectParams(route.props.path,match.params),props.params=match.params,props.query=query,props.activeRouteHandler=childHandler?childHandler:returnNull,childHandler=function(props,addedProps){if(arguments.length>2&&"undefined"!=typeof arguments[2])throw new Error("Passing children to a route handler is not supported");return route.props.handler(mergeProperties(props,addedProps))}.bind(this,props)}),props}function returnNull(){return null}function reversedArray(array){return array.slice(0).reverse()}var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,warning=_dereq_("react/lib/warning"),ExecutionEnvironment=_dereq_("react/lib/ExecutionEnvironment"),mergeProperties=_dereq_("../helpers/mergeProperties"),goBack=_dereq_("../helpers/goBack"),replaceWith=_dereq_("../helpers/replaceWith"),transitionTo=_dereq_("../helpers/transitionTo"),withoutProperties=_dereq_("../helpers/withoutProperties"),Route=_dereq_("../components/Route"),Path=_dereq_("../helpers/Path"),ActiveStore=_dereq_("../stores/ActiveStore"),RouteStore=_dereq_("../stores/RouteStore"),URLStore=_dereq_("../stores/URLStore"),Promise=_dereq_("es6-promise").Promise,REF_NAME="__activeRoute__",Routes=React.createClass({displayName:"Routes",statics:{getUnreservedProps:function(props){return withoutProperties(props,RESERVED_PROPS)},handleAsyncError:function(error){throw error},handleCancelledTransition:function(transition){var reason=transition.cancelReason;reason instanceof Redirect?replaceWith(reason.to,reason.params,reason.query):reason instanceof Abort&&goBack()}},propTypes:{location:React.PropTypes.oneOf(["hash","history"]).isRequired},getDefaultProps:function(){return{location:"hash"}},getInitialState:function(){return{}},componentWillMount:function(){React.Children.forEach(this.props.children,function(child){RouteStore.registerRoute(child)}),!URLStore.isSetup()&&ExecutionEnvironment.canUseDOM&&URLStore.setup(this.props.location),URLStore.addChangeListener(this.handleRouteChange)},componentDidMount:function(){this.dispatch(URLStore.getCurrentPath())},componentWillUnmount:function(){URLStore.removeChangeListener(this.handleRouteChange)},handleRouteChange:function(){this.dispatch(URLStore.getCurrentPath())},match:function(path){var rootRoutes=this.props.children;Array.isArray(rootRoutes)||(rootRoutes=[rootRoutes]);for(var matches=null,i=0;null==matches&&i defined somewhere in your routes'),path=route.props.path}return Path.withQuery(Path.injectParams(path,params),query)}var invariant=_dereq_("react/lib/invariant"),RouteStore=_dereq_("../stores/RouteStore"),Path=_dereq_("./Path");module.exports=makePath},{"../stores/RouteStore":17,"./Path":5,"react/lib/invariant":50}],10:[function(_dereq_,module){function mergeProperties(object,properties){for(var property in properties)properties.hasOwnProperty(property)&&(object[property]=properties[property]);return object}module.exports=mergeProperties},{}],11:[function(_dereq_,module){function replaceWith(to,params,query){URLStore.replace(makePath(to,params,query))}var URLStore=_dereq_("../stores/URLStore"),makePath=_dereq_("./makePath");module.exports=replaceWith},{"../stores/URLStore":18,"./makePath":9}],12:[function(_dereq_,module){function transitionTo(to,params,query){URLStore.push(makePath(to,params,query))}var URLStore=_dereq_("../stores/URLStore"),makePath=_dereq_("./makePath");module.exports=transitionTo},{"../stores/URLStore":18,"./makePath":9}],13:[function(_dereq_,module){function withoutProperties(object,properties){var result={};for(var property in object)object.hasOwnProperty(property)&&!properties[property]&&(result[property]=object[property]);return result}module.exports=withoutProperties},{}],14:[function(_dereq_,module,exports){exports.Link=_dereq_("./components/Link"),exports.Route=_dereq_("./components/Route"),exports.Routes=_dereq_("./components/Routes"),exports.goBack=_dereq_("./helpers/goBack"),exports.replaceWith=_dereq_("./helpers/replaceWith"),exports.transitionTo=_dereq_("./helpers/transitionTo"),exports.ActiveState=_dereq_("./mixins/ActiveState"),exports.Router=_dereq_("./Router")},{"./Router":1,"./components/Link":2,"./components/Route":3,"./components/Routes":4,"./helpers/goBack":7,"./helpers/replaceWith":11,"./helpers/transitionTo":12,"./mixins/ActiveState":15}],15:[function(_dereq_,module){var ActiveStore=_dereq_("../stores/ActiveStore"),ActiveState={statics:{isActive:ActiveStore.isActive},componentWillMount:function(){ActiveStore.addChangeListener(this.handleActiveStateChange)},componentDidMount:function(){this.updateActiveState&&this.updateActiveState()},componentWillUnmount:function(){ActiveStore.removeChangeListener(this.handleActiveStateChange)},handleActiveStateChange:function(){this.isMounted()&&this.updateActiveState&&this.updateActiveState()}};module.exports=ActiveState},{"../stores/ActiveStore":16}],16:[function(_dereq_,module){function routeIsActive(routeName){return _activeRoutes.some(function(route){return route.props.name===routeName})}function paramsAreActive(params){for(var property in params)if(_activeParams[property]!==String(params[property]))return!1;return!0}function queryIsActive(query){for(var property in query)if(_activeQuery[property]!==String(query[property]))return!1;return!0}function notifyChange(){_events.emit("change")}var _activeRoutes=[],_activeParams={},_activeQuery={},EventEmitter=_dereq_("event-emitter"),_events=EventEmitter(),ActiveStore={addChangeListener:function(listener){_events.on("change",listener)},removeChangeListener:function(listener){_events.off("change",listener)},updateState:function(state){state=state||{},_activeRoutes=state.activeRoutes||[],_activeParams=state.activeParams||{},_activeQuery=state.activeQuery||{},notifyChange()},isActive:function(routeName,params,query){var isActive=routeIsActive(routeName)&¶msAreActive(params);return query?isActive&&queryIsActive(query):isActive}};module.exports=ActiveStore},{"event-emitter":32}],17:[function(_dereq_,module){var React="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,invariant=_dereq_("react/lib/invariant"),Path=(_dereq_("react/lib/warning"),_dereq_("../helpers/Path")),_namedRoutes={},RouteStore={registerRoute:function(route,_parentRoute){if(route.props.path=route.props.path||route.props.name?Path.normalize(route.props.path||route.props.name):"/",invariant(React.isValidClass(route.props.handler),'The handler for Route "'+(route.props.name||route.props.path)+'" must be a valid React component'),_parentRoute){var paramNames=Path.extractParamNames(route.props.path);Path.extractParamNames(_parentRoute.props.path).forEach(function(paramName){invariant(-1!==paramNames.indexOf(paramName),'The nested route path "'+route.props.path+'" is missing the "'+paramName+'" parameter of its parent path "'+_parentRoute.props.path+'"')})}if(route.props.name){var existingRoute=_namedRoutes[route.props.name];invariant(!existingRoute||route===existingRoute,'You cannot use the name "'+route.props.name+'" for more than one route'),_namedRoutes[route.props.name]=route}React.Children.forEach(route.props.children,function(child){RouteStore.registerRoute(child,route)})},unregisterRoute:function(route){route.props.name&&delete _namedRoutes[route.props.name],React.Children.forEach(route.props.children,function(){RouteStore.unregisterRoute(route)})},getRouteByName:function(routeName){return _namedRoutes[routeName]||null}};module.exports=RouteStore},{"../helpers/Path":5,"react/lib/invariant":50,"react/lib/warning":51}],18:[function(_dereq_,module){function getWindowPath(){return window.location.pathname+window.location.search}function notifyChange(){_events.emit("change")}var _location,ExecutionEnvironment=_dereq_("react/lib/ExecutionEnvironment"),invariant=_dereq_("react/lib/invariant"),warning=_dereq_("react/lib/warning"),CHANGE_EVENTS={hash:window.addEventListener?"hashchange":"onhashchange",history:"popstate"},_currentPath="/",_lastPath=null,EventEmitter=_dereq_("event-emitter"),_events=EventEmitter(),URLStore={addChangeListener:function(listener){_events.on("change",listener)},removeChangeListener:function(listener){_events.off("change",listener)},getLocation:function(){return _location||"hash"},getCurrentPath:function(){return"history"===_location?getWindowPath():"hash"===_location?window.location.hash.substr(1):_currentPath},push:function(path){"history"===_location?(window.history.pushState({path:path},"",path),notifyChange()):"hash"===_location?window.location.hash=path:(_lastPath=_currentPath,_currentPath=path,notifyChange())},replace:function(path){"history"===_location?(window.history.replaceState({path:path},"",path),notifyChange()):"hash"===_location?window.location.replace(getWindowPath()+"#"+path):(_currentPath=path,notifyChange())},back:function(){null!=_location?window.history.back():(invariant(_lastPath,"You cannot make the URL store go back more than once when it does not use the DOM"),_currentPath=_lastPath,_lastPath=null,notifyChange())},isSetup:function(){return null!=_location},setup:function(location){if(invariant(ExecutionEnvironment.canUseDOM,"You cannot setup the URL store in an environment with no DOM"),null!=_location)return void warning(_location===location,"The URL store was already setup using "+_location+" location. You cannot use "+location+" location on the same page");var changeEvent=CHANGE_EVENTS[location];invariant(changeEvent,'The URL store location "'+location+'" is not valid. It must be either "hash" or "history"'),_location=location,"hash"===location&&""===window.location.hash&&URLStore.replace("/"),window.addEventListener?window.addEventListener(changeEvent,notifyChange,!1):window.attachEvent(changeEvent,notifyChange),notifyChange()},teardown:function(){if(null!=_location){var changeEvent=CHANGE_EVENTS[_location];window.removeEventListener?window.removeEventListener(changeEvent,notifyChange,!1):window.detachEvent(changeEvent,notifyChange),_location=null}}};module.exports=URLStore},{"event-emitter":32,"react/lib/ExecutionEnvironment":47,"react/lib/invariant":50,"react/lib/warning":51}],19:[function(_dereq_,module){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;len>i;++i){var kstr,vstr,k,v,x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq);idx>=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},{}],20:[function(_dereq_,module){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;ii;++i)args[i-1]=arguments[i];for(listeners=listeners.slice(),i=0;listener=listeners[i];++i)apply.call(listener,this,args)}else switch(arguments.length){case 1:call.call(listeners,this);break;case 2:call.call(listeners,this,arguments[1]);break;case 3:call.call(listeners,this,arguments[1],arguments[2]);break;default:for(l=arguments.length,args=new Array(l-1),i=1;l>i;++i)args[i-1]=arguments[i];apply.call(listeners,this,args)}},methods={on:on,once:once,off:off,emit:emit},descriptors={on:d(on),once:d(once),off:d(off),emit:d(emit)},base=defineProperties({},descriptors),module.exports=exports=function(o){return null==o?create(base):defineProperties(Object(o),descriptors)},exports.methods=methods},{d:33,"es5-ext/object/valid-callable":42}],33:[function(_dereq_,module){"use strict";var d,assign=_dereq_("es5-ext/object/assign"),normalizeOpts=_dereq_("es5-ext/object/normalize-options"),isCallable=_dereq_("es5-ext/object/is-callable"),contains=_dereq_("es5-ext/string/#/contains");d=module.exports=function(dscr,value){var c,e,w,options,desc;return arguments.length<2||"string"!=typeof dscr?(options=value,value=dscr,dscr=null):options=arguments[2],null==dscr?(c=w=!0,e=!1):(c=contains.call(dscr,"c"),e=contains.call(dscr,"e"),w=contains.call(dscr,"w")),desc={value:value,configurable:c,enumerable:e,writable:w},options?assign(normalizeOpts(options),desc):desc},d.gs=function(dscr,get,set){var c,e,options,desc;return"string"!=typeof dscr?(options=set,set=get,get=dscr,dscr=null):options=arguments[3],null==get?get=void 0:isCallable(get)?null==set?set=void 0:isCallable(set)||(options=set,set=void 0):(options=get,get=set=void 0),null==dscr?(c=!0,e=!1):(c=contains.call(dscr,"c"),e=contains.call(dscr,"e")),desc={get:get,set:set,configurable:c,enumerable:e},options?assign(normalizeOpts(options),desc):desc}},{"es5-ext/object/assign":34,"es5-ext/object/is-callable":37,"es5-ext/object/normalize-options":41,"es5-ext/string/#/contains":44}],34:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?Object.assign:_dereq_("./shim")},{"./is-implemented":35,"./shim":36}],35:[function(_dereq_,module){"use strict";module.exports=function(){var obj,assign=Object.assign;return"function"!=typeof assign?!1:(obj={foo:"raz"},assign(obj,{bar:"dwa"},{trzy:"trzy"}),obj.foo+obj.bar+obj.trzy==="razdwatrzy")}},{}],36:[function(_dereq_,module){"use strict";var keys=_dereq_("../keys"),value=_dereq_("../valid-value"),max=Math.max;module.exports=function(dest,src){var error,i,assign,l=max(arguments.length,2);for(dest=Object(value(dest)),assign=function(key){try{dest[key]=src[key]}catch(e){error||(error=e)}},i=1;l>i;++i)src=arguments[i],keys(src).forEach(assign);if(void 0!==error)throw error;return dest}},{"../keys":38,"../valid-value":43}],37:[function(_dereq_,module){"use strict";module.exports=function(obj){return"function"==typeof obj}},{}],38:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?Object.keys:_dereq_("./shim")},{"./is-implemented":39,"./shim":40}],39:[function(_dereq_,module){"use strict";module.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],40:[function(_dereq_,module){"use strict";var keys=Object.keys;module.exports=function(object){return keys(null==object?object:Object(object))}},{}],41:[function(_dereq_,module){"use strict";var process,assign=_dereq_("./assign"),forEach=Array.prototype.forEach,create=Object.create,getPrototypeOf=Object.getPrototypeOf;process=function(src,obj){var proto=getPrototypeOf(src);return assign(proto?process(proto,obj):obj,src)},module.exports=function(){var result=create(null);return forEach.call(arguments,function(options){null!=options&&process(Object(options),result)}),result}},{"./assign":34}],42:[function(_dereq_,module){"use strict";module.exports=function(fn){if("function"!=typeof fn)throw new TypeError(fn+" is not a function");return fn}},{}],43:[function(_dereq_,module){"use strict";module.exports=function(value){if(null==value)throw new TypeError("Cannot use null or undefined");return value}},{}],44:[function(_dereq_,module){"use strict";module.exports=_dereq_("./is-implemented")()?String.prototype.contains:_dereq_("./shim")},{"./is-implemented":45,"./shim":46}],45:[function(_dereq_,module){"use strict";var str="razdwatrzy";module.exports=function(){return"function"!=typeof str.contains?!1:str.contains("dwa")===!0&&str.contains("foo")===!1}},{}],46:[function(_dereq_,module){"use strict";var indexOf=String.prototype.indexOf;module.exports=function(searchString){return indexOf.call(this,searchString,arguments[1])>-1}},{}],47:[function(_dereq_,module){"use strict";var canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),ExecutionEnvironment={canUseDOM:canUseDOM,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:canUseDOM&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:canUseDOM&&!!window.screen,isInWorker:!canUseDOM};module.exports=ExecutionEnvironment},{}],48:[function(_dereq_,module){function copyProperties(obj,a,b,c,d,e,f){obj=obj||{};for(var v,args=[a,b,c,d,e],ii=0;args[ii];){v=args[ii++];for(var k in v)obj[k]=v[k];v.hasOwnProperty&&v.hasOwnProperty("toString")&&"undefined"!=typeof v.toString&&obj.toString!==v.toString&&(obj.toString=v.toString)}return obj}module.exports=copyProperties},{}],49:[function(_dereq_,module){function makeEmptyFunction(arg){return function(){return arg}}function emptyFunction(){}var copyProperties=_dereq_("./copyProperties");copyProperties(emptyFunction,{thatReturns:makeEmptyFunction,thatReturnsFalse:makeEmptyFunction(!1),thatReturnsTrue:makeEmptyFunction(!0),thatReturnsNull:makeEmptyFunction(null),thatReturnsThis:function(){return this},thatReturnsArgument:function(arg){return arg}}),module.exports=emptyFunction},{"./copyProperties":48}],50:[function(_dereq_,module){"use strict";var invariant=function(condition,format,a,b,c,d,e,f){if(!condition){var error;if(void 0===format)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],argIndex=0;error=new Error("Invariant Violation: "+format.replace(/%s/g,function(){return args[argIndex++]}))}throw error.framesToPop=1,error}};module.exports=invariant},{}],51:[function(_dereq_,module){"use strict";var emptyFunction=_dereq_("./emptyFunction"),warning=emptyFunction;module.exports=warning},{"./emptyFunction":49}]},{},[14])(14)}); \ No newline at end of file diff --git a/package.json b/package.json index d55890d4a2..1b1c64073d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "0.4.2", + "version": "0.5.0", "description": "A complete routing library for React.js", "tags": [ "react",