Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-play

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-play - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## [Version 3.1.2](https://github.com/egoist/vue-play/releases/tag/v3.1.2) (2017-3-31)
### Bug fixes
- [Hotfix] fix readme not showing: [`5d251c2`](https://github.com/egoist/vue-play/commit/5d251c2) ([#55](https://github.com/egoist/vue-play/issues/55))
[...full changes](https://github.com/egoist/vue-play/compare/v3.1.1...v3.1.2)
## v2.1.0 (2016/11/13)

@@ -2,0 +10,0 @@

653

dist/app.js

@@ -67,3 +67,3 @@ module.exports =

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 49);
/******/ return __webpack_require__(__webpack_require__.s = 52);
/******/ })

@@ -75,8 +75,2 @@ /************************************************************************/

module.exports = require("vue");
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = function normalizeComponent (

@@ -116,3 +110,3 @@ rawScriptExports,

if (cssModules) {
var computed = options.computed || (options.computed = {})
var computed = Object.create(options.computed || null)
Object.keys(cssModules).forEach(function (key) {

@@ -122,2 +116,3 @@ var module = cssModules[key]

})
options.computed = computed
}

@@ -134,2 +129,8 @@

/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = require("vue");
/***/ }),
/* 2 */

@@ -142,6 +143,10 @@ /***/ (function(module, exports) {

/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return validShortcuts; });
Object.defineProperty(exports, "__esModule", {
value: true
});
var model = {

@@ -177,11 +182,17 @@ actions: {

/* harmony default export */ __webpack_exports__["b"] = model;
var validShortcuts = Object.keys(model.actions);
exports.default = model;
var validShortcuts = exports.validShortcuts = Object.keys(model.actions);
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = function (spots, query) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (spots, query) {
var scenarios = spots[query.spot];

@@ -198,12 +209,14 @@ if (scenarios) {

/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_store_modules_shortcuts__ = __webpack_require__(3);
/* unused harmony export isModifierPressed */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parseKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return executeShortcut; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return observeKeyEvents; });
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.observeKeyEvents = exports.executeShortcut = exports.parseKey = exports.isModifierPressed = undefined;
var _shortcuts = __webpack_require__(3);
// Key codes

@@ -217,7 +230,7 @@ var keyK = 75;

var isModifierPressed = function isModifierPressed(e) {
var isModifierPressed = exports.isModifierPressed = function isModifierPressed(e) {
return (e.ctrlKey || e.keyCode === keyWindows || e.metaKey) && e.shiftKey;
};
var parseKey = function parseKey(e) {
var parseKey = exports.parseKey = function parseKey(e) {
if (!isModifierPressed(e)) {

@@ -248,5 +261,5 @@ return false;

var executeShortcut = function executeShortcut(store, combination) {
var executeShortcut = exports.executeShortcut = function executeShortcut(store, combination) {
if (combination) {
if (!__WEBPACK_IMPORTED_MODULE_0_store_modules_shortcuts__["a" /* validShortcuts */].includes(combination)) {
if (!_shortcuts.validShortcuts.includes(combination)) {
console.warn('Combination ' + combination + ' is not a valid shortcut');

@@ -259,3 +272,3 @@ return;

var observeKeyEvents = function observeKeyEvents(store) {
var observeKeyEvents = exports.observeKeyEvents = function observeKeyEvents(store) {
window.onkeydown = function (e) {

@@ -269,22 +282,32 @@ var combination = parseKey(e);

/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_router__ = __webpack_require__(47);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_router__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_Home_vue__ = __webpack_require__(33);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_Home_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__components_Home_vue__);
Object.defineProperty(exports, "__esModule", {
value: true
});
var _vue = __webpack_require__(1);
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_1_vue_router___default.a);
var _vue2 = _interopRequireDefault(_vue);
/* harmony default export */ __webpack_exports__["a"] = new __WEBPACK_IMPORTED_MODULE_1_vue_router___default.a({
var _vueRouter = __webpack_require__(49);
var _vueRouter2 = _interopRequireDefault(_vueRouter);
var _Home = __webpack_require__(33);
var _Home2 = _interopRequireDefault(_Home);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_vue2.default.use(_vueRouter2.default);
exports.default = new _vueRouter2.default({
mode: 'history',
routes: [{
path: '*',
component: __WEBPACK_IMPORTED_MODULE_2__components_Home_vue___default.a
component: _Home2.default
}]

@@ -295,22 +318,34 @@ });

/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight__ = __webpack_require__(42);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight__);
__WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight___default.a.registerLanguage('json', __webpack_require__(44));
__WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight___default.a.registerLanguage('javascript', __webpack_require__(43));
__WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight___default.a.registerLanguage('xml', __webpack_require__(45));
/* harmony default export */ __webpack_exports__["a"] = __WEBPACK_IMPORTED_MODULE_0_highlight_js_lib_highlight___default.a;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _highlight = __webpack_require__(43);
var _highlight2 = _interopRequireDefault(_highlight);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_highlight2.default.registerLanguage('json', __webpack_require__(45));
_highlight2.default.registerLanguage('javascript', __webpack_require__(44));
_highlight2.default.registerLanguage('xml', __webpack_require__(46));
exports.default = _highlight2.default;
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return preventSelectStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return preventSelectStop; });
var preventSelectStart = function preventSelectStart() {
Object.defineProperty(exports, "__esModule", {
value: true
});
var preventSelectStart = exports.preventSelectStart = function preventSelectStart() {
document.onselectstart = function () {

@@ -321,3 +356,3 @@ return false;

var preventSelectStop = function preventSelectStop() {
var preventSelectStop = exports.preventSelectStop = function preventSelectStop() {
document.onselectstart = function () {

@@ -330,6 +365,12 @@ return true;

/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = function (a, b) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (a, b) {
return Object.keys(a).every(function (key) {

@@ -342,34 +383,62 @@ return a[key] === b[key];

/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vuex__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modules_layout__ = __webpack_require__(19);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modules_playspot__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modules_shortcuts__ = __webpack_require__(3);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modules_toys__ = __webpack_require__(21);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function () {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$spots = _ref.spots,
spots = _ref$spots === undefined ? [] : _ref$spots;
_store2.default.registerModule('app', {
state: {
spots: spots
},
mutations: {
SET_SPOTS: function SET_SPOTS(state, payload) {
state.spots = payload;
}
},
actions: {
setSpots: function setSpots(_ref2, payload) {
var commit = _ref2.commit;
commit('SET_SPOTS', payload);
}
}
});
(0, _vuexRouterSync.sync)(_store2.default, _router2.default);
return new _vue2.default({
el: '#app',
store: _store2.default,
router: _router2.default,
render: function render(h) {
return h('router-view');
}
});
};
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_1_vuex___default.a);
var _vue = __webpack_require__(1);
var store = new __WEBPACK_IMPORTED_MODULE_1_vuex___default.a.Store({
modules: {
layout: __WEBPACK_IMPORTED_MODULE_2__modules_layout__["a" /* default */],
playspot: __WEBPACK_IMPORTED_MODULE_3__modules_playspot__["a" /* default */],
shortcuts: __WEBPACK_IMPORTED_MODULE_4__modules_shortcuts__["b" /* default */],
toys: __WEBPACK_IMPORTED_MODULE_5__modules_toys__["a" /* default */]
}
});
var _vue2 = _interopRequireDefault(_vue);
/* harmony default export */ __webpack_exports__["a"] = store;
var _vuexRouterSync = __webpack_require__(51);
var _store = __webpack_require__(18);
var _store2 = _interopRequireDefault(_store);
var _router = __webpack_require__(6);
var _router2 = _interopRequireDefault(_router);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),

@@ -379,20 +448,12 @@ /* 11 */,

/* 13 */
/***/ (function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
module.exports = require("vuex-router-sync");
"use strict";
/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vuex__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_utils_find_scenario__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_utils_key_events__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Tabs_vue__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Tabs_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__Tabs_vue__);
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; };
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; //
//

@@ -410,10 +471,18 @@ //

//
//
var _vuex = __webpack_require__(2);
var _findScenario = __webpack_require__(4);
var _findScenario2 = _interopRequireDefault(_findScenario);
var _keyEvents = __webpack_require__(5);
var _Tabs = __webpack_require__(35);
/* harmony default export */ __webpack_exports__["default"] = {
var _Tabs2 = _interopRequireDefault(_Tabs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
watch: {

@@ -430,10 +499,10 @@ current: 'updateIframe'

this.listenChild();
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_key_events__["b" /* observeKeyEvents */])(this.$store);
(0, _keyEvents.observeKeyEvents)(this.$store);
},
computed: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_vuex__["mapGetters"])(['mainWidth']), {
computed: _extends({}, (0, _vuex.mapGetters)(['mainWidth']), {
current: function current() {
var spot = this.$route.query.spot;
var _ref = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_utils_find_scenario__["a" /* default */])(this.$store.state.app.spots, this.$route.query) || {},
var _ref = (0, _findScenario2.default)(this.$store.state.app.spots, this.$route.query) || {},
scenario = _ref.scenario,

@@ -457,3 +526,3 @@ component = _ref.component;

}),
methods: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_vuex__["mapActions"])(['addLog', 'updateCurrentScenario', 'setSpots']), {
methods: _extends({}, (0, _vuex.mapActions)(['addLog', 'updateCurrentScenario', 'setSpots']), {
postMessage: function postMessage() {

@@ -493,3 +562,3 @@ this.$refs.iframe.contentWindow.postMessage({

if (data.type === 'APPLY_SHORTCUT') {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_key_events__["c" /* executeShortcut */])(_this2.$store, JSON.parse(data.payload));
(0, _keyEvents.executeShortcut)(_this2.$store, JSON.parse(data.payload));
}

@@ -518,3 +587,3 @@ if (data.type === 'ADD_LOG') {

components: {
Tabs: __WEBPACK_IMPORTED_MODULE_3__Tabs_vue___default.a
Tabs: _Tabs2.default
}

@@ -524,13 +593,13 @@ };

/***/ }),
/* 15 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_slim_modal__ = __webpack_require__(48);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_slim_modal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_slim_modal__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vuex__);
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; };
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; //
//

@@ -576,61 +645,72 @@ //

//
//
var _vueSlimModal = __webpack_require__(50);
var _vueSlimModal2 = _interopRequireDefault(_vueSlimModal);
var _vuex = __webpack_require__(2);
/* harmony default export */ __webpack_exports__["default"] = {
computed: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex__["mapGetters"])(['showHelp'])),
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
computed: _extends({}, (0, _vuex.mapGetters)(['showHelp'])),
components: {
SlimModal: __WEBPACK_IMPORTED_MODULE_0_vue_slim_modal___default.a
SlimModal: _vueSlimModal2.default
},
methods: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex__["mapActions"])(['toggleHelp']))
methods: _extends({}, (0, _vuex.mapActions)(['toggleHelp']))
};
/***/ }),
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Sidebar_vue__ = __webpack_require__(34);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Sidebar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Sidebar_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AppMain_vue__ = __webpack_require__(31);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AppMain_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__AppMain_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__HelpModal_vue__ = __webpack_require__(32);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__HelpModal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__HelpModal_vue__);
//
//
//
//
//
//
//
//
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Sidebar = __webpack_require__(34);
var _Sidebar2 = _interopRequireDefault(_Sidebar);
/* harmony default export */ __webpack_exports__["default"] = {
var _AppMain = __webpack_require__(31);
var _AppMain2 = _interopRequireDefault(_AppMain);
var _HelpModal = __webpack_require__(32);
var _HelpModal2 = _interopRequireDefault(_HelpModal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
name: 'home',
components: {
Sidebar: __WEBPACK_IMPORTED_MODULE_0__Sidebar_vue___default.a,
AppMain: __WEBPACK_IMPORTED_MODULE_1__AppMain_vue___default.a,
HelpModal: __WEBPACK_IMPORTED_MODULE_2__HelpModal_vue___default.a
Sidebar: _Sidebar2.default,
AppMain: _AppMain2.default,
HelpModal: _HelpModal2.default
}
};
}; //
//
//
//
//
//
//
//
/***/ }),
/* 17 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_utils_prevent_select__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vuex__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_utils_debounce__ = __webpack_require__(22);
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; };
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; //
//

@@ -670,8 +750,13 @@ //

//
//
var _preventSelect = __webpack_require__(8);
var _vuex = __webpack_require__(2);
var _debounce = __webpack_require__(22);
var _debounce2 = _interopRequireDefault(_debounce);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var BOUNDARY = {

@@ -682,4 +767,4 @@ min: 200,

/* harmony default export */ __webpack_exports__["default"] = {
computed: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex__["mapGetters"])(['leftPanelExpanded', 'visibleScenarios', 'sidebarWidth', 'currentScenario', 'filterKeyword'])),
exports.default = {
computed: _extends({}, (0, _vuex.mapGetters)(['leftPanelExpanded', 'visibleScenarios', 'sidebarWidth', 'currentScenario', 'filterKeyword'])),

@@ -696,4 +781,4 @@ data: function data() {

methods: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex__["mapActions"])(['updatePlayspot', 'updateSidebarWidth', 'toggleHelp', 'filterToys', 'activateSpot']), {
filter: __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_debounce__["a" /* default */])(function (_ref) {
methods: _extends({}, (0, _vuex.mapActions)(['updatePlayspot', 'updateSidebarWidth', 'toggleHelp', 'filterToys', 'activateSpot']), {
filter: (0, _debounce2.default)(function (_ref) {
var target = _ref.target;

@@ -711,3 +796,3 @@

document.addEventListener('mouseup', this.handleMouseUp);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_utils_prevent_select__["a" /* preventSelectStart */])();
(0, _preventSelect.preventSelectStart)();
},

@@ -726,3 +811,3 @@ handleMouseMove: function handleMouseMove(_ref3) {

document.removeEventListener('mouseup', this.handleMouseUp);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_utils_prevent_select__["b" /* preventSelectStop */])();
(0, _preventSelect.preventSelectStop)();
},

@@ -742,13 +827,13 @@ isActiveSpot: function isActiveSpot(name, index) {

/***/ }),
/* 18 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vuex__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_utils_highlight__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_utils_prevent_select__ = __webpack_require__(8);
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; };
Object.defineProperty(exports, "__esModule", {
value: true
});
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; }; //
//

@@ -848,9 +933,14 @@ //

//
//
var _vuex = __webpack_require__(2);
var _highlight = __webpack_require__(7);
var _highlight2 = _interopRequireDefault(_highlight);
var _preventSelect = __webpack_require__(8);
/* harmony default export */ __webpack_exports__["default"] = {
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
name: 'console',

@@ -865,3 +955,3 @@ props: {

},
computed: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_vuex__["mapGetters"])(['logs', 'bottomPanelExpanded']), {
computed: _extends({}, (0, _vuex.mapGetters)(['logs', 'bottomPanelExpanded']), {
highlightedExample: function highlightedExample() {

@@ -871,3 +961,3 @@ if (!this.example) {

}
return __WEBPACK_IMPORTED_MODULE_1_utils_highlight__["a" /* default */].highlightAuto(this.example).value;
return _highlight2.default.highlightAuto(this.example).value;
},

@@ -898,3 +988,3 @@ active: function active() {

methods: _extends({}, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_vuex__["mapActions"])(['setBottomPanelHeight', 'clearLogs', 'updateActiveTab']), {
methods: _extends({}, (0, _vuex.mapActions)(['setBottomPanelHeight', 'clearLogs', 'updateActiveTab']), {
handleMouseDown: function handleMouseDown(_ref) {

@@ -908,3 +998,3 @@ var clientY = _ref.clientY;

document.addEventListener('mouseup', this.handleMouseUp);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_prevent_select__["a" /* preventSelectStart */])();
(0, _preventSelect.preventSelectStart)();
},

@@ -925,3 +1015,3 @@ handleMouseMove: function handleMouseMove(_ref2) {

document.removeEventListener('mouseup', this.handleMouseUp);
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_prevent_select__["b" /* preventSelectStop */])();
(0, _preventSelect.preventSelectStop)();
},

@@ -942,20 +1032,69 @@ clearCurrentLogs: function clearCurrentLogs() {

/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _vue = __webpack_require__(1);
var _vue2 = _interopRequireDefault(_vue);
var _vuex = __webpack_require__(2);
var _vuex2 = _interopRequireDefault(_vuex);
var _layout = __webpack_require__(19);
var _layout2 = _interopRequireDefault(_layout);
var _playspot = __webpack_require__(20);
var _playspot2 = _interopRequireDefault(_playspot);
var _shortcuts = __webpack_require__(3);
var _shortcuts2 = _interopRequireDefault(_shortcuts);
var _toys = __webpack_require__(21);
var _toys2 = _interopRequireDefault(_toys);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_vue2.default.use(_vuex2.default);
var store = new _vuex2.default.Store({
modules: {
layout: _layout2.default,
playspot: _playspot2.default,
shortcuts: _shortcuts2.default,
toys: _toys2.default
}
});
exports.default = store;
/***/ }),
/* 19 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* unused harmony export TOGGLE_LEFT_PANEL */
/* unused harmony export TOGGLE_BOTTOM_PANEL */
/* unused harmony export TOGGLE_ALL_PANELS */
/* unused harmony export UPDATE_SIDEBAR_WIDTH */
/* unused harmony export UPDATE_ACTIVE_TAB */
/* unused harmony export TOGGLE_HELP */
var TOGGLE_LEFT_PANEL = 'TOGGLE_LEFT_PANEL';
var TOGGLE_BOTTOM_PANEL = 'TOGGLE_BOTTOM_PANEL';
var TOGGLE_ALL_PANELS = 'TOGGLE_ALL_PANELS';
var UPDATE_SIDEBAR_WIDTH = 'UPDATE_SIDEBAR_WIDTH';
var UPDATE_ACTIVE_TAB = 'UPDATE_ACTIVE_TAB';
var TOGGLE_HELP = 'TOGGLE_HELP';
/* harmony default export */ __webpack_exports__["a"] = {
Object.defineProperty(exports, "__esModule", {
value: true
});
var TOGGLE_LEFT_PANEL = exports.TOGGLE_LEFT_PANEL = 'TOGGLE_LEFT_PANEL';
var TOGGLE_BOTTOM_PANEL = exports.TOGGLE_BOTTOM_PANEL = 'TOGGLE_BOTTOM_PANEL';
var TOGGLE_ALL_PANELS = exports.TOGGLE_ALL_PANELS = 'TOGGLE_ALL_PANELS';
var UPDATE_SIDEBAR_WIDTH = exports.UPDATE_SIDEBAR_WIDTH = 'UPDATE_SIDEBAR_WIDTH';
var UPDATE_ACTIVE_TAB = exports.UPDATE_ACTIVE_TAB = 'UPDATE_ACTIVE_TAB';
var TOGGLE_HELP = exports.TOGGLE_HELP = 'TOGGLE_HELP';
exports.default = {
state: {

@@ -1055,16 +1194,28 @@ leftPanelExpanded: true,

/* 20 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_array_find_index__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_array_find_index___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_array_find_index__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_utils_shallow_equal__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_router__ = __webpack_require__(6);
/* unused harmony export UPDATE_CURRENT_SCENARIO */
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UPDATE_CURRENT_SCENARIO = undefined;
var _arrayFindIndex = __webpack_require__(42);
var UPDATE_CURRENT_SCENARIO = 'UPDATE_CURRENT_SCENARIO';
var _arrayFindIndex2 = _interopRequireDefault(_arrayFindIndex);
var _shallowEqual = __webpack_require__(9);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
var _router = __webpack_require__(6);
var _router2 = _interopRequireDefault(_router);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var UPDATE_CURRENT_SCENARIO = exports.UPDATE_CURRENT_SCENARIO = 'UPDATE_CURRENT_SCENARIO';
var updateCurrent = function updateCurrent(state, payload) {

@@ -1074,3 +1225,3 @@ state.current = payload;

/* harmony default export */ __webpack_exports__["a"] = {
exports.default = {
state: {

@@ -1089,4 +1240,4 @@ current: null

var total = getters.playspotRoutes.length;
var current = __WEBPACK_IMPORTED_MODULE_0_array_find_index___default()(getters.playspotRoutes, function (element) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_utils_shallow_equal__["a" /* default */])(state.current, element);
var current = (0, _arrayFindIndex2.default)(getters.playspotRoutes, function (element) {
return (0, _shallowEqual2.default)(state.current, element);
});

@@ -1096,3 +1247,3 @@ var nextIndex = (current + 1) % total;

commit(UPDATE_CURRENT_SCENARIO, next);
__WEBPACK_IMPORTED_MODULE_2_router__["a" /* default */].push({ query: next });
_router2.default.push({ query: next });
},

@@ -1105,4 +1256,4 @@ playPrevious: function playPrevious(_ref2) {

var total = getters.playspotRoutes.length;
var current = __WEBPACK_IMPORTED_MODULE_0_array_find_index___default()(getters.playspotRoutes, function (element) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_utils_shallow_equal__["a" /* default */])(state.current, element);
var current = (0, _arrayFindIndex2.default)(getters.playspotRoutes, function (element) {
return (0, _shallowEqual2.default)(state.current, element);
});

@@ -1112,3 +1263,3 @@ var prevIndex = (total + (current - 1)) % total;

commit(UPDATE_CURRENT_SCENARIO, prev);
__WEBPACK_IMPORTED_MODULE_2_router__["a" /* default */].push({ query: prev });
_router2.default.push({ query: prev });
},

@@ -1125,3 +1276,3 @@ updateCurrentScenario: function updateCurrentScenario(_ref3, path) {

__WEBPACK_IMPORTED_MODULE_2_router__["a" /* default */].push({ query: { spot: spot, scenario: scenario } });
_router2.default.push({ query: { spot: spot, scenario: scenario } });
}

@@ -1142,17 +1293,29 @@ },

/* 21 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_uid__ = __webpack_require__(46);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_uid___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_uid__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_utils_highlight__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_utils_shallow_equal__ = __webpack_require__(9);
Object.defineProperty(exports, "__esModule", {
value: true
});
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; };
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); } }
var _uid = __webpack_require__(48);
var _uid2 = _interopRequireDefault(_uid);
var _highlight = __webpack_require__(7);
var _highlight2 = _interopRequireDefault(_highlight);
var _shallowEqual = __webpack_require__(9);
var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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); } }
var matches = function matches(filter, text) {

@@ -1164,3 +1327,3 @@ var f = filter.toLowerCase();

/* harmony default export */ __webpack_exports__["a"] = {
exports.default = {
state: {

@@ -1195,3 +1358,3 @@ logs: [],

route: route,
id: __WEBPACK_IMPORTED_MODULE_0_uid___default()()
id: (0, _uid2.default)()
});

@@ -1204,3 +1367,3 @@ },

commit('CLEAR_CURRENT_LOGS', state.logs.filter(function (log) {
return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_shallow_equal__["a" /* default */])(payload, log.route);
return !(0, _shallowEqual2.default)(payload, log.route);
}));

@@ -1212,6 +1375,6 @@ }

return state.logs.filter(function (log) {
return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_utils_shallow_equal__["a" /* default */])(log.route, getters.currentScenario);
return (0, _shallowEqual2.default)(log.route, getters.currentScenario);
}).map(function (log) {
return _extends({}, log, {
data: __WEBPACK_IMPORTED_MODULE_1_utils_highlight__["a" /* default */].highlight('json', JSON.stringify(log.data, null, 2)).value
data: _highlight2.default.highlight('json', JSON.stringify(log.data, null, 2)).value
});

@@ -1264,6 +1427,11 @@ });

/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = debounce;
function debounce(func, wait, immediate) {

@@ -1351,5 +1519,5 @@ var timeout = void 0;

var Component = __webpack_require__(1)(
var Component = __webpack_require__(0)(
/* script */
__webpack_require__(14),
__webpack_require__(13),
/* template */

@@ -1390,5 +1558,5 @@ __webpack_require__(36),

var Component = __webpack_require__(1)(
var Component = __webpack_require__(0)(
/* script */
__webpack_require__(15),
__webpack_require__(14),
/* template */

@@ -1429,5 +1597,5 @@ __webpack_require__(38),

var Component = __webpack_require__(1)(
var Component = __webpack_require__(0)(
/* script */
__webpack_require__(16),
__webpack_require__(15),
/* template */

@@ -1468,5 +1636,5 @@ __webpack_require__(39),

var Component = __webpack_require__(1)(
var Component = __webpack_require__(0)(
/* script */
__webpack_require__(17),
__webpack_require__(16),
/* template */

@@ -1510,5 +1678,5 @@ __webpack_require__(37),

var Component = __webpack_require__(1)(
var Component = __webpack_require__(0)(
/* script */
__webpack_require__(18),
__webpack_require__(17),
/* template */

@@ -1992,3 +2160,4 @@ __webpack_require__(40),

/***/ }),
/* 41 */
/* 41 */,
/* 42 */
/***/ (function(module, exports) {

@@ -1999,3 +2168,3 @@

/***/ }),
/* 42 */
/* 43 */
/***/ (function(module, exports) {

@@ -2006,3 +2175,3 @@

/***/ }),
/* 43 */
/* 44 */
/***/ (function(module, exports) {

@@ -2013,3 +2182,3 @@

/***/ }),
/* 44 */
/* 45 */
/***/ (function(module, exports) {

@@ -2020,3 +2189,3 @@

/***/ }),
/* 45 */
/* 46 */
/***/ (function(module, exports) {

@@ -2027,3 +2196,4 @@

/***/ }),
/* 46 */
/* 47 */,
/* 48 */
/***/ (function(module, exports) {

@@ -2034,3 +2204,3 @@

/***/ }),
/* 47 */
/* 49 */
/***/ (function(module, exports) {

@@ -2041,3 +2211,3 @@

/***/ }),
/* 48 */
/* 50 */
/***/ (function(module, exports) {

@@ -2048,54 +2218,15 @@

/***/ }),
/* 49 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* 51 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex_router_sync__ = __webpack_require__(13);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex_router_sync___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vuex_router_sync__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__router__ = __webpack_require__(6);
module.exports = require("vuex-router-sync");
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(10);
/* harmony default export */ __webpack_exports__["default"] = function () {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$spots = _ref.spots,
spots = _ref$spots === undefined ? [] : _ref$spots;
__WEBPACK_IMPORTED_MODULE_2__store__["a" /* default */].registerModule('app', {
state: {
spots: spots
},
mutations: {
SET_SPOTS: function SET_SPOTS(state, payload) {
state.spots = payload;
}
},
actions: {
setSpots: function setSpots(_ref2, payload) {
var commit = _ref2.commit;
commit('SET_SPOTS', payload);
}
}
});
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_vuex_router_sync__["sync"])(__WEBPACK_IMPORTED_MODULE_2__store__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__router__["a" /* default */]);
return new __WEBPACK_IMPORTED_MODULE_0_vue___default.a({
el: '#app',
store: __WEBPACK_IMPORTED_MODULE_2__store__["a" /* default */],
router: __WEBPACK_IMPORTED_MODULE_3__router__["a" /* default */],
render: function render(h) {
return h('router-view');
}
});
};
/***/ })
/******/ ]);

@@ -67,3 +67,3 @@ module.exports =

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 50);
/******/ return __webpack_require__(__webpack_require__.s = 53);
/******/ })

@@ -73,9 +73,12 @@ /************************************************************************/

/***/ 50:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ 11:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "play", function() { return play; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSpots", function() { return getSpots; });
Object.defineProperty(exports, "__esModule", {
value: true
});
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; };

@@ -161,6 +164,15 @@

exports.play = play;
exports.getSpots = getSpots;
/***/ }),
/***/ 53:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(11);
/***/ })
/******/ });

@@ -67,3 +67,3 @@ module.exports =

/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 51);
/******/ return __webpack_require__(__webpack_require__.s = 54);
/******/ })

@@ -73,3 +73,3 @@ /************************************************************************/

/***/ 0:
/***/ 1:
/***/ (function(module, exports) {

@@ -81,21 +81,110 @@

/***/ 11:
/***/ (function(module, exports) {
/***/ 12:
/***/ (function(module, exports, __webpack_require__) {
module.exports = require("./play");
"use strict";
/***/ }),
/***/ 12:
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
module.exports = require("query-string");
exports.default = function () {
var spots = (0, _play.getSpots)();
var query = _queryString2.default.parse(location.search);
_vue2.default.prototype.$log = function (data) {
parent.postMessage({
type: 'ADD_LOG',
payload: data
}, location.origin);
};
return new _vue2.default({
el: '#app',
data: function data() {
var scenario = (0, _findScenario2.default)(spots, query);
var component = scenario && scenario.component;
if (component) {
component.example = undefined;
component.readme = undefined;
}
return {
current: component
};
},
created: function created() {
var _this = this;
window.addEventListener('message', function (_ref) {
var data = _ref.data;
if (data.type === 'UPDATE_ROUTE') {
var scenario = (0, _findScenario2.default)(spots, data.payload);
if (scenario) {
_this.current = scenario.component;
}
}
});
window.onkeydown = function (e) {
parent.postMessage({
type: 'APPLY_SHORTCUT',
payload: JSON.stringify((0, _keyEvents.parseKey)(e))
}, location.origin);
};
parent.postMessage({
type: 'SET_SPOTS',
payload: JSON.stringify(purify(spots))
}, location.origin);
},
render: function render(h) {
return h('div', { attrs: { id: 'app' } }, [h(this.current)]);
}
});
};
var _vue = __webpack_require__(1);
var _vue2 = _interopRequireDefault(_vue);
var _queryString = __webpack_require__(47);
var _queryString2 = _interopRequireDefault(_queryString);
var _findScenario = __webpack_require__(4);
var _findScenario2 = _interopRequireDefault(_findScenario);
var _keyEvents = __webpack_require__(5);
var _play = __webpack_require__(41);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function purify(spots) {
var result = {};
for (var name in spots) {
result[name] = spots[name].map(function (spot) {
return {
scenario: spot.scenario,
component: {
example: spot.component.example,
template: spot.component.template
}
};
});
}
return result;
}
/***/ }),
/***/ 3:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return validShortcuts; });
Object.defineProperty(exports, "__esModule", {
value: true
});
var model = {

@@ -131,4 +220,4 @@ actions: {

/* harmony default export */ __webpack_exports__["b"] = model;
var validShortcuts = Object.keys(model.actions);
exports.default = model;
var validShortcuts = exports.validShortcuts = Object.keys(model.actions);

@@ -138,6 +227,12 @@ /***/ }),

/***/ 4:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = function (spots, query) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (spots, query) {
var scenarios = spots[query.spot];

@@ -154,13 +249,29 @@ if (scenarios) {

/***/ 41:
/***/ (function(module, exports) {
module.exports = require("./play");
/***/ }),
/***/ 47:
/***/ (function(module, exports) {
module.exports = require("query-string");
/***/ }),
/***/ 5:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_store_modules_shortcuts__ = __webpack_require__(3);
/* unused harmony export isModifierPressed */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parseKey; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return executeShortcut; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return observeKeyEvents; });
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.observeKeyEvents = exports.executeShortcut = exports.parseKey = exports.isModifierPressed = undefined;
var _shortcuts = __webpack_require__(3);
// Key codes

@@ -174,7 +285,7 @@ var keyK = 75;

var isModifierPressed = function isModifierPressed(e) {
var isModifierPressed = exports.isModifierPressed = function isModifierPressed(e) {
return (e.ctrlKey || e.keyCode === keyWindows || e.metaKey) && e.shiftKey;
};
var parseKey = function parseKey(e) {
var parseKey = exports.parseKey = function parseKey(e) {
if (!isModifierPressed(e)) {

@@ -205,5 +316,5 @@ return false;

var executeShortcut = function executeShortcut(store, combination) {
var executeShortcut = exports.executeShortcut = function executeShortcut(store, combination) {
if (combination) {
if (!__WEBPACK_IMPORTED_MODULE_0_store_modules_shortcuts__["a" /* validShortcuts */].includes(combination)) {
if (!_shortcuts.validShortcuts.includes(combination)) {
console.warn('Combination ' + combination + ' is not a valid shortcut');

@@ -216,3 +327,3 @@ return;

var observeKeyEvents = function observeKeyEvents(store) {
var observeKeyEvents = exports.observeKeyEvents = function observeKeyEvents(store) {
window.onkeydown = function (e) {

@@ -226,92 +337,10 @@ var combination = parseKey(e);

/***/ 51:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ 54:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_query_string__ = __webpack_require__(12);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_query_string___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_query_string__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_find_scenario__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_key_events__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__play__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__play___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__play__);
module.exports = __webpack_require__(12);
/* harmony default export */ __webpack_exports__["default"] = function () {
var spots = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__play__["getSpots"])();
var query = __WEBPACK_IMPORTED_MODULE_1_query_string___default.a.parse(location.search);
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$log = function (data) {
parent.postMessage({
type: 'ADD_LOG',
payload: data
}, location.origin);
};
return new __WEBPACK_IMPORTED_MODULE_0_vue___default.a({
el: '#app',
data: function data() {
var scenario = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_find_scenario__["a" /* default */])(spots, query);
var component = scenario && scenario.component;
if (component) {
component.example = undefined;
component.readme = undefined;
}
return {
current: component
};
},
created: function created() {
var _this = this;
window.addEventListener('message', function (_ref) {
var data = _ref.data;
if (data.type === 'UPDATE_ROUTE') {
var scenario = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__utils_find_scenario__["a" /* default */])(spots, data.payload);
if (scenario) {
_this.current = scenario.component;
}
}
});
window.onkeydown = function (e) {
parent.postMessage({
type: 'APPLY_SHORTCUT',
payload: JSON.stringify(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__utils_key_events__["a" /* parseKey */])(e))
}, location.origin);
};
parent.postMessage({
type: 'SET_SPOTS',
payload: JSON.stringify(purify(spots))
}, location.origin);
},
render: function render(h) {
return h('div', { attrs: { id: 'app' } }, [h(this.current)]);
}
});
};
function purify(spots) {
var result = {};
for (var name in spots) {
result[name] = spots[name].map(function (spot) {
return {
scenario: spot.scenario,
component: {
example: spot.component.example,
template: spot.component.template
}
};
});
}
return result;
}
/***/ })
/******/ });
{
"name": "vue-play",
"version": "3.1.1",
"version": "3.1.2",
"description": "Play with your vue components.",

@@ -42,22 +42,22 @@ "license": "MIT",

"array-find-index": "^1.0.2",
"highlight.js": "^9.8.0",
"query-string": "^4.2.3",
"highlight.js": "^9.10.0",
"query-string": "^4.3.2",
"uid": "0.0.2",
"vue-router": "^2.0.3",
"vue-router": "^2.3.0",
"vue-slim-modal": "^0.3.0",
"vuex": "^2.0.0",
"vuex-router-sync": "next"
"vuex": "^2.2.1",
"vuex-router-sync": "^4.1.2"
},
"devDependencies": {
"eslint": "^3.15.0",
"eslint": "^3.17.1",
"eslint-config-xo": "^0.17.0",
"eslint-loader": "^1.6.1",
"eslint-loader": "^1.6.3",
"eslint-plugin-vue": "^2.0.1",
"github-markdown-css": "^2.4.1",
"hint.css": "^2.4.1",
"markdown-toc": "^0.13.0",
"markdown-toc": "^1.1.0",
"postcss-nested": "^1.0.0",
"postcss-simple-vars": "^3.0.0",
"vbuild": "^6.12.1"
"vbuild": "^6.24.2"
}
}
}

@@ -14,4 +14,2 @@ # vue-play

- [Getting Started](#getting-started)
+ [App interface](#app-interface)
+ [Preview](#preview)
- [Writing Scenarios](#writing-scenarios)

@@ -37,108 +35,28 @@ * [Keeping Scenarios](#keeping-scenarios)

Install it:
Integrate `vue-play` into your project using [getplay](https://github.com/vue-play/getplay):
```bash
yarn global add getplay
cd my-project
npm install --save-dev vue-play vue-play-cli
# vue-play-cli gives you the `vue-play` command
# vue-play is the UI utils.
getplay
```
Add npm scripts:
Then you can run `yarn play` and go to `http://localhost:5000`
```json
{
"scripts": {
"play": "vue-play start",
"play:build": "vue-play build"
}
}
```
So far we got:
Write `play entry` to load your examples:
- npm scripts `yarn play` & `yarn build:play`
- A `./play` folder where you write scenarios for your component
- A `./play.config.js` file which helps you configure webpack easily using [vbuild](https://vbuild.js.org)
```js
// ./play/index.js
import { play } from 'vue-play'
import MyButton from './components/MyButton.vue'
play('Button')
.add('with text', h => h(MyButton, 'hello'))
.add('with emoji', h => h(MyButton, '💫'))
```
The only thing you really need to worry about is `./play/index.js`, since you will write scenarios or dynamically load scenarios there.
Then just run `npm run play` and go to `http://localhost:5000`
For more usages on vue-play-cli, please head to [vue-play/vue-play-cli](https://github.com/vue-play/vue-play-cli).
<details><summary>The hard way</summary>
There're two pages in your play app, one is the app interface which has a sidebar and it can toggle scenarios of your components, the other page is for rendering the examples, this page will be loaded as iframe in app interface.
And only the latter needs to load scenarios that you write in the `play entry`, let's say `./play/index.js`:
```js
import { play } from 'vue-play'
import MyButton from './MyButton.vue'
play('MyButton')
.add('with text', h => h(MyButton, ['text']))
```
#### App interface
```js
// ./play/app.js
import app from 'vue-play/app'
// bootstrap app
app()
```
#### Preview
```js
// ./play/preview.js
import './' // which is ./play/index.js
import preview from 'vue-play/preview'
// actually render the scenarios in preview page
// when the preview page is ready
// it will tell the app interface what scenarios we have
preview()
```
Add `app interface` and `preview` to your webpack entry:
```js
module.exports = {
// ...
entry: {
app: './play/app.js',
preview: './play/preview.js'
},
// don't forget to generate html output for both of them
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['app']
}),
new HtmlWebpackPlugin({
filename: 'preview.html',
chunks: ['preview']
})
]
}
```
That's it, you're all set!
</details>
## Writing Scenarios
`scenario`, a.k.a. story in react-storybook, it's usually an example for demostrating your real component.
`scenario`, a.k.a. story in react-storybook, it's usually an example component for demostrating your real component.
### Keeping Scenarios
You can keep scenarios anywhere you want, for example you can keep them all at `./play/index.js`, you can also use separate files for them, or even name them `*.play.js` in your component directory and load them dynamically.
You can keep scenarios anywhere you want, by default keep them all at `./play/index.js`, you can also use separate files for them, or even name them `*.play.js` in your component directory and load them dynamically.

@@ -145,0 +63,0 @@ ### Writing Scenarios

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc