juttle-viewer
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -7,5 +7,5 @@ ## [v2.0.0] | ||
[v2.0.0]: https://github.com/rackt/history/compare/v2.0.0-rc3...v2.0.0 | ||
[#221]: https://github.com/rackt/history/issues/221 | ||
[#223]: https://github.com/rackt/history/pull/223 | ||
[v2.0.0]: https://github.com/reactjs/history/compare/v2.0.0-rc3...v2.0.0 | ||
[#221]: https://github.com/reactjs/history/issues/221 | ||
[#223]: https://github.com/reactjs/history/pull/223 | ||
@@ -19,6 +19,6 @@ ## [v2.0.0-rc3] | ||
[v2.0.0-rc3]: https://github.com/rackt/history/compare/v2.0.0-rc2...v2.0.0-rc3 | ||
[#179]: https://github.com/rackt/history/pull/179 | ||
[#208]: https://github.com/rackt/history/pull/208 | ||
[#200]: https://github.com/rackt/history/pull/200 | ||
[v2.0.0-rc3]: https://github.com/reactjs/history/compare/v2.0.0-rc2...v2.0.0-rc3 | ||
[#179]: https://github.com/reactjs/history/pull/179 | ||
[#208]: https://github.com/reactjs/history/pull/208 | ||
[#200]: https://github.com/reactjs/history/pull/200 | ||
@@ -30,3 +30,3 @@ ## [v2.0.0-rc2] | ||
[v2.0.0-rc2]: https://github.com/rackt/history/compare/v2.0.0-rc1...v2.0.0-rc2 | ||
[v2.0.0-rc2]: https://github.com/reactjs/history/compare/v2.0.0-rc1...v2.0.0-rc2 | ||
@@ -38,4 +38,4 @@ ## [v2.0.0-rc1] | ||
[v2.0.0-rc1]: https://github.com/rackt/history/compare/v1.17.0...v2.0.0-rc1 | ||
[#177]: https://github.com/rackt/history/pull/177 | ||
[v2.0.0-rc1]: https://github.com/reactjs/history/compare/v1.17.0...v2.0.0-rc1 | ||
[#177]: https://github.com/reactjs/history/pull/177 | ||
@@ -48,5 +48,5 @@ ## [v1.17.0] | ||
[v1.17.0]: https://github.com/rackt/history/compare/v1.16.0...v1.17.0 | ||
[#170]: https://github.com/rackt/history/pull/170 | ||
[#189]: https://github.com/rackt/history/pull/189 | ||
[v1.17.0]: https://github.com/reactjs/history/compare/v1.16.0...v1.17.0 | ||
[#170]: https://github.com/reactjs/history/pull/170 | ||
[#189]: https://github.com/reactjs/history/pull/189 | ||
@@ -56,8 +56,8 @@ ## [v1.16.0] | ||
- **Bugfix:** Silence all warnings that were introduced since 1.13 (see [rackt/react-router#2682]) | ||
- **Bugfix:** Silence all warnings that were introduced since 1.13 (see [reactjs/react-router#2682]) | ||
- **Deprecation:** Deprecate the `createLocation` method in the top-level exports | ||
- **Deprecation:** Deprecate the `state` arg to `history.createLocation` | ||
[v1.16.0]: https://github.com/rackt/history/compare/v1.15.0...v1.16.0 | ||
[rackt/react-router#2682]: https://github.com/rackt/react-router/issues/2682 | ||
[v1.16.0]: https://github.com/reactjs/history/compare/v1.15.0...v1.16.0 | ||
[reactjs/react-router#2682]: https://github.com/reactjs/react-router/issues/2682 | ||
@@ -70,4 +70,4 @@ ## [v1.15.0] | ||
[v1.15.0]: https://github.com/rackt/history/compare/v1.14.0...v1.15.0 | ||
[#173]: https://github.com/rackt/history/pull/173 | ||
[v1.15.0]: https://github.com/reactjs/history/compare/v1.14.0...v1.15.0 | ||
[#173]: https://github.com/reactjs/history/pull/173 | ||
@@ -84,9 +84,9 @@ ## [v1.14.0] | ||
[v1.14.0]: https://github.com/rackt/history/compare/v1.13.1...v1.14.0 | ||
[#121]: https://github.com/rackt/history/issues/121 | ||
[#141]: https://github.com/rackt/history/pull/141 | ||
[#146]: https://github.com/rackt/history/pull/146 | ||
[#152]: https://github.com/rackt/history/pull/152 | ||
[#167]: https://github.com/rackt/history/pull/167 | ||
[#168]: https://github.com/rackt/history/pull/168 | ||
[v1.14.0]: https://github.com/reactjs/history/compare/v1.13.1...v1.14.0 | ||
[#121]: https://github.com/reactjs/history/issues/121 | ||
[#141]: https://github.com/reactjs/history/pull/141 | ||
[#146]: https://github.com/reactjs/history/pull/146 | ||
[#152]: https://github.com/reactjs/history/pull/152 | ||
[#167]: https://github.com/reactjs/history/pull/167 | ||
[#168]: https://github.com/reactjs/history/pull/168 | ||
@@ -100,5 +100,5 @@ ## [v1.13.1] | ||
[v1.13.1]: https://github.com/rackt/history/compare/v1.13.0...v1.13.1 | ||
[#43]: https://github.com/rackt/history/pull/43 | ||
[#139]: https://github.com/rackt/history/pull/139 | ||
[v1.13.1]: https://github.com/reactjs/history/compare/v1.13.0...v1.13.1 | ||
[#43]: https://github.com/reactjs/history/pull/43 | ||
[#139]: https://github.com/reactjs/history/pull/139 | ||
@@ -112,5 +112,5 @@ ## [v1.13.0] | ||
[v1.13.0]: https://github.com/rackt/history/compare/v1.12.6...v1.13.0 | ||
[#108]: https://github.com/rackt/history/pull/108 | ||
[#94]: https://github.com/rackt/history/issues/94 | ||
[v1.13.0]: https://github.com/reactjs/history/compare/v1.12.6...v1.13.0 | ||
[#108]: https://github.com/reactjs/history/pull/108 | ||
[#94]: https://github.com/reactjs/history/issues/94 | ||
@@ -123,4 +123,4 @@ ## [v1.12.6] | ||
[v1.12.6]: https://github.com/rackt/history/compare/v1.12.5...v1.12.6 | ||
[#95]: https://github.com/rackt/history/issues/95 | ||
[v1.12.6]: https://github.com/reactjs/history/compare/v1.12.5...v1.12.6 | ||
[#95]: https://github.com/reactjs/history/issues/95 | ||
@@ -135,4 +135,4 @@ ## [v1.12.5] | ||
[v1.12.5]: https://github.com/rackt/history/compare/v1.12.4...v1.12.5 | ||
[#93]: https://github.com/rackt/history/issues/93 | ||
[v1.12.5]: https://github.com/reactjs/history/compare/v1.12.4...v1.12.5 | ||
[#93]: https://github.com/reactjs/history/issues/93 | ||
@@ -144,4 +144,4 @@ ## [v1.12.4] | ||
[v1.12.4]: https://github.com/rackt/history/compare/v1.12.3...v1.12.4 | ||
[#62]: https://github.com/rackt/history/issues/62 | ||
[v1.12.4]: https://github.com/reactjs/history/compare/v1.12.3...v1.12.4 | ||
[#62]: https://github.com/reactjs/history/issues/62 | ||
@@ -154,5 +154,5 @@ ## [v1.12.3] | ||
[v1.12.3]: https://github.com/rackt/history/compare/v1.12.2...v1.12.3 | ||
[#71]: https://github.com/rackt/history/issues/71 | ||
[#42]: https://github.com/rackt/history/issues/42 | ||
[v1.12.3]: https://github.com/reactjs/history/compare/v1.12.2...v1.12.3 | ||
[#71]: https://github.com/reactjs/history/issues/71 | ||
[#42]: https://github.com/reactjs/history/issues/42 | ||
@@ -164,4 +164,4 @@ ## [v1.12.2] | ||
[v1.12.2]: https://github.com/rackt/history/compare/v1.12.1...v1.12.2 | ||
[#51-comments]: https://github.com/rackt/history/pull/51#issuecomment-143189672 | ||
[v1.12.2]: https://github.com/reactjs/history/compare/v1.12.1...v1.12.2 | ||
[#51-comments]: https://github.com/reactjs/history/pull/51#issuecomment-143189672 | ||
@@ -174,3 +174,3 @@ ## [v1.12.1] | ||
[v1.12.1]: https://github.com/rackt/history/compare/v1.12.0...v1.12.1 | ||
[v1.12.1]: https://github.com/reactjs/history/compare/v1.12.0...v1.12.1 | ||
@@ -183,3 +183,3 @@ ## [v1.12.0] | ||
[v1.12.0]: https://github.com/rackt/history/compare/v1.11.1...v1.12.0 | ||
[v1.12.0]: https://github.com/reactjs/history/compare/v1.11.1...v1.12.0 | ||
@@ -192,4 +192,4 @@ ## [v1.11.1] | ||
[v1.11.1]: https://github.com/rackt/history/compare/v1.11.0...v1.11.1 | ||
[#68]: https://github.com/rackt/history/issues/68 | ||
[v1.11.1]: https://github.com/reactjs/history/compare/v1.11.0...v1.11.1 | ||
[#68]: https://github.com/reactjs/history/issues/68 | ||
@@ -206,2 +206,2 @@ ## [v1.11.0] | ||
[v1.11.0]: https://github.com/rackt/history/compare/v1.10.2...v1.11.0 | ||
[v1.11.0]: https://github.com/reactjs/history/compare/v1.10.2...v1.11.0 |
"use strict"; | ||
var _slice = Array.prototype.slice; | ||
export { loopAsync }; | ||
function loopAsync(turns, work, callback) { | ||
var currentTurn = 0; | ||
var isDone = false; | ||
var currentTurn = 0, | ||
isDone = false; | ||
var sync = false, | ||
hasNext = false, | ||
doneArgs = undefined; | ||
function done() { | ||
isDone = true; | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
doneArgs = [].concat(_slice.call(arguments)); | ||
return; | ||
} | ||
callback.apply(this, arguments); | ||
@@ -15,9 +25,31 @@ } | ||
function next() { | ||
if (isDone) return; | ||
if (isDone) { | ||
return; | ||
} | ||
if (currentTurn < turns) { | ||
hasNext = true; | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
return; | ||
} | ||
sync = true; | ||
while (!isDone && currentTurn < turns && hasNext) { | ||
hasNext = false; | ||
work.call(this, currentTurn++, next, done); | ||
} else { | ||
done.apply(this, arguments); | ||
} | ||
sync = false; | ||
if (isDone) { | ||
// This means the loop finished synchronously. | ||
callback.apply(this, doneArgs); | ||
return; | ||
} | ||
if (currentTurn >= turns && hasNext) { | ||
isDone = true; | ||
callback(); | ||
} | ||
} | ||
@@ -24,0 +56,0 @@ |
@@ -32,4 +32,4 @@ 'use strict'; | ||
var go = options.go; | ||
var getUserConfirmation = options.getUserConfirmation; | ||
var keyLength = options.keyLength; | ||
var getUserConfirmation = options.getUserConfirmation; | ||
@@ -36,0 +36,0 @@ if (typeof keyLength !== 'number') keyLength = DefaultKeyLength; |
@@ -74,3 +74,2 @@ 'use strict'; | ||
var entry = entries[current]; | ||
var key = entry.key; | ||
var basename = entry.basename; | ||
@@ -82,8 +81,10 @@ var pathname = entry.pathname; | ||
var state = undefined; | ||
if (key) { | ||
var key = undefined, | ||
state = undefined; | ||
if (entry.key) { | ||
key = entry.key; | ||
state = readState(key); | ||
} else { | ||
key = history.createKey(); | ||
state = null; | ||
key = history.createKey(); | ||
entry.key = key; | ||
@@ -90,0 +91,0 @@ } |
@@ -5,4 +5,2 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
import { canUseDOM } from './ExecutionEnvironment'; | ||
@@ -16,7 +14,6 @@ import { extractPath, parsePath } from './PathUtils'; | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var basename = options.basename; | ||
var historyOptions = _objectWithoutProperties(options, ['basename']); | ||
var history = createHistory(options); | ||
var history = createHistory(historyOptions); | ||
var basename = options.basename; | ||
@@ -23,0 +20,0 @@ // Automatically use the value of <base href> in HTML |
@@ -5,4 +5,2 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
import warning from 'warning'; | ||
@@ -35,9 +33,8 @@ import { parse, stringify } from 'query-string'; | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var history = createHistory(options); | ||
var stringifyQuery = options.stringifyQuery; | ||
var parseQueryString = options.parseQueryString; | ||
var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']); | ||
var history = createHistory(historyOptions); | ||
if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery; | ||
@@ -44,0 +41,0 @@ |
"use strict"; | ||
exports.__esModule = true; | ||
var _slice = Array.prototype.slice; | ||
exports.loopAsync = loopAsync; | ||
function loopAsync(turns, work, callback) { | ||
var currentTurn = 0; | ||
var isDone = false; | ||
var currentTurn = 0, | ||
isDone = false; | ||
var sync = false, | ||
hasNext = false, | ||
doneArgs = undefined; | ||
function done() { | ||
isDone = true; | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
doneArgs = [].concat(_slice.call(arguments)); | ||
return; | ||
} | ||
callback.apply(this, arguments); | ||
@@ -16,9 +26,31 @@ } | ||
function next() { | ||
if (isDone) return; | ||
if (isDone) { | ||
return; | ||
} | ||
if (currentTurn < turns) { | ||
hasNext = true; | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
return; | ||
} | ||
sync = true; | ||
while (!isDone && currentTurn < turns && hasNext) { | ||
hasNext = false; | ||
work.call(this, currentTurn++, next, done); | ||
} else { | ||
done.apply(this, arguments); | ||
} | ||
sync = false; | ||
if (isDone) { | ||
// This means the loop finished synchronously. | ||
callback.apply(this, doneArgs); | ||
return; | ||
} | ||
if (currentTurn >= turns && hasNext) { | ||
isDone = true; | ||
callback(); | ||
} | ||
} | ||
@@ -25,0 +57,0 @@ |
@@ -53,4 +53,4 @@ 'use strict'; | ||
var go = options.go; | ||
var getUserConfirmation = options.getUserConfirmation; | ||
var keyLength = options.keyLength; | ||
var getUserConfirmation = options.getUserConfirmation; | ||
@@ -57,0 +57,0 @@ if (typeof keyLength !== 'number') keyLength = DefaultKeyLength; |
@@ -88,3 +88,2 @@ 'use strict'; | ||
var entry = entries[current]; | ||
var key = entry.key; | ||
var basename = entry.basename; | ||
@@ -96,8 +95,10 @@ var pathname = entry.pathname; | ||
var state = undefined; | ||
if (key) { | ||
var key = undefined, | ||
state = undefined; | ||
if (entry.key) { | ||
key = entry.key; | ||
state = readState(key); | ||
} else { | ||
key = history.createKey(); | ||
state = null; | ||
key = history.createKey(); | ||
entry.key = key; | ||
@@ -104,0 +105,0 @@ } |
@@ -9,4 +9,2 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var _ExecutionEnvironment = require('./ExecutionEnvironment'); | ||
@@ -27,7 +25,6 @@ | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var basename = options.basename; | ||
var historyOptions = _objectWithoutProperties(options, ['basename']); | ||
var history = createHistory(options); | ||
var history = createHistory(historyOptions); | ||
var basename = options.basename; | ||
@@ -34,0 +31,0 @@ // Automatically use the value of <base href> in HTML |
@@ -9,4 +9,2 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var _warning = require('warning'); | ||
@@ -49,9 +47,8 @@ | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var history = createHistory(options); | ||
var stringifyQuery = options.stringifyQuery; | ||
var parseQueryString = options.parseQueryString; | ||
var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']); | ||
var history = createHistory(historyOptions); | ||
if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery; | ||
@@ -58,0 +55,0 @@ |
export function loopAsync(turns, work, callback) { | ||
let currentTurn = 0 | ||
let isDone = false | ||
let currentTurn = 0, isDone = false | ||
let sync = false, hasNext = false, doneArgs | ||
function done() { | ||
isDone = true | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
doneArgs = [ ...arguments ] | ||
return | ||
} | ||
callback.apply(this, arguments) | ||
@@ -11,10 +17,31 @@ } | ||
function next() { | ||
if (isDone) | ||
if (isDone) { | ||
return | ||
} | ||
if (currentTurn < turns) { | ||
hasNext = true | ||
if (sync) { | ||
// Iterate instead of recursing if possible. | ||
return | ||
} | ||
sync = true | ||
while (!isDone && currentTurn < turns && hasNext) { | ||
hasNext = false | ||
work.call(this, currentTurn++, next, done) | ||
} else { | ||
done.apply(this, arguments) | ||
} | ||
sync = false | ||
if (isDone) { | ||
// This means the loop finished synchronously. | ||
callback.apply(this, doneArgs) | ||
return | ||
} | ||
if (currentTurn >= turns && hasNext) { | ||
isDone = true | ||
callback() | ||
} | ||
} | ||
@@ -21,0 +48,0 @@ |
@@ -24,5 +24,5 @@ import invariant from 'invariant' | ||
let { forceRefresh } = options | ||
let isSupported = supportsHistory() | ||
let useRefresh = !isSupported || forceRefresh | ||
const { forceRefresh } = options | ||
const isSupported = supportsHistory() | ||
const useRefresh = !isSupported || forceRefresh | ||
@@ -32,3 +32,3 @@ function getCurrentLocation(historyState) { | ||
let path = getWindowPath() | ||
const path = getWindowPath() | ||
let { key } = historyState | ||
@@ -70,3 +70,3 @@ | ||
function finishTransition(location) { | ||
let { basename, pathname, search, hash, state, action, key } = location | ||
const { basename, pathname, search, hash, state, action, key } = location | ||
@@ -78,4 +78,4 @@ if (action === POP) | ||
let path = (basename || '') + pathname + search + hash | ||
let historyState = { | ||
const path = (basename || '') + pathname + search + hash | ||
const historyState = { | ||
key | ||
@@ -101,3 +101,3 @@ } | ||
let history = createDOMHistory({ | ||
const history = createDOMHistory({ | ||
...options, | ||
@@ -115,3 +115,3 @@ getCurrentLocation, | ||
let unlisten = history.listenBefore(listener) | ||
const unlisten = history.listenBefore(listener) | ||
@@ -130,3 +130,3 @@ return function () { | ||
let unlisten = history.listen(listener) | ||
const unlisten = history.listen(listener) | ||
@@ -133,0 +133,0 @@ return function () { |
@@ -7,3 +7,3 @@ import invariant from 'invariant' | ||
function createDOMHistory(options) { | ||
let history = createHistory({ | ||
const history = createHistory({ | ||
getUserConfirmation, | ||
@@ -10,0 +10,0 @@ ...options, |
@@ -15,3 +15,3 @@ import warning from 'warning' | ||
function ensureSlash() { | ||
let path = getHashPath() | ||
const path = getHashPath() | ||
@@ -35,3 +35,3 @@ if (isAbsolutePath(path)) | ||
function getQueryStringValueFromPath(path, key) { | ||
let match = path.match(new RegExp(`\\?.*?\\b${key}=(.+?)\\b`)) | ||
const match = path.match(new RegExp(`\\?.*?\\b${key}=(.+?)\\b`)) | ||
return match && match[1] | ||
@@ -96,3 +96,3 @@ } | ||
function finishTransition(location) { | ||
let { basename, pathname, search, state, action, key } = location | ||
const { basename, pathname, search, state, action, key } = location | ||
@@ -112,3 +112,3 @@ if (action === POP) | ||
let currentHash = getHashPath() | ||
const currentHash = getHashPath() | ||
@@ -129,3 +129,3 @@ if (action === PUSH) { | ||
let history = createDOMHistory({ | ||
const history = createDOMHistory({ | ||
...options, | ||
@@ -143,3 +143,3 @@ getCurrentLocation, | ||
let unlisten = history.listenBefore(listener) | ||
const unlisten = history.listenBefore(listener) | ||
@@ -158,3 +158,3 @@ return function () { | ||
let unlisten = history.listen(listener) | ||
const unlisten = history.listen(listener) | ||
@@ -187,3 +187,3 @@ return function () { | ||
let goIsSupportedWithoutReload = supportsGoWithoutReloadUsingHash() | ||
const goIsSupportedWithoutReload = supportsGoWithoutReloadUsingHash() | ||
@@ -190,0 +190,0 @@ function go(n) { |
@@ -25,3 +25,4 @@ import warning from 'warning' | ||
function createHistory(options={}) { | ||
let { getCurrentLocation, finishTransition, saveState, go, keyLength, getUserConfirmation } = options | ||
const { getCurrentLocation, finishTransition, saveState, go, getUserConfirmation } = options | ||
let { keyLength } = options | ||
@@ -56,3 +57,3 @@ if (typeof keyLength !== 'number') | ||
function updateLocation(newLocation) { | ||
let current = getCurrent() | ||
const current = getCurrent() | ||
@@ -78,3 +79,3 @@ location = newLocation | ||
} else { | ||
let location = getCurrentLocation() | ||
const location = getCurrentLocation() | ||
allKeys = [ location.key ] | ||
@@ -134,4 +135,4 @@ updateLocation(location) | ||
} else if (location && nextLocation.action === POP) { | ||
let prevIndex = allKeys.indexOf(location.key) | ||
let nextIndex = allKeys.indexOf(nextLocation.key) | ||
const prevIndex = allKeys.indexOf(location.key) | ||
const nextIndex = allKeys.indexOf(nextLocation.key) | ||
@@ -138,0 +139,0 @@ if (prevIndex !== -1 && nextIndex !== -1) |
@@ -23,3 +23,3 @@ import warning from 'warning' | ||
let history = createHistory({ | ||
const history = createHistory({ | ||
...options, | ||
@@ -41,3 +41,3 @@ getCurrentLocation, | ||
entries = entries.map(function (entry) { | ||
let key = history.createKey() | ||
const key = history.createKey() | ||
@@ -67,3 +67,3 @@ if (typeof entry === 'string') | ||
let storage = createStateStorage(entries) | ||
const storage = createStateStorage(entries) | ||
@@ -79,12 +79,13 @@ function saveState(key, state) { | ||
function getCurrentLocation() { | ||
let entry = entries[current] | ||
let { key, basename, pathname, search } = entry | ||
let path = (basename || '') + pathname + (search || '') | ||
const entry = entries[current] | ||
const { basename, pathname, search } = entry | ||
const path = (basename || '') + pathname + (search || '') | ||
let state | ||
if (key) { | ||
let key, state | ||
if (entry.key) { | ||
key = entry.key | ||
state = readState(key) | ||
} else { | ||
key = history.createKey() | ||
state = null | ||
key = history.createKey() | ||
entry.key = key | ||
@@ -99,3 +100,3 @@ } | ||
function canGo(n) { | ||
let index = current + n | ||
const index = current + n | ||
return index >= 0 && index < entries.length | ||
@@ -117,3 +118,3 @@ } | ||
let currentLocation = getCurrentLocation() | ||
const currentLocation = getCurrentLocation() | ||
@@ -120,0 +121,0 @@ // change action to POP |
@@ -50,3 +50,3 @@ export function addEventListener(node, event, listener) { | ||
export function supportsHistory() { | ||
let ua = navigator.userAgent | ||
const ua = navigator.userAgent | ||
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && | ||
@@ -65,4 +65,4 @@ ua.indexOf('Mobile Safari') !== -1 && | ||
export function supportsGoWithoutReloadUsingHash() { | ||
let ua = navigator.userAgent | ||
const ua = navigator.userAgent | ||
return ua.indexOf('Firefox') === -1 | ||
} |
@@ -23,3 +23,3 @@ import warning from 'warning' | ||
let hashIndex = pathname.indexOf('#') | ||
const hashIndex = pathname.indexOf('#') | ||
if (hashIndex !== -1) { | ||
@@ -30,3 +30,3 @@ hash = pathname.substring(hashIndex) | ||
let searchIndex = pathname.indexOf('?') | ||
const searchIndex = pathname.indexOf('?') | ||
if (searchIndex !== -1) { | ||
@@ -33,0 +33,0 @@ search = pathname.substring(searchIndex) |
@@ -8,9 +8,10 @@ import { canUseDOM } from './ExecutionEnvironment' | ||
return function (options={}) { | ||
let { basename, ...historyOptions } = options | ||
let history = createHistory(historyOptions) | ||
const history = createHistory(options) | ||
let { basename } = options | ||
// Automatically use the value of <base href> in HTML | ||
// documents as basename if it's not explicitly given. | ||
if (basename == null && canUseDOM) { | ||
let base = document.getElementsByTagName('base')[0] | ||
const base = document.getElementsByTagName('base')[0] | ||
@@ -17,0 +18,0 @@ if (base) |
@@ -8,3 +8,3 @@ import warning from 'warning' | ||
function listener(event) { | ||
let message = getBeforeUnloadPromptMessage() | ||
const message = getBeforeUnloadPromptMessage() | ||
@@ -31,3 +31,3 @@ if (typeof message === 'string') { | ||
return function (options) { | ||
let history = createHistory(options) | ||
const history = createHistory(options) | ||
@@ -74,3 +74,3 @@ let stopBeforeUnloadListener | ||
beforeUnloadHooks.push(hook) | ||
if (beforeUnloadHooks.length === 1) | ||
@@ -77,0 +77,0 @@ stopBeforeUnloadListener = startBeforeUnloadListener(getBeforeUnloadPromptMessage) |
@@ -32,5 +32,6 @@ import warning from 'warning' | ||
return function (options={}) { | ||
let { stringifyQuery, parseQueryString, ...historyOptions } = options | ||
let history = createHistory(historyOptions) | ||
const history = createHistory(options) | ||
let { stringifyQuery, parseQueryString } = options | ||
if (typeof stringifyQuery !== 'function') | ||
@@ -37,0 +38,0 @@ stringifyQuery = defaultStringifyQuery |
@@ -5,7 +5,7 @@ { | ||
"history@^2.0.0", | ||
"/Users/olegseletsky/git/juttle/juttle-viewer" | ||
"/Users/mattnibecker/Code/juttle-viewer" | ||
] | ||
], | ||
"_from": "history@>=2.0.0 <3.0.0", | ||
"_id": "history@2.0.0", | ||
"_id": "history@2.0.1", | ||
"_inCache": true, | ||
@@ -16,4 +16,4 @@ "_installable": true, | ||
"_npmOperationalInternal": { | ||
"host": "packages-5-east.internal.npmjs.com", | ||
"tmp": "tmp/history-2.0.0.tgz_1454610918089_0.9449934186413884" | ||
"host": "packages-13-west.internal.npmjs.com", | ||
"tmp": "tmp/history-2.0.1.tgz_1456978260388_0.6892792345024645" | ||
}, | ||
@@ -38,7 +38,7 @@ "_npmUser": { | ||
], | ||
"_resolved": "https://registry.npmjs.org/history/-/history-2.0.0.tgz", | ||
"_shasum": "6d5144af2da8a3dea4e5f1abae11a3c2e868e2c7", | ||
"_resolved": "https://registry.npmjs.org/history/-/history-2.0.1.tgz", | ||
"_shasum": "4a0b7f2b87b29f4da2d47910f0c86de0fad579f8", | ||
"_shrinkwrap": null, | ||
"_spec": "history@^2.0.0", | ||
"_where": "/Users/olegseletsky/git/juttle/juttle-viewer", | ||
"_where": "/Users/mattnibecker/Code/juttle-viewer", | ||
"authors": [ | ||
@@ -48,3 +48,3 @@ "Michael Jackson" | ||
"bugs": { | ||
"url": "https://github.com/rackt/history/issues" | ||
"url": "https://github.com/mjackson/history/issues" | ||
}, | ||
@@ -57,21 +57,18 @@ "dependencies": { | ||
}, | ||
"description": "A minimal, functional history implementation for JavaScript", | ||
"description": "Manage browser history with JavaScript", | ||
"devDependencies": { | ||
"assert": "1.3.0", | ||
"babel": "^5.4.7", | ||
"babel-core": "^5.4.7", | ||
"babel-eslint": "^3.1.23", | ||
"babel-loader": "^5.0.0", | ||
"babel": "^5.8.35", | ||
"babel-core": "^5.8.35", | ||
"babel-eslint": "^4.1.8", | ||
"babel-loader": "^5.4.0", | ||
"babel-plugin-dev-expression": "^0.1.0", | ||
"eslint": "1.4.1", | ||
"eslint-config-rackt": "1.0.0", | ||
"eslint-plugin-react": "3.3.2", | ||
"eslint": "^1.10.3", | ||
"eslint-config-rackt": "^1.1.1", | ||
"eslint-plugin-react": "^3.16.1", | ||
"expect": "^1.12.0", | ||
"gzip-size": "^3.0.0", | ||
"isparta-loader": "^1.0.0", | ||
"karma": "^0.13.3", | ||
"karma-browserstack-launcher": "^0.1.3", | ||
"karma-chrome-launcher": "^0.2.0", | ||
"karma-coverage": "^0.5.3", | ||
"karma-coveralls": "^1.1.2", | ||
"karma-mocha": "^0.2.0", | ||
@@ -82,3 +79,4 @@ "karma-mocha-reporter": "^1.0.4", | ||
"mocha": "^2.0.1", | ||
"pretty-bytes": "^2.0.1", | ||
"pretty-bytes": "^3.0.1", | ||
"readline-sync": "^1.4.1", | ||
"rimraf": "^2.4.2", | ||
@@ -90,16 +88,13 @@ "webpack": "^1.4.13", | ||
"dist": { | ||
"shasum": "6d5144af2da8a3dea4e5f1abae11a3c2e868e2c7", | ||
"tarball": "http://registry.npmjs.org/history/-/history-2.0.0.tgz" | ||
"shasum": "4a0b7f2b87b29f4da2d47910f0c86de0fad579f8", | ||
"tarball": "http://registry.npmjs.org/history/-/history-2.0.1.tgz" | ||
}, | ||
"files": [ | ||
"*.md", | ||
"docs", | ||
"es6", | ||
"lib", | ||
"modules/*.js", | ||
"npm-scripts", | ||
"umd" | ||
], | ||
"gitHead": "b4def645e6ffd99cbee7a387717b826493f07972", | ||
"homepage": "https://github.com/rackt/history#readme", | ||
"gitHead": "1b4003f91cfb09c47122831633226a657c5ea686", | ||
"homepage": "https://github.com/mjackson/history#readme", | ||
"jsnext:main": "es6/index", | ||
@@ -114,4 +109,4 @@ "keywords": [ | ||
{ | ||
"name": "mjackson", | ||
"email": "mjijackson@gmail.com" | ||
"email": "mjijackson@gmail.com", | ||
"name": "mjackson" | ||
} | ||
@@ -124,6 +119,6 @@ ], | ||
"type": "git", | ||
"url": "git+https://github.com/rackt/history.git" | ||
"url": "git+https://github.com/mjackson/history.git" | ||
}, | ||
"scripts": { | ||
"build": "npm run build-cjs && npm run build-es6", | ||
"build": "node ./scripts/build.js", | ||
"build-cjs": "rimraf lib && babel ./modules --stage 0 --loose all --plugins dev-expression -d lib --ignore '__tests__'", | ||
@@ -134,3 +129,4 @@ "build-es6": "rimraf es6 && babel ./modules --stage 0 --loose all --plugins dev-expression -d es6 --blacklist=es6.modules --ignore '__tests__'", | ||
"lint": "eslint modules", | ||
"postinstall": "node ./npm-scripts/postinstall.js", | ||
"prepublish": "npm run build", | ||
"release": "node ./scripts/release.js", | ||
"start": "webpack-dev-server -d --content-base ./ --history-api-fallback --inline modules/index.js", | ||
@@ -143,3 +139,3 @@ "test": "npm run lint && karma start" | ||
], | ||
"version": "2.0.0" | ||
"version": "2.0.1" | ||
} |
# history [![Travis][build-badge]][build] [![npm package][npm-badge]][npm] | ||
[build-badge]: https://img.shields.io/travis/mjackson/history/master.svg?style=flat-square | ||
[build]: https://travis-ci.org/mjackson/history | ||
[npm-badge]: https://img.shields.io/npm/v/history.svg?style=flat-square | ||
[npm]: https://www.npmjs.org/package/history | ||
[`history`](https://www.npmjs.com/package/history) is a JavaScript library that lets you easily manage session history in browsers, testing environments, and (soon, via [React Native](https://facebook.github.io/react-native/)) native devices. `history` abstracts away the differences in these different platforms and provides a minimal API that lets you manage the history stack, navigate, confirm navigation, and persist state between sessions. `history` is library-agnostic and may easily be included in any JavaScript project. | ||
[![Coveralls][coveralls-badge]][coveralls] | ||
[![Discord][discord-badge]][discord] | ||
## Docs & Help | ||
@@ -20,3 +23,3 @@ | ||
$ npm install history | ||
$ npm install --save history | ||
@@ -48,7 +51,7 @@ Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else: | ||
let history = createHistory() | ||
const history = createHistory() | ||
// Listen for changes to the current location. The | ||
// listener is called once immediately. | ||
let unlisten = history.listen(location => { | ||
const unlisten = history.listen(location => { | ||
console.log(location.pathname) | ||
@@ -67,3 +70,3 @@ }) | ||
You can find many more examples [in the documentation](https://github.com/rackt/history/tree/master/docs)! | ||
You can find many more examples [in the documentation](https://github.com/mjackson/history/tree/master/docs)! | ||
@@ -75,13 +78,1 @@ ## Thanks | ||
Also, thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to run our build in real browsers. | ||
[build-badge]: https://img.shields.io/travis/rackt/history/master.svg?style=flat-square | ||
[build]: https://travis-ci.org/rackt/history | ||
[npm-badge]: https://img.shields.io/npm/v/history.svg?style=flat-square | ||
[npm]: https://www.npmjs.org/package/history | ||
[coveralls-badge]: https://img.shields.io/coveralls/rackt/history/master.svg?style=flat-square | ||
[coveralls]: https://coveralls.io/github/rackt/history | ||
[discord-badge]: https://img.shields.io/badge/Discord-join%20chat%20%E2%86%92-738bd7.svg?style=flat-square | ||
[discord]: https://discord.gg/0ZcbPKXt5bYaNQ46 |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(12),i=r(u),s=n(16),c=r(s);t.createHistory=c["default"];var f=n(17),l=r(f);t.createHashHistory=l["default"];var d=n(18),p=r(d);t.createMemoryHistory=p["default"];var h=n(21),g=r(h);t.useBasename=g["default"];var v=n(13),y=r(v);t.useBeforeUnload=y["default"];var m=n(14),w=r(m);t.useQueries=w["default"];var P=n(4),O=r(P);t.Actions=O["default"];var _=n(19),b=r(_);t.enableBeforeUnload=b["default"];var S=n(20),x=r(S);t.enableQueries=x["default"];var H=o["default"](i["default"],"Using createLocation without a history instance is deprecated; please use history.createLocation instead");t.createLocation=H},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function o(e){var t=a(e),n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substring(o),t=t.substring(0,o));var u=t.indexOf("?");return-1!==u&&(n=t.substring(u),t=t.substring(0,u)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=a,t.parsePath=o;var u=n(1);r(u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){return function(){return e.apply(this,arguments)}}t.__esModule=!0;var o=n(1);r(o);t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var a="POP";t.POP=a,t["default"]={PUSH:n,REPLACE:r,POP:a}},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function a(){return window.location.href.split("#")[1]||""}function o(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function u(){return window.location.pathname+window.location.search+window.location.hash}function i(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function c(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function f(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=a,t.replaceHashPath=o,t.getWindowPath=u,t.go=i,t.getUserConfirmation=s,t.supportsHistory=c,t.supportsGoWithoutReloadUsingHash=f},function(e,t,n){"use strict";var r=function(e,t,n,r,a,o,u,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,u,i],f=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[f++]}))}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){var r=e(t,n);e.length<2&&n(r)}t.__esModule=!0;var o=n(1);r(o);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return s+e}function o(e,t){try{null==t?window.sessionStorage.removeItem(a(e)):window.sessionStorage.setItem(a(e),JSON.stringify(t))}catch(n){if(n.name===f)return;if(c.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}}function u(e){var t=void 0;try{t=window.sessionStorage.getItem(a(e))}catch(n){if(n.name===f)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=o,t.readState=u;var i=n(1),s=(r(i),"@@History/"),c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],f="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(e){return s.canUseDOM?void 0:i["default"](!1),n.listen(e)}var n=l["default"](o({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(7),i=r(u),s=n(5),c=n(6),f=n(11),l=r(f);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return Math.random().toString(36).substr(2,e)}function o(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&f["default"](e.state,t.state)}function u(){function e(e){return q.push(e),function(){q=q.filter(function(t){return t!==e})}}function t(){return K&&K.action===p.POP?D.indexOf(K.key):I?D.indexOf(I.key):-1}function n(e){var n=t();I=e,I.action===p.PUSH?D=[].concat(D.slice(0,n+1),[I.key]):I.action===p.REPLACE&&(D[n]=I.key),Q.forEach(function(e){e(I)})}function r(e){if(Q.push(e),I)e(I);else{var t=L();D=[t.key],n(t)}return function(){Q=Q.filter(function(t){return t!==e})}}function u(e,t){d.loopAsync(q.length,function(t,n,r){y["default"](q[t],e,function(e){null!=e?r(e):n()})},function(e){R&&"string"==typeof e?R(e,function(e){t(e!==!1)}):t(e!==!1)})}function s(e){I&&o(I,e)||(K=e,u(e,function(t){if(K===e)if(t){if(e.action===p.PUSH){var r=_(I),a=_(e);a===r&&f["default"](I.state,e.state)&&(e.action=p.REPLACE)}A(e)!==!1&&n(e)}else if(I&&e.action===p.POP){var o=D.indexOf(I.key),u=D.indexOf(e.key);-1!==o&&-1!==u&&T(o-u)}}))}function c(e){s(S(e,p.PUSH,O()))}function h(e){s(S(e,p.REPLACE,O()))}function v(){T(-1)}function m(){T(1)}function O(){return a(C)}function _(e){if(null==e||"string"==typeof e)return e;var t=e.pathname,n=e.search,r=e.hash,a=t;return n&&(a+=n),r&&(a+=r),a}function b(e){return _(e)}function S(e,t){var n=arguments.length<=2||void 0===arguments[2]?O():arguments[2];return"object"==typeof t&&("string"==typeof e&&(e=l.parsePath(e)),e=i({},e,{state:t}),t=n,n=arguments[3]||O()),g["default"](e,t,n)}function x(e){I?(H(I,e),n(I)):H(L(),e)}function H(e,t){e.state=i({},e.state,t),B(e.key,e.state)}function k(e){-1===q.indexOf(e)&&q.push(e)}function M(e){q=q.filter(function(t){return t!==e})}function E(e,t){"string"==typeof t&&(t=l.parsePath(t)),c(i({state:e},t))}function j(e,t){"string"==typeof t&&(t=l.parsePath(t)),h(i({state:e},t))}var U=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],L=U.getCurrentLocation,A=U.finishTransition,B=U.saveState,T=U.go,C=U.keyLength,R=U.getUserConfirmation;"number"!=typeof C&&(C=P);var q=[],D=[],Q=[],I=void 0,K=void 0;return{listenBefore:e,listen:r,transitionTo:s,push:c,replace:h,go:T,goBack:v,goForward:m,createKey:O,createPath:_,createHref:b,createLocation:S,setState:w["default"](x,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:w["default"](k,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:w["default"](M,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead"),pushState:w["default"](E,"pushState is deprecated; use push instead"),replaceState:w["default"](j,"replaceState is deprecated; use replace instead")}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),c=(r(s),n(22)),f=r(c),l=n(2),d=n(15),p=n(4),h=n(12),g=r(h),v=n(8),y=r(v),m=n(3),w=r(m),P=6;t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?i.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];"string"==typeof e&&(e=s.parsePath(e)),"object"==typeof t&&(e=o({},e,{state:t}),t=n||i.POP,n=r);var a=e.pathname||"/",u=e.search||"",c=e.hash||"",f=e.state||null;return{pathname:a,search:u,hash:c,state:f,action:t,key:n}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(1),i=(r(u),n(4)),s=n(2);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0}return c.addEventListener(window,"beforeunload",t),function(){c.removeEventListener(window,"beforeunload",t)}}function o(e){return function(t){function n(){for(var e=void 0,t=0,n=d.length;null==e&&n>t;++t)e=d[t].call();return e}function r(e){return d.push(e),1===d.length&&s.canUseDOM&&(f=a(n)),function(){d=d.filter(function(t){return t!==e}),0===d.length&&f&&(f(),f=null)}}function o(e){s.canUseDOM&&-1===d.indexOf(e)&&(d.push(e),1===d.length&&(f=a(n)))}function i(e){d.length>0&&(d=d.filter(function(t){return t!==e}),0===d.length&&f())}var c=e(t),f=void 0,d=[];return u({},c,{listenBeforeUnload:r,registerBeforeUnloadHook:l["default"](o,"registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead"),unregisterBeforeUnloadHook:l["default"](i,"unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=(r(i),n(5)),c=n(6),f=n(3),l=r(f);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return c.stringify(e).replace(/%20/g,"+")}function u(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=_(t.substring(1)),e[g]={search:t,searchBase:""}}return e}function n(e,t){var n,r=e[g],a=t?O(t):"";if(!r&&!a)return e;"string"==typeof e&&(e=d.parsePath(e));var o=void 0;o=r&&e.search===r.search?r.searchBase:e.search||"";var u=o;return a&&(u+=(u?"&":"?")+a),i({},e,(n={search:u},n[g]={search:u,searchBase:o},n))}function r(e){return S.listenBefore(function(n,r){l["default"](e,t(n),r)})}function u(e){return S.listen(function(n){e(t(n))})}function s(e){S.push(n(e,e.query))}function c(e){S.replace(n(e,e.query))}function f(e,t){return S.createPath(n(e,t||e.query))}function p(e,t){return S.createHref(n(e,t||e.query))}function y(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];var u=S.createLocation.apply(S,[n(e,e.query)].concat(a));return e.query&&(u.query=e.query),t(u)}function m(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),s(i({state:e},t,{query:n}))}function w(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),c(i({state:e},t,{query:n}))}var P=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],O=P.stringifyQuery,_=P.parseQueryString,b=a(P,["stringifyQuery","parseQueryString"]),S=e(b);return"function"!=typeof O&&(O=o),"function"!=typeof _&&(_=v),i({},S,{listenBefore:r,listen:u,push:s,replace:c,createPath:f,createHref:p,createLocation:y,pushState:h["default"](m,"pushState is deprecated; use push instead"),replaceState:h["default"](w,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),c=(r(s),n(25)),f=n(8),l=r(f),d=n(2),p=n(3),h=r(p),g="$searchBase",v=c.parse;t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function a(){u||(e>o?t.call(this,o++,a,r):r.apply(this,arguments))}var o=0,u=!1;a()}t.__esModule=!0,t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){function e(e){e=e||window.history.state||{};var t=l.getWindowPath(),n=e,r=n.key,a=void 0;r?a=d.readState(r):(a=null,r=w.createKey(),y&&window.history.replaceState(o({},e,{key:r}),null,t));var u=c.parsePath(t);return w.createLocation(o({},u,{state:a}),void 0,r)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return l.addEventListener(window,"popstate",n),function(){l.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,a=e.hash,o=e.state,u=e.action,i=e.key;if(u!==s.POP){d.saveState(i,o);var c=(t||"")+n+r+a,f={key:i};if(u===s.PUSH){if(m)return window.location.href=c,!1;window.history.pushState(f,null,c)}else{if(m)return window.location.replace(c),!1;window.history.replaceState(f,null,c)}}}function r(e){1===++P&&(O=t(w));var n=w.listenBefore(e);return function(){n(),0===--P&&O()}}function a(e){1===++P&&(O=t(w));var n=w.listen(e);return function(){n(),0===--P&&O()}}function u(e){1===++P&&(O=t(w)),w.registerTransitionHook(e)}function p(e){w.unregisterTransitionHook(e),0===--P&&O()}var g=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f.canUseDOM?void 0:i["default"](!1);var v=g.forceRefresh,y=l.supportsHistory(),m=!y||v,w=h["default"](o({},g,{getCurrentLocation:e,finishTransition:n,saveState:d.saveState})),P=0,O=void 0;return o({},w,{listenBefore:r,listen:a,registerTransitionHook:u,unregisterTransitionHook:p})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(7),i=r(u),s=n(4),c=n(2),f=n(5),l=n(6),d=n(9),p=n(10),h=r(p);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return"string"==typeof e&&"/"===e.charAt(0)}function o(){var e=y.getHashPath();return a(e)?!0:(y.replaceHashPath("/"+e),!1)}function u(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function i(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=y.getHashPath(),t=void 0,n=void 0;k?(t=s(e,k),e=i(e,k),t?n=m.readState(t):(n=null,t=M.createKey(),y.replaceHashPath(u(e,k,t)))):t=n=null;var r=g.parsePath(e);return M.createLocation(f({},r,{state:n}),void 0,t)}function t(t){function n(){o()&&r(e())}var r=t.transitionTo;return o(),y.addEventListener(window,"hashchange",n),function(){y.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,a=e.state,o=e.action,i=e.key;if(o!==h.POP){var s=(t||"")+n+r;k?(s=u(s,k,i),m.saveState(i,a)):e.key=e.state=null;var c=y.getHashPath();o===h.PUSH?c!==s&&(window.location.hash=s):c!==s&&y.replaceHashPath(s)}}function r(e){1===++E&&(j=t(M));var n=M.listenBefore(e);return function(){n(),0===--E&&j()}}function a(e){1===++E&&(j=t(M));var n=M.listen(e);return function(){n(),0===--E&&j()}}function c(e){M.push(e)}function l(e){M.replace(e)}function d(e){M.go(e)}function w(e){return"#"+M.createHref(e)}function _(e){1===++E&&(j=t(M)),M.registerTransitionHook(e)}function b(e){M.unregisterTransitionHook(e),0===--E&&j()}function S(e,t){M.pushState(e,t)}function x(e,t){M.replaceState(e,t)}var H=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];v.canUseDOM?void 0:p["default"](!1);var k=H.queryKey;(void 0===k||k)&&(k="string"==typeof k?k:O);var M=P["default"](f({},H,{getCurrentLocation:e,finishTransition:n,saveState:m.saveState})),E=0,j=void 0;y.supportsGoWithoutReloadUsingHash();return f({},M,{listenBefore:r,listen:a,push:c,replace:l,go:d,createHref:w,registerTransitionHook:_,unregisterTransitionHook:b,pushState:S,replaceState:x})}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(1),d=(r(l),n(7)),p=r(d),h=n(4),g=n(2),v=n(5),y=n(6),m=n(9),w=n(10),P=r(w),O="_k";t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function o(){function e(e,t){y[e]=t}function t(e){return y[e]}function n(){var e=g[v],n=e.key,r=e.basename,a=e.pathname,o=e.search,i=(r||"")+a+(o||""),s=void 0;n?s=t(n):(s=null,n=d.createKey(),e.key=n);var c=f.parsePath(i);return d.createLocation(u({},c,{state:s}),void 0,n)}function r(e){var t=v+e;return t>=0&&t<g.length}function o(e){if(e){if(!r(e))return;v+=e;var t=n();d.transitionTo(u({},t,{action:l.POP}))}}function i(t){switch(t.action){case l.PUSH:v+=1,v<g.length&&g.splice(v),g.push(t),e(t.key,t.state);break;case l.REPLACE:g[v]=t,e(t.key,t.state)}}var s=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(s)?s={entries:s}:"string"==typeof s&&(s={entries:[s]});var d=p["default"](u({},s,{getCurrentLocation:n,finishTransition:i,saveState:e,go:o})),h=s,g=h.entries,v=h.current;"string"==typeof g?g=[g]:Array.isArray(g)||(g=["/"]),g=g.map(function(e){var t=d.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?u({},e,{key:t}):void c["default"](!1)}),null==v?v=g.length-1:v>=0&&v<g.length?void 0:c["default"](!1);var y=a(g);return d}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=(r(i),n(7)),c=r(s),f=n(2),l=n(4),d=n(11),p=r(d);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(13),i=r(u);t["default"]=o["default"](i["default"],"enableBeforeUnload is deprecated, use useBeforeUnload instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(14),i=r(u);t["default"]=o["default"](i["default"],"enableQueries is deprecated, use useQueries instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){function t(e){return w&&null==e.basename&&(0===e.pathname.indexOf(w)?(e.pathname=e.pathname.substring(w.length),e.basename=w,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!w)return e;"string"==typeof e&&(e=s.parsePath(e));var t=e.pathname,n="/"===w.slice(-1)?w:w+"/",r="/"===t.charAt(0)?t.slice(1):t,a=n+r;return u({},e,{pathname:a})}function r(e){return O.listenBefore(function(n,r){f["default"](e,t(n),r)})}function o(e){return O.listen(function(n){e(t(n))})}function c(e){O.push(n(e))}function l(e){O.replace(n(e))}function p(e){return O.createPath(n(e))}function h(e){return O.createHref(n(e))}function g(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];return t(O.createLocation.apply(O,[n(e)].concat(a)))}function v(e,t){"string"==typeof t&&(t=s.parsePath(t)),c(u({state:e},t))}function y(e,t){"string"==typeof t&&(t=s.parsePath(t)),l(u({state:e},t))}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],w=m.basename,P=a(m,["basename"]),O=e(P);if(null==w&&i.canUseDOM){var _=document.getElementsByTagName("base")[0];_&&(w=s.extractPath(_.href))}return u({},O,{listenBefore:r,listen:o,push:c,replace:l,createPath:p,createHref:h,createLocation:g,pushState:d["default"](v,"pushState is deprecated; use push instead"),replaceState:d["default"](y,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(5),s=n(2),c=n(8),f=r(c),l=n(3),d=r(l);t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function a(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,n){var o,f;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=u.call(e),t=u.call(t),c(e,t,n)):!1;if(a(e)){if(!a(t))return!1;if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}try{var l=i(e),d=i(t)}catch(p){return!1}if(l.length!=d.length)return!1;for(l.sort(),d.sort(),o=l.length-1;o>=0;o--)if(l[o]!=d[o])return!1;for(o=l.length-1;o>=0;o--)if(f=l[o],!c(e[f],t[f],n))return!1;return typeof e==typeof t}var u=Array.prototype.slice,i=n(24),s=n(23),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=a?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){"use strict";var r=n(26);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),a=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),a=void 0===a?null:decodeURIComponent(a),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(a):e[r]=[e[r],a]:e[r]=a,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(12),i=r(u),s=n(16),c=r(s);t.createHistory=c["default"];var f=n(17),l=r(f);t.createHashHistory=l["default"];var d=n(18),p=r(d);t.createMemoryHistory=p["default"];var h=n(21),g=r(h);t.useBasename=g["default"];var v=n(13),y=r(v);t.useBeforeUnload=y["default"];var m=n(14),w=r(m);t.useQueries=w["default"];var P=n(4),_=r(P);t.Actions=_["default"];var O=n(19),b=r(O);t.enableBeforeUnload=b["default"];var S=n(20),x=r(S);t.enableQueries=x["default"];var k=o["default"](i["default"],"Using createLocation without a history instance is deprecated; please use history.createLocation instead");t.createLocation=k},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function o(e){var t=a(e),n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substring(o),t=t.substring(0,o));var u=t.indexOf("?");return-1!==u&&(n=t.substring(u),t=t.substring(0,u)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=a,t.parsePath=o;var u=n(1);r(u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){return function(){return e.apply(this,arguments)}}t.__esModule=!0;var o=n(1);r(o);t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var a="POP";t.POP=a,t["default"]={PUSH:n,REPLACE:r,POP:a}},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function a(){return window.location.href.split("#")[1]||""}function o(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function u(){return window.location.pathname+window.location.search+window.location.hash}function i(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function c(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function f(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=a,t.replaceHashPath=o,t.getWindowPath=u,t.go=i,t.getUserConfirmation=s,t.supportsHistory=c,t.supportsGoWithoutReloadUsingHash=f},function(e,t,n){"use strict";var r=function(e,t,n,r,a,o,u,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,u,i],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){var r=e(t,n);e.length<2&&n(r)}t.__esModule=!0;var o=n(1);r(o);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return s+e}function o(e,t){try{null==t?window.sessionStorage.removeItem(a(e)):window.sessionStorage.setItem(a(e),JSON.stringify(t))}catch(n){if(n.name===f)return;if(c.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}}function u(e){var t=void 0;try{t=window.sessionStorage.getItem(a(e))}catch(n){if(n.name===f)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=o,t.readState=u;var i=n(1),s=(r(i),"@@History/"),c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],f="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(e){return s.canUseDOM?void 0:i["default"](!1),n.listen(e)}var n=l["default"](o({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(7),i=r(u),s=n(5),c=n(6),f=n(11),l=r(f);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return Math.random().toString(36).substr(2,e)}function o(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&f["default"](e.state,t.state)}function u(){function e(e){return q.push(e),function(){q=q.filter(function(t){return t!==e})}}function t(){return K&&K.action===p.POP?D.indexOf(K.key):Q?D.indexOf(Q.key):-1}function n(e){var n=t();Q=e,Q.action===p.PUSH?D=[].concat(D.slice(0,n+1),[Q.key]):Q.action===p.REPLACE&&(D[n]=Q.key),I.forEach(function(e){e(Q)})}function r(e){if(I.push(e),Q)e(Q);else{var t=L();D=[t.key],n(t)}return function(){I=I.filter(function(t){return t!==e})}}function u(e,t){d.loopAsync(q.length,function(t,n,r){y["default"](q[t],e,function(e){null!=e?r(e):n()})},function(e){C&&"string"==typeof e?C(e,function(e){t(e!==!1)}):t(e!==!1)})}function s(e){Q&&o(Q,e)||(K=e,u(e,function(t){if(K===e)if(t){if(e.action===p.PUSH){var r=O(Q),a=O(e);a===r&&f["default"](Q.state,e.state)&&(e.action=p.REPLACE)}A(e)!==!1&&n(e)}else if(Q&&e.action===p.POP){var o=D.indexOf(Q.key),u=D.indexOf(e.key);-1!==o&&-1!==u&&T(o-u)}}))}function c(e){s(S(e,p.PUSH,_()))}function h(e){s(S(e,p.REPLACE,_()))}function v(){T(-1)}function m(){T(1)}function _(){return a(R)}function O(e){if(null==e||"string"==typeof e)return e;var t=e.pathname,n=e.search,r=e.hash,a=t;return n&&(a+=n),r&&(a+=r),a}function b(e){return O(e)}function S(e,t){var n=arguments.length<=2||void 0===arguments[2]?_():arguments[2];return"object"==typeof t&&("string"==typeof e&&(e=l.parsePath(e)),e=i({},e,{state:t}),t=n,n=arguments[3]||_()),g["default"](e,t,n)}function x(e){Q?(k(Q,e),n(Q)):k(L(),e)}function k(e,t){e.state=i({},e.state,t),B(e.key,e.state)}function H(e){-1===q.indexOf(e)&&q.push(e)}function M(e){q=q.filter(function(t){return t!==e})}function E(e,t){"string"==typeof t&&(t=l.parsePath(t)),c(i({state:e},t))}function j(e,t){"string"==typeof t&&(t=l.parsePath(t)),h(i({state:e},t))}var U=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],L=U.getCurrentLocation,A=U.finishTransition,B=U.saveState,T=U.go,C=U.getUserConfirmation,R=U.keyLength;"number"!=typeof R&&(R=P);var q=[],D=[],I=[],Q=void 0,K=void 0;return{listenBefore:e,listen:r,transitionTo:s,push:c,replace:h,go:T,goBack:v,goForward:m,createKey:_,createPath:O,createHref:b,createLocation:S,setState:w["default"](x,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:w["default"](H,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:w["default"](M,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead"),pushState:w["default"](E,"pushState is deprecated; use push instead"),replaceState:w["default"](j,"replaceState is deprecated; use replace instead")}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(1),c=(r(s),n(22)),f=r(c),l=n(2),d=n(15),p=n(4),h=n(12),g=r(h),v=n(8),y=r(v),m=n(3),w=r(m),P=6;t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?i.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];"string"==typeof e&&(e=s.parsePath(e)),"object"==typeof t&&(e=o({},e,{state:t}),t=n||i.POP,n=r);var a=e.pathname||"/",u=e.search||"",c=e.hash||"",f=e.state||null;return{pathname:a,search:u,hash:c,state:f,action:t,key:n}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(1),i=(r(u),n(4)),s=n(2);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0}return c.addEventListener(window,"beforeunload",t),function(){c.removeEventListener(window,"beforeunload",t)}}function o(e){return function(t){function n(){for(var e=void 0,t=0,n=d.length;null==e&&n>t;++t)e=d[t].call();return e}function r(e){return d.push(e),1===d.length&&s.canUseDOM&&(f=a(n)),function(){d=d.filter(function(t){return t!==e}),0===d.length&&f&&(f(),f=null)}}function o(e){s.canUseDOM&&-1===d.indexOf(e)&&(d.push(e),1===d.length&&(f=a(n)))}function i(e){d.length>0&&(d=d.filter(function(t){return t!==e}),0===d.length&&f())}var c=e(t),f=void 0,d=[];return u({},c,{listenBeforeUnload:r,registerBeforeUnloadHook:l["default"](o,"registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead"),unregisterBeforeUnloadHook:l["default"](i,"unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=(r(i),n(5)),c=n(6),f=n(3),l=r(f);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return s.stringify(e).replace(/%20/g,"+")}function o(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=O(t.substring(1)),e[h]={search:t,searchBase:""}}return e}function n(e,t){var n,r=e[h],a=t?_(t):"";if(!r&&!a)return e;"string"==typeof e&&(e=l.parsePath(e));var o=void 0;o=r&&e.search===r.search?r.searchBase:e.search||"";var i=o;return a&&(i+=(i?"&":"?")+a),u({},e,(n={search:i},n[h]={search:i,searchBase:o},n))}function r(e){return P.listenBefore(function(n,r){f["default"](e,t(n),r)})}function o(e){return P.listen(function(n){e(t(n))})}function i(e){P.push(n(e,e.query))}function s(e){P.replace(n(e,e.query))}function c(e,t){return P.createPath(n(e,t||e.query))}function d(e,t){return P.createHref(n(e,t||e.query))}function v(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];var u=P.createLocation.apply(P,[n(e,e.query)].concat(a));return e.query&&(u.query=e.query),t(u)}function y(e,t,n){"string"==typeof t&&(t=l.parsePath(t)),i(u({state:e},t,{query:n}))}function m(e,t,n){"string"==typeof t&&(t=l.parsePath(t)),s(u({state:e},t,{query:n}))}var w=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],P=e(w),_=w.stringifyQuery,O=w.parseQueryString;return"function"!=typeof _&&(_=a),"function"!=typeof O&&(O=g),u({},P,{listenBefore:r,listen:o,push:i,replace:s,createPath:c,createHref:d,createLocation:v,pushState:p["default"](y,"pushState is deprecated; use push instead"),replaceState:p["default"](m,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=(r(i),n(25)),c=n(8),f=r(c),l=n(2),d=n(3),p=r(d),h="$searchBase",g=s.parse;t["default"]=o,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function a(){return i=!0,s?void(f=[].concat(r.call(arguments))):void n.apply(this,arguments)}function o(){if(!i&&(c=!0,!s)){for(s=!0;!i&&e>u&&c;)c=!1,t.call(this,u++,o,a);return s=!1,i?void n.apply(this,f):void(u>=e&&c&&(i=!0,n()))}}var u=0,i=!1,s=!1,c=!1,f=void 0;o()}t.__esModule=!0;var r=Array.prototype.slice;t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(){function e(e){e=e||window.history.state||{};var t=l.getWindowPath(),n=e,r=n.key,a=void 0;r?a=d.readState(r):(a=null,r=w.createKey(),y&&window.history.replaceState(o({},e,{key:r}),null,t));var u=c.parsePath(t);return w.createLocation(o({},u,{state:a}),void 0,r)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return l.addEventListener(window,"popstate",n),function(){l.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,a=e.hash,o=e.state,u=e.action,i=e.key;if(u!==s.POP){d.saveState(i,o);var c=(t||"")+n+r+a,f={key:i};if(u===s.PUSH){if(m)return window.location.href=c,!1;window.history.pushState(f,null,c)}else{if(m)return window.location.replace(c),!1;window.history.replaceState(f,null,c)}}}function r(e){1===++P&&(_=t(w));var n=w.listenBefore(e);return function(){n(),0===--P&&_()}}function a(e){1===++P&&(_=t(w));var n=w.listen(e);return function(){n(),0===--P&&_()}}function u(e){1===++P&&(_=t(w)),w.registerTransitionHook(e)}function p(e){w.unregisterTransitionHook(e),0===--P&&_()}var g=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f.canUseDOM?void 0:i["default"](!1);var v=g.forceRefresh,y=l.supportsHistory(),m=!y||v,w=h["default"](o({},g,{getCurrentLocation:e,finishTransition:n,saveState:d.saveState})),P=0,_=void 0;return o({},w,{listenBefore:r,listen:a,registerTransitionHook:u,unregisterTransitionHook:p})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(7),i=r(u),s=n(4),c=n(2),f=n(5),l=n(6),d=n(9),p=n(10),h=r(p);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return"string"==typeof e&&"/"===e.charAt(0)}function o(){var e=y.getHashPath();return a(e)?!0:(y.replaceHashPath("/"+e),!1)}function u(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function i(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=y.getHashPath(),t=void 0,n=void 0;H?(t=s(e,H),e=i(e,H),t?n=m.readState(t):(n=null,t=M.createKey(),y.replaceHashPath(u(e,H,t)))):t=n=null;var r=g.parsePath(e);return M.createLocation(f({},r,{state:n}),void 0,t)}function t(t){function n(){o()&&r(e())}var r=t.transitionTo;return o(),y.addEventListener(window,"hashchange",n),function(){y.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,a=e.state,o=e.action,i=e.key;if(o!==h.POP){var s=(t||"")+n+r;H?(s=u(s,H,i),m.saveState(i,a)):e.key=e.state=null;var c=y.getHashPath();o===h.PUSH?c!==s&&(window.location.hash=s):c!==s&&y.replaceHashPath(s)}}function r(e){1===++E&&(j=t(M));var n=M.listenBefore(e);return function(){n(),0===--E&&j()}}function a(e){1===++E&&(j=t(M));var n=M.listen(e);return function(){n(),0===--E&&j()}}function c(e){M.push(e)}function l(e){M.replace(e)}function d(e){M.go(e)}function w(e){return"#"+M.createHref(e)}function O(e){1===++E&&(j=t(M)),M.registerTransitionHook(e)}function b(e){M.unregisterTransitionHook(e),0===--E&&j()}function S(e,t){M.pushState(e,t)}function x(e,t){M.replaceState(e,t)}var k=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];v.canUseDOM?void 0:p["default"](!1);var H=k.queryKey;(void 0===H||H)&&(H="string"==typeof H?H:_);var M=P["default"](f({},k,{getCurrentLocation:e,finishTransition:n,saveState:m.saveState})),E=0,j=void 0;y.supportsGoWithoutReloadUsingHash();return f({},M,{listenBefore:r,listen:a,push:c,replace:l,go:d,createHref:w,registerTransitionHook:O,unregisterTransitionHook:b,pushState:S,replaceState:x})}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(1),d=(r(l),n(7)),p=r(d),h=n(4),g=n(2),v=n(5),y=n(6),m=n(9),w=n(10),P=r(w),_="_k";t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function o(){function e(e,t){y[e]=t}function t(e){return y[e]}function n(){var e=g[v],n=e.basename,r=e.pathname,a=e.search,o=(n||"")+r+(a||""),i=void 0,s=void 0;e.key?(i=e.key,s=t(i)):(i=d.createKey(),s=null,e.key=i);var c=f.parsePath(o);return d.createLocation(u({},c,{state:s}),void 0,i)}function r(e){var t=v+e;return t>=0&&t<g.length}function o(e){if(e){if(!r(e))return;v+=e;var t=n();d.transitionTo(u({},t,{action:l.POP}))}}function i(t){switch(t.action){case l.PUSH:v+=1,v<g.length&&g.splice(v),g.push(t),e(t.key,t.state);break;case l.REPLACE:g[v]=t,e(t.key,t.state)}}var s=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(s)?s={entries:s}:"string"==typeof s&&(s={entries:[s]});var d=p["default"](u({},s,{getCurrentLocation:n,finishTransition:i,saveState:e,go:o})),h=s,g=h.entries,v=h.current;"string"==typeof g?g=[g]:Array.isArray(g)||(g=["/"]),g=g.map(function(e){var t=d.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?u({},e,{key:t}):void c["default"](!1)}),null==v?v=g.length-1:v>=0&&v<g.length?void 0:c["default"](!1);var y=a(g);return d}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=(r(i),n(7)),c=r(s),f=n(2),l=n(4),d=n(11),p=r(d);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(13),i=r(u);t["default"]=o["default"](i["default"],"enableBeforeUnload is deprecated, use useBeforeUnload instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),u=n(14),i=r(u);t["default"]=o["default"](i["default"],"enableQueries is deprecated, use useQueries instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return function(){function t(e){return w&&null==e.basename&&(0===e.pathname.indexOf(w)?(e.pathname=e.pathname.substring(w.length),e.basename=w,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!w)return e;"string"==typeof e&&(e=i.parsePath(e));var t=e.pathname,n="/"===w.slice(-1)?w:w+"/",r="/"===t.charAt(0)?t.slice(1):t,a=n+r;return o({},e,{pathname:a})}function r(e){return m.listenBefore(function(n,r){c["default"](e,t(n),r)})}function a(e){return m.listen(function(n){e(t(n))})}function s(e){m.push(n(e))}function f(e){m.replace(n(e))}function d(e){return m.createPath(n(e))}function p(e){return m.createHref(n(e))}function h(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];return t(m.createLocation.apply(m,[n(e)].concat(a)))}function g(e,t){"string"==typeof t&&(t=i.parsePath(t)),s(o({state:e},t))}function v(e,t){"string"==typeof t&&(t=i.parsePath(t)),f(o({state:e},t))}var y=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],m=e(y),w=y.basename;if(null==w&&u.canUseDOM){var P=document.getElementsByTagName("base")[0];P&&(w=i.extractPath(P.href))}return o({},m,{listenBefore:r,listen:a,push:s,replace:f,createPath:d,createHref:p,createLocation:h,pushState:l["default"](g,"pushState is deprecated; use push instead"),replaceState:l["default"](v,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(5),i=n(2),s=n(8),c=r(s),f=n(3),l=r(f);t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function a(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,n){var o,f;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=u.call(e),t=u.call(t),c(e,t,n)):!1;if(a(e)){if(!a(t))return!1;if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}try{var l=i(e),d=i(t)}catch(p){return!1}if(l.length!=d.length)return!1;for(l.sort(),d.sort(),o=l.length-1;o>=0;o--)if(l[o]!=d[o])return!1;for(o=l.length-1;o>=0;o--)if(f=l[o],!c(e[f],t[f],n))return!1;return typeof e==typeof t}var u=Array.prototype.slice,i=n(24),s=n(23),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=a?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){"use strict";var r=n(26);t.extract=function(e){return e.split("?")[1]||""},t.parse=function(e){return"string"!=typeof e?{}:(e=e.trim().replace(/^(\?|#|&)/,""),e?e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n.shift(),a=n.length>0?n.join("="):void 0;return r=decodeURIComponent(r),a=void 0===a?null:decodeURIComponent(a),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(a):e[r]=[e[r],a]:e[r]=a,e},{}):{})},t.stringify=function(e){return e?Object.keys(e).sort().map(function(t){var n=e[t];return void 0===n?"":null===n?t:Array.isArray(n)?n.sort().map(function(e){return r(t)+"="+r(e)}).join("&"):r(t)+"="+r(n)}).filter(function(e){return e.length>0}).join("&"):""}},function(e,t){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}}])}); |
{ | ||
"name": "juttle-viewer", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "application to develop and execute juttle programs", | ||
@@ -52,2 +52,3 @@ "main": "src/router/index.js", | ||
"chai": "^3.5.0", | ||
"classnames": "^2.2.3", | ||
"css-loader": "^0.23.1", | ||
@@ -68,4 +69,5 @@ "eslint": "^1.10.3", | ||
"isparta": "^4.0.0", | ||
"jsdom": "^8.1.0", | ||
"json-loader": "^0.5.4", | ||
"juttle-client-library": "^0.6.0", | ||
"juttle-client-library": "^0.7.0", | ||
"mock-socket": "^2.0.0", | ||
@@ -75,2 +77,3 @@ "nock": "^7.0.2", | ||
"react": "^0.14.7", | ||
"react-addons-test-utils": "^0.14.7", | ||
"react-dom": "^0.14.7", | ||
@@ -85,2 +88,4 @@ "react-redux": "^4.4.0", | ||
"selenium-webdriver": "^2.48.2", | ||
"sinon": "^1.17.3", | ||
"sinon-chai": "^2.8.0", | ||
"style-loader": "^0.13.0", | ||
@@ -87,0 +92,0 @@ "url-loader": "^0.5.7", |
@@ -1,2 +0,59 @@ | ||
# juttle-viewer | ||
application to develop and execute juttle programs | ||
# Juttle Viewer | ||
juttle-viewer is a development and presentation application for | ||
[juttle](https://github.com/juttle/juttle) | ||
programs that packages | ||
[juttle-client-library](https://github.com/juttle/juttle-client-library), | ||
[juttle-viz](https://github.com/juttle/juttle-viz), and application | ||
logic to select and run juttle programs using a remote | ||
[juttle-service](https://github.com/juttle/juttle-service). | ||
[![Build Status](https://travis-ci.org/juttle/juttle-viewer.svg?branch=master)](https://travis-ci.org/juttle/juttle-viewer) | ||
![](docs/screenshots/juttle-viewer-0.3-screen.png) | ||
## Getting Started | ||
In a production setting juttle-viewer can be run multiple ways. | ||
Primarily, juttle-viewer is seen in | ||
[juttle-engine](https://github.com/juttle/juttle-engine) where it is packaged | ||
along with juttle-service. | ||
Additionally juttle-viewer can be run by itself. It will need an instance | ||
of juttle-service to play along with. It can be run standalone, but it also | ||
exports an express router and can be included in an express app. | ||
### Running Standalone | ||
1. Install juttle-viewer: `npm install juttle-viewer` | ||
2. Use the command script to start: `npm run juttle-viewer` | ||
The juttle-viewer command script has several options (such as changing the | ||
juttle-service host), that can be viewed by running `npm run juttle-viewer -h` | ||
### Include as Express Router | ||
Include juttle-viewer into an express app by doing this: | ||
```javascript | ||
var express = require('express'); | ||
var viewer = require('juttle-viewer'); | ||
var app = express(); | ||
app.use(viewer({ | ||
juttleServiceHost: JUTTLE_SERVICE_HOST | ||
})); | ||
``` | ||
## Development | ||
Once you've cloned the repo and have run `npm install`, run this: | ||
``` | ||
./bin/juttle-viewer -d | ||
``` | ||
Note the `-d` (or `--dev`) argument is important because it uses | ||
webpackMiddleware to serve and continually recompile your changes. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
13013
60
0
49
4
14607861
50
80