From db3f3b38c894404deed37c0f8fc3591b5e26fbd1 Mon Sep 17 00:00:00 2001 From: Dmitry Karpunin Date: Mon, 29 Jan 2018 20:43:59 +0300 Subject: [PATCH] Use rollup instead webpack --- README.md | 1 - config/rollup.config.js | 49 + dist/index.js | 1361 ----------- dist/js/normas.js | 1018 ++++++++ dist/js/normas.js.map | 1 + dist/js/normasMutations.js | 172 ++ dist/js/normasMutations.js.map | 1 + dist/js/normasWithTurbolinks.js | 1207 ++++++++++ dist/js/normasWithTurbolinks.js.map | 1 + dist/normasMutations.js | 165 -- dist/normasWithTurbolinks.js | 1636 ------------- .../app/javascript/lib/normas.js | 4 +- examples/normas_on_rails/package.json | 1 + examples/normas_on_rails/yarn.lock | 6 + package.json | 19 +- src/js/.babelrc | 1 + src/js/index.js | 19 +- src/js/minimalNormas.js | 16 + src/js/mixins/events.js | 2 +- webpack.config.js | 32 - yarn.lock | 2133 +---------------- 21 files changed, 2574 insertions(+), 5271 deletions(-) create mode 100644 config/rollup.config.js delete mode 100644 dist/index.js create mode 100644 dist/js/normas.js create mode 100644 dist/js/normas.js.map create mode 100644 dist/js/normasMutations.js create mode 100644 dist/js/normasMutations.js.map create mode 100644 dist/js/normasWithTurbolinks.js create mode 100644 dist/js/normasWithTurbolinks.js.map delete mode 100644 dist/normasMutations.js delete mode 100644 dist/normasWithTurbolinks.js create mode 100644 src/js/minimalNormas.js delete mode 100644 webpack.config.js diff --git a/README.md b/README.md index b41cdd1..ef6c9ea 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,6 @@ $('.some-selector').filter('.jquery-chain').each$(($element) => { ## Roadmap - More readme and documentation -- Use rollup for build dist - More examples of usage with actual javascript plugins and libs - Improve debugging - Optional jQuery usage diff --git a/config/rollup.config.js b/config/rollup.config.js new file mode 100644 index 0000000..d6190f6 --- /dev/null +++ b/config/rollup.config.js @@ -0,0 +1,49 @@ +import commonjs from 'rollup-plugin-commonjs'; +import nodeResolve from 'rollup-plugin-node-resolve'; +import babel from 'rollup-plugin-babel'; +// import memory from 'rollup-plugin-memory'; + +const bundles = [{ + name: 'normas', + input: 'src/js/index.js', +}, { + name: 'normasWithTurbolinks', + input: 'src/js/normasWithTurbolinks.js', +}, { + name: 'normasMutations', + input: 'src/js/mixins/mutations.js', +}]; + +export default bundles.map(({ name, input }) => ({ + input, + output: { + strict: true, + file: `dist/js/${name}.js`, + format: 'cjs', + name, + sourcemap: true + }, + plugins: [ + // memory({ + // path: 'src/normas.js', + // contents: ` + // import normas from './normas'; + // if (typeof module!='undefined') module.exports = normas; + // else self.normas = normas; + // ` + // }), + nodeResolve({ + // module: true, + // jsnext: true, + // browser: true, + // main: true, + // jail: '/src/js', + // modulesOnly: true, + }), + babel({ + sourceMap: true, + exclude: 'node_modules/**', + }), + commonjs(), + ] +})); diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b7eb3c5..0000000 --- a/dist/index.js +++ /dev/null @@ -1,1361 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 5); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export isArray */ -/* harmony export (immutable) */ __webpack_exports__["e"] = isFunction; -/* harmony export (immutable) */ __webpack_exports__["g"] = isString; -/* unused harmony export compact */ -/* harmony export (immutable) */ __webpack_exports__["a"] = debounce; -/* harmony export (immutable) */ __webpack_exports__["d"] = flatten; -/* harmony export (immutable) */ __webpack_exports__["b"] = filter; -/* harmony export (immutable) */ __webpack_exports__["c"] = find; -/* unused harmony export map */ -/* harmony export (immutable) */ __webpack_exports__["h"] = mapValues; -/* harmony export (immutable) */ __webpack_exports__["i"] = without; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__); -/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default.a; }); -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -// Sufficient for Normas implementation of functions like from lodash - - - - - -var isArray = Array.isArray; - -function isFunction(v) { - return typeof v === 'function'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function compact(array) { - return filter(array, function (v) { - return v; - }); -} - -function debounce(func, wait) { - var timeoutId = void 0; - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (timeoutId) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(function () { - func.apply(undefined, args); - }, wait); - }; -} - -function flatten(array) { - var result = []; - array.forEach(function (value) { - if (isArray(value)) { - result.push.apply(result, _toConsumableArray(value)); - } else { - result.push(value); - } - }); - return result; -} - -function filter(collection, conditions) { - return filterBase('filter', collection, conditions); -} - -function find(collection, conditions) { - return filterBase('find', collection, conditions); -} - -function map(collection, iteratee) { - return Array.prototype.map.call(collection, iteratee); -} - -function mapValues(object, iteratee) { - var result = {}; - Object.keys(object).forEach(function (key) { - result[key] = iteratee(object[key]); - }); - return result; -} - -function without(collection) { - for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - - return filter(collection, function (item) { - return !values.includes(item); - }); -} - -// private - -function filterBase(baseName, collection, conditions) { - return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions)); -} - -function makeConditionsMatch(conditions) { - if (isFunction(conditions)) { - return conditions; - } else { - var conditionsKeys = Object.keys(conditions); - return function (item) { - return filterMatch(item, conditions, conditionsKeys); - }; - } -} - -function filterMatch(item, conditions, conditionsKeys) { - return conditionsKeys.find(function (key) { - return conditions[key] !== item[key]; - }) === undefined; -} - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Base = function () { - function Base(_ref) { - var _ref$debugMode = _ref.debugMode, - debugMode = _ref$debugMode === undefined ? true : _ref$debugMode, - _ref$$el = _ref.$el, - $el = _ref$$el === undefined ? $(document) : _ref$$el, - _ref$instanceName = _ref.instanceName, - instanceName = _ref$instanceName === undefined ? 'NormasApp' : _ref$instanceName; - - _classCallCheck(this, Base); - - this.instanceName = instanceName; - this.debugMode = debugMode; - this.$el = $el; - this.el = $el[0]; - this.log('info', '"' + this.instanceName + '" constructed.'); - } - - _createClass(Base, [{ - key: '$', - value: function $() { - var _$el; - - return (_$el = this.$el).find.apply(_$el, arguments); - } - }, { - key: 'log', - value: function log() { - if (!this.debugMode) return; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log'; - this._log.apply(this, [method].concat(args)); - } - }, { - key: 'error', - value: function error() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - this._log.apply(this, ['error'].concat(args)); - } - }, { - key: '_log', - value: function _log(method) { - if (console && console[method]) { - var _console; - - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - - (_console = console)[method].apply(_console, args); // eslint-disable-line no-console - } - } - }]); - - return Base; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (Base); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - return function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.eventsDebug = _this.debugMode && options.eventsDebug || false; - if (_this.eventsDebug) { - _this.eventsLogBuffer = []; - _this.eventsLog = Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["a" /* debounce */])(_this.eventsLog, 20); - } - _this.log('info', '"' + _this.instanceName + '" events mixin activated. eventsDebug =', _this.eventsDebug); - return _this; - } - - _createClass(_class, [{ - key: 'trigger', - value: function trigger() { - var _$el; - - (_$el = this.$el).trigger.apply(_$el, arguments); - } - }, { - key: 'listenEvents', - value: function listenEvents() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var listeningArgs = this.listenEventsOnElement.apply(this, [this.$el].concat(args)); - if (this.eventsDebug) { - this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs); - this.eventsLog(); - } - return listeningArgs; - } - }, { - key: 'listenEventsOnElement', - value: function listenEventsOnElement($element) { - var _constructor; - - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - var listeningArgs = (_constructor = this.constructor).listeningArguments.apply(_constructor, args); - listeningArgs.forEach(function (_ref) { - var events = _ref.events, - selector = _ref.selector, - handle = _ref.handle; - - $element.on(events, selector, handle); - }); - return listeningArgs; - } - }, { - key: 'eventsLog', - value: function eventsLog() { - this.log('table', this.eventsLogBuffer); - this.eventsLogBuffer = []; - } - }, { - key: 'forgetEvents', - value: function forgetEvents(listeningArgs) { - this.forgetEventsOnElement(this.$el, listeningArgs); - } - }, { - key: 'forgetEventsOnElement', - value: function forgetEventsOnElement($element, listeningArgs) { - if (this.eventsDebug) { - this.log('forget events', listeningArgs); - } - listeningArgs.forEach(function (_ref2) { - var events = _ref2.events, - selector = _ref2.selector, - handle = _ref2.handle; - - $element.off(events, selector, handle); - }); - } - }], [{ - key: 'listeningArguments', - value: function listeningArguments(selector, eventRule, _handle) { - var _this2 = this; - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(selector)) { - eventRule = selector; - selector = ''; - } - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(eventRule)) { - _handle = eventRule; - eventRule = selector; - selector = ''; - } - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(eventRule)) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["d" /* flatten */])(Object.keys(eventRule).map(function (key) { - var value = eventRule[key]; - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(value) ? _this2.listeningArguments(selector ? selector + ' ' + key : key, value) : _this2.listeningArguments(selector, key, value); - })); - } - - if (!Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(_handle)) { - console.error('handle isn\'t function in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - if (!eventRule) { - console.error('eventRule not defined! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - - var selectors = eventRule.split(/\s+/); - var eventName = selectors[0]; - selectors[0] = selector; - - if (!eventName) { - console.error('bad eventName in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - - return [{ - events: eventName.replace(/\//g, ' '), - selector: selectors.join(' ').trim(), - handle: function handle(event) { - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - - return _handle.apply(undefined, [$(event.currentTarget), event].concat(args)); - } - }]; - } - }]); - - return _class; - }(Base); -}); - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 5 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_base__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_events__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_content__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_navigation__ = __webpack_require__(10); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mixins_views__ = __webpack_require__(11); - - - - - - - -var Normas = Object(__WEBPACK_IMPORTED_MODULE_5__mixins_views__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__mixins_navigation__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_content__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_events__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__mixins_base__["a" /* default */])))); - -/* harmony default export */ __webpack_exports__["default"] = (Normas); - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -$.fn.each$ = function (handle) { - return this.each(function (index, element) { - handle($(element), index); - }); -}; - -// [showOrHide[, duration[, callback]]] -$.fn.slideToggleByState = function slideToggleByState() { - if (this.length > 0) { - for (var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++) { - a[_key] = arguments[_key]; - } - - if (a.length > 0) { - if (a.shift()) { - this.slideDown.apply(this, a); - } else { - this.slideUp.apply(this, a); - } - } else { - this.slideToggle(); - } - } - return this; -}; - -// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/ -$.fn.focusToEnd = function focusToEnd() { - var $this = this.first(); - if ($this.is('select, :checkbox, :radio')) { - $this.focus(); - } else { - var val = $this.val(); - $this.focus().val('').val(val); - } - return this; -}; - -$.fn.focusTo = function focusTo(caretPos) { - return this.each(function (index, element) { - if (element.createTextRange) { - var range = element.createTextRange(); - range.move('character', caretPos); - range.select(); - } else if (element.selectionStart) { - element.focus(); - element.setSelectionRange(caretPos, caretPos); - } else { - element.focus(); - } - }); -}; - -/* - ** Returns the caret (cursor) position of the specified text field. - ** Return value range is 0-oField.value.length. - */ -$.fn.caretPosition = function caretPosition() { - // Initialize - var iCaretPos = 0; - var oField = this[0]; - - // IE Support - if (document.selection) { - // Set focus on the element - oField.focus(); - // To get cursor position, get empty selection range - var oSel = document.selection.createRange(); - // Move selection start to 0 position - oSel.moveStart('character', -oField.value.length); - // The caret position is selection length - iCaretPos = oSel.text.length; - } else if (oField.selectionStart != null) { - iCaretPos = oField.selectionStart; - } - - // Return results - return iCaretPos; -}; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -var isObject = __webpack_require__(8); - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -module.exports = function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// require events mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - var _class, _temp; - - return _temp = _class = function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.log('info', '"' + _this.instanceName + '" content mixin activated.'); - return _this; - } - - _createClass(_class, [{ - key: 'listenToElement', - value: function listenToElement(selector, enter) { - var leave = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - var contentEnter = this.constructor.makeElementContentEnter(selector, enter); - if (delay > 0) { - contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay); - } - var contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null; - this.listenToContent(contentEnter, contentLeave); - } - }, { - key: 'listenToContent', - value: function listenToContent(enter) { - var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (enter) { - this.$el.on(this.constructor.contentEnterEventName, function (event, $root) { - return enter($root, event); - }); - } - if (leave) { - this.$el.on(this.constructor.contentLeaveEventName, function (event, $root) { - return leave($root, event); - }); - } - } - }, { - key: 'sayAboutContentEnter', - value: function sayAboutContentEnter($content) { - $content = this.constructor.filterContent($content, 'normasEntered'); - if ($content.length > 0) { - $content.removeClass(this.constructor.preventContentEventsClassName); - this.trigger(this.constructor.contentEnterEventName, [$content]); - } - return $content; - } - }, { - key: 'sayAboutContentLeave', - value: function sayAboutContentLeave($content) { - $content = this.constructor.filterContent($content, 'normasLeft'); - if ($content.length > 0) { - this.trigger(this.constructor.contentLeaveEventName, [$content]); - } - return $content; - } - }, { - key: 'replaceContentInner', - value: function replaceContentInner($container, content) { - this.sayAboutContentLeave($container); - $container.html(content); - this.sayAboutContentEnter($container); - } - }, { - key: 'replaceContent', - value: function replaceContent($content, $newContent) { - this.sayAboutContentLeave($content); - if ($content.length === 1) { - $content.replaceWith($newContent); - } else { - $newContent.insertBefore($content.first()); - $content.remove(); - } - this.sayAboutContentEnter($newContent); - } - - // private - - }], [{ - key: 'makeElementContentEnter', - value: function makeElementContentEnter(selector, enter) { - var _this2 = this; - - return function ($root) { - $root.filter(selector).add($root.find(selector)).each$(function ($element) { - if (!_this2.preventEventForElement($element)) { - enter($element); - } - }); - }; - } - }, { - key: 'makeDelayedElementContentEnter', - value: function makeDelayedElementContentEnter(contentEnter, delay) { - return function ($root) { - $root.data('contentEnterTimeoutId', setTimeout(function () { - $root.removeData('contentEnterTimeoutId'); - if (document.documentElement.hasAttribute('data-turbolinks-preview')) { - return; - } - contentEnter($root); - }, delay)); - }; - } - }, { - key: 'makeElementContentLeave', - value: function makeElementContentLeave(selector, leave, delay) { - var _this3 = this; - - return function ($root) { - if (delay > 0) { - var timeoutId = $root.data('contentEnterTimeoutId'); - if (timeoutId) { - clearTimeout(timeoutId); - $root.removeData('contentEnterTimeoutId'); - } - } - if (leave) { - $root.filter(selector).add($root.find(selector)).each$(function ($element) { - if (!_this3.preventEventForElement($element)) { - leave($element); - } - }); - } - }; - } - }, { - key: 'preventEventForElement', - value: function preventEventForElement($element) { - return $element.closest('.' + this.preventContentEventsClassName).length > 0; - } - }, { - key: 'filterContent', - value: function filterContent($content, elementFlagName) { - return $content.filter(function (_index, element) { - if (element[elementFlagName]) { - return false; - } else { - element[elementFlagName] = true; - return true; - } - }); - } - }]); - - return _class; - }(Base), Object.defineProperty(_class, 'contentEnterEventName', { - enumerable: true, - writable: true, - value: 'content:enter' - }), Object.defineProperty(_class, 'contentLeaveEventName', { - enumerable: true, - writable: true, - value: 'content:leave' - }), Object.defineProperty(_class, 'preventContentEventsClassName', { - enumerable: true, - writable: true, - value: 'js-prevent-normas' - }), _temp; -}); - -/***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) {var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// require content mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - var _class, _temp; - - return _temp = _class = function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.bindPageEvents(options); - _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); - return _this; - } - - _createClass(_class, [{ - key: 'bindPageEvents', - value: function bindPageEvents(options) { - if (options.Turbolinks || global.Turbolinks) { - var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); - this.log('warn', 'You have Turbolinks and can use \'' + turboNormasImportPath + '/normasWithTurbolinks\' instead \'normas\'.'); - } - $(this.pageEnter.bind(this)); - } - }, { - key: 'listenToPage', - value: function listenToPage(enter) { - var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (enter) { - this.listenEvents(this.constructor.pageEnterEventName, enter); - } - if (leave) { - this.listenEvents(this.constructor.pageLeaveEventName, leave); - } - } - }, { - key: 'visit', - value: function visit(location) { - window.location = location; - } - }, { - key: 'refreshPage', - value: function refreshPage() { - this.visit(window.location); - } - }, { - key: 'setHash', - value: function setHash(hash) { - location.hash = hash; - } - }, { - key: 'back', - value: function back() { - global.history.back(); - } - }, { - key: 'replaceLocation', - value: function replaceLocation(url) { - this.log('`replaceLocation` works only with Turbolinks.'); - } - }, { - key: 'pushLocation', - value: function pushLocation(url) { - var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - - if (global.history) global.history.pushState(state, title, url); - } - }, { - key: 'sayAboutPageLoading', - value: function sayAboutPageLoading(state) { - this.log('`sayAboutPageLoading` works only with Turbolinks.'); - } - }, { - key: 'pageEnter', - value: function pageEnter() { - this.trigger(this.constructor.pageEnterEventName); - this.sayAboutContentEnter(this.$el.find('body')); - } - }, { - key: 'pageLeave', - value: function pageLeave() { - this.sayAboutContentLeave(this.$el.find('body')); - this.trigger(this.constructor.pageLeaveEventName); - } - }]); - - return _class; - }(Base), Object.defineProperty(_class, 'pageEnterEventName', { - enumerable: true, - writable: true, - value: 'page:enter' - }), Object.defineProperty(_class, 'pageLeaveEventName', { - enumerable: true, - writable: true, - value: 'page:leave' - }), _temp; -}); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(4))) - -/***/ }), -/* 11 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__view__ = __webpack_require__(12); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// TODO: may be rename Views, views, View, view - - - -// require content mixin -// require events mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - return function (_Base) { - _inherits(_class2, _Base); - - function _class2(options) { - _classCallCheck(this, _class2); - - var _this = _possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); - - Object.defineProperty(_this, 'View', { - enumerable: true, - writable: true, - value: __WEBPACK_IMPORTED_MODULE_1__view__["a" /* default */] - }); - Object.defineProperty(_this, 'viewClasses', { - enumerable: true, - writable: true, - value: {} - }); - Object.defineProperty(_this, 'viewInstances', { - enumerable: true, - writable: true, - value: [] - }); - - _this.viewOptions = _extends({ - debugMode: _this.debugMode, - eventsDebug: _this.eventsDebug - }, options.viewOptions); - _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); - return _this; - } - - _createClass(_class2, [{ - key: 'registerView', - value: function registerView(viewClass) { - var _this2 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (this.viewClasses[viewClass.selector]) { - this.error('View class for selector `' + viewClass.selector + '` already registered', this.viewClasses[viewClass.selector]); - return; - } - this.viewClasses[viewClass.selector] = viewClass; - this.listenToElement(viewClass.selector, function ($el) { - return _this2.bindView($el, viewClass, options); - }, function ($el) { - return _this2.unbindView($el, viewClass); - }, viewClass.delay); - } - }, { - key: 'bindView', - value: function bindView($el, viewClass, options) { - if (!this.canBind($el, viewClass)) { - return null; - } - if (viewClass.instanceIndex) { - viewClass.instanceIndex += 1; - } else { - viewClass.instanceIndex = 1; - } - var view = new viewClass(_extends({}, this.viewOptions, options, { - instanceName: viewClass.selector + '_' + viewClass.instanceIndex, - $el: $el - })); - this.viewInstances.push(view); - return view; - } - }, { - key: 'canBind', - value: function canBind($element, viewClass) { - var view = this.getViewsOnElement($element, viewClass)[0]; - if (view) { - this.log('warn', 'Element already has bound view', $element, viewClass, view); - return false; - } - return true; - } - }, { - key: 'unbindView', - value: function unbindView($element, viewClass) { - var view = this.getViewsOnElement($element, viewClass)[0]; - if (view) { - view.terminate(); - this.viewInstances = Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["i" /* without */])(this.viewInstances, view); - } - } - }, { - key: 'getViewsOnElement', - value: function getViewsOnElement($element) { - var viewClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - var el = $element instanceof $ ? $element[0] : $element; - var filterOptions = { el: el }; - if (viewClass) { - filterOptions.constructor = viewClass; - } - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, filterOptions); - } - }, { - key: 'getViewsInContainer', - value: function getViewsInContainer($container) { - var checkRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, function (view) { - return view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0]); - }); - } - }, { - key: 'getAllViews', - value: function getAllViews(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, { constructor: viewClass }); - } - }, { - key: 'getFirstView', - value: function getFirstView(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["c" /* find */])(this.viewInstances, { constructor: viewClass }); - } - }, { - key: 'getFirstChildView', - value: function getFirstChildView(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["c" /* find */])(this.viewInstances, function (view) { - return view instanceof viewClass; - }); - } - }]); - - return _class2; - }(Base); -}); - -/***/ }), -/* 12 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_base__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_events__ = __webpack_require__(2); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - -var _class = function (_normasEvents) { - _inherits(_class, _normasEvents); - - _createClass(_class, [{ - key: 'initialize', - - // Override it with your own initialization logic. - value: function initialize(options) {} - - // Override it (and use this super method) with your own unmount logic. - - }, { - key: 'terminate', - value: function terminate() { - if (this.listenedEvents) { - this.forgetEvents(this.listenedEvents); - this.listenedEvents = null; - } - } - }]); - - function _class(options) { - _classCallCheck(this, _class); - - Object.assign(options, options.$el.data()); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.reflectOptions(options); - _this.initializeEvents(options); - _this.initialize(options); - return _this; - } - - _createClass(_class, [{ - key: 'reflectOptions', - value: function reflectOptions(options) { - var _this2 = this; - - Object.keys(options).forEach(function (attr) { - if (_this2.hasOwnProperty(attr)) { - _this2[attr] = options[attr]; - } - }); - } - }, { - key: 'initializeEvents', - value: function initializeEvents(_options) { - var events = this.constructor.events; - - if (events) { - if (!this.linkedEvents) { - this.linkedEvents = this.linkEvents(Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(events) ? events() : events); - } - this.listenedEvents = this.listenEvents(this.linkedEvents); - } - } - }, { - key: 'linkEvents', - value: function linkEvents(events) { - var _this3 = this; - - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["h" /* mapValues */])(events, function (handle) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["g" /* isString */])(handle) ? _this3[handle].bind(_this3) : _typeof(Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(handle)) ? _this3.linkEvents(handle) : handle; - }); - } - }]); - - return _class; -}(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_events__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__mixins_base__["a" /* default */])); - -/* harmony default export */ __webpack_exports__["a"] = (_class); -; - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/dist/js/normas.js b/dist/js/normas.js new file mode 100644 index 0000000..04ab9ce --- /dev/null +++ b/dist/js/normas.js @@ -0,0 +1,1018 @@ +'use strict'; + +$.fn.each$ = function (handle) { + return this.each(function (index, element) { + handle($(element), index); + }); +}; + +// [showOrHide[, duration[, callback]]] +$.fn.slideToggleByState = function slideToggleByState() { + if (this.length > 0) { + for (var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++) { + a[_key] = arguments[_key]; + } + + if (a.length > 0) { + if (a.shift()) { + this.slideDown.apply(this, a); + } else { + this.slideUp.apply(this, a); + } + } else { + this.slideToggle(); + } + } + return this; +}; + +// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/ +$.fn.focusToEnd = function focusToEnd() { + var $this = this.first(); + if ($this.is('select, :checkbox, :radio')) { + $this.focus(); + } else { + var val = $this.val(); + $this.focus().val('').val(val); + } + return this; +}; + +$.fn.focusTo = function focusTo(caretPos) { + return this.each(function (index, element) { + if (element.createTextRange) { + var range = element.createTextRange(); + range.move('character', caretPos); + range.select(); + } else if (element.selectionStart) { + element.focus(); + element.setSelectionRange(caretPos, caretPos); + } else { + element.focus(); + } + }); +}; + +/* + ** Returns the caret (cursor) position of the specified text field. + ** Return value range is 0-oField.value.length. + */ +$.fn.caretPosition = function caretPosition() { + // Initialize + var iCaretPos = 0; + var oField = this[0]; + + // IE Support + if (document.selection) { + // Set focus on the element + oField.focus(); + // To get cursor position, get empty selection range + var oSel = document.selection.createRange(); + // Move selection start to 0 position + oSel.moveStart('character', -oField.value.length); + // The caret position is selection length + iCaretPos = oSel.text.length; + } else if (oField.selectionStart != null) { + iCaretPos = oField.selectionStart; + } + + // Return results + return iCaretPos; +}; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + + + + + + + + + + + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + + + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + + + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + + + + + + + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +var Base = function () { + function Base(_ref) { + var _ref$debugMode = _ref.debugMode, + debugMode = _ref$debugMode === undefined ? true : _ref$debugMode, + _ref$$el = _ref.$el, + $el = _ref$$el === undefined ? $(document) : _ref$$el, + _ref$instanceName = _ref.instanceName, + instanceName = _ref$instanceName === undefined ? 'NormasApp' : _ref$instanceName; + classCallCheck(this, Base); + + this.instanceName = instanceName; + this.debugMode = debugMode; + this.$el = $el; + this.el = $el[0]; + this.log('info', '"' + this.instanceName + '" constructed.'); + } + + createClass(Base, [{ + key: '$', + value: function $() { + var _$el; + + return (_$el = this.$el).find.apply(_$el, arguments); + } + }, { + key: 'log', + value: function log() { + if (!this.debugMode) return; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log'; + this._log.apply(this, [method].concat(args)); + } + }, { + key: 'error', + value: function error() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this._log.apply(this, ['error'].concat(args)); + } + }, { + key: '_log', + value: function _log(method) { + if (console && console[method]) { + var _console; + + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } + } + }]); + return Base; +}(); + +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isobject = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; + +function isObjectObject(o) { + return isobject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +var isPlainObject = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; + +// Sufficient for Normas implementation of functions like from lodash + +var isArray = Array.isArray; + +function isFunction(v) { + return typeof v === 'function'; +} + +function isString(v) { + return typeof v === 'string'; +} + + + +function debounce(func, wait) { + var timeoutId = void 0; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (timeoutId) { + clearTimeout(timeoutId); + } + timeoutId = setTimeout(function () { + func.apply(undefined, args); + }, wait); + }; +} + +function flatten(array) { + var result = []; + array.forEach(function (value) { + if (isArray(value)) { + result.push.apply(result, toConsumableArray(value)); + } else { + result.push(value); + } + }); + return result; +} + +function filter(collection, conditions) { + return filterBase('filter', collection, conditions); +} + +function find(collection, conditions) { + return filterBase('find', collection, conditions); +} + + + +function mapValues(object, iteratee) { + var result = {}; + Object.keys(object).forEach(function (key) { + result[key] = iteratee(object[key]); + }); + return result; +} + +function without(collection) { + for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + return filter(collection, function (item) { + return !values.includes(item); + }); +} + +// private + +function filterBase(baseName, collection, conditions) { + return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions)); +} + +function makeConditionsMatch(conditions) { + if (isFunction(conditions)) { + return conditions; + } else { + var conditionsKeys = Object.keys(conditions); + return function (item) { + return filterMatch(item, conditions, conditionsKeys); + }; + } +} + +function filterMatch(item, conditions, conditionsKeys) { + return conditionsKeys.find(function (key) { + return conditions[key] !== item[key]; + }) === undefined; +} + +var normasEvents = (function (Base) { + return function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.eventsDebug = _this.debugMode && options.eventsDebug || false; + if (_this.eventsDebug) { + _this.eventsLogBuffer = []; + _this.eventsLog = debounce(_this.eventsLog.bind(_this), 20); + } + _this.log('info', '"' + _this.instanceName + '" events mixin activated. eventsDebug =', _this.eventsDebug); + return _this; + } + + createClass(_class, [{ + key: 'trigger', + value: function trigger() { + var _$el; + + (_$el = this.$el).trigger.apply(_$el, arguments); + } + }, { + key: 'listenEvents', + value: function listenEvents() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var listeningArgs = this.listenEventsOnElement.apply(this, [this.$el].concat(args)); + if (this.eventsDebug) { + this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs); + this.eventsLog(); + } + return listeningArgs; + } + }, { + key: 'listenEventsOnElement', + value: function listenEventsOnElement($element) { + var _constructor; + + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + var listeningArgs = (_constructor = this.constructor).listeningArguments.apply(_constructor, args); + listeningArgs.forEach(function (_ref) { + var events = _ref.events, + selector = _ref.selector, + handle = _ref.handle; + + $element.on(events, selector, handle); + }); + return listeningArgs; + } + }, { + key: 'eventsLog', + value: function eventsLog() { + this.log('table', this.eventsLogBuffer); + this.eventsLogBuffer = []; + } + }, { + key: 'forgetEvents', + value: function forgetEvents(listeningArgs) { + this.forgetEventsOnElement(this.$el, listeningArgs); + } + }, { + key: 'forgetEventsOnElement', + value: function forgetEventsOnElement($element, listeningArgs) { + if (this.eventsDebug) { + this.log('forget events', listeningArgs); + } + listeningArgs.forEach(function (_ref2) { + var events = _ref2.events, + selector = _ref2.selector, + handle = _ref2.handle; + + $element.off(events, selector, handle); + }); + } + }], [{ + key: 'listeningArguments', + value: function listeningArguments(selector, eventRule, _handle) { + var _this2 = this; + + if (isPlainObject(selector)) { + eventRule = selector; + selector = ''; + } + + if (isFunction(eventRule)) { + _handle = eventRule; + eventRule = selector; + selector = ''; + } + + if (isPlainObject(eventRule)) { + return flatten(Object.keys(eventRule).map(function (key) { + var value = eventRule[key]; + return isPlainObject(value) ? _this2.listeningArguments(selector ? selector + ' ' + key : key, value) : _this2.listeningArguments(selector, key, value); + })); + } + + if (!isFunction(_handle)) { + console.error('handle isn\'t function in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + if (!eventRule) { + console.error('eventRule not defined! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + + var selectors = eventRule.split(/\s+/); + var eventName = selectors[0]; + selectors[0] = selector; + + if (!eventName) { + console.error('bad eventName in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + + return [{ + events: eventName.replace(/\//g, ' '), + selector: selectors.join(' ').trim(), + handle: function handle(event) { + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + return _handle.apply(undefined, [$(event.currentTarget), event].concat(args)); + } + }]; + } + }]); + return _class; + }(Base); +}); + +// require events mixin +var normasContent = (function (Base) { + var _class, _temp; + + return _temp = _class = function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.log('info', '"' + _this.instanceName + '" content mixin activated.'); + return _this; + } + + createClass(_class, [{ + key: 'listenToElement', + value: function listenToElement(selector, enter) { + var leave = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var contentEnter = this.constructor.makeElementContentEnter(selector, enter); + if (delay > 0) { + contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay); + } + var contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null; + this.listenToContent(contentEnter, contentLeave); + } + }, { + key: 'listenToContent', + value: function listenToContent(enter) { + var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (enter) { + this.$el.on(this.constructor.contentEnterEventName, function (event, $root) { + return enter($root, event); + }); + } + if (leave) { + this.$el.on(this.constructor.contentLeaveEventName, function (event, $root) { + return leave($root, event); + }); + } + } + }, { + key: 'sayAboutContentEnter', + value: function sayAboutContentEnter($content) { + $content = this.constructor.filterContent($content, 'normasEntered'); + if ($content.length > 0) { + $content.removeClass(this.constructor.preventContentEventsClassName); + this.trigger(this.constructor.contentEnterEventName, [$content]); + } + return $content; + } + }, { + key: 'sayAboutContentLeave', + value: function sayAboutContentLeave($content) { + $content = this.constructor.filterContent($content, 'normasLeft'); + if ($content.length > 0) { + this.trigger(this.constructor.contentLeaveEventName, [$content]); + } + return $content; + } + }, { + key: 'replaceContentInner', + value: function replaceContentInner($container, content) { + this.sayAboutContentLeave($container); + $container.html(content); + this.sayAboutContentEnter($container); + } + }, { + key: 'replaceContent', + value: function replaceContent($content, $newContent) { + this.sayAboutContentLeave($content); + if ($content.length === 1) { + $content.replaceWith($newContent); + } else { + $newContent.insertBefore($content.first()); + $content.remove(); + } + this.sayAboutContentEnter($newContent); + } + + // private + + }], [{ + key: 'makeElementContentEnter', + value: function makeElementContentEnter(selector, enter) { + var _this2 = this; + + return function ($root) { + $root.filter(selector).add($root.find(selector)).each$(function ($element) { + if (!_this2.preventEventForElement($element)) { + enter($element); + } + }); + }; + } + }, { + key: 'makeDelayedElementContentEnter', + value: function makeDelayedElementContentEnter(contentEnter, delay) { + return function ($root) { + $root.data('contentEnterTimeoutId', setTimeout(function () { + $root.removeData('contentEnterTimeoutId'); + if (document.documentElement.hasAttribute('data-turbolinks-preview')) { + return; + } + contentEnter($root); + }, delay)); + }; + } + }, { + key: 'makeElementContentLeave', + value: function makeElementContentLeave(selector, leave, delay) { + var _this3 = this; + + return function ($root) { + if (delay > 0) { + var timeoutId = $root.data('contentEnterTimeoutId'); + if (timeoutId) { + clearTimeout(timeoutId); + $root.removeData('contentEnterTimeoutId'); + } + } + if (leave) { + $root.filter(selector).add($root.find(selector)).each$(function ($element) { + if (!_this3.preventEventForElement($element)) { + leave($element); + } + }); + } + }; + } + }, { + key: 'preventEventForElement', + value: function preventEventForElement($element) { + return $element.closest('.' + this.preventContentEventsClassName).length > 0; + } + }, { + key: 'filterContent', + value: function filterContent($content, elementFlagName) { + return $content.filter(function (_index, element) { + if (element[elementFlagName]) { + return false; + } else { + element[elementFlagName] = true; + return true; + } + }); + } + }]); + return _class; + }(Base), Object.defineProperty(_class, 'contentEnterEventName', { + enumerable: true, + writable: true, + value: 'content:enter' + }), Object.defineProperty(_class, 'contentLeaveEventName', { + enumerable: true, + writable: true, + value: 'content:leave' + }), Object.defineProperty(_class, 'preventContentEventsClassName', { + enumerable: true, + writable: true, + value: 'js-prevent-normas' + }), _temp; +}); + +// require content mixin +var normasNavigation = (function (Base) { + var _class, _temp; + + return _temp = _class = function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.bindPageEvents(options); + _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); + return _this; + } + + createClass(_class, [{ + key: 'bindPageEvents', + value: function bindPageEvents(options) { + if (options.Turbolinks || global.Turbolinks) { + var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); + this.log('warn', 'You have Turbolinks and can use \'' + turboNormasImportPath + '/normasWithTurbolinks\' instead \'normas\'.'); + } + $(this.pageEnter.bind(this)); + } + }, { + key: 'listenToPage', + value: function listenToPage(enter) { + var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (enter) { + this.listenEvents(this.constructor.pageEnterEventName, enter); + } + if (leave) { + this.listenEvents(this.constructor.pageLeaveEventName, leave); + } + } + }, { + key: 'visit', + value: function visit(location) { + window.location = location; + } + }, { + key: 'refreshPage', + value: function refreshPage() { + this.visit(window.location); + } + }, { + key: 'setHash', + value: function setHash(hash) { + location.hash = hash; + } + }, { + key: 'back', + value: function back() { + global.history.back(); + } + }, { + key: 'replaceLocation', + value: function replaceLocation(url) { + this.log('`replaceLocation` works only with Turbolinks.'); + } + }, { + key: 'pushLocation', + value: function pushLocation(url) { + var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + + if (global.history) global.history.pushState(state, title, url); + } + }, { + key: 'sayAboutPageLoading', + value: function sayAboutPageLoading(state) { + this.log('`sayAboutPageLoading` works only with Turbolinks.'); + } + }, { + key: 'pageEnter', + value: function pageEnter() { + this.trigger(this.constructor.pageEnterEventName); + this.sayAboutContentEnter(this.$el.find('body')); + } + }, { + key: 'pageLeave', + value: function pageLeave() { + this.sayAboutContentLeave(this.$el.find('body')); + this.trigger(this.constructor.pageLeaveEventName); + } + }]); + return _class; + }(Base), Object.defineProperty(_class, 'pageEnterEventName', { + enumerable: true, + writable: true, + value: 'page:enter' + }), Object.defineProperty(_class, 'pageLeaveEventName', { + enumerable: true, + writable: true, + value: 'page:leave' + }), _temp; +}); + +var Normas = normasNavigation(normasContent(normasEvents(Base))); + +var _class = function (_normasEvents) { + inherits(_class, _normasEvents); + createClass(_class, [{ + key: 'initialize', + + // Override it with your own initialization logic. + value: function initialize(options) {} + + // Override it (and use this super method) with your own unmount logic. + + }, { + key: 'terminate', + value: function terminate() { + if (this.listenedEvents) { + this.forgetEvents(this.listenedEvents); + this.listenedEvents = null; + } + } + }]); + + function _class(options) { + classCallCheck(this, _class); + + Object.assign(options, options.$el.data()); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.reflectOptions(options); + _this.initializeEvents(options); + _this.initialize(options); + return _this; + } + + createClass(_class, [{ + key: 'reflectOptions', + value: function reflectOptions(options) { + var _this2 = this; + + Object.keys(options).forEach(function (attr) { + if (_this2.hasOwnProperty(attr)) { + _this2[attr] = options[attr]; + } + }); + } + }, { + key: 'initializeEvents', + value: function initializeEvents(_options) { + var events = this.constructor.events; + + if (events) { + if (!this.linkedEvents) { + this.linkedEvents = this.linkEvents(isFunction(events) ? events() : events); + } + this.listenedEvents = this.listenEvents(this.linkedEvents); + } + } + }, { + key: 'linkEvents', + value: function linkEvents(events) { + var _this3 = this; + + return mapValues(events, function (handle) { + return isString(handle) ? _this3[handle].bind(_this3) : _typeof(isPlainObject(handle)) ? _this3.linkEvents(handle) : handle; + }); + } + }]); + return _class; +}(normasEvents(Base)); + +// TODO: may be rename Views, views, View, view +// require content mixin +// require events mixin +var normasViews = (function (Base) { + return function (_Base) { + inherits(_class2, _Base); + + function _class2(options) { + classCallCheck(this, _class2); + + var _this = possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); + + Object.defineProperty(_this, 'View', { + enumerable: true, + writable: true, + value: _class + }); + Object.defineProperty(_this, 'viewClasses', { + enumerable: true, + writable: true, + value: {} + }); + Object.defineProperty(_this, 'viewInstances', { + enumerable: true, + writable: true, + value: [] + }); + + _this.viewOptions = _extends({ + debugMode: _this.debugMode, + eventsDebug: _this.eventsDebug + }, options.viewOptions); + _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); + return _this; + } + + createClass(_class2, [{ + key: 'registerView', + value: function registerView(viewClass) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.viewClasses[viewClass.selector]) { + this.error('View class for selector `' + viewClass.selector + '` already registered', this.viewClasses[viewClass.selector]); + return; + } + this.viewClasses[viewClass.selector] = viewClass; + this.listenToElement(viewClass.selector, function ($el) { + return _this2.bindView($el, viewClass, options); + }, function ($el) { + return _this2.unbindView($el, viewClass); + }, viewClass.delay); + } + }, { + key: 'bindView', + value: function bindView($el, viewClass, options) { + if (!this.canBind($el, viewClass)) { + return null; + } + if (viewClass.instanceIndex) { + viewClass.instanceIndex += 1; + } else { + viewClass.instanceIndex = 1; + } + var view = new viewClass(_extends({}, this.viewOptions, options, { + instanceName: viewClass.selector + '_' + viewClass.instanceIndex, + $el: $el + })); + this.viewInstances.push(view); + return view; + } + }, { + key: 'canBind', + value: function canBind($element, viewClass) { + var view = this.getViewsOnElement($element, viewClass)[0]; + if (view) { + this.log('warn', 'Element already has bound view', $element, viewClass, view); + return false; + } + return true; + } + }, { + key: 'unbindView', + value: function unbindView($element, viewClass) { + var view = this.getViewsOnElement($element, viewClass)[0]; + if (view) { + view.terminate(); + this.viewInstances = without(this.viewInstances, view); + } + } + }, { + key: 'getViewsOnElement', + value: function getViewsOnElement($element) { + var viewClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + var el = $element instanceof $ ? $element[0] : $element; + var filterOptions = { el: el }; + if (viewClass) { + filterOptions.constructor = viewClass; + } + return filter(this.viewInstances, filterOptions); + } + }, { + key: 'getViewsInContainer', + value: function getViewsInContainer($container) { + var checkRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return filter(this.viewInstances, function (view) { + return view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0]); + }); + } + }, { + key: 'getAllViews', + value: function getAllViews(viewClass) { + return filter(this.viewInstances, { constructor: viewClass }); + } + }, { + key: 'getFirstView', + value: function getFirstView(viewClass) { + return find(this.viewInstances, { constructor: viewClass }); + } + }, { + key: 'getFirstChildView', + value: function getFirstChildView(viewClass) { + return find(this.viewInstances, function (view) { + return view instanceof viewClass; + }); + } + }]); + return _class2; + }(Base); +}); + +var index = normasViews(Normas); + +module.exports = index; +//# sourceMappingURL=normas.js.map diff --git a/dist/js/normas.js.map b/dist/js/normas.js.map new file mode 100644 index 0000000..4768305 --- /dev/null +++ b/dist/js/normas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"normas.js","sources":["../../src/js/lib/jqueryAdditions.js","../../src/js/mixins/base.js","../../node_modules/isobject/index.js","../../node_modules/is-plain-object/index.js","../../src/js/lib/helpers.js","../../src/js/mixins/events.js","../../src/js/mixins/content.js","../../src/js/mixins/navigation.js","../../src/js/minimalNormas.js","../../src/js/view.js","../../src/js/mixins/views.js","../../src/js/index.js"],"sourcesContent":["$.fn.each$ = function (handle) {\n return this.each((index, element) => {\n handle($(element), index);\n });\n};\n\n// [showOrHide[, duration[, callback]]]\n$.fn.slideToggleByState = function slideToggleByState(...a) {\n if (this.length > 0) {\n if (a.length > 0) {\n if (a.shift()) {\n this.slideDown(...a);\n } else {\n this.slideUp(...a);\n }\n } else {\n this.slideToggle();\n }\n }\n return this;\n};\n\n// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/\n$.fn.focusToEnd = function focusToEnd() {\n let $this = this.first();\n if ($this.is('select, :checkbox, :radio')) {\n $this.focus();\n } else {\n let val = $this.val();\n $this.focus().val('').val(val);\n }\n return this;\n};\n\n$.fn.focusTo = function focusTo(caretPos) {\n return this.each((index, element) => {\n if (element.createTextRange) {\n let range = element.createTextRange();\n range.move('character', caretPos);\n range.select();\n } else if (element.selectionStart) {\n element.focus();\n element.setSelectionRange(caretPos, caretPos);\n } else {\n element.focus();\n }\n });\n};\n\n/*\n ** Returns the caret (cursor) position of the specified text field.\n ** Return value range is 0-oField.value.length.\n */\n$.fn.caretPosition = function caretPosition() {\n // Initialize\n let iCaretPos = 0;\n let oField = this[0];\n\n // IE Support\n if (document.selection) {\n // Set focus on the element\n oField.focus();\n // To get cursor position, get empty selection range\n let oSel = document.selection.createRange();\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length);\n // The caret position is selection length\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart != null) {\n iCaretPos = oField.selectionStart;\n }\n\n // Return results\n return iCaretPos;\n};\n","export default class Base {\n constructor({ debugMode = true, $el = $(document), instanceName = 'NormasApp' }) {\n this.instanceName = instanceName;\n this.debugMode = debugMode;\n this.$el = $el;\n this.el = $el[0];\n this.log('info', `\"${this.instanceName}\" constructed.`);\n }\n\n $(...args) {\n return this.$el.find(...args);\n }\n\n log(...args) {\n if (!this.debugMode) return;\n let method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log';\n this._log(method, ...args);\n }\n\n error(...args) {\n this._log('error', ...args);\n }\n\n _log(method, ...args) {\n if (console && console[method]) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n","/*!\n * isobject \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nmodule.exports = function isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n};\n","/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nvar isObject = require('isobject');\n\nfunction isObjectObject(o) {\n return isObject(o) === true\n && Object.prototype.toString.call(o) === '[object Object]';\n}\n\nmodule.exports = function isPlainObject(o) {\n var ctor,prot;\n\n if (isObjectObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (typeof ctor !== 'function') return false;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObjectObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n};\n","// Sufficient for Normas implementation of functions like from lodash\n\nexport isPlainObject from 'is-plain-object';\n\nexport const isArray = Array.isArray;\n\nexport function isFunction(v) {\n return typeof v === 'function';\n}\n\nexport function isString(v) {\n return typeof v === 'string';\n}\n\nexport function compact(array) {\n return filter(array, v => v);\n}\n\nexport function debounce(func, wait) {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n func(...args);\n }, wait);\n }\n}\n\nexport function flatten(array) {\n const result = [];\n array.forEach(value => {\n if (isArray(value)) {\n result.push(...value);\n } else {\n result.push(value);\n }\n });\n return result;\n}\n\nexport function filter(collection, conditions) {\n return filterBase('filter', collection, conditions);\n}\n\nexport function find(collection, conditions) {\n return filterBase('find', collection, conditions);\n}\n\nexport function map(collection, iteratee) {\n return Array.prototype.map.call(collection, iteratee);\n}\n\nexport function mapValues(object, iteratee) {\n const result = {};\n Object.keys(object).forEach(key => {\n result[key] = iteratee(object[key]);\n });\n return result;\n}\n\nexport function without(collection, ...values) {\n return filter(collection, item => !values.includes(item));\n}\n\n// private\n\nfunction filterBase(baseName, collection, conditions) {\n return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions));\n}\n\nfunction makeConditionsMatch(conditions) {\n if (isFunction(conditions)) {\n return conditions;\n } else {\n const conditionsKeys = Object.keys(conditions);\n return item => filterMatch(item, conditions, conditionsKeys);\n }\n}\n\nfunction filterMatch(item, conditions, conditionsKeys) {\n return conditionsKeys.find(key => conditions[key] !== item[key]) === undefined;\n}\n","import { isFunction, isPlainObject, debounce, flatten } from '../lib/helpers';\n\nexport default Base => (class extends Base {\n constructor(options) {\n super(options);\n this.eventsDebug = this.debugMode && options.eventsDebug || false;\n if (this.eventsDebug) {\n this.eventsLogBuffer = [];\n this.eventsLog = debounce(this.eventsLog.bind(this), 20);\n }\n this.log('info', `\"${this.instanceName}\" events mixin activated. eventsDebug =`, this.eventsDebug);\n }\n\n trigger(...args) {\n this.$el.trigger(...args);\n }\n\n listenEvents(...args) {\n const listeningArgs = this.listenEventsOnElement(this.$el, ...args);\n if (this.eventsDebug) {\n this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs);\n this.eventsLog();\n }\n return listeningArgs;\n }\n\n listenEventsOnElement($element, ...args) {\n const listeningArgs = this.constructor.listeningArguments(...args);\n listeningArgs.forEach(({ events, selector, handle }) => {\n $element.on(events, selector, handle);\n });\n return listeningArgs;\n }\n\n eventsLog() {\n this.log('table', this.eventsLogBuffer);\n this.eventsLogBuffer = [];\n }\n\n forgetEvents(listeningArgs) {\n this.forgetEventsOnElement(this.$el, listeningArgs);\n }\n\n forgetEventsOnElement($element, listeningArgs) {\n if (this.eventsDebug) {\n this.log('forget events', listeningArgs);\n }\n listeningArgs.forEach(({ events, selector, handle }) => {\n $element.off(events, selector, handle);\n });\n }\n\n static listeningArguments(selector, eventRule, handle) {\n if (isPlainObject(selector)) {\n eventRule = selector;\n selector = '';\n }\n\n if (isFunction(eventRule)) {\n handle = eventRule;\n eventRule = selector;\n selector = '';\n }\n\n if (isPlainObject(eventRule)) {\n return flatten(Object.keys(eventRule).map((key) => {\n let value = eventRule[key];\n return isPlainObject(value) ?\n this.listeningArguments(selector ? `${selector} ${key}` : key, value)\n :\n this.listeningArguments(selector, key, value);\n }));\n }\n\n if (!isFunction(handle)) {\n console.error(`handle isn't function in listening declaration! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n if (!eventRule) {\n console.error(`eventRule not defined! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n\n const selectors = eventRule.split(/\\s+/);\n const eventName = selectors[0];\n selectors[0] = selector;\n\n if (!eventName) {\n console.error(`bad eventName in listening declaration! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n\n return [{\n events: eventName.replace(/\\//g, ' '),\n selector: selectors.join(' ').trim(),\n handle: (event, ...args) => handle($(event.currentTarget), event, ...args),\n }];\n }\n});\n","// require events mixin\nexport default Base => (class extends Base {\n static contentEnterEventName = 'content:enter';\n static contentLeaveEventName = 'content:leave';\n\n static preventContentEventsClassName = 'js-prevent-normas';\n\n constructor(options) {\n super(options);\n this.log('info', `\"${this.instanceName}\" content mixin activated.`);\n }\n\n listenToElement(selector, enter, leave = null, delay = 0) {\n let contentEnter = this.constructor.makeElementContentEnter(selector, enter);\n if (delay > 0) {\n contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay);\n }\n const contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null;\n this.listenToContent(contentEnter, contentLeave);\n }\n\n listenToContent(enter, leave = null) {\n if (enter) {\n this.$el.on(this.constructor.contentEnterEventName, (event, $root) => enter($root, event));\n }\n if (leave) {\n this.$el.on(this.constructor.contentLeaveEventName, (event, $root) => leave($root, event));\n }\n }\n\n sayAboutContentEnter($content) {\n $content = this.constructor.filterContent($content, 'normasEntered');\n if ($content.length > 0) {\n $content.removeClass(this.constructor.preventContentEventsClassName);\n this.trigger(this.constructor.contentEnterEventName, [$content]);\n }\n return $content;\n }\n\n sayAboutContentLeave($content) {\n $content = this.constructor.filterContent($content, 'normasLeft');\n if ($content.length > 0) {\n this.trigger(this.constructor.contentLeaveEventName, [$content]);\n }\n return $content;\n }\n\n replaceContentInner($container, content) {\n this.sayAboutContentLeave($container);\n $container.html(content);\n this.sayAboutContentEnter($container);\n }\n\n replaceContent($content, $newContent) {\n this.sayAboutContentLeave($content);\n if ($content.length === 1) {\n $content.replaceWith($newContent);\n } else {\n $newContent.insertBefore($content.first());\n $content.remove();\n }\n this.sayAboutContentEnter($newContent);\n }\n\n // private\n\n static makeElementContentEnter(selector, enter) {\n return ($root) => {\n $root.filter(selector).add($root.find(selector)).each$($element => {\n if (!this.preventEventForElement($element)) {\n enter($element);\n }\n });\n };\n }\n\n static makeDelayedElementContentEnter(contentEnter, delay) {\n return ($root) => {\n $root.data('contentEnterTimeoutId', setTimeout(() => {\n $root.removeData('contentEnterTimeoutId');\n if (document.documentElement.hasAttribute('data-turbolinks-preview')) {\n return;\n }\n contentEnter($root);\n }, delay));\n };\n }\n\n static makeElementContentLeave(selector, leave, delay) {\n return ($root) => {\n if (delay > 0) {\n let timeoutId = $root.data('contentEnterTimeoutId');\n if (timeoutId) {\n clearTimeout(timeoutId);\n $root.removeData('contentEnterTimeoutId');\n }\n }\n if (leave) {\n $root.filter(selector).add($root.find(selector)).each$($element => {\n if (!this.preventEventForElement($element)) {\n leave($element);\n }\n });\n }\n };\n }\n\n static preventEventForElement($element) {\n return $element.closest(`.${this.preventContentEventsClassName}`).length > 0;\n }\n\n static filterContent($content, elementFlagName) {\n return $content.filter((_index, element) => {\n if (element[elementFlagName]) {\n return false;\n } else {\n element[elementFlagName] = true;\n return true;\n }\n });\n }\n});\n","// require content mixin\nexport default Base => (class extends Base {\n static pageEnterEventName = 'page:enter';\n static pageLeaveEventName = 'page:leave';\n\n constructor(options) {\n super(options);\n this.bindPageEvents(options);\n this.log('info', `\"${this.instanceName}\" navigation mixin activated.`);\n }\n\n bindPageEvents(options) {\n if (options.Turbolinks || global.Turbolinks) {\n const turboNormasImportPath = `normas${process.env.NODE_ENV === 'development' ? '/src/js' : ''}`;\n this.log('warn',\n `You have Turbolinks and can use '${turboNormasImportPath}/normasWithTurbolinks' instead 'normas'.`);\n }\n $(this.pageEnter.bind(this));\n }\n\n listenToPage(enter, leave = null) {\n if (enter) {\n this.listenEvents(this.constructor.pageEnterEventName, enter);\n }\n if (leave) {\n this.listenEvents(this.constructor.pageLeaveEventName, leave);\n }\n }\n\n visit(location) {\n window.location = location;\n }\n\n refreshPage() {\n this.visit(window.location);\n }\n\n setHash(hash) {\n location.hash = hash;\n }\n\n back() {\n global.history.back();\n }\n\n replaceLocation(url) {\n this.log('`replaceLocation` works only with Turbolinks.');\n }\n\n pushLocation(url, title = null, state = null) {\n if (global.history) global.history.pushState(state, title, url);\n }\n\n sayAboutPageLoading(state) {\n this.log('`sayAboutPageLoading` works only with Turbolinks.');\n }\n\n pageEnter() {\n this.trigger(this.constructor.pageEnterEventName);\n this.sayAboutContentEnter(this.$el.find('body'));\n }\n\n pageLeave() {\n this.sayAboutContentLeave(this.$el.find('body'));\n this.trigger(this.constructor.pageLeaveEventName);\n }\n});\n","import './lib/jqueryAdditions';\nimport NormasBase from './mixins/base';\nimport normasEvents from './mixins/events';\nimport normasContent from './mixins/content';\nimport normasNavigation from './mixins/navigation';\n\nconst Normas =\n normasNavigation(\n normasContent(\n normasEvents(\n NormasBase\n )\n )\n );\n\nexport default Normas;\n","import { isFunction, isString, isPlainObject, mapValues } from './lib/helpers';\nimport NormasBase from './mixins/base';\nimport normasEvents from './mixins/events';\n\nexport default class extends normasEvents(NormasBase) {\n // Override it with your own initialization logic.\n initialize(options) {\n }\n\n // Override it (and use this super method) with your own unmount logic.\n terminate() {\n if (this.listenedEvents) {\n this.forgetEvents(this.listenedEvents);\n this.listenedEvents = null;\n }\n }\n\n constructor(options) {\n Object.assign(options, options.$el.data());\n super(options);\n this.reflectOptions(options);\n this.initializeEvents(options);\n this.initialize(options);\n }\n\n reflectOptions(options) {\n Object.keys(options).forEach(attr => {\n if (this.hasOwnProperty(attr)) {\n this[attr] = options[attr];\n }\n });\n }\n\n initializeEvents(_options) {\n const { events } = this.constructor;\n if (events) {\n if (!this.linkedEvents) {\n this.linkedEvents = this.linkEvents(isFunction(events) ? events() : events);\n }\n this.listenedEvents = this.listenEvents(this.linkedEvents);\n }\n }\n\n linkEvents(events) {\n return mapValues(events, handle => isString(handle) ?\n this[handle].bind(this)\n :\n (typeof isPlainObject(handle) ? this.linkEvents(handle) : handle)\n );\n }\n};\n","// TODO: may be rename Views, views, View, view\nimport { filter, find, without } from '../lib/helpers';\nimport View from '../view';\n\n// require content mixin\n// require events mixin\nexport default Base => (class extends Base {\n View = View;\n viewClasses = {};\n viewInstances = [];\n\n constructor(options) {\n super(options);\n this.viewOptions = {\n debugMode: this.debugMode,\n eventsDebug: this.eventsDebug,\n ...options.viewOptions,\n };\n this.log('info', `\"${this.instanceName}\" navigation mixin activated.`);\n }\n\n registerView(viewClass, options = {}) {\n if (this.viewClasses[viewClass.selector]) {\n this.error(`View class for selector \\`${viewClass.selector}\\` already registered`,\n this.viewClasses[viewClass.selector]);\n return;\n }\n this.viewClasses[viewClass.selector] = viewClass;\n this.listenToElement(\n viewClass.selector,\n $el => this.bindView($el, viewClass, options),\n $el => this.unbindView($el, viewClass),\n viewClass.delay,\n );\n }\n\n bindView($el, viewClass, options) {\n if (!this.canBind($el, viewClass)) {\n return null;\n }\n if (viewClass.instanceIndex) {\n viewClass.instanceIndex += 1;\n } else {\n viewClass.instanceIndex = 1;\n }\n const view = new viewClass({\n ...this.viewOptions,\n ...options,\n instanceName: `${viewClass.selector}_${viewClass.instanceIndex}`,\n $el,\n });\n this.viewInstances.push(view);\n return view;\n }\n\n canBind($element, viewClass) {\n const view = this.getViewsOnElement($element, viewClass)[0];\n if (view) {\n this.log('warn', 'Element already has bound view', $element, viewClass, view);\n return false;\n }\n return true;\n }\n\n unbindView($element, viewClass) {\n const view = this.getViewsOnElement($element, viewClass)[0];\n if (view) {\n view.terminate();\n this.viewInstances = without(this.viewInstances, view);\n }\n }\n\n getViewsOnElement($element, viewClass = null) {\n const el = $element instanceof $ ? $element[0] : $element;\n const filterOptions = { el };\n if (viewClass) {\n filterOptions.constructor = viewClass;\n }\n return filter(this.viewInstances, filterOptions);\n }\n\n getViewsInContainer($container, checkRoot = true) {\n return filter(this.viewInstances, view =>\n view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0])\n );\n }\n\n getAllViews(viewClass) {\n return filter(this.viewInstances, { constructor: viewClass });\n }\n\n getFirstView(viewClass) {\n return find(this.viewInstances, { constructor: viewClass });\n }\n\n getFirstChildView(viewClass) {\n return find(this.viewInstances, view => view instanceof viewClass);\n }\n});\n","import MinimalNormas from './minimalNormas';\nimport normasViews from './mixins/views';\n\nexport default normasViews(MinimalNormas);\n"],"names":["$","fn","each$","handle","each","index","element","slideToggleByState","length","a","shift","slideDown","slideUp","slideToggle","focusToEnd","$this","first","is","focus","val","focusTo","caretPos","createTextRange","range","move","select","selectionStart","setSelectionRange","caretPosition","iCaretPos","oField","document","selection","oSel","createRange","moveStart","value","text","Base","debugMode","$el","instanceName","el","log","find","args","method","indexOf","_log","console","isObject","isArray","Array","isFunction","v","isString","debounce","func","wait","timeoutId","setTimeout","flatten","array","result","forEach","push","filter","collection","conditions","filterBase","mapValues","object","iteratee","keys","key","without","values","includes","item","baseName","prototype","call","makeConditionsMatch","conditionsKeys","Object","filterMatch","undefined","options","eventsDebug","eventsLogBuffer","eventsLog","bind","trigger","listeningArgs","listenEventsOnElement","concat","$element","constructor","listeningArguments","events","selector","on","forgetEventsOnElement","off","eventRule","isPlainObject","map","error","selectors","split","eventName","replace","join","trim","event","currentTarget","enter","leave","delay","contentEnter","makeElementContentEnter","makeDelayedElementContentEnter","contentLeave","makeElementContentLeave","listenToContent","contentEnterEventName","$root","contentLeaveEventName","$content","filterContent","removeClass","preventContentEventsClassName","$container","content","sayAboutContentLeave","html","sayAboutContentEnter","$newContent","replaceWith","insertBefore","remove","add","preventEventForElement","data","removeData","documentElement","hasAttribute","closest","elementFlagName","_index","bindPageEvents","Turbolinks","global","turboNormasImportPath","process","env","NODE_ENV","pageEnter","listenEvents","pageEnterEventName","pageLeaveEventName","location","visit","window","hash","history","back","url","title","state","pushState","Normas","normasNavigation","normasContent","normasEvents","NormasBase","listenedEvents","forgetEvents","assign","reflectOptions","initializeEvents","initialize","hasOwnProperty","attr","_options","linkedEvents","linkEvents","babelHelpers.typeof","View","viewOptions","viewClass","viewClasses","listenToElement","bindView","unbindView","canBind","instanceIndex","view","viewInstances","getViewsOnElement","terminate","filterOptions","checkRoot","normasViews","MinimalNormas"],"mappings":";;AAAAA,EAAEC,EAAF,CAAKC,KAAL,GAAa,UAAUC,MAAV,EAAkB;SACtB,KAAKC,IAAL,CAAU,UAACC,KAAD,EAAQC,OAAR,EAAoB;WAC5BN,EAAEM,OAAF,CAAP,EAAmBD,KAAnB;GADK,CAAP;CADF;;;AAOAL,EAAEC,EAAF,CAAKM,kBAAL,GAA0B,SAASA,kBAAT,GAAkC;MACtD,KAAKC,MAAL,GAAc,CAAlB,EAAqB;sCADkCC,CAClC;OAAA;;;QACfA,EAAED,MAAF,GAAW,CAAf,EAAkB;UACZC,EAAEC,KAAF,EAAJ,EAAe;aACRC,SAAL,aAAkBF,CAAlB;OADF,MAEO;aACAG,OAAL,aAAgBH,CAAhB;;KAJJ,MAMO;WACAI,WAAL;;;SAGG,IAAP;CAZF;;;AAgBAb,EAAEC,EAAF,CAAKa,UAAL,GAAkB,SAASA,UAAT,GAAsB;MAClCC,QAAQ,KAAKC,KAAL,E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AAO,KAAKE,iBAAL,CAAuBvG,QAAvB,EAAiC8F,SAAjC,EAA4C,CAA5C,CAAb;YACIO,IAAJ,EAAU;eACHG,SAAL;eACKF,aAAL,GAAqB3H,QAAQ,KAAK2H,aAAb,EAA4BD,IAA5B,CAArB;;;;;wCAIcrG,QAlEL,EAkEiC;YAAlB8F,SAAkB,uEAAN,IAAM;;YACtCpJ,KAAKsD,oBAAoBhG,CAApB,GAAwBgG,SAAS,CAAT,CAAxB,GAAsCA,QAAjD;YACMyG,gBAAgB,EAAE/J,MAAF,EAAtB;YACIoJ,SAAJ,EAAe;wBACC7F,WAAd,GAA4B6F,SAA5B;;eAEK5H,OAAO,KAAKoI,aAAZ,EAA2BG,aAA3B,CAAP;;;;0CAGkBrE,UA3EP,EA2EqC;YAAlBsE,SAAkB,uEAAN,IAAM;;eACzCxI,OAAO,KAAKoI,aAAZ,EAA2B;iBAChCD,KAAK7J,GAAL,CAAS2G,OAAT,CAAiBf,UAAjB,EAA6B5H,MAA7B,GAAsC,CAAtC,KAA4CkM,aAAaL,KAAK3J,EAAL,KAAY0F,WAAW,CAAX,CAArE,CADgC;SAA3B,CAAP;;;;kCAKU0D,SAjFC,EAiFU;eACd5H,OAAO,KAAKoI,aAAZ,EAA2B,EAAErG,aAAa6F,SAAf,EAA3B,CAAP;;;;mCAGWA,SArFA,EAqFW;eACflJ,KAAK,KAAK0J,aAAV,EAAyB,EAAErG,aAAa6F,SAAf,EAAzB,CAAP;;;;wCAGgBA,SAzFL,EAyFgB;eACpBlJ,KAAK,KAAK0J,aAAV,EAAyB;iBAAQD,gBAAgBP,SAAxB;SAAzB,CAAP;;;;IA1FkCxJ,IAAvB;CAAf;;ACHA,YAAeqK,YAAYC,MAAZ,CAAf;;;;"} \ No newline at end of file diff --git a/dist/js/normasMutations.js b/dist/js/normasMutations.js new file mode 100644 index 0000000..2a5bee1 --- /dev/null +++ b/dist/js/normasMutations.js @@ -0,0 +1,172 @@ +'use strict'; + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + + + +var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + + + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +// EXPERIMENTAL + +var initialMutations = true; + +var mutations = (function (Base) { + return function (_Base) { + inherits(_class2, _Base); + + function _class2(options) { + classCallCheck(this, _class2); + + var _this = possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); + + Object.defineProperty(_this, 'checkMutations', { + enumerable: true, + writable: true, + value: function value(mutation) { + if (mutation.type !== 'childList') { + return; + } + + var removedNodes = _this.constructor.filterMutationNodes(mutation.removedNodes); + var addedNodes = _this.constructor.filterMutationNodes(mutation.addedNodes); + + if (removedNodes.length > 0) { + _this.sayAboutContentLeave($(removedNodes)); + } + if (addedNodes.length > 0) { + _this.sayAboutContentEnter($(addedNodes)); + } + } + }); + + if (MutationObserver) { + _this.observeMutations(); + _this.log('warn', '"' + _this.instanceName + '" mutation observer activated. (EXPERIMENTAL feature)'); + } else { + _this.log('warn', '"' + _this.instanceName + '" mutation observer NOT DEFINED!'); + } + return _this; + } + + createClass(_class2, [{ + key: 'observeMutations', + value: function observeMutations() { + var _this2 = this; + + // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver + this.mutationObserver = new MutationObserver(function (mutations) { + return mutations.forEach(_this2.checkMutations); + }); + this.mutationObserver.observe(this.$el[0], { childList: true, subtree: true }); + } + }, { + key: 'pageEnter', + value: function pageEnter() { + if (initialMutations) { + initialMutations = false; + } + get(_class2.prototype.__proto__ || Object.getPrototypeOf(_class2.prototype), 'pageEnter', this).call(this); + } + }], [{ + key: 'filterMutationNodes', + value: function filterMutationNodes(nodes) { + return Array.prototype.filter.call(nodes, function (node) { + if (initialMutations) { + node.normasInitialMutationReady = true; + if (node.parentElement && node.parentElement.normasInitialMutationReady) { + return false; + } + } + return node.nodeType === 1 && !node.isPreview && node.tagName !== 'TITLE' && node.tagName !== 'META' && (!node.parentElement || node.parentElement.tagName !== 'HEAD'); + }); + } + }]); + return _class2; + }(Base); +}); + +module.exports = mutations; +//# sourceMappingURL=normasMutations.js.map diff --git a/dist/js/normasMutations.js.map b/dist/js/normasMutations.js.map new file mode 100644 index 0000000..355c999 --- /dev/null +++ b/dist/js/normasMutations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"normasMutations.js","sources":["../../src/js/mixins/mutations.js"],"sourcesContent":["// EXPERIMENTAL\n\nlet initialMutations = true;\n\nexport default Base => (class extends Base {\n constructor(options) {\n super(options);\n if (MutationObserver) {\n this.observeMutations();\n this.log('warn', `\"${this.instanceName}\" mutation observer activated. (EXPERIMENTAL feature)`);\n } else {\n this.log('warn', `\"${this.instanceName}\" mutation observer NOT DEFINED!`);\n }\n }\n\n observeMutations() {\n // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver\n this.mutationObserver = new MutationObserver(mutations => mutations.forEach(this.checkMutations));\n this.mutationObserver.observe(this.$el[0], { childList: true, subtree: true });\n }\n\n checkMutations = (mutation) => {\n if (mutation.type !== 'childList') {\n return;\n }\n\n const removedNodes = this.constructor.filterMutationNodes(mutation.removedNodes);\n const addedNodes = this.constructor.filterMutationNodes(mutation.addedNodes);\n\n if (removedNodes.length > 0) {\n this.sayAboutContentLeave($(removedNodes));\n }\n if (addedNodes.length > 0) {\n this.sayAboutContentEnter($(addedNodes));\n }\n };\n\n pageEnter() {\n if (initialMutations) {\n initialMutations = false;\n }\n super.pageEnter();\n }\n\n static filterMutationNodes(nodes) {\n return Array.prototype.filter.call(nodes, node => {\n if (initialMutations) {\n node.normasInitialMutationReady = true;\n if (node.parentElement && node.parentElement.normasInitialMutationReady) {\n return false;\n }\n }\n return node.nodeType === 1 &&\n !node.isPreview &&\n node.tagName !== 'TITLE' && node.tagName !== 'META' &&\n (!node.parentElement || node.parentElement.tagName !== 'HEAD');\n });\n }\n});\n"],"names":["initialMutations","options","mutation","type","removedNodes","constructor","filterMutationNodes","addedNodes","length","sayAboutContentLeave","$","sayAboutContentEnter","MutationObserver","observeMutations","log","instanceName","mutationObserver","mutations","forEach","checkMutations","observe","$el","childList","subtree","nodes","Array","prototype","filter","call","normasInitialMutationReady","node","parentElement","nodeType","isPreview","tagName","Base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAIA,mBAAmB,IAAvB;;AAEA,iBAAe;;;;qBACDC,OAAZ,EAAqB;;;mHACbA,OADa;;;;;eAgBJ,eAACC,QAAD,EAAc;cACzBA,SAASC,IAAT,KAAkB,WAAtB,E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AHlD,CAAP;SAPK,CAAP;;;;IAzCkCC,IAAvB;CAAf;;;;"} \ No newline at end of file diff --git a/dist/js/normasWithTurbolinks.js b/dist/js/normasWithTurbolinks.js new file mode 100644 index 0000000..086aeed --- /dev/null +++ b/dist/js/normasWithTurbolinks.js @@ -0,0 +1,1207 @@ +'use strict'; + +$.fn.each$ = function (handle) { + return this.each(function (index, element) { + handle($(element), index); + }); +}; + +// [showOrHide[, duration[, callback]]] +$.fn.slideToggleByState = function slideToggleByState() { + if (this.length > 0) { + for (var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++) { + a[_key] = arguments[_key]; + } + + if (a.length > 0) { + if (a.shift()) { + this.slideDown.apply(this, a); + } else { + this.slideUp.apply(this, a); + } + } else { + this.slideToggle(); + } + } + return this; +}; + +// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/ +$.fn.focusToEnd = function focusToEnd() { + var $this = this.first(); + if ($this.is('select, :checkbox, :radio')) { + $this.focus(); + } else { + var val = $this.val(); + $this.focus().val('').val(val); + } + return this; +}; + +$.fn.focusTo = function focusTo(caretPos) { + return this.each(function (index, element) { + if (element.createTextRange) { + var range = element.createTextRange(); + range.move('character', caretPos); + range.select(); + } else if (element.selectionStart) { + element.focus(); + element.setSelectionRange(caretPos, caretPos); + } else { + element.focus(); + } + }); +}; + +/* + ** Returns the caret (cursor) position of the specified text field. + ** Return value range is 0-oField.value.length. + */ +$.fn.caretPosition = function caretPosition() { + // Initialize + var iCaretPos = 0; + var oField = this[0]; + + // IE Support + if (document.selection) { + // Set focus on the element + oField.focus(); + // To get cursor position, get empty selection range + var oSel = document.selection.createRange(); + // Move selection start to 0 position + oSel.moveStart('character', -oField.value.length); + // The caret position is selection length + iCaretPos = oSel.text.length; + } else if (oField.selectionStart != null) { + iCaretPos = oField.selectionStart; + } + + // Return results + return iCaretPos; +}; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + + + + + + + + + + + +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + + + +var _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; + +var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +}; + + + + + + + + + + + +var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + + + + + + + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +var Base = function () { + function Base(_ref) { + var _ref$debugMode = _ref.debugMode, + debugMode = _ref$debugMode === undefined ? true : _ref$debugMode, + _ref$$el = _ref.$el, + $el = _ref$$el === undefined ? $(document) : _ref$$el, + _ref$instanceName = _ref.instanceName, + instanceName = _ref$instanceName === undefined ? 'NormasApp' : _ref$instanceName; + classCallCheck(this, Base); + + this.instanceName = instanceName; + this.debugMode = debugMode; + this.$el = $el; + this.el = $el[0]; + this.log('info', '"' + this.instanceName + '" constructed.'); + } + + createClass(Base, [{ + key: '$', + value: function $() { + var _$el; + + return (_$el = this.$el).find.apply(_$el, arguments); + } + }, { + key: 'log', + value: function log() { + if (!this.debugMode) return; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log'; + this._log.apply(this, [method].concat(args)); + } + }, { + key: 'error', + value: function error() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this._log.apply(this, ['error'].concat(args)); + } + }, { + key: '_log', + value: function _log(method) { + if (console && console[method]) { + var _console; + + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } + } + }]); + return Base; +}(); + +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isobject = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; + +function isObjectObject(o) { + return isobject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +var isPlainObject = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; + +// Sufficient for Normas implementation of functions like from lodash + +var isArray = Array.isArray; + +function isFunction(v) { + return typeof v === 'function'; +} + +function isString(v) { + return typeof v === 'string'; +} + + + +function debounce(func, wait) { + var timeoutId = void 0; + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (timeoutId) { + clearTimeout(timeoutId); + } + timeoutId = setTimeout(function () { + func.apply(undefined, args); + }, wait); + }; +} + +function flatten(array) { + var result = []; + array.forEach(function (value) { + if (isArray(value)) { + result.push.apply(result, toConsumableArray(value)); + } else { + result.push(value); + } + }); + return result; +} + +function filter(collection, conditions) { + return filterBase('filter', collection, conditions); +} + +function find(collection, conditions) { + return filterBase('find', collection, conditions); +} + + + +function mapValues(object, iteratee) { + var result = {}; + Object.keys(object).forEach(function (key) { + result[key] = iteratee(object[key]); + }); + return result; +} + +function without(collection) { + for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + return filter(collection, function (item) { + return !values.includes(item); + }); +} + +// private + +function filterBase(baseName, collection, conditions) { + return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions)); +} + +function makeConditionsMatch(conditions) { + if (isFunction(conditions)) { + return conditions; + } else { + var conditionsKeys = Object.keys(conditions); + return function (item) { + return filterMatch(item, conditions, conditionsKeys); + }; + } +} + +function filterMatch(item, conditions, conditionsKeys) { + return conditionsKeys.find(function (key) { + return conditions[key] !== item[key]; + }) === undefined; +} + +var normasEvents = (function (Base) { + return function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.eventsDebug = _this.debugMode && options.eventsDebug || false; + if (_this.eventsDebug) { + _this.eventsLogBuffer = []; + _this.eventsLog = debounce(_this.eventsLog.bind(_this), 20); + } + _this.log('info', '"' + _this.instanceName + '" events mixin activated. eventsDebug =', _this.eventsDebug); + return _this; + } + + createClass(_class, [{ + key: 'trigger', + value: function trigger() { + var _$el; + + (_$el = this.$el).trigger.apply(_$el, arguments); + } + }, { + key: 'listenEvents', + value: function listenEvents() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var listeningArgs = this.listenEventsOnElement.apply(this, [this.$el].concat(args)); + if (this.eventsDebug) { + this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs); + this.eventsLog(); + } + return listeningArgs; + } + }, { + key: 'listenEventsOnElement', + value: function listenEventsOnElement($element) { + var _constructor; + + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + var listeningArgs = (_constructor = this.constructor).listeningArguments.apply(_constructor, args); + listeningArgs.forEach(function (_ref) { + var events = _ref.events, + selector = _ref.selector, + handle = _ref.handle; + + $element.on(events, selector, handle); + }); + return listeningArgs; + } + }, { + key: 'eventsLog', + value: function eventsLog() { + this.log('table', this.eventsLogBuffer); + this.eventsLogBuffer = []; + } + }, { + key: 'forgetEvents', + value: function forgetEvents(listeningArgs) { + this.forgetEventsOnElement(this.$el, listeningArgs); + } + }, { + key: 'forgetEventsOnElement', + value: function forgetEventsOnElement($element, listeningArgs) { + if (this.eventsDebug) { + this.log('forget events', listeningArgs); + } + listeningArgs.forEach(function (_ref2) { + var events = _ref2.events, + selector = _ref2.selector, + handle = _ref2.handle; + + $element.off(events, selector, handle); + }); + } + }], [{ + key: 'listeningArguments', + value: function listeningArguments(selector, eventRule, _handle) { + var _this2 = this; + + if (isPlainObject(selector)) { + eventRule = selector; + selector = ''; + } + + if (isFunction(eventRule)) { + _handle = eventRule; + eventRule = selector; + selector = ''; + } + + if (isPlainObject(eventRule)) { + return flatten(Object.keys(eventRule).map(function (key) { + var value = eventRule[key]; + return isPlainObject(value) ? _this2.listeningArguments(selector ? selector + ' ' + key : key, value) : _this2.listeningArguments(selector, key, value); + })); + } + + if (!isFunction(_handle)) { + console.error('handle isn\'t function in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + if (!eventRule) { + console.error('eventRule not defined! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + + var selectors = eventRule.split(/\s+/); + var eventName = selectors[0]; + selectors[0] = selector; + + if (!eventName) { + console.error('bad eventName in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console + return []; + } + + return [{ + events: eventName.replace(/\//g, ' '), + selector: selectors.join(' ').trim(), + handle: function handle(event) { + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + return _handle.apply(undefined, [$(event.currentTarget), event].concat(args)); + } + }]; + } + }]); + return _class; + }(Base); +}); + +// require events mixin +var normasContent = (function (Base) { + var _class, _temp; + + return _temp = _class = function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.log('info', '"' + _this.instanceName + '" content mixin activated.'); + return _this; + } + + createClass(_class, [{ + key: 'listenToElement', + value: function listenToElement(selector, enter) { + var leave = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + var contentEnter = this.constructor.makeElementContentEnter(selector, enter); + if (delay > 0) { + contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay); + } + var contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null; + this.listenToContent(contentEnter, contentLeave); + } + }, { + key: 'listenToContent', + value: function listenToContent(enter) { + var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (enter) { + this.$el.on(this.constructor.contentEnterEventName, function (event, $root) { + return enter($root, event); + }); + } + if (leave) { + this.$el.on(this.constructor.contentLeaveEventName, function (event, $root) { + return leave($root, event); + }); + } + } + }, { + key: 'sayAboutContentEnter', + value: function sayAboutContentEnter($content) { + $content = this.constructor.filterContent($content, 'normasEntered'); + if ($content.length > 0) { + $content.removeClass(this.constructor.preventContentEventsClassName); + this.trigger(this.constructor.contentEnterEventName, [$content]); + } + return $content; + } + }, { + key: 'sayAboutContentLeave', + value: function sayAboutContentLeave($content) { + $content = this.constructor.filterContent($content, 'normasLeft'); + if ($content.length > 0) { + this.trigger(this.constructor.contentLeaveEventName, [$content]); + } + return $content; + } + }, { + key: 'replaceContentInner', + value: function replaceContentInner($container, content) { + this.sayAboutContentLeave($container); + $container.html(content); + this.sayAboutContentEnter($container); + } + }, { + key: 'replaceContent', + value: function replaceContent($content, $newContent) { + this.sayAboutContentLeave($content); + if ($content.length === 1) { + $content.replaceWith($newContent); + } else { + $newContent.insertBefore($content.first()); + $content.remove(); + } + this.sayAboutContentEnter($newContent); + } + + // private + + }], [{ + key: 'makeElementContentEnter', + value: function makeElementContentEnter(selector, enter) { + var _this2 = this; + + return function ($root) { + $root.filter(selector).add($root.find(selector)).each$(function ($element) { + if (!_this2.preventEventForElement($element)) { + enter($element); + } + }); + }; + } + }, { + key: 'makeDelayedElementContentEnter', + value: function makeDelayedElementContentEnter(contentEnter, delay) { + return function ($root) { + $root.data('contentEnterTimeoutId', setTimeout(function () { + $root.removeData('contentEnterTimeoutId'); + if (document.documentElement.hasAttribute('data-turbolinks-preview')) { + return; + } + contentEnter($root); + }, delay)); + }; + } + }, { + key: 'makeElementContentLeave', + value: function makeElementContentLeave(selector, leave, delay) { + var _this3 = this; + + return function ($root) { + if (delay > 0) { + var timeoutId = $root.data('contentEnterTimeoutId'); + if (timeoutId) { + clearTimeout(timeoutId); + $root.removeData('contentEnterTimeoutId'); + } + } + if (leave) { + $root.filter(selector).add($root.find(selector)).each$(function ($element) { + if (!_this3.preventEventForElement($element)) { + leave($element); + } + }); + } + }; + } + }, { + key: 'preventEventForElement', + value: function preventEventForElement($element) { + return $element.closest('.' + this.preventContentEventsClassName).length > 0; + } + }, { + key: 'filterContent', + value: function filterContent($content, elementFlagName) { + return $content.filter(function (_index, element) { + if (element[elementFlagName]) { + return false; + } else { + element[elementFlagName] = true; + return true; + } + }); + } + }]); + return _class; + }(Base), Object.defineProperty(_class, 'contentEnterEventName', { + enumerable: true, + writable: true, + value: 'content:enter' + }), Object.defineProperty(_class, 'contentLeaveEventName', { + enumerable: true, + writable: true, + value: 'content:leave' + }), Object.defineProperty(_class, 'preventContentEventsClassName', { + enumerable: true, + writable: true, + value: 'js-prevent-normas' + }), _temp; +}); + +// require content mixin +var normasNavigation = (function (Base) { + var _class, _temp; + + return _temp = _class = function (_Base) { + inherits(_class, _Base); + + function _class(options) { + classCallCheck(this, _class); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.bindPageEvents(options); + _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); + return _this; + } + + createClass(_class, [{ + key: 'bindPageEvents', + value: function bindPageEvents(options) { + if (options.Turbolinks || global.Turbolinks) { + var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); + this.log('warn', 'You have Turbolinks and can use \'' + turboNormasImportPath + '/normasWithTurbolinks\' instead \'normas\'.'); + } + $(this.pageEnter.bind(this)); + } + }, { + key: 'listenToPage', + value: function listenToPage(enter) { + var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (enter) { + this.listenEvents(this.constructor.pageEnterEventName, enter); + } + if (leave) { + this.listenEvents(this.constructor.pageLeaveEventName, leave); + } + } + }, { + key: 'visit', + value: function visit(location) { + window.location = location; + } + }, { + key: 'refreshPage', + value: function refreshPage() { + this.visit(window.location); + } + }, { + key: 'setHash', + value: function setHash(hash) { + location.hash = hash; + } + }, { + key: 'back', + value: function back() { + global.history.back(); + } + }, { + key: 'replaceLocation', + value: function replaceLocation(url) { + this.log('`replaceLocation` works only with Turbolinks.'); + } + }, { + key: 'pushLocation', + value: function pushLocation(url) { + var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + + if (global.history) global.history.pushState(state, title, url); + } + }, { + key: 'sayAboutPageLoading', + value: function sayAboutPageLoading(state) { + this.log('`sayAboutPageLoading` works only with Turbolinks.'); + } + }, { + key: 'pageEnter', + value: function pageEnter() { + this.trigger(this.constructor.pageEnterEventName); + this.sayAboutContentEnter(this.$el.find('body')); + } + }, { + key: 'pageLeave', + value: function pageLeave() { + this.sayAboutContentLeave(this.$el.find('body')); + this.trigger(this.constructor.pageLeaveEventName); + } + }]); + return _class; + }(Base), Object.defineProperty(_class, 'pageEnterEventName', { + enumerable: true, + writable: true, + value: 'page:enter' + }), Object.defineProperty(_class, 'pageLeaveEventName', { + enumerable: true, + writable: true, + value: 'page:leave' + }), _temp; +}); + +var Normas = normasNavigation(normasContent(normasEvents(Base))); + +var _class = function (_normasEvents) { + inherits(_class, _normasEvents); + createClass(_class, [{ + key: 'initialize', + + // Override it with your own initialization logic. + value: function initialize(options) {} + + // Override it (and use this super method) with your own unmount logic. + + }, { + key: 'terminate', + value: function terminate() { + if (this.listenedEvents) { + this.forgetEvents(this.listenedEvents); + this.listenedEvents = null; + } + } + }]); + + function _class(options) { + classCallCheck(this, _class); + + Object.assign(options, options.$el.data()); + + var _this = possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); + + _this.reflectOptions(options); + _this.initializeEvents(options); + _this.initialize(options); + return _this; + } + + createClass(_class, [{ + key: 'reflectOptions', + value: function reflectOptions(options) { + var _this2 = this; + + Object.keys(options).forEach(function (attr) { + if (_this2.hasOwnProperty(attr)) { + _this2[attr] = options[attr]; + } + }); + } + }, { + key: 'initializeEvents', + value: function initializeEvents(_options) { + var events = this.constructor.events; + + if (events) { + if (!this.linkedEvents) { + this.linkedEvents = this.linkEvents(isFunction(events) ? events() : events); + } + this.listenedEvents = this.listenEvents(this.linkedEvents); + } + } + }, { + key: 'linkEvents', + value: function linkEvents(events) { + var _this3 = this; + + return mapValues(events, function (handle) { + return isString(handle) ? _this3[handle].bind(_this3) : _typeof(isPlainObject(handle)) ? _this3.linkEvents(handle) : handle; + }); + } + }]); + return _class; +}(normasEvents(Base)); + +// TODO: may be rename Views, views, View, view +// require content mixin +// require events mixin +var normasViews = (function (Base) { + return function (_Base) { + inherits(_class2, _Base); + + function _class2(options) { + classCallCheck(this, _class2); + + var _this = possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); + + Object.defineProperty(_this, 'View', { + enumerable: true, + writable: true, + value: _class + }); + Object.defineProperty(_this, 'viewClasses', { + enumerable: true, + writable: true, + value: {} + }); + Object.defineProperty(_this, 'viewInstances', { + enumerable: true, + writable: true, + value: [] + }); + + _this.viewOptions = _extends({ + debugMode: _this.debugMode, + eventsDebug: _this.eventsDebug + }, options.viewOptions); + _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); + return _this; + } + + createClass(_class2, [{ + key: 'registerView', + value: function registerView(viewClass) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.viewClasses[viewClass.selector]) { + this.error('View class for selector `' + viewClass.selector + '` already registered', this.viewClasses[viewClass.selector]); + return; + } + this.viewClasses[viewClass.selector] = viewClass; + this.listenToElement(viewClass.selector, function ($el) { + return _this2.bindView($el, viewClass, options); + }, function ($el) { + return _this2.unbindView($el, viewClass); + }, viewClass.delay); + } + }, { + key: 'bindView', + value: function bindView($el, viewClass, options) { + if (!this.canBind($el, viewClass)) { + return null; + } + if (viewClass.instanceIndex) { + viewClass.instanceIndex += 1; + } else { + viewClass.instanceIndex = 1; + } + var view = new viewClass(_extends({}, this.viewOptions, options, { + instanceName: viewClass.selector + '_' + viewClass.instanceIndex, + $el: $el + })); + this.viewInstances.push(view); + return view; + } + }, { + key: 'canBind', + value: function canBind($element, viewClass) { + var view = this.getViewsOnElement($element, viewClass)[0]; + if (view) { + this.log('warn', 'Element already has bound view', $element, viewClass, view); + return false; + } + return true; + } + }, { + key: 'unbindView', + value: function unbindView($element, viewClass) { + var view = this.getViewsOnElement($element, viewClass)[0]; + if (view) { + view.terminate(); + this.viewInstances = without(this.viewInstances, view); + } + } + }, { + key: 'getViewsOnElement', + value: function getViewsOnElement($element) { + var viewClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + var el = $element instanceof $ ? $element[0] : $element; + var filterOptions = { el: el }; + if (viewClass) { + filterOptions.constructor = viewClass; + } + return filter(this.viewInstances, filterOptions); + } + }, { + key: 'getViewsInContainer', + value: function getViewsInContainer($container) { + var checkRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return filter(this.viewInstances, function (view) { + return view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0]); + }); + } + }, { + key: 'getAllViews', + value: function getAllViews(viewClass) { + return filter(this.viewInstances, { constructor: viewClass }); + } + }, { + key: 'getFirstView', + value: function getFirstView(viewClass) { + return find(this.viewInstances, { constructor: viewClass }); + } + }, { + key: 'getFirstChildView', + value: function getFirstChildView(viewClass) { + return find(this.viewInstances, function (view) { + return view instanceof viewClass; + }); + } + }]); + return _class2; + }(Base); +}); + +var Normas$1 = normasViews(Normas); + +// require navigation mixin +var normasTurbolinks = (function (Base) { + var _class, _temp; + + return _temp = _class = function (_Base) { + inherits(_class, _Base); + + function _class() { + classCallCheck(this, _class); + return possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + createClass(_class, [{ + key: 'bindPageEvents', + value: function bindPageEvents(options) { + this.Turbolinks = options.Turbolinks || global.Turbolinks; + var turbolinksExists = !!this.Turbolinks; + this.turbolinksEnabled = options.turbolinksEnabled === false ? false : turbolinksExists; + if (options.turbolinksEnabled === true && !turbolinksExists) { + this.error('Turbolinks: `option.turbolinksEnabled === true` but `!turbolinksExists`'); + } + this.log('info', '"' + this.instanceName + '" Turbolinks ' + (this.turbolinksEnabled ? 'enabled' : 'disabled') + '.'); + + if (this.turbolinksEnabled) { + // Turbolinks connected :) + // patchTurbolinks(this.Turbolinks); // TODO: check versions + patchTurbolinksPreviewControl(this.Turbolinks); + this.listenEvents(this.constructor.turboPageEnterEventName, this.pageEnter.bind(this)); + this.listenEvents(this.constructor.turboPageLeaveEventName, this.pageLeave.bind(this)); + if (options.Turbolinks) { + options.Turbolinks.start(); + } + } else { + // No Turbolinks ;( + var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); + this.log('warn', 'You have' + (this.Turbolinks ? '' : 'n\'t') + ' Turbolinks and use \'' + turboNormasImportPath + '/normasWithTurbolinks\', but `turbolinksEnabled === false`. Use \'' + turboNormasImportPath + '/normas\' instead.'); + $(this.pageEnter.bind(this)); + } + } + }, { + key: 'visit', + value: function visit(location) { + if (this.turbolinksEnabled) { + this.Turbolinks.visit(location); + } else { + get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'visit', this).call(this, location); + } + } + }, { + key: 'setHash', + value: function setHash(hash) { + if (this.turbolinksEnabled) { + var controller = this.Turbolinks.controller; + controller.replaceHistoryWithLocationAndRestorationIdentifier(hash, controller.restorationIdentifier); + } else { + get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'setHash', this).call(this, hash); + } + } + }, { + key: 'replaceLocation', + value: function replaceLocation(url) { + if (this.turbolinksEnabled) { + this.Turbolinks.controller.replaceHistoryWithLocationAndRestorationIdentifier(url); + } else { + get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'replaceLocation', this).call(this, url); + } + } + }, { + key: 'pushLocation', + value: function pushLocation(url) { + if (this.turbolinksEnabled) { + this.Turbolinks.controller.pushHistoryWithLocationAndRestorationIdentifier(url); + } else { + get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'pushLocation', this).call(this, url); + } + } + }, { + key: 'sayAboutPageLoading', + value: function sayAboutPageLoading(state) { + if (this.turbolinksEnabled) { + var progressBar = this.Turbolinks.controller.adapter.progressBar; + if (state) { + progressBar.setValue(0); + progressBar.show(); + } else { + progressBar.hide(); + } + } else { + get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'sayAboutPageLoading', this).call(this, state); + } + } + }]); + return _class; + }(Base), Object.defineProperty(_class, 'turboPageEnterEventName', { + enumerable: true, + writable: true, + value: 'turbolinks:load' + }), Object.defineProperty(_class, 'turboPageLeaveEventName', { + enumerable: true, + writable: true, + value: 'turbolinks:before-cache' + }), _temp; +}); + +function patchTurbolinksPreviewControl(Turbolinks) { + var OurView = function (_Turbolinks$View) { + inherits(OurView, _Turbolinks$View); + + function OurView() { + classCallCheck(this, OurView); + return possibleConstructorReturn(this, (OurView.__proto__ || Object.getPrototypeOf(OurView)).apply(this, arguments)); + } + + createClass(OurView, [{ + key: 'render', + value: function render(_ref, callback) { + var snapshot = _ref.snapshot, + error = _ref.error, + isPreview = _ref.isPreview; + + this.markAsPreview(isPreview); + if (snapshot) { + // added `isPreview` argument + this.renderSnapshot(snapshot, isPreview, callback); + } else { + this.renderError(error, callback); + } + } + + // added `isPreview` argument + + }, { + key: 'renderSnapshot', + value: function renderSnapshot(snapshot, isPreview, callback) { + var renderer = new OurSnapshotRenderer(this.getSnapshot(), Turbolinks.Snapshot.wrap(snapshot), isPreview); + renderer.delegate = this.delegate; + renderer.render(callback); + } + }]); + return OurView; + }(Turbolinks.View); + + Turbolinks.View = OurView; + + var OurSnapshotRenderer = function (_Turbolinks$SnapshotR) { + inherits(OurSnapshotRenderer, _Turbolinks$SnapshotR); + + // added `isPreview` argument + function OurSnapshotRenderer(currentSnapshot, newSnapshot, isPreview) { + classCallCheck(this, OurSnapshotRenderer); + + var _this3 = possibleConstructorReturn(this, (OurSnapshotRenderer.__proto__ || Object.getPrototypeOf(OurSnapshotRenderer)).call(this, currentSnapshot, newSnapshot)); + + if (isPreview) { + _this3.newBody = _this3.newBody.cloneNode(true); + _this3.newBody.isPreview = true; + } + return _this3; + } + + return OurSnapshotRenderer; + }(Turbolinks.SnapshotRenderer); +} + +var normasWithTurbolinks = normasTurbolinks(Normas$1); + +module.exports = normasWithTurbolinks; +//# sourceMappingURL=normasWithTurbolinks.js.map diff --git a/dist/js/normasWithTurbolinks.js.map b/dist/js/normasWithTurbolinks.js.map new file mode 100644 index 0000000..e832fc7 --- /dev/null +++ b/dist/js/normasWithTurbolinks.js.map @@ -0,0 +1 @@ +{"version":3,"file":"normasWithTurbolinks.js","sources":["../../src/js/lib/jqueryAdditions.js","../../src/js/mixins/base.js","../../node_modules/isobject/index.js","../../node_modules/is-plain-object/index.js","../../src/js/lib/helpers.js","../../src/js/mixins/events.js","../../src/js/mixins/content.js","../../src/js/mixins/navigation.js","../../src/js/minimalNormas.js","../../src/js/view.js","../../src/js/mixins/views.js","../../src/js/index.js","../../src/js/mixins/turbolinks.js","../../src/js/normasWithTurbolinks.js"],"sourcesContent":["$.fn.each$ = function (handle) {\n return this.each((index, element) => {\n handle($(element), index);\n });\n};\n\n// [showOrHide[, duration[, callback]]]\n$.fn.slideToggleByState = function slideToggleByState(...a) {\n if (this.length > 0) {\n if (a.length > 0) {\n if (a.shift()) {\n this.slideDown(...a);\n } else {\n this.slideUp(...a);\n }\n } else {\n this.slideToggle();\n }\n }\n return this;\n};\n\n// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/\n$.fn.focusToEnd = function focusToEnd() {\n let $this = this.first();\n if ($this.is('select, :checkbox, :radio')) {\n $this.focus();\n } else {\n let val = $this.val();\n $this.focus().val('').val(val);\n }\n return this;\n};\n\n$.fn.focusTo = function focusTo(caretPos) {\n return this.each((index, element) => {\n if (element.createTextRange) {\n let range = element.createTextRange();\n range.move('character', caretPos);\n range.select();\n } else if (element.selectionStart) {\n element.focus();\n element.setSelectionRange(caretPos, caretPos);\n } else {\n element.focus();\n }\n });\n};\n\n/*\n ** Returns the caret (cursor) position of the specified text field.\n ** Return value range is 0-oField.value.length.\n */\n$.fn.caretPosition = function caretPosition() {\n // Initialize\n let iCaretPos = 0;\n let oField = this[0];\n\n // IE Support\n if (document.selection) {\n // Set focus on the element\n oField.focus();\n // To get cursor position, get empty selection range\n let oSel = document.selection.createRange();\n // Move selection start to 0 position\n oSel.moveStart('character', -oField.value.length);\n // The caret position is selection length\n iCaretPos = oSel.text.length;\n } else if (oField.selectionStart != null) {\n iCaretPos = oField.selectionStart;\n }\n\n // Return results\n return iCaretPos;\n};\n","export default class Base {\n constructor({ debugMode = true, $el = $(document), instanceName = 'NormasApp' }) {\n this.instanceName = instanceName;\n this.debugMode = debugMode;\n this.$el = $el;\n this.el = $el[0];\n this.log('info', `\"${this.instanceName}\" constructed.`);\n }\n\n $(...args) {\n return this.$el.find(...args);\n }\n\n log(...args) {\n if (!this.debugMode) return;\n let method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log';\n this._log(method, ...args);\n }\n\n error(...args) {\n this._log('error', ...args);\n }\n\n _log(method, ...args) {\n if (console && console[method]) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n","/*!\n * isobject \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nmodule.exports = function isObject(val) {\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\n};\n","/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\n'use strict';\n\nvar isObject = require('isobject');\n\nfunction isObjectObject(o) {\n return isObject(o) === true\n && Object.prototype.toString.call(o) === '[object Object]';\n}\n\nmodule.exports = function isPlainObject(o) {\n var ctor,prot;\n\n if (isObjectObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (typeof ctor !== 'function') return false;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObjectObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n};\n","// Sufficient for Normas implementation of functions like from lodash\n\nexport isPlainObject from 'is-plain-object';\n\nexport const isArray = Array.isArray;\n\nexport function isFunction(v) {\n return typeof v === 'function';\n}\n\nexport function isString(v) {\n return typeof v === 'string';\n}\n\nexport function compact(array) {\n return filter(array, v => v);\n}\n\nexport function debounce(func, wait) {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n func(...args);\n }, wait);\n }\n}\n\nexport function flatten(array) {\n const result = [];\n array.forEach(value => {\n if (isArray(value)) {\n result.push(...value);\n } else {\n result.push(value);\n }\n });\n return result;\n}\n\nexport function filter(collection, conditions) {\n return filterBase('filter', collection, conditions);\n}\n\nexport function find(collection, conditions) {\n return filterBase('find', collection, conditions);\n}\n\nexport function map(collection, iteratee) {\n return Array.prototype.map.call(collection, iteratee);\n}\n\nexport function mapValues(object, iteratee) {\n const result = {};\n Object.keys(object).forEach(key => {\n result[key] = iteratee(object[key]);\n });\n return result;\n}\n\nexport function without(collection, ...values) {\n return filter(collection, item => !values.includes(item));\n}\n\n// private\n\nfunction filterBase(baseName, collection, conditions) {\n return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions));\n}\n\nfunction makeConditionsMatch(conditions) {\n if (isFunction(conditions)) {\n return conditions;\n } else {\n const conditionsKeys = Object.keys(conditions);\n return item => filterMatch(item, conditions, conditionsKeys);\n }\n}\n\nfunction filterMatch(item, conditions, conditionsKeys) {\n return conditionsKeys.find(key => conditions[key] !== item[key]) === undefined;\n}\n","import { isFunction, isPlainObject, debounce, flatten } from '../lib/helpers';\n\nexport default Base => (class extends Base {\n constructor(options) {\n super(options);\n this.eventsDebug = this.debugMode && options.eventsDebug || false;\n if (this.eventsDebug) {\n this.eventsLogBuffer = [];\n this.eventsLog = debounce(this.eventsLog.bind(this), 20);\n }\n this.log('info', `\"${this.instanceName}\" events mixin activated. eventsDebug =`, this.eventsDebug);\n }\n\n trigger(...args) {\n this.$el.trigger(...args);\n }\n\n listenEvents(...args) {\n const listeningArgs = this.listenEventsOnElement(this.$el, ...args);\n if (this.eventsDebug) {\n this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs);\n this.eventsLog();\n }\n return listeningArgs;\n }\n\n listenEventsOnElement($element, ...args) {\n const listeningArgs = this.constructor.listeningArguments(...args);\n listeningArgs.forEach(({ events, selector, handle }) => {\n $element.on(events, selector, handle);\n });\n return listeningArgs;\n }\n\n eventsLog() {\n this.log('table', this.eventsLogBuffer);\n this.eventsLogBuffer = [];\n }\n\n forgetEvents(listeningArgs) {\n this.forgetEventsOnElement(this.$el, listeningArgs);\n }\n\n forgetEventsOnElement($element, listeningArgs) {\n if (this.eventsDebug) {\n this.log('forget events', listeningArgs);\n }\n listeningArgs.forEach(({ events, selector, handle }) => {\n $element.off(events, selector, handle);\n });\n }\n\n static listeningArguments(selector, eventRule, handle) {\n if (isPlainObject(selector)) {\n eventRule = selector;\n selector = '';\n }\n\n if (isFunction(eventRule)) {\n handle = eventRule;\n eventRule = selector;\n selector = '';\n }\n\n if (isPlainObject(eventRule)) {\n return flatten(Object.keys(eventRule).map((key) => {\n let value = eventRule[key];\n return isPlainObject(value) ?\n this.listeningArguments(selector ? `${selector} ${key}` : key, value)\n :\n this.listeningArguments(selector, key, value);\n }));\n }\n\n if (!isFunction(handle)) {\n console.error(`handle isn't function in listening declaration! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n if (!eventRule) {\n console.error(`eventRule not defined! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n\n const selectors = eventRule.split(/\\s+/);\n const eventName = selectors[0];\n selectors[0] = selector;\n\n if (!eventName) {\n console.error(`bad eventName in listening declaration! (selector: '${selector}')`); // eslint-disable-line no-console\n return [];\n }\n\n return [{\n events: eventName.replace(/\\//g, ' '),\n selector: selectors.join(' ').trim(),\n handle: (event, ...args) => handle($(event.currentTarget), event, ...args),\n }];\n }\n});\n","// require events mixin\nexport default Base => (class extends Base {\n static contentEnterEventName = 'content:enter';\n static contentLeaveEventName = 'content:leave';\n\n static preventContentEventsClassName = 'js-prevent-normas';\n\n constructor(options) {\n super(options);\n this.log('info', `\"${this.instanceName}\" content mixin activated.`);\n }\n\n listenToElement(selector, enter, leave = null, delay = 0) {\n let contentEnter = this.constructor.makeElementContentEnter(selector, enter);\n if (delay > 0) {\n contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay);\n }\n const contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null;\n this.listenToContent(contentEnter, contentLeave);\n }\n\n listenToContent(enter, leave = null) {\n if (enter) {\n this.$el.on(this.constructor.contentEnterEventName, (event, $root) => enter($root, event));\n }\n if (leave) {\n this.$el.on(this.constructor.contentLeaveEventName, (event, $root) => leave($root, event));\n }\n }\n\n sayAboutContentEnter($content) {\n $content = this.constructor.filterContent($content, 'normasEntered');\n if ($content.length > 0) {\n $content.removeClass(this.constructor.preventContentEventsClassName);\n this.trigger(this.constructor.contentEnterEventName, [$content]);\n }\n return $content;\n }\n\n sayAboutContentLeave($content) {\n $content = this.constructor.filterContent($content, 'normasLeft');\n if ($content.length > 0) {\n this.trigger(this.constructor.contentLeaveEventName, [$content]);\n }\n return $content;\n }\n\n replaceContentInner($container, content) {\n this.sayAboutContentLeave($container);\n $container.html(content);\n this.sayAboutContentEnter($container);\n }\n\n replaceContent($content, $newContent) {\n this.sayAboutContentLeave($content);\n if ($content.length === 1) {\n $content.replaceWith($newContent);\n } else {\n $newContent.insertBefore($content.first());\n $content.remove();\n }\n this.sayAboutContentEnter($newContent);\n }\n\n // private\n\n static makeElementContentEnter(selector, enter) {\n return ($root) => {\n $root.filter(selector).add($root.find(selector)).each$($element => {\n if (!this.preventEventForElement($element)) {\n enter($element);\n }\n });\n };\n }\n\n static makeDelayedElementContentEnter(contentEnter, delay) {\n return ($root) => {\n $root.data('contentEnterTimeoutId', setTimeout(() => {\n $root.removeData('contentEnterTimeoutId');\n if (document.documentElement.hasAttribute('data-turbolinks-preview')) {\n return;\n }\n contentEnter($root);\n }, delay));\n };\n }\n\n static makeElementContentLeave(selector, leave, delay) {\n return ($root) => {\n if (delay > 0) {\n let timeoutId = $root.data('contentEnterTimeoutId');\n if (timeoutId) {\n clearTimeout(timeoutId);\n $root.removeData('contentEnterTimeoutId');\n }\n }\n if (leave) {\n $root.filter(selector).add($root.find(selector)).each$($element => {\n if (!this.preventEventForElement($element)) {\n leave($element);\n }\n });\n }\n };\n }\n\n static preventEventForElement($element) {\n return $element.closest(`.${this.preventContentEventsClassName}`).length > 0;\n }\n\n static filterContent($content, elementFlagName) {\n return $content.filter((_index, element) => {\n if (element[elementFlagName]) {\n return false;\n } else {\n element[elementFlagName] = true;\n return true;\n }\n });\n }\n});\n","// require content mixin\nexport default Base => (class extends Base {\n static pageEnterEventName = 'page:enter';\n static pageLeaveEventName = 'page:leave';\n\n constructor(options) {\n super(options);\n this.bindPageEvents(options);\n this.log('info', `\"${this.instanceName}\" navigation mixin activated.`);\n }\n\n bindPageEvents(options) {\n if (options.Turbolinks || global.Turbolinks) {\n const turboNormasImportPath = `normas${process.env.NODE_ENV === 'development' ? '/src/js' : ''}`;\n this.log('warn',\n `You have Turbolinks and can use '${turboNormasImportPath}/normasWithTurbolinks' instead 'normas'.`);\n }\n $(this.pageEnter.bind(this));\n }\n\n listenToPage(enter, leave = null) {\n if (enter) {\n this.listenEvents(this.constructor.pageEnterEventName, enter);\n }\n if (leave) {\n this.listenEvents(this.constructor.pageLeaveEventName, leave);\n }\n }\n\n visit(location) {\n window.location = location;\n }\n\n refreshPage() {\n this.visit(window.location);\n }\n\n setHash(hash) {\n location.hash = hash;\n }\n\n back() {\n global.history.back();\n }\n\n replaceLocation(url) {\n this.log('`replaceLocation` works only with Turbolinks.');\n }\n\n pushLocation(url, title = null, state = null) {\n if (global.history) global.history.pushState(state, title, url);\n }\n\n sayAboutPageLoading(state) {\n this.log('`sayAboutPageLoading` works only with Turbolinks.');\n }\n\n pageEnter() {\n this.trigger(this.constructor.pageEnterEventName);\n this.sayAboutContentEnter(this.$el.find('body'));\n }\n\n pageLeave() {\n this.sayAboutContentLeave(this.$el.find('body'));\n this.trigger(this.constructor.pageLeaveEventName);\n }\n});\n","import './lib/jqueryAdditions';\nimport NormasBase from './mixins/base';\nimport normasEvents from './mixins/events';\nimport normasContent from './mixins/content';\nimport normasNavigation from './mixins/navigation';\n\nconst Normas =\n normasNavigation(\n normasContent(\n normasEvents(\n NormasBase\n )\n )\n );\n\nexport default Normas;\n","import { isFunction, isString, isPlainObject, mapValues } from './lib/helpers';\nimport NormasBase from './mixins/base';\nimport normasEvents from './mixins/events';\n\nexport default class extends normasEvents(NormasBase) {\n // Override it with your own initialization logic.\n initialize(options) {\n }\n\n // Override it (and use this super method) with your own unmount logic.\n terminate() {\n if (this.listenedEvents) {\n this.forgetEvents(this.listenedEvents);\n this.listenedEvents = null;\n }\n }\n\n constructor(options) {\n Object.assign(options, options.$el.data());\n super(options);\n this.reflectOptions(options);\n this.initializeEvents(options);\n this.initialize(options);\n }\n\n reflectOptions(options) {\n Object.keys(options).forEach(attr => {\n if (this.hasOwnProperty(attr)) {\n this[attr] = options[attr];\n }\n });\n }\n\n initializeEvents(_options) {\n const { events } = this.constructor;\n if (events) {\n if (!this.linkedEvents) {\n this.linkedEvents = this.linkEvents(isFunction(events) ? events() : events);\n }\n this.listenedEvents = this.listenEvents(this.linkedEvents);\n }\n }\n\n linkEvents(events) {\n return mapValues(events, handle => isString(handle) ?\n this[handle].bind(this)\n :\n (typeof isPlainObject(handle) ? this.linkEvents(handle) : handle)\n );\n }\n};\n","// TODO: may be rename Views, views, View, view\nimport { filter, find, without } from '../lib/helpers';\nimport View from '../view';\n\n// require content mixin\n// require events mixin\nexport default Base => (class extends Base {\n View = View;\n viewClasses = {};\n viewInstances = [];\n\n constructor(options) {\n super(options);\n this.viewOptions = {\n debugMode: this.debugMode,\n eventsDebug: this.eventsDebug,\n ...options.viewOptions,\n };\n this.log('info', `\"${this.instanceName}\" navigation mixin activated.`);\n }\n\n registerView(viewClass, options = {}) {\n if (this.viewClasses[viewClass.selector]) {\n this.error(`View class for selector \\`${viewClass.selector}\\` already registered`,\n this.viewClasses[viewClass.selector]);\n return;\n }\n this.viewClasses[viewClass.selector] = viewClass;\n this.listenToElement(\n viewClass.selector,\n $el => this.bindView($el, viewClass, options),\n $el => this.unbindView($el, viewClass),\n viewClass.delay,\n );\n }\n\n bindView($el, viewClass, options) {\n if (!this.canBind($el, viewClass)) {\n return null;\n }\n if (viewClass.instanceIndex) {\n viewClass.instanceIndex += 1;\n } else {\n viewClass.instanceIndex = 1;\n }\n const view = new viewClass({\n ...this.viewOptions,\n ...options,\n instanceName: `${viewClass.selector}_${viewClass.instanceIndex}`,\n $el,\n });\n this.viewInstances.push(view);\n return view;\n }\n\n canBind($element, viewClass) {\n const view = this.getViewsOnElement($element, viewClass)[0];\n if (view) {\n this.log('warn', 'Element already has bound view', $element, viewClass, view);\n return false;\n }\n return true;\n }\n\n unbindView($element, viewClass) {\n const view = this.getViewsOnElement($element, viewClass)[0];\n if (view) {\n view.terminate();\n this.viewInstances = without(this.viewInstances, view);\n }\n }\n\n getViewsOnElement($element, viewClass = null) {\n const el = $element instanceof $ ? $element[0] : $element;\n const filterOptions = { el };\n if (viewClass) {\n filterOptions.constructor = viewClass;\n }\n return filter(this.viewInstances, filterOptions);\n }\n\n getViewsInContainer($container, checkRoot = true) {\n return filter(this.viewInstances, view =>\n view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0])\n );\n }\n\n getAllViews(viewClass) {\n return filter(this.viewInstances, { constructor: viewClass });\n }\n\n getFirstView(viewClass) {\n return find(this.viewInstances, { constructor: viewClass });\n }\n\n getFirstChildView(viewClass) {\n return find(this.viewInstances, view => view instanceof viewClass);\n }\n});\n","import MinimalNormas from './minimalNormas';\nimport normasViews from './mixins/views';\n\nexport default normasViews(MinimalNormas);\n","// require navigation mixin\nexport default Base => (class extends Base {\n static turboPageEnterEventName = 'turbolinks:load';\n static turboPageLeaveEventName = 'turbolinks:before-cache';\n\n bindPageEvents(options) {\n this.Turbolinks = options.Turbolinks || global.Turbolinks;\n const turbolinksExists = !!this.Turbolinks;\n this.turbolinksEnabled = options.turbolinksEnabled === false ? false : turbolinksExists;\n if (options.turbolinksEnabled === true && !turbolinksExists) {\n this.error('Turbolinks: `option.turbolinksEnabled === true` but `!turbolinksExists`');\n }\n this.log('info', `\"${this.instanceName}\" Turbolinks ${this.turbolinksEnabled ? 'enabled' : 'disabled'}.`);\n\n if (this.turbolinksEnabled) {\n // Turbolinks connected :)\n // patchTurbolinks(this.Turbolinks); // TODO: check versions\n patchTurbolinksPreviewControl(this.Turbolinks);\n this.listenEvents(this.constructor.turboPageEnterEventName, this.pageEnter.bind(this));\n this.listenEvents(this.constructor.turboPageLeaveEventName, this.pageLeave.bind(this));\n if (options.Turbolinks) {\n options.Turbolinks.start();\n }\n } else {\n // No Turbolinks ;(\n const turboNormasImportPath = `normas${process.env.NODE_ENV === 'development' ? '/src/js' : ''}`;\n this.log('warn',\n `You have${this.Turbolinks ? '' : 'n\\'t'} Turbolinks and use '${turboNormasImportPath}/normasWithTurbolinks', but \\`turbolinksEnabled === false\\`. Use '${turboNormasImportPath}/normas' instead.`);\n $(this.pageEnter.bind(this));\n }\n }\n\n visit(location) {\n if (this.turbolinksEnabled) {\n this.Turbolinks.visit(location);\n } else {\n super.visit(location);\n }\n }\n\n setHash(hash) {\n if (this.turbolinksEnabled) {\n let controller = this.Turbolinks.controller;\n controller.replaceHistoryWithLocationAndRestorationIdentifier(hash, controller.restorationIdentifier);\n } else {\n super.setHash(hash);\n }\n }\n\n replaceLocation(url) {\n if (this.turbolinksEnabled) {\n this.Turbolinks.controller.replaceHistoryWithLocationAndRestorationIdentifier(url);\n } else {\n super.replaceLocation(url);\n }\n }\n\n pushLocation(url) {\n if (this.turbolinksEnabled) {\n this.Turbolinks.controller.pushHistoryWithLocationAndRestorationIdentifier(url);\n } else {\n super.pushLocation(url);\n }\n }\n\n sayAboutPageLoading(state) {\n if (this.turbolinksEnabled) {\n const progressBar = this.Turbolinks.controller.adapter.progressBar;\n if (state) {\n progressBar.setValue(0);\n progressBar.show();\n } else {\n progressBar.hide();\n }\n } else {\n super.sayAboutPageLoading(state);\n }\n }\n});\n\nfunction patchTurbolinksPreviewControl(Turbolinks) {\n class OurView extends Turbolinks.View {\n render({ snapshot, error, isPreview }, callback) {\n this.markAsPreview(isPreview);\n if (snapshot) {\n // added `isPreview` argument\n this.renderSnapshot(snapshot, isPreview, callback);\n } else {\n this.renderError(error, callback);\n }\n }\n\n // added `isPreview` argument\n renderSnapshot(snapshot, isPreview, callback) {\n const renderer = new OurSnapshotRenderer(this.getSnapshot(), Turbolinks.Snapshot.wrap(snapshot), isPreview);\n renderer.delegate = this.delegate;\n renderer.render(callback);\n }\n }\n Turbolinks.View = OurView;\n\n class OurSnapshotRenderer extends Turbolinks.SnapshotRenderer {\n // added `isPreview` argument\n constructor(currentSnapshot, newSnapshot, isPreview) {\n super(currentSnapshot, newSnapshot);\n if (isPreview) {\n this.newBody = this.newBody.cloneNode(true);\n this.newBody.isPreview = true;\n }\n }\n }\n}\n\nfunction patchTurbolinks(Turbolinks) {\n class OurHeadDetails extends Turbolinks.HeadDetails {\n constructor(...args) {\n super(...args);\n this.elements = {};\n $(this.element).children().each((index, element) => {\n let key = turboElementToKey(element);\n if (!this.elements[key]) {\n this.elements[key] = {\n type: turboElementType(element),\n tracked: turboElementIsTracked(element),\n elements: [],\n };\n }\n this.elements[key].elements.push(element);\n });\n }\n // getTrackedElementSignature() {\n // let sign = super.getTrackedElementSignature();\n // console.log('sign ', sign);\n // return sign;\n // }\n }\n Turbolinks.HeadDetails = OurHeadDetails;\n}\n\n// Injection in Turbolinks.HeadDetails for override this logic:\nfunction turboElementToKey(element) {\n let url = element.getAttribute('src') || element.getAttribute('href');\n if (url) {\n let cuts = url.split('/');\n cuts = cuts[cuts.length - 1];\n if (cuts) { url = cuts }\n }\n return url || element.outerHTML;\n}\n\nfunction turboElementType(element) {\n if (turboElementIsScript(element)) {\n return 'script';\n } else if (turboElementIsStylesheet(element)) {\n return 'stylesheet';\n }\n return null;\n}\n\nfunction turboElementIsTracked(element) {\n return element.getAttribute('data-turbolinks-track') === 'reload';\n}\n\nfunction turboElementIsScript(element) {\n let tagName = element.tagName.toLowerCase();\n return tagName === 'script';\n}\n\nfunction turboElementIsStylesheet(element) {\n let tagName = element.tagName.toLowerCase();\n return tagName === 'style' || (tagName === 'link' && element.getAttribute('rel') === 'stylesheet');\n}\n","import Normas from './index';\nimport normasTurbolinks from './mixins/turbolinks';\n\nexport default normasTurbolinks(Normas);\n"],"names":["$","fn","each$","handle","each","index","element","slideToggleByState","length","a","shift","slideDown","slideUp","slideToggle","focusToEnd","$this","first","is","focus","val","focusTo","caretPos","createTextRange","range","move","select","selectionStart","setSelectionRange","caretPosition","iCaretPos","oField","document","selection","oSel","createRange","moveStart","value","text","Base","debugMode","$el","instanceName","el","log","find","args","method","indexOf","_log","console","isObject","isArray","Array","isFunction","v","isString","debounce","func","wait","timeoutId","setTimeout","flatten","array","result","forEach","push","filter","collection","conditions","filterBase","mapValues","object","iteratee","keys","key","without","values","includes","item","baseName","prototype","call","makeConditionsMatch","conditionsKeys","Object","filterMatch","undefined","options","eventsDebug","eventsLogBuffer","eventsLog","bind","trigger","listeningArgs","listenEventsOnElement","concat","$element","constructor","listeningArguments","events","selector","on","forgetEventsOnElement","off","eventRule","isPlainObject","map","error","selectors","split","eventName","replace","join","trim","event","currentTarget","enter","leave","delay","contentEnter","makeElementContentEnter","makeDelayedElementContentEnter","contentLeave","makeElementContentLeave","listenToContent","contentEnterEventName","$root","contentLeaveEventName","$content","filterContent","removeClass","preventContentEventsClassName","$container","content","sayAboutContentLeave","html","sayAboutContentEnter","$newContent","replaceWith","insertBefore","remove","add","preventEventForElement","data","removeData","documentElement","hasAttribute","closest","elementFlagName","_index","bindPageEvents","Turbolinks","global","turboNormasImportPath","process","env","NODE_ENV","pageEnter","listenEvents","pageEnterEventName","pageLeaveEventName","location","visit","window","hash","history","back","url","title","state","pushState","Normas","normasNavigation","normasContent","normasEvents","NormasBase","listenedEvents","forgetEvents","assign","reflectOptions","initializeEvents","initialize","hasOwnProperty","attr","_options","linkedEvents","linkEvents","babelHelpers.typeof","View","viewOptions","viewClass","viewClasses","listenToElement","bindView","unbindView","canBind","instanceIndex","view","viewInstances","getViewsOnElement","terminate","filterOptions","checkRoot","normasViews","MinimalNormas","turbolinksExists","turbolinksEnabled","turboPageEnterEventName","turboPageLeaveEventName","pageLeave","start","controller","replaceHistoryWithLocationAndRestorationIdentifier","restorationIdentifier","pushHistoryWithLocationAndRestorationIdentifier","progressBar","adapter","setValue","show","hide","patchTurbolinksPreviewControl","OurView","callback","snapshot","isPreview","markAsPreview","renderSnapshot","renderError","renderer","OurSnapshotRenderer","getSnapshot","Snapshot","wrap","delegate","render","currentSnapshot","newSnapshot","newBody","cloneNode","SnapshotRenderer","normasTurbolinks"],"mappings":";;AAAAA,EAAEC,EAAF,CAAKC,KAAL,GAAa,UAAUC,MAAV,EAAkB;SACtB,KAAKC,IAAL,CAAU,UAACC,KAAD,EAAQC,OAAR,EAAoB;WAC5BN,EAAEM,OAAF,CAAP,EAAmBD,KAAnB;GADK,CAAP;CADF;;;AAOAL,EAAEC,EAAF,CAAKM,kBAAL,GAA0B,SAASA,kBAAT,GAAkC;MACtD,KAAKC,MAAL,GAAc,CAAlB,EAAqB;sCADkCC,CAClC;OAAA;;;QACfA,EAAED,MAAF,GAAW,CAAf,EAAkB;UACZC,EAAEC,KAAF,EAAJ,EAAe;aACRC,S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,KAAKC,WAAL,EAAxB,EAA4C/E,WAAWgF,QAAX,CAAoBC,IAApB,CAAyBT,QAAzB,CAA5C,EAAgFC,SAAhF,CAAjB;iBACSS,QAAT,GAAoB,KAAKA,QAAzB;iBACSC,MAAT,CAAgBZ,QAAhB;;;;IAfkBvE,WAAWqC,IADgB;;aAmBtCA,IAAX,GAAkBiC,OAAlB;;MAEMQ,mBArB2C;;;;iCAuBnCM,eAAZ,EAA6BC,WAA7B,EAA0CZ,SAA1C,EAAqD;;;4IAC7CW,eAD6C,EAC5BC,WAD4B;;UAE/CZ,SAAJ,EAAe;eACRa,OAAL,GAAe,OAAKA,OAAL,CAAaC,SAAb,CAAuB,IAAvB,CAAf;eACKD,OAAL,CAAab,SAAb,GAAyB,IAAzB;;;;;;IAN4BzE,WAAWwF,gBArBI;;;AC7EnD,2BAAeC,iBAAiBrE,QAAjB,CAAf;;;;"} \ No newline at end of file diff --git a/dist/normasMutations.js b/dist/normasMutations.js deleted file mode 100644 index 195513b..0000000 --- a/dist/normasMutations.js +++ /dev/null @@ -1,165 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 15); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 15: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// EXPERIMENTAL - -var initialMutations = true; - -/* harmony default export */ __webpack_exports__["default"] = (function (Base) { - return function (_Base) { - _inherits(_class2, _Base); - - function _class2(options) { - _classCallCheck(this, _class2); - - var _this = _possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); - - Object.defineProperty(_this, 'checkMutations', { - enumerable: true, - writable: true, - value: function value(mutation) { - if (mutation.type !== 'childList') { - return; - } - - var removedNodes = _this.constructor.filterMutationNodes(mutation.removedNodes); - var addedNodes = _this.constructor.filterMutationNodes(mutation.addedNodes); - - if (removedNodes.length > 0) { - _this.sayAboutContentLeave($(removedNodes)); - } - if (addedNodes.length > 0) { - _this.sayAboutContentEnter($(addedNodes)); - } - } - }); - - if (MutationObserver) { - _this.observeMutations(); - _this.log('warn', '"' + _this.instanceName + '" mutation observer activated. (EXPERIMENTAL feature)'); - } else { - _this.log('warn', '"' + _this.instanceName + '" mutation observer NOT DEFINED!'); - } - return _this; - } - - _createClass(_class2, [{ - key: 'observeMutations', - value: function observeMutations() { - var _this2 = this; - - // https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver - this.mutationObserver = new MutationObserver(function (mutations) { - return mutations.forEach(_this2.checkMutations); - }); - this.mutationObserver.observe(this.$el[0], { childList: true, subtree: true }); - } - }, { - key: 'pageEnter', - value: function pageEnter() { - if (initialMutations) { - initialMutations = false; - } - _get(_class2.prototype.__proto__ || Object.getPrototypeOf(_class2.prototype), 'pageEnter', this).call(this); - } - }], [{ - key: 'filterMutationNodes', - value: function filterMutationNodes(nodes) { - return Array.prototype.filter.call(nodes, function (node) { - if (initialMutations) { - node.normasInitialMutationReady = true; - if (node.parentElement && node.parentElement.normasInitialMutationReady) { - return false; - } - } - return node.nodeType === 1 && !node.isPreview && node.tagName !== 'TITLE' && node.tagName !== 'META' && (!node.parentElement || node.parentElement.tagName !== 'HEAD'); - }); - } - }]); - - return _class2; - }(Base); -}); - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/dist/normasWithTurbolinks.js b/dist/normasWithTurbolinks.js deleted file mode 100644 index 3513b6e..0000000 --- a/dist/normasWithTurbolinks.js +++ /dev/null @@ -1,1636 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 13); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export isArray */ -/* harmony export (immutable) */ __webpack_exports__["e"] = isFunction; -/* harmony export (immutable) */ __webpack_exports__["g"] = isString; -/* unused harmony export compact */ -/* harmony export (immutable) */ __webpack_exports__["a"] = debounce; -/* harmony export (immutable) */ __webpack_exports__["d"] = flatten; -/* harmony export (immutable) */ __webpack_exports__["b"] = filter; -/* harmony export (immutable) */ __webpack_exports__["c"] = find; -/* unused harmony export map */ -/* harmony export (immutable) */ __webpack_exports__["h"] = mapValues; -/* harmony export (immutable) */ __webpack_exports__["i"] = without; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_is_plain_object__); -/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0_is_plain_object___default.a; }); -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -// Sufficient for Normas implementation of functions like from lodash - - - - - -var isArray = Array.isArray; - -function isFunction(v) { - return typeof v === 'function'; -} - -function isString(v) { - return typeof v === 'string'; -} - -function compact(array) { - return filter(array, function (v) { - return v; - }); -} - -function debounce(func, wait) { - var timeoutId = void 0; - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (timeoutId) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(function () { - func.apply(undefined, args); - }, wait); - }; -} - -function flatten(array) { - var result = []; - array.forEach(function (value) { - if (isArray(value)) { - result.push.apply(result, _toConsumableArray(value)); - } else { - result.push(value); - } - }); - return result; -} - -function filter(collection, conditions) { - return filterBase('filter', collection, conditions); -} - -function find(collection, conditions) { - return filterBase('find', collection, conditions); -} - -function map(collection, iteratee) { - return Array.prototype.map.call(collection, iteratee); -} - -function mapValues(object, iteratee) { - var result = {}; - Object.keys(object).forEach(function (key) { - result[key] = iteratee(object[key]); - }); - return result; -} - -function without(collection) { - for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - - return filter(collection, function (item) { - return !values.includes(item); - }); -} - -// private - -function filterBase(baseName, collection, conditions) { - return Array.prototype[baseName].call(collection, makeConditionsMatch(conditions)); -} - -function makeConditionsMatch(conditions) { - if (isFunction(conditions)) { - return conditions; - } else { - var conditionsKeys = Object.keys(conditions); - return function (item) { - return filterMatch(item, conditions, conditionsKeys); - }; - } -} - -function filterMatch(item, conditions, conditionsKeys) { - return conditionsKeys.find(function (key) { - return conditions[key] !== item[key]; - }) === undefined; -} - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Base = function () { - function Base(_ref) { - var _ref$debugMode = _ref.debugMode, - debugMode = _ref$debugMode === undefined ? true : _ref$debugMode, - _ref$$el = _ref.$el, - $el = _ref$$el === undefined ? $(document) : _ref$$el, - _ref$instanceName = _ref.instanceName, - instanceName = _ref$instanceName === undefined ? 'NormasApp' : _ref$instanceName; - - _classCallCheck(this, Base); - - this.instanceName = instanceName; - this.debugMode = debugMode; - this.$el = $el; - this.el = $el[0]; - this.log('info', '"' + this.instanceName + '" constructed.'); - } - - _createClass(Base, [{ - key: '$', - value: function $() { - var _$el; - - return (_$el = this.$el).find.apply(_$el, arguments); - } - }, { - key: 'log', - value: function log() { - if (!this.debugMode) return; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var method = ['table', 'warn', 'info'].indexOf(args[0]) > -1 ? args.shift() : 'log'; - this._log.apply(this, [method].concat(args)); - } - }, { - key: 'error', - value: function error() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - this._log.apply(this, ['error'].concat(args)); - } - }, { - key: '_log', - value: function _log(method) { - if (console && console[method]) { - var _console; - - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - - (_console = console)[method].apply(_console, args); // eslint-disable-line no-console - } - } - }]); - - return Base; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (Base); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - return function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.eventsDebug = _this.debugMode && options.eventsDebug || false; - if (_this.eventsDebug) { - _this.eventsLogBuffer = []; - _this.eventsLog = Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["a" /* debounce */])(_this.eventsLog, 20); - } - _this.log('info', '"' + _this.instanceName + '" events mixin activated. eventsDebug =', _this.eventsDebug); - return _this; - } - - _createClass(_class, [{ - key: 'trigger', - value: function trigger() { - var _$el; - - (_$el = this.$el).trigger.apply(_$el, arguments); - } - }, { - key: 'listenEvents', - value: function listenEvents() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var listeningArgs = this.listenEventsOnElement.apply(this, [this.$el].concat(args)); - if (this.eventsDebug) { - this.eventsLogBuffer = this.eventsLogBuffer.concat(listeningArgs); - this.eventsLog(); - } - return listeningArgs; - } - }, { - key: 'listenEventsOnElement', - value: function listenEventsOnElement($element) { - var _constructor; - - for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - var listeningArgs = (_constructor = this.constructor).listeningArguments.apply(_constructor, args); - listeningArgs.forEach(function (_ref) { - var events = _ref.events, - selector = _ref.selector, - handle = _ref.handle; - - $element.on(events, selector, handle); - }); - return listeningArgs; - } - }, { - key: 'eventsLog', - value: function eventsLog() { - this.log('table', this.eventsLogBuffer); - this.eventsLogBuffer = []; - } - }, { - key: 'forgetEvents', - value: function forgetEvents(listeningArgs) { - this.forgetEventsOnElement(this.$el, listeningArgs); - } - }, { - key: 'forgetEventsOnElement', - value: function forgetEventsOnElement($element, listeningArgs) { - if (this.eventsDebug) { - this.log('forget events', listeningArgs); - } - listeningArgs.forEach(function (_ref2) { - var events = _ref2.events, - selector = _ref2.selector, - handle = _ref2.handle; - - $element.off(events, selector, handle); - }); - } - }], [{ - key: 'listeningArguments', - value: function listeningArguments(selector, eventRule, _handle) { - var _this2 = this; - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(selector)) { - eventRule = selector; - selector = ''; - } - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(eventRule)) { - _handle = eventRule; - eventRule = selector; - selector = ''; - } - - if (Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(eventRule)) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["d" /* flatten */])(Object.keys(eventRule).map(function (key) { - var value = eventRule[key]; - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(value) ? _this2.listeningArguments(selector ? selector + ' ' + key : key, value) : _this2.listeningArguments(selector, key, value); - })); - } - - if (!Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(_handle)) { - console.error('handle isn\'t function in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - if (!eventRule) { - console.error('eventRule not defined! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - - var selectors = eventRule.split(/\s+/); - var eventName = selectors[0]; - selectors[0] = selector; - - if (!eventName) { - console.error('bad eventName in listening declaration! (selector: \'' + selector + '\')'); // eslint-disable-line no-console - return []; - } - - return [{ - events: eventName.replace(/\//g, ' '), - selector: selectors.join(' ').trim(), - handle: function handle(event) { - for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - args[_key3 - 1] = arguments[_key3]; - } - - return _handle.apply(undefined, [$(event.currentTarget), event].concat(args)); - } - }]; - } - }]); - - return _class; - }(Base); -}); - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 5 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__lib_jqueryAdditions__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_base__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_events__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mixins_content__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mixins_navigation__ = __webpack_require__(10); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mixins_views__ = __webpack_require__(11); - - - - - - - -var Normas = Object(__WEBPACK_IMPORTED_MODULE_5__mixins_views__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__mixins_navigation__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_3__mixins_content__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_events__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__mixins_base__["a" /* default */])))); - -/* harmony default export */ __webpack_exports__["default"] = (Normas); - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -$.fn.each$ = function (handle) { - return this.each(function (index, element) { - handle($(element), index); - }); -}; - -// [showOrHide[, duration[, callback]]] -$.fn.slideToggleByState = function slideToggleByState() { - if (this.length > 0) { - for (var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++) { - a[_key] = arguments[_key]; - } - - if (a.length > 0) { - if (a.shift()) { - this.slideDown.apply(this, a); - } else { - this.slideUp.apply(this, a); - } - } else { - this.slideToggle(); - } - } - return this; -}; - -// http://css-tricks.com/snippets/jquery/mover-cursor-to-end-of-textarea/ -$.fn.focusToEnd = function focusToEnd() { - var $this = this.first(); - if ($this.is('select, :checkbox, :radio')) { - $this.focus(); - } else { - var val = $this.val(); - $this.focus().val('').val(val); - } - return this; -}; - -$.fn.focusTo = function focusTo(caretPos) { - return this.each(function (index, element) { - if (element.createTextRange) { - var range = element.createTextRange(); - range.move('character', caretPos); - range.select(); - } else if (element.selectionStart) { - element.focus(); - element.setSelectionRange(caretPos, caretPos); - } else { - element.focus(); - } - }); -}; - -/* - ** Returns the caret (cursor) position of the specified text field. - ** Return value range is 0-oField.value.length. - */ -$.fn.caretPosition = function caretPosition() { - // Initialize - var iCaretPos = 0; - var oField = this[0]; - - // IE Support - if (document.selection) { - // Set focus on the element - oField.focus(); - // To get cursor position, get empty selection range - var oSel = document.selection.createRange(); - // Move selection start to 0 position - oSel.moveStart('character', -oField.value.length); - // The caret position is selection length - iCaretPos = oSel.text.length; - } else if (oField.selectionStart != null) { - iCaretPos = oField.selectionStart; - } - - // Return results - return iCaretPos; -}; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -var isObject = __webpack_require__(8); - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -module.exports = function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - - - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// require events mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - var _class, _temp; - - return _temp = _class = function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.log('info', '"' + _this.instanceName + '" content mixin activated.'); - return _this; - } - - _createClass(_class, [{ - key: 'listenToElement', - value: function listenToElement(selector, enter) { - var leave = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - var contentEnter = this.constructor.makeElementContentEnter(selector, enter); - if (delay > 0) { - contentEnter = this.constructor.makeDelayedElementContentEnter(contentEnter, delay); - } - var contentLeave = leave || delay > 0 ? this.constructor.makeElementContentLeave(selector, leave, delay) : null; - this.listenToContent(contentEnter, contentLeave); - } - }, { - key: 'listenToContent', - value: function listenToContent(enter) { - var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (enter) { - this.$el.on(this.constructor.contentEnterEventName, function (event, $root) { - return enter($root, event); - }); - } - if (leave) { - this.$el.on(this.constructor.contentLeaveEventName, function (event, $root) { - return leave($root, event); - }); - } - } - }, { - key: 'sayAboutContentEnter', - value: function sayAboutContentEnter($content) { - $content = this.constructor.filterContent($content, 'normasEntered'); - if ($content.length > 0) { - $content.removeClass(this.constructor.preventContentEventsClassName); - this.trigger(this.constructor.contentEnterEventName, [$content]); - } - return $content; - } - }, { - key: 'sayAboutContentLeave', - value: function sayAboutContentLeave($content) { - $content = this.constructor.filterContent($content, 'normasLeft'); - if ($content.length > 0) { - this.trigger(this.constructor.contentLeaveEventName, [$content]); - } - return $content; - } - }, { - key: 'replaceContentInner', - value: function replaceContentInner($container, content) { - this.sayAboutContentLeave($container); - $container.html(content); - this.sayAboutContentEnter($container); - } - }, { - key: 'replaceContent', - value: function replaceContent($content, $newContent) { - this.sayAboutContentLeave($content); - if ($content.length === 1) { - $content.replaceWith($newContent); - } else { - $newContent.insertBefore($content.first()); - $content.remove(); - } - this.sayAboutContentEnter($newContent); - } - - // private - - }], [{ - key: 'makeElementContentEnter', - value: function makeElementContentEnter(selector, enter) { - var _this2 = this; - - return function ($root) { - $root.filter(selector).add($root.find(selector)).each$(function ($element) { - if (!_this2.preventEventForElement($element)) { - enter($element); - } - }); - }; - } - }, { - key: 'makeDelayedElementContentEnter', - value: function makeDelayedElementContentEnter(contentEnter, delay) { - return function ($root) { - $root.data('contentEnterTimeoutId', setTimeout(function () { - $root.removeData('contentEnterTimeoutId'); - if (document.documentElement.hasAttribute('data-turbolinks-preview')) { - return; - } - contentEnter($root); - }, delay)); - }; - } - }, { - key: 'makeElementContentLeave', - value: function makeElementContentLeave(selector, leave, delay) { - var _this3 = this; - - return function ($root) { - if (delay > 0) { - var timeoutId = $root.data('contentEnterTimeoutId'); - if (timeoutId) { - clearTimeout(timeoutId); - $root.removeData('contentEnterTimeoutId'); - } - } - if (leave) { - $root.filter(selector).add($root.find(selector)).each$(function ($element) { - if (!_this3.preventEventForElement($element)) { - leave($element); - } - }); - } - }; - } - }, { - key: 'preventEventForElement', - value: function preventEventForElement($element) { - return $element.closest('.' + this.preventContentEventsClassName).length > 0; - } - }, { - key: 'filterContent', - value: function filterContent($content, elementFlagName) { - return $content.filter(function (_index, element) { - if (element[elementFlagName]) { - return false; - } else { - element[elementFlagName] = true; - return true; - } - }); - } - }]); - - return _class; - }(Base), Object.defineProperty(_class, 'contentEnterEventName', { - enumerable: true, - writable: true, - value: 'content:enter' - }), Object.defineProperty(_class, 'contentLeaveEventName', { - enumerable: true, - writable: true, - value: 'content:leave' - }), Object.defineProperty(_class, 'preventContentEventsClassName', { - enumerable: true, - writable: true, - value: 'js-prevent-normas' - }), _temp; -}); - -/***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) {var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// require content mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - var _class, _temp; - - return _temp = _class = function (_Base) { - _inherits(_class, _Base); - - function _class(options) { - _classCallCheck(this, _class); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.bindPageEvents(options); - _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); - return _this; - } - - _createClass(_class, [{ - key: 'bindPageEvents', - value: function bindPageEvents(options) { - if (options.Turbolinks || global.Turbolinks) { - var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); - this.log('warn', 'You have Turbolinks and can use \'' + turboNormasImportPath + '/normasWithTurbolinks\' instead \'normas\'.'); - } - $(this.pageEnter.bind(this)); - } - }, { - key: 'listenToPage', - value: function listenToPage(enter) { - var leave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - if (enter) { - this.listenEvents(this.constructor.pageEnterEventName, enter); - } - if (leave) { - this.listenEvents(this.constructor.pageLeaveEventName, leave); - } - } - }, { - key: 'visit', - value: function visit(location) { - window.location = location; - } - }, { - key: 'refreshPage', - value: function refreshPage() { - this.visit(window.location); - } - }, { - key: 'setHash', - value: function setHash(hash) { - location.hash = hash; - } - }, { - key: 'back', - value: function back() { - global.history.back(); - } - }, { - key: 'replaceLocation', - value: function replaceLocation(url) { - this.log('`replaceLocation` works only with Turbolinks.'); - } - }, { - key: 'pushLocation', - value: function pushLocation(url) { - var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - - if (global.history) global.history.pushState(state, title, url); - } - }, { - key: 'sayAboutPageLoading', - value: function sayAboutPageLoading(state) { - this.log('`sayAboutPageLoading` works only with Turbolinks.'); - } - }, { - key: 'pageEnter', - value: function pageEnter() { - this.trigger(this.constructor.pageEnterEventName); - this.sayAboutContentEnter(this.$el.find('body')); - } - }, { - key: 'pageLeave', - value: function pageLeave() { - this.sayAboutContentLeave(this.$el.find('body')); - this.trigger(this.constructor.pageLeaveEventName); - } - }]); - - return _class; - }(Base), Object.defineProperty(_class, 'pageEnterEventName', { - enumerable: true, - writable: true, - value: 'page:enter' - }), Object.defineProperty(_class, 'pageLeaveEventName', { - enumerable: true, - writable: true, - value: 'page:leave' - }), _temp; -}); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(4))) - -/***/ }), -/* 11 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__view__ = __webpack_require__(12); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// TODO: may be rename Views, views, View, view - - - -// require content mixin -// require events mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - return function (_Base) { - _inherits(_class2, _Base); - - function _class2(options) { - _classCallCheck(this, _class2); - - var _this = _possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).call(this, options)); - - Object.defineProperty(_this, 'View', { - enumerable: true, - writable: true, - value: __WEBPACK_IMPORTED_MODULE_1__view__["a" /* default */] - }); - Object.defineProperty(_this, 'viewClasses', { - enumerable: true, - writable: true, - value: {} - }); - Object.defineProperty(_this, 'viewInstances', { - enumerable: true, - writable: true, - value: [] - }); - - _this.viewOptions = _extends({ - debugMode: _this.debugMode, - eventsDebug: _this.eventsDebug - }, options.viewOptions); - _this.log('info', '"' + _this.instanceName + '" navigation mixin activated.'); - return _this; - } - - _createClass(_class2, [{ - key: 'registerView', - value: function registerView(viewClass) { - var _this2 = this; - - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (this.viewClasses[viewClass.selector]) { - this.error('View class for selector `' + viewClass.selector + '` already registered', this.viewClasses[viewClass.selector]); - return; - } - this.viewClasses[viewClass.selector] = viewClass; - this.listenToElement(viewClass.selector, function ($el) { - return _this2.bindView($el, viewClass, options); - }, function ($el) { - return _this2.unbindView($el, viewClass); - }, viewClass.delay); - } - }, { - key: 'bindView', - value: function bindView($el, viewClass, options) { - if (!this.canBind($el, viewClass)) { - return null; - } - if (viewClass.instanceIndex) { - viewClass.instanceIndex += 1; - } else { - viewClass.instanceIndex = 1; - } - var view = new viewClass(_extends({}, this.viewOptions, options, { - instanceName: viewClass.selector + '_' + viewClass.instanceIndex, - $el: $el - })); - this.viewInstances.push(view); - return view; - } - }, { - key: 'canBind', - value: function canBind($element, viewClass) { - var view = this.getViewsOnElement($element, viewClass)[0]; - if (view) { - this.log('warn', 'Element already has bound view', $element, viewClass, view); - return false; - } - return true; - } - }, { - key: 'unbindView', - value: function unbindView($element, viewClass) { - var view = this.getViewsOnElement($element, viewClass)[0]; - if (view) { - view.terminate(); - this.viewInstances = Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["i" /* without */])(this.viewInstances, view); - } - } - }, { - key: 'getViewsOnElement', - value: function getViewsOnElement($element) { - var viewClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - var el = $element instanceof $ ? $element[0] : $element; - var filterOptions = { el: el }; - if (viewClass) { - filterOptions.constructor = viewClass; - } - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, filterOptions); - } - }, { - key: 'getViewsInContainer', - value: function getViewsInContainer($container) { - var checkRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, function (view) { - return view.$el.closest($container).length > 0 && (checkRoot || view.el !== $container[0]); - }); - } - }, { - key: 'getAllViews', - value: function getAllViews(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["b" /* filter */])(this.viewInstances, { constructor: viewClass }); - } - }, { - key: 'getFirstView', - value: function getFirstView(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["c" /* find */])(this.viewInstances, { constructor: viewClass }); - } - }, { - key: 'getFirstChildView', - value: function getFirstChildView(viewClass) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["c" /* find */])(this.viewInstances, function (view) { - return view instanceof viewClass; - }); - } - }]); - - return _class2; - }(Base); -}); - -/***/ }), -/* 12 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_helpers__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_base__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mixins_events__ = __webpack_require__(2); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - -var _class = function (_normasEvents) { - _inherits(_class, _normasEvents); - - _createClass(_class, [{ - key: 'initialize', - - // Override it with your own initialization logic. - value: function initialize(options) {} - - // Override it (and use this super method) with your own unmount logic. - - }, { - key: 'terminate', - value: function terminate() { - if (this.listenedEvents) { - this.forgetEvents(this.listenedEvents); - this.listenedEvents = null; - } - } - }]); - - function _class(options) { - _classCallCheck(this, _class); - - Object.assign(options, options.$el.data()); - - var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this, options)); - - _this.reflectOptions(options); - _this.initializeEvents(options); - _this.initialize(options); - return _this; - } - - _createClass(_class, [{ - key: 'reflectOptions', - value: function reflectOptions(options) { - var _this2 = this; - - Object.keys(options).forEach(function (attr) { - if (_this2.hasOwnProperty(attr)) { - _this2[attr] = options[attr]; - } - }); - } - }, { - key: 'initializeEvents', - value: function initializeEvents(_options) { - var events = this.constructor.events; - - if (events) { - if (!this.linkedEvents) { - this.linkedEvents = this.linkEvents(Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["e" /* isFunction */])(events) ? events() : events); - } - this.listenedEvents = this.listenEvents(this.linkedEvents); - } - } - }, { - key: 'linkEvents', - value: function linkEvents(events) { - var _this3 = this; - - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["h" /* mapValues */])(events, function (handle) { - return Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["g" /* isString */])(handle) ? _this3[handle].bind(_this3) : _typeof(Object(__WEBPACK_IMPORTED_MODULE_0__lib_helpers__["f" /* isPlainObject */])(handle)) ? _this3.linkEvents(handle) : handle; - }); - } - }]); - - return _class; -}(Object(__WEBPACK_IMPORTED_MODULE_2__mixins_events__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__mixins_base__["a" /* default */])); - -/* harmony default export */ __webpack_exports__["a"] = (_class); -; - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_turbolinks__ = __webpack_require__(14); - - - -/* harmony default export */ __webpack_exports__["default"] = (Object(__WEBPACK_IMPORTED_MODULE_1__mixins_turbolinks__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_0__index__["default"])); - -/***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) {var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// require navigation mixin -/* harmony default export */ __webpack_exports__["a"] = (function (Base) { - var _class, _temp; - - return _temp = _class = function (_Base) { - _inherits(_class, _Base); - - function _class() { - _classCallCheck(this, _class); - - return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); - } - - _createClass(_class, [{ - key: 'bindPageEvents', - value: function bindPageEvents(options) { - this.Turbolinks = options.Turbolinks || global.Turbolinks; - var turbolinksExists = !!this.Turbolinks; - this.turbolinksEnabled = options.turbolinksEnabled === false ? false : turbolinksExists; - if (options.turbolinksEnabled === true && !turbolinksExists) { - this.error('Turbolinks: `option.turbolinksEnabled === true` but `!turbolinksExists`'); - } - this.log('info', '"' + this.instanceName + '" Turbolinks ' + (this.turbolinksEnabled ? 'enabled' : 'disabled') + '.'); - - if (this.turbolinksEnabled) { - // Turbolinks connected :) - // patchTurbolinks(this.Turbolinks); // TODO: check versions - patchTurbolinksPreviewControl(this.Turbolinks); - this.listenEvents(this.constructor.turboPageEnterEventName, this.pageEnter.bind(this)); - this.listenEvents(this.constructor.turboPageLeaveEventName, this.pageLeave.bind(this)); - if (options.Turbolinks) { - options.Turbolinks.start(); - } - } else { - // No Turbolinks ;( - var turboNormasImportPath = 'normas' + (process.env.NODE_ENV === 'development' ? '/src/js' : ''); - this.log('warn', 'You have' + (this.Turbolinks ? '' : 'n\'t') + ' Turbolinks and use \'' + turboNormasImportPath + '/normasWithTurbolinks\', but `turbolinksEnabled === false`. Use \'' + turboNormasImportPath + '/normas\' instead.'); - $(this.pageEnter.bind(this)); - } - } - }, { - key: 'visit', - value: function visit(location) { - if (this.turbolinksEnabled) { - this.Turbolinks.visit(location); - } else { - _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'visit', this).call(this, location); - } - } - }, { - key: 'setHash', - value: function setHash(hash) { - if (this.turbolinksEnabled) { - var controller = this.Turbolinks.controller; - controller.replaceHistoryWithLocationAndRestorationIdentifier(hash, controller.restorationIdentifier); - } else { - _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'setHash', this).call(this, hash); - } - } - }, { - key: 'replaceLocation', - value: function replaceLocation(url) { - if (this.turbolinksEnabled) { - this.Turbolinks.controller.replaceHistoryWithLocationAndRestorationIdentifier(url); - } else { - _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'replaceLocation', this).call(this, url); - } - } - }, { - key: 'pushLocation', - value: function pushLocation(url) { - if (this.turbolinksEnabled) { - this.Turbolinks.controller.pushHistoryWithLocationAndRestorationIdentifier(url); - } else { - _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'pushLocation', this).call(this, url); - } - } - }, { - key: 'sayAboutPageLoading', - value: function sayAboutPageLoading(state) { - if (this.turbolinksEnabled) { - var progressBar = this.Turbolinks.controller.adapter.progressBar; - if (state) { - progressBar.setValue(0); - progressBar.show(); - } else { - progressBar.hide(); - } - } else { - _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'sayAboutPageLoading', this).call(this, state); - } - } - }]); - - return _class; - }(Base), Object.defineProperty(_class, 'turboPageEnterEventName', { - enumerable: true, - writable: true, - value: 'turbolinks:load' - }), Object.defineProperty(_class, 'turboPageLeaveEventName', { - enumerable: true, - writable: true, - value: 'turbolinks:before-cache' - }), _temp; -}); - -function patchTurbolinksPreviewControl(Turbolinks) { - var OurView = function (_Turbolinks$View) { - _inherits(OurView, _Turbolinks$View); - - function OurView() { - _classCallCheck(this, OurView); - - return _possibleConstructorReturn(this, (OurView.__proto__ || Object.getPrototypeOf(OurView)).apply(this, arguments)); - } - - _createClass(OurView, [{ - key: 'render', - value: function render(_ref, callback) { - var snapshot = _ref.snapshot, - error = _ref.error, - isPreview = _ref.isPreview; - - this.markAsPreview(isPreview); - if (snapshot) { - // added `isPreview` argument - this.renderSnapshot(snapshot, isPreview, callback); - } else { - this.renderError(error, callback); - } - } - - // added `isPreview` argument - - }, { - key: 'renderSnapshot', - value: function renderSnapshot(snapshot, isPreview, callback) { - var renderer = new OurSnapshotRenderer(this.getSnapshot(), Turbolinks.Snapshot.wrap(snapshot), isPreview); - renderer.delegate = this.delegate; - renderer.render(callback); - } - }]); - - return OurView; - }(Turbolinks.View); - - Turbolinks.View = OurView; - - var OurSnapshotRenderer = function (_Turbolinks$SnapshotR) { - _inherits(OurSnapshotRenderer, _Turbolinks$SnapshotR); - - // added `isPreview` argument - function OurSnapshotRenderer(currentSnapshot, newSnapshot, isPreview) { - _classCallCheck(this, OurSnapshotRenderer); - - var _this3 = _possibleConstructorReturn(this, (OurSnapshotRenderer.__proto__ || Object.getPrototypeOf(OurSnapshotRenderer)).call(this, currentSnapshot, newSnapshot)); - - if (isPreview) { - _this3.newBody = _this3.newBody.cloneNode(true); - _this3.newBody.isPreview = true; - } - return _this3; - } - - return OurSnapshotRenderer; - }(Turbolinks.SnapshotRenderer); -} - -function patchTurbolinks(Turbolinks) { - var OurHeadDetails = function (_Turbolinks$HeadDetai) { - _inherits(OurHeadDetails, _Turbolinks$HeadDetai); - - function OurHeadDetails() { - var _ref2; - - _classCallCheck(this, OurHeadDetails); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var _this4 = _possibleConstructorReturn(this, (_ref2 = OurHeadDetails.__proto__ || Object.getPrototypeOf(OurHeadDetails)).call.apply(_ref2, [this].concat(args))); - - _this4.elements = {}; - $(_this4.element).children().each(function (index, element) { - var key = turboElementToKey(element); - if (!_this4.elements[key]) { - _this4.elements[key] = { - type: turboElementType(element), - tracked: turboElementIsTracked(element), - elements: [] - }; - } - _this4.elements[key].elements.push(element); - }); - return _this4; - } - // getTrackedElementSignature() { - // let sign = super.getTrackedElementSignature(); - // console.log('sign ', sign); - // return sign; - // } - - - return OurHeadDetails; - }(Turbolinks.HeadDetails); - - Turbolinks.HeadDetails = OurHeadDetails; -} - -// Injection in Turbolinks.HeadDetails for override this logic: -function turboElementToKey(element) { - var url = element.getAttribute('src') || element.getAttribute('href'); - if (url) { - var cuts = url.split('/'); - cuts = cuts[cuts.length - 1]; - if (cuts) { - url = cuts; - } - } - return url || element.outerHTML; -} - -function turboElementType(element) { - if (turboElementIsScript(element)) { - return 'script'; - } else if (turboElementIsStylesheet(element)) { - return 'stylesheet'; - } - return null; -} - -function turboElementIsTracked(element) { - return element.getAttribute('data-turbolinks-track') === 'reload'; -} - -function turboElementIsScript(element) { - var tagName = element.tagName.toLowerCase(); - return tagName === 'script'; -} - -function turboElementIsStylesheet(element) { - var tagName = element.tagName.toLowerCase(); - return tagName === 'style' || tagName === 'link' && element.getAttribute('rel') === 'stylesheet'; -} -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(3), __webpack_require__(4))) - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/examples/normas_on_rails/app/javascript/lib/normas.js b/examples/normas_on_rails/app/javascript/lib/normas.js index 9f12312..c75ff15 100644 --- a/examples/normas_on_rails/app/javascript/lib/normas.js +++ b/examples/normas_on_rails/app/javascript/lib/normas.js @@ -1,5 +1,5 @@ -import Normas from 'normas/src/js/normasWithTurbolinks'; -import normasMutations from 'normas/src/js/mixins/mutations'; +import Normas from 'normas/dist/js/normasWithTurbolinks'; +import normasMutations from 'normas/dist/js/normasMutations'; // import Turbolinks from 'turbolinks'; import Turbolinks from '../../../vendor/turbolinks-debug'; diff --git a/examples/normas_on_rails/package.json b/examples/normas_on_rails/package.json index daaa39f..36a916b 100644 --- a/examples/normas_on_rails/package.json +++ b/examples/normas_on_rails/package.json @@ -8,6 +8,7 @@ "jquery": "^3.2.1", "jquery-ujs": "^1.2.2", "lodash": "^4.17.4", + "normas": "^0.2.0", "prop-types": "^15.6.0", "react": "^16.2.0", "react-dom": "^16.2.0", diff --git a/examples/normas_on_rails/yarn.lock b/examples/normas_on_rails/yarn.lock index 9893d9a..faea2a0 100644 --- a/examples/normas_on_rails/yarn.lock +++ b/examples/normas_on_rails/yarn.lock @@ -3468,6 +3468,12 @@ normalize-url@^1.4.0: query-string "^4.1.0" sort-keys "^1.0.0" +normas@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/normas/-/normas-0.2.0.tgz#c3f87ed3f8d1377e67d4d03dd391303ef3ad8a6f" + dependencies: + lodash "^4.17.4" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" diff --git a/package.json b/package.json index 1001db8..a82efa1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "normas", - "version": "0.2.0", + "version": "0.2.1", "description": "Normal Ligtweight Javascript Framework for server-side render compatible with Turbolinks", "author": "Dmitry Karpunin ", "license": "MIT", @@ -14,26 +14,29 @@ "src", "dist" ], - "main": "dist/js/index.js", - "module": "dist/js/index.js", + "main": "dist/js/normas.js", + "module": "dist/js/normas.js", "esnext": "src/js/index.js", "scripts": { - "build": "webpack" + "build": "rollup -c config/rollup.config.js" }, "dependencies": { "is-plain-object": "^2.0.4" }, "devDependencies": { "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", + "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-export-extensions": "^6.22.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.0", "jquery": "^3.2.1", - "turbolinks": "^5.0.3", - "webpack": "^3.7.1", - "webpack-bundle-analyzer": "^2.9.0" + "rollup": "^0.54.0", + "rollup-config-module": "^2.0.0", + "rollup-plugin-babel": "^3.0.3", + "rollup-plugin-commonjs": "^8.3.0", + "rollup-plugin-node-resolve": "^3.0.2", + "turbolinks": "^5.0.3" } } diff --git a/src/js/.babelrc b/src/js/.babelrc index 34df307..1cd0a7a 100644 --- a/src/js/.babelrc +++ b/src/js/.babelrc @@ -13,6 +13,7 @@ ] ], "plugins": [ + "external-helpers", "syntax-dynamic-import", "transform-export-extensions", "transform-object-rest-spread", diff --git a/src/js/index.js b/src/js/index.js index 4f55acb..8599eb7 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,19 +1,4 @@ -import './lib/jqueryAdditions'; -import NormasBase from './mixins/base'; -import normasEvents from './mixins/events'; -import normasContent from './mixins/content'; -import normasNavigation from './mixins/navigation'; +import MinimalNormas from './minimalNormas'; import normasViews from './mixins/views'; -const Normas = - normasViews( - normasNavigation( - normasContent( - normasEvents( - NormasBase - ) - ) - ) - ); - -export default Normas; +export default normasViews(MinimalNormas); diff --git a/src/js/minimalNormas.js b/src/js/minimalNormas.js new file mode 100644 index 0000000..8afe3bf --- /dev/null +++ b/src/js/minimalNormas.js @@ -0,0 +1,16 @@ +import './lib/jqueryAdditions'; +import NormasBase from './mixins/base'; +import normasEvents from './mixins/events'; +import normasContent from './mixins/content'; +import normasNavigation from './mixins/navigation'; + +const Normas = + normasNavigation( + normasContent( + normasEvents( + NormasBase + ) + ) + ); + +export default Normas; diff --git a/src/js/mixins/events.js b/src/js/mixins/events.js index 2347a18..25077c5 100644 --- a/src/js/mixins/events.js +++ b/src/js/mixins/events.js @@ -6,7 +6,7 @@ export default Base => (class extends Base { this.eventsDebug = this.debugMode && options.eventsDebug || false; if (this.eventsDebug) { this.eventsLogBuffer = []; - this.eventsLog = debounce(this.eventsLog, 20); + this.eventsLog = debounce(this.eventsLog.bind(this), 20); } this.log('info', `"${this.instanceName}" events mixin activated. eventsDebug =`, this.eventsDebug); } diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index a318e6b..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,32 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); - -module.exports = { - entry: { - index: './src/js/index.js', - normasWithTurbolinks: './src/js/normasWithTurbolinks.js', - normasMutations: './src/js/mixins/mutations.js', - }, - output: { - path: path.resolve(__dirname, 'dist'), - filename: '[name].js' - }, - resolve: { - extensions: ['.js'], - }, - - module: { - // strictExportPresence: true, - rules: [{ - test: /\.js$/, - exclude: /node_modules/, - use: [{ - loader: 'babel-loader' - }] - }], - }, - - plugins: [ - new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin)() - ] -}; diff --git a/yarn.lock b/yarn.lock index 45adfef..eefcf62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,89 +2,18 @@ # yarn lockfile v1 -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -accepts@~1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f" - dependencies: - mime-types "~2.1.16" - negotiator "0.6.1" - -acorn-dynamic-import@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" - dependencies: - acorn "^4.0.3" - -acorn@^4.0.3: - version "4.0.13" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" - -acorn@^5.0.0, acorn@^5.1.1: +acorn@^5.2.1: version "5.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" -ajv-keywords@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - -ajv@^4.9.1: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -ajv@^5.1.5: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -are-we-there-yet@~1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -95,66 +24,10 @@ arr-flatten@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -asn1.js@^4.0.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - -assert@^1.1.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@^2.1.2: - version "2.6.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" - dependencies: - lodash "^4.14.0" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws4@^1.2.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -301,14 +174,6 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-loader@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-7.1.2.tgz#f6cbe122710f1aa2af4d881c6d5b54358ca24126" - dependencies: - find-cache-dir "^1.0.0" - loader-utils "^1.0.2" - mkdirp "^0.5.1" - babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -321,6 +186,12 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -664,55 +535,6 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" -base64-js@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" - -bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - dependencies: - tweetnacl "^0.14.3" - -big.js@^3.1.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" - -binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" - -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - dependencies: - inherits "~2.0.0" - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - -body-parser@1.18.2: - version "1.18.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.1" - http-errors "~1.6.2" - iconv-lite "0.4.19" - on-finished "~2.3.0" - qs "6.5.1" - raw-body "2.3.2" - type-is "~1.6.15" - -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" - brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" @@ -728,62 +550,6 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - dependencies: - pako "~1.0.5" - browserslist@^2.1.2: version "2.10.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.10.0.tgz#bac5ee1cc69ca9d96403ffb8a3abdc5b6aed6346" @@ -791,53 +557,14 @@ browserslist@^2.1.2: caniuse-lite "^1.0.30000780" electron-to-chromium "^1.3.28" -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - -builtin-modules@^1.0.0: +builtin-modules@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - caniuse-lite@^1.0.30000780: version "1.0.30000784" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000784.tgz#129ced74e9a1280a441880b6cd2bce30ef59e6c0" -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -848,262 +575,30 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" - dependencies: - delayed-stream "~1.0.0" - -commander@^2.9.0: - version "2.12.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - dependencies: - date-now "^0.1.4" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - -content-disposition@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - core-js@^2.4.0, core-js@^2.5.0: version "2.5.3" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - ripemd160 "^2.0.0" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.6" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - -debug@2.6.9, debug@^2.2.0, debug@^2.6.8: +debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -deep-extend@~0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -depd@1.1.1, depd@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" - -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" dependencies: repeating "^2.0.0" -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -domain-browser@^1.1.1: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" - -duplexer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - -ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - dependencies: - jsbn "~0.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -ejs@^2.5.6: - version "2.5.7" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.7.tgz#cc872c168880ae3c7189762fd5ffc00896c9518a" - electron-releases@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/electron-releases/-/electron-releases-2.1.0.tgz#c5614bf811f176ce3c836e368a0625782341fd4e" @@ -1114,165 +609,26 @@ electron-to-chromium@^1.3.28: dependencies: electron-releases "^2.1.0" -elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - -encodeurl@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" - -enhanced-resolve@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - object-assign "^4.0.1" - tapable "^0.2.7" - -errno@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.6.tgz#c386ce8a6283f14fc09563b71560908c9bf53026" - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.37" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.37.tgz#0ee741d148b80069ba27d020393756af257defc3" - dependencies: - es6-iterator "~2.0.1" - es6-symbol "~3.1.1" - -es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" -esrecurse@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" - dependencies: - estraverse "^4.1.0" - object-assign "^4.0.1" +estree-walker@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" -estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" +estree-walker@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.1.tgz#64fc375053abc6f57d73e9bd2f004644ad3c5854" esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - -events@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1285,75 +641,16 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -express@^4.15.2: - version "4.16.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c" - dependencies: - accepts "~1.3.4" - array-flatten "1.1.1" - body-parser "1.18.2" - content-disposition "0.5.2" - content-type "~1.0.4" - cookie "0.3.1" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.1" - encodeurl "~1.0.1" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.1.0" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.2" - path-to-regexp "0.1.7" - proxy-addr "~2.0.2" - qs "6.5.1" - range-parser "~1.2.0" - safe-buffer "5.1.1" - send "0.16.1" - serve-static "1.13.1" - setprototypeof "1.1.0" - statuses "~1.3.1" - type-is "~1.6.15" - utils-merge "1.0.1" - vary "~1.1.2" - -extend@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" dependencies: is-extglob "^1.0.0" -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" -filesize@^3.5.9: - version "3.5.11" - resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.5.11.tgz#1919326749433bb3cf77368bd158caabcc19e9ee" - fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -1364,32 +661,6 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -find-cache-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" - dependencies: - commondir "^1.0.1" - make-dir "^1.0.0" - pkg-dir "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" - for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1400,81 +671,6 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.12" - -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" - dependencies: - nan "^2.3.0" - node-pre-gyp "^0.6.39" - -fstream-ignore@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" - dependencies: - fstream "^1.0.0" - inherits "2" - minimatch "^3.0.0" - -fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: - version "1.0.11" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1488,97 +684,16 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^7.0.5: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -gzip-size@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520" - dependencies: - duplexer "^0.1.1" - -har-schema@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" - -har-validator@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" - dependencies: - ajv "^4.9.1" - har-schema "^1.0.5" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" dependencies: ansi-regex "^2.0.0" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -hash-base@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" - dependencies: - inherits "^2.0.1" - -hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hawk@3.1.3, hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -1586,100 +701,16 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" -hosted-git-info@^2.1.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" - -http-errors@1.6.2, http-errors@~1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" - dependencies: - depd "1.1.1" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" - -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - -ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -ipaddr.js@1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -1704,22 +735,16 @@ is-finite@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" dependencies: is-extglob "^1.0.0" +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -1746,22 +771,10 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -1772,10 +785,6 @@ isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - jquery@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" @@ -1784,10 +793,6 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -1796,45 +801,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" -json-loader@^0.5.4: - version "0.5.7" - resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - kind-of@^3.0.2: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -1847,104 +817,23 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -loader-runner@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" - -loader-utils@^1.0.2, loader-utils@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash@^4.14.0, lodash@^4.17.4: +lodash@^4.17.4: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - loose-envify@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" -lru-cache@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" +magic-string@^0.22.4: + version "0.22.4" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff" dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" + vlq "^0.2.1" -make-dir@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" - dependencies: - pify "^3.0.0" - -md5.js@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - dependencies: - mimic-fn "^1.0.0" - -memory-fs@^0.4.0, memory-fs@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - -micromatch@^2.1.5: +micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -1962,40 +851,7 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@~1.30.0: - version "1.30.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" - -mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.7: - version "2.1.17" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" - dependencies: - mime-db "~1.30.0" - -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - -mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" - -minimalistic-assert@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2005,11 +861,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -"mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -2019,107 +871,16 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -nan@^2.3.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - -node-libs-browser@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^1.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.0" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.10.3" - vm-browserify "0.0.4" - -node-pre-gyp@^0.6.39: - version "0.6.39" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" - dependencies: - detect-libc "^1.0.2" - hawk "3.1.3" - mkdirp "^0.5.1" - nopt "^4.0.1" - npmlog "^4.0.2" - rc "^1.1.7" - request "2.81.0" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^2.2.1" - tar-pack "^3.4.0" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-package-data@^2.3.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: remove-trailing-separator "^1.0.1" -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - dependencies: - path-key "^2.0.0" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -2127,77 +888,14 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -once@^1.3.0, once@^1.3.3: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -opener@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" - -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - -p-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - -pako@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - -parse-asn1@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2207,69 +905,13 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - -path-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - dependencies: - pify "^2.0.0" - -pbkdf2@^3.0.3: - version "3.0.14" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -performance-now@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - dependencies: - find-up "^2.1.0" +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" preserve@^0.2.0: version "0.2.0" @@ -2279,63 +921,6 @@ private@^0.1.6, private@^0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - -proxy-addr@~2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec" - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.5.2" - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - -punycode@^1.2.4, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -qs@6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" - -qs@~6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" - -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - randomatic@^1.1.3: version "1.1.7" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -2343,77 +928,6 @@ randomatic@^1.1.3: is-number "^3.0.0" kind-of "^4.0.0" -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -raw-body@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" - dependencies: - bytes "3.0.0" - http-errors "1.6.2" - iconv-lite "0.4.19" - unpipe "1.0.0" - -rc@^1.1.7: - version "1.2.2" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" - dependencies: - deep-extend "~0.4.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - -readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.6, readable-stream@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - safe-buffer "~5.1.1" - string_decoder "~1.0.3" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - regenerate@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" @@ -2472,575 +986,98 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2.81.0: - version "2.81.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~4.2.1" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - performance-now "^0.2.0" - qs "~6.4.0" - safe-buffer "^5.0.1" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "^0.6.0" - uuid "^3.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" +resolve@^1.1.6, resolve@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: - align-text "^0.1.1" + path-parse "^1.0.5" -rimraf@2, rimraf@^2.5.1, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" +rollup-config-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/rollup-config-module/-/rollup-config-module-2.0.0.tgz#a9fd00c3e68f3875f4a42a9662495da12f55a85c" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" +rollup-plugin-babel@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.3.tgz#63adedc863130327512a4a9006efc2241c5b7c15" dependencies: - hash-base "^2.0.0" - inherits "^2.0.1" + rollup-pluginutils "^1.5.0" -safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" - -send@0.16.1: - version "0.16.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" - dependencies: - debug "2.6.9" - depd "~1.1.1" - destroy "~1.0.4" - encodeurl "~1.0.1" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.3.1" - -serve-static@1.13.1: - version "1.13.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.1.tgz#4c57d53404a761d8f2e7c1e8a18a47dbf278a719" +rollup-plugin-commonjs@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.3.0.tgz#91b4ba18f340951e39ed7b1901f377a80ab3f9c3" dependencies: - encodeurl "~1.0.1" - escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.1" - -set-blocking@^2.0.0, set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + acorn "^5.2.1" + estree-walker "^0.5.0" + magic-string "^0.22.4" + resolve "^1.4.0" + rollup-pluginutils "^2.0.1" -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - -setprototypeof@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" +rollup-plugin-node-resolve@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.2.tgz#38babc12fd404cc2ba1ff68648fe43fa3ffee6b0" + dependencies: + builtin-modules "^1.1.0" + is-module "^1.0.0" + resolve "^1.1.6" -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.9" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.9.tgz#98f64880474b74f4a38b8da9d3c0f2d104633e7d" +rollup-pluginutils@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" + estree-walker "^0.2.1" + minimatch "^3.0.2" -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" +rollup-pluginutils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0" dependencies: - shebang-regex "^1.0.0" + estree-walker "^0.3.0" + micromatch "^2.3.11" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +rollup@^0.54.0: + version "0.54.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.54.0.tgz#0641b8154ba02706464285d2ead924c486b48ba9" -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -source-list-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" - source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: source-map "^0.5.6" -source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: +source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" - dependencies: - spdx-license-ids "^1.0.2" - -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" - -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" - -sshpk@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - -"statuses@>= 1.3.1 < 2": - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - -stream-browserify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-http@^2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.2.tgz#40a050ec8dc3b53b33d9909415c02c0bf1abfbad" - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.2.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -string-width@^1.0.1, string-width@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@^1.0.0, string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - -stringstream@~0.0.4: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - dependencies: - has-flag "^2.0.0" - -tapable@^0.2.7: - version "0.2.8" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" - -tar-pack@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" - dependencies: - debug "^2.2.0" - fstream "^1.0.10" - fstream-ignore "^1.0.5" - once "^1.3.3" - readable-stream "^2.1.4" - rimraf "^2.5.1" - tar "^2.2.1" - uid-number "^0.0.6" - -tar@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" - -timers-browserify@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.4.tgz#96ca53f4b794a5e7c0e1bd7cc88a372298fa01e6" - dependencies: - setimmediate "^1.0.4" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -tough-cookie@~2.3.0: - version "2.3.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" - dependencies: - punycode "^1.4.1" - trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - turbolinks@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/turbolinks/-/turbolinks-5.0.3.tgz#c8ce128cfc9be1d691a1e41ffa858a5a5ee86a02" -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-is@~1.6.15: - version "1.6.15" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410" - dependencies: - media-typer "0.3.0" - mime-types "~2.1.15" - -uglify-js@^2.8.29: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -uglifyjs-webpack-plugin@^0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" - dependencies: - source-map "^0.5.6" - uglify-js "^2.8.29" - webpack-sources "^1.0.1" - -uid-number@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -util@0.10.3, util@^0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - -uuid@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" - -validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" - dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - -watchpack@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac" - dependencies: - async "^2.1.2" - chokidar "^1.7.0" - graceful-fs "^4.1.2" - -webpack-bundle-analyzer@^2.9.0: - version "2.9.1" - resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-2.9.1.tgz#c2c8e03e8e5768ed288b39ae9e27a8b8d7b9d476" - dependencies: - acorn "^5.1.1" - chalk "^1.1.3" - commander "^2.9.0" - ejs "^2.5.6" - express "^4.15.2" - filesize "^3.5.9" - gzip-size "^3.0.0" - lodash "^4.17.4" - mkdirp "^0.5.1" - opener "^1.4.3" - ws "^3.3.1" - -webpack-sources@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack@^3.7.1: - version "3.10.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.10.0.tgz#5291b875078cf2abf42bdd23afe3f8f96c17d725" - dependencies: - acorn "^5.0.0" - acorn-dynamic-import "^2.0.0" - ajv "^5.1.5" - ajv-keywords "^2.0.0" - async "^2.1.2" - enhanced-resolve "^3.4.0" - escope "^3.6.0" - interpret "^1.0.0" - json-loader "^0.5.4" - json5 "^0.5.1" - loader-runner "^2.3.0" - loader-utils "^1.1.0" - memory-fs "~0.4.1" - mkdirp "~0.5.0" - node-libs-browser "^2.0.0" - source-map "^0.5.3" - supports-color "^4.2.1" - tapable "^0.2.7" - uglifyjs-webpack-plugin "^0.4.6" - watchpack "^1.4.0" - webpack-sources "^1.0.1" - yargs "^8.0.2" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - -which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" - dependencies: - string-width "^1.0.2" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -ws@^3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yargs-parser@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - dependencies: - camelcase "^4.1.0" - -yargs@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - dependencies: - camelcase "^4.1.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - read-pkg-up "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^7.0.0" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" +vlq@^0.2.1: + version "0.2.3" + resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"