diff --git a/dist/grapes.js b/dist/grapes.js index 2cb6064dbb..47ccf41c99 100644 --- a/dist/grapes.js +++ b/dist/grapes.js @@ -4240,7 +4240,7 @@ var Backbone = __webpack_require__(0); var Components = __webpack_require__(51); var Selector = __webpack_require__(8); var Selectors = __webpack_require__(11); -var Traits = __webpack_require__(154); +var Traits = __webpack_require__(155); var componentList = {}; var componentIndex = 0; @@ -16639,7 +16639,7 @@ var Property = __webpack_require__(13); module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.default).extend({ types: [{ id: 'stack', - model: __webpack_require__(123), + model: __webpack_require__(124), view: __webpack_require__(35), isType: function isType(value) { if (value && value.type == 'stack') { @@ -16693,8 +16693,8 @@ module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.d } }, { id: 'slider', - model: __webpack_require__(129), - view: __webpack_require__(130), + model: __webpack_require__(130), + view: __webpack_require__(131), isType: function isType(value) { if (value && value.type == 'slider') { return value; @@ -17803,8 +17803,8 @@ var _underscore = __webpack_require__(1); var _mixins = __webpack_require__(2); -var ToolbarView = __webpack_require__(193); -var Toolbar = __webpack_require__(195); +var ToolbarView = __webpack_require__(194); +var Toolbar = __webpack_require__(196); var key = __webpack_require__(24); var $ = __webpack_require__(0).$; var showOffsets = void 0; @@ -18001,18 +18001,27 @@ module.exports = { */ onClick: function onClick(e) { e.stopPropagation(); - var model = $(e.target).data('model'); + var $el = $(e.target); var editor = this.editor; + var model = $el.data('model'); + + if (!model) { + var parent = $el.parent(); + while (!model && parent) { + model = parent.data('model'); + parent = parent.parent(); + } + } if (model) { if (model.get('selectable')) { editor.select(model); this.initResize(model); } else { - var parent = model.parent(); - while (parent && !parent.get('selectable')) { - parent = parent.parent(); - }parent && editor.select(parent); + var _parent = model.parent(); + while (_parent && !_parent.get('selectable')) { + _parent = _parent.parent(); + }_parent && editor.select(_parent); } } }, @@ -20612,8 +20621,7 @@ module.exports = function (config) { var cls = str.split(' '); for (var i = 0, len = cls.length; i < len; i++) { var cl = cls[i].trim(); - var reg = new RegExp('^' + c.pStylePrefix); - if (!cl || reg.test(cl)) continue; + if (!cl) continue; result.push(cl); } return result; @@ -21681,7 +21689,7 @@ module.exports = Backbone.Model.extend({ var Backbone = __webpack_require__(0); -var Button = __webpack_require__(112); +var Button = __webpack_require__(113); module.exports = Backbone.Collection.extend({ model: Button, @@ -21764,7 +21772,7 @@ module.exports = Backbone.Collection.extend({ 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 Backbone = __webpack_require__(0); -var ButtonsView = __webpack_require__(114); +var ButtonsView = __webpack_require__(115); module.exports = Backbone.View.extend({ initialize: function initialize(o) { @@ -21939,10 +21947,10 @@ var _underscore = __webpack_require__(1); module.exports = function () { var c = {}, - defaults = __webpack_require__(120), - Sectors = __webpack_require__(121), + defaults = __webpack_require__(121), + Sectors = __webpack_require__(122), Properties = __webpack_require__(12), - SectorsView = __webpack_require__(132); + SectorsView = __webpack_require__(133); var properties = void 0; var sectors, SectView; @@ -22552,7 +22560,7 @@ module.exports = Property.extend({ var PropertyCompositeView = __webpack_require__(17); -var LayersView = __webpack_require__(127); +var LayersView = __webpack_require__(128); module.exports = PropertyCompositeView.extend({ templateInput: function templateInput() { @@ -22989,7 +22997,7 @@ var _backbone2 = _interopRequireDefault(_backbone); var _underscore = __webpack_require__(1); -var _ColorPicker = __webpack_require__(126); +var _ColorPicker = __webpack_require__(127); var _ColorPicker2 = _interopRequireDefault(_ColorPicker); @@ -24717,7 +24725,7 @@ module.exports = ComponentView.extend({ 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 _config = __webpack_require__(181); +var _config = __webpack_require__(182); var _config2 = _interopRequireDefault(_config); @@ -25580,11 +25588,11 @@ var _editor2 = _interopRequireDefault(_editor); var _underscore = __webpack_require__(1); -var _polyfills = __webpack_require__(223); +var _polyfills = __webpack_require__(224); var _polyfills2 = _interopRequireDefault(_polyfills); -var _plugin_manager = __webpack_require__(224); +var _plugin_manager = __webpack_require__(225); var _plugin_manager2 = _interopRequireDefault(_plugin_manager); @@ -25614,7 +25622,7 @@ module.exports = function () { plugins: plugins, // Will be replaced on build - version: '0.14.16', + version: '0.14.17', /** * Initializes an editor based on passed options @@ -25680,7 +25688,7 @@ module.exports = function (config) { var c = config || {}, defaults = __webpack_require__(63), EditorModel = __webpack_require__(64), - EditorView = __webpack_require__(222); + EditorView = __webpack_require__(223); for (var name in defaults) { if (!(name in c)) c[name] = defaults[name]; @@ -26548,12 +26556,12 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument var _underscore = __webpack_require__(1); -var deps = [__webpack_require__(66), __webpack_require__(70), __webpack_require__(71), __webpack_require__(74), __webpack_require__(82), __webpack_require__(87), __webpack_require__(90), __webpack_require__(94), __webpack_require__(98), __webpack_require__(110), __webpack_require__(117), __webpack_require__(32), __webpack_require__(134), __webpack_require__(140), __webpack_require__(145), __webpack_require__(152), __webpack_require__(55), __webpack_require__(182), __webpack_require__(189), __webpack_require__(213)]; +var deps = [__webpack_require__(66), __webpack_require__(70), __webpack_require__(71), __webpack_require__(74), __webpack_require__(83), __webpack_require__(88), __webpack_require__(91), __webpack_require__(95), __webpack_require__(99), __webpack_require__(111), __webpack_require__(118), __webpack_require__(32), __webpack_require__(135), __webpack_require__(141), __webpack_require__(146), __webpack_require__(153), __webpack_require__(55), __webpack_require__(183), __webpack_require__(190), __webpack_require__(214)]; var Backbone = __webpack_require__(0); var timedInterval = void 0; -__webpack_require__(221)({ +__webpack_require__(222)({ Backbone: Backbone, $: Backbone.$ }); @@ -32971,6 +32979,18 @@ module.exports = __webpack_require__(0).Model.extend({ "use strict"; /* WEBPACK VAR INJECTION */(function(setImmediate) { +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; }; + +var _finally = __webpack_require__(82); + +var _finally2 = _interopRequireDefault(_finally); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // Store setTimeout reference so promise-polyfill will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var setTimeoutFunc = setTimeout; @@ -32979,14 +32999,13 @@ function noop() {} // Polyfill for Function.prototype.bind function bind(fn, thisArg) { - return function() { + return function () { fn.apply(thisArg, arguments); }; } function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); + if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new'); if (typeof fn !== 'function') throw new TypeError('not a function'); this._state = 0; this._handled = false; @@ -33005,7 +33024,7 @@ function handle(self, deferred) { return; } self._handled = true; - Promise._immediateFn(function() { + Promise._immediateFn(function () { var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { (self._state === 1 ? resolve : reject)(deferred.promise, self._value); @@ -33025,12 +33044,8 @@ function handle(self, deferred) { function resolve(self, newValue) { try { // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { + if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && ((typeof newValue === 'undefined' ? 'undefined' : _typeof(newValue)) === 'object' || typeof newValue === 'function')) { var then = newValue.then; if (newValue instanceof Promise) { self._state = 3; @@ -33058,7 +33073,7 @@ function reject(self, newValue) { function finale(self) { if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function() { + Promise._immediateFn(function () { if (!self._handled) { Promise._unhandledRejectionFn(self._value); } @@ -33086,18 +33101,15 @@ function Handler(onFulfilled, onRejected, promise) { function doResolve(fn, self) { var done = false; try { - fn( - function(value) { - if (done) return; - done = true; - resolve(self, value); - }, - function(reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); + fn(function (value) { + if (done) return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) return; + done = true; + reject(self, reason); + }); } catch (ex) { if (done) return; done = true; @@ -33105,53 +33117,34 @@ function doResolve(fn, self) { } } -Promise.prototype['catch'] = function(onRejected) { +Promise.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; -Promise.prototype.then = function(onFulfilled, onRejected) { +Promise.prototype.then = function (onFulfilled, onRejected) { var prom = new this.constructor(noop); handle(this, new Handler(onFulfilled, onRejected, prom)); return prom; }; -Promise.prototype['finally'] = function(callback) { - var constructor = this.constructor; - return this.then( - function(value) { - return constructor.resolve(callback()).then(function() { - return value; - }); - }, - function(reason) { - return constructor.resolve(callback()).then(function() { - return constructor.reject(reason); - }); - } - ); -}; +Promise.prototype['finally'] = _finally2.default; -Promise.all = function(arr) { - return new Promise(function(resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); +Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array'); var args = Array.prototype.slice.call(arr); if (args.length === 0) return resolve([]); var remaining = args.length; function res(i, val) { try { - if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val && ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' || typeof val === 'function')) { var then = val.then; if (typeof then === 'function') { - then.call( - val, - function(val) { - res(i, val); - }, - reject - ); + then.call(val, function (val) { + res(i, val); + }, reject); return; } } @@ -33170,24 +33163,24 @@ Promise.all = function(arr) { }); }; -Promise.resolve = function(value) { - if (value && typeof value === 'object' && value.constructor === Promise) { +Promise.resolve = function (value) { + if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Promise) { return value; } - return new Promise(function(resolve) { + return new Promise(function (resolve) { resolve(value); }); }; -Promise.reject = function(value) { - return new Promise(function(resolve, reject) { +Promise.reject = function (value) { + return new Promise(function (resolve, reject) { reject(value); }); }; -Promise.race = function(values) { - return new Promise(function(resolve, reject) { +Promise.race = function (values) { + return new Promise(function (resolve, reject) { for (var i = 0, len = values.length; i < len; i++) { values[i].then(resolve, reject); } @@ -33195,14 +33188,11 @@ Promise.race = function(values) { }; // Use polyfill for setImmediate for performance gains -Promise._immediateFn = - (typeof setImmediate === 'function' && - function(fn) { - setImmediate(fn); - }) || - function(fn) { - setTimeoutFunc(fn, 0); - }; +Promise._immediateFn = typeof setImmediate === 'function' && function (fn) { + setImmediate(fn); +} || function (fn) { + setTimeoutFunc(fn, 0); +}; Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { if (typeof console !== 'undefined' && console) { @@ -33210,8 +33200,7 @@ Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { } }; -module.exports = Promise; - +exports.default = Promise; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(79).setImmediate)) /***/ }), @@ -33671,6 +33660,30 @@ process.umask = function() { return 0; }; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (callback) { + var constructor = this.constructor; + return this.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + }); +}; + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + /** * Before using methods you should get first the module from the editor instance, in this way: * @@ -33682,9 +33695,9 @@ process.umask = function() { return 0; }; */ module.exports = function () { var c = {}, - defaults = __webpack_require__(83), - Devices = __webpack_require__(84), - DevicesView = __webpack_require__(86); + defaults = __webpack_require__(84), + Devices = __webpack_require__(85), + DevicesView = __webpack_require__(87); var devices, view; return { @@ -33785,7 +33798,7 @@ module.exports = function () { }; /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33798,7 +33811,7 @@ module.exports = { }; /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33810,14 +33823,14 @@ var _backbone2 = _interopRequireDefault(_backbone); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var Device = __webpack_require__(85); +var Device = __webpack_require__(86); module.exports = _backbone2.default.Collection.extend({ model: Device }); /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33854,7 +33867,7 @@ module.exports = _backbone2.default.Model.extend({ }); /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33951,7 +33964,7 @@ module.exports = _backbone2.default.View.extend({ }); /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33959,8 +33972,8 @@ module.exports = _backbone2.default.View.extend({ module.exports = function () { var c = {}, - defaults = __webpack_require__(88), - parserCss = __webpack_require__(89), + defaults = __webpack_require__(89), + parserCss = __webpack_require__(90), parserHtml = __webpack_require__(27); var pHtml, pCss; @@ -34016,7 +34029,7 @@ module.exports = function () { }; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34027,7 +34040,7 @@ module.exports = { }; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34238,7 +34251,7 @@ module.exports = function (config) { }; /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34308,10 +34321,10 @@ module.exports = function (config) { var _ref; var c = config || {}, - defaults = __webpack_require__(91), + defaults = __webpack_require__(92), Selector = __webpack_require__(8), Selectors = __webpack_require__(11), - ClassTagsView = __webpack_require__(92); + ClassTagsView = __webpack_require__(93); var selectors, selectorTags; return _ref = { @@ -34428,7 +34441,7 @@ module.exports = function (config) { }; /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34458,7 +34471,7 @@ module.exports = { }; /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34474,7 +34487,7 @@ var _backbone2 = _interopRequireDefault(_backbone); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ClassTagView = __webpack_require__(93); +var ClassTagView = __webpack_require__(94); module.exports = _backbone2.default.View.extend({ template: _underscore2.default.template('\n