From 9941ea6c27607a07a771b63ea2a51fd7f17c371f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 9 Feb 2018 01:06:00 +0100 Subject: [PATCH] Test build --- dist/grapes.js | 2017 +++++++++++++++++++++++++++--------------------- 1 file changed, 1134 insertions(+), 883 deletions(-) diff --git a/dist/grapes.js b/dist/grapes.js index 661c66236..05cd9502e 100644 --- a/dist/grapes.js +++ b/dist/grapes.js @@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 59); +/******/ return __webpack_require__(__webpack_require__.s = 60); /******/ }) /************************************************************************/ /******/ ([ @@ -3806,6 +3806,7 @@ module.exports = Backbone.View.extend({ var selectedCls = pfx + 'selected'; var selectedParentCls = selectedCls + '-parent'; var freezedCls = ppfx + 'freezed'; + this.$el.removeClass(selectedCls + ' ' + selectedParentCls + ' ' + freezedCls); var actualCls = el.getAttribute('class') || ''; var cls = ''; @@ -3819,8 +3820,9 @@ module.exports = Backbone.View.extend({ case 'freezed': cls = actualCls + ' ' + freezedCls; break; - default: - this.$el.removeClass(selectedCls + ' ' + selectedParentCls + ' ' + freezedCls); + case 'freezed-selected': + cls = actualCls + ' ' + freezedCls + ' ' + selectedCls; + break; } cls = cls.trim(); @@ -4072,7 +4074,7 @@ var Backbone = __webpack_require__(0); var Components = __webpack_require__(50); var Selector = __webpack_require__(7); var Selectors = __webpack_require__(10); -var Traits = __webpack_require__(150); +var Traits = __webpack_require__(151); var componentList = {}; var componentIndex = 0; @@ -4977,6 +4979,7 @@ module.exports = Backbone.View.extend({ } em && em.on('update:component:style:' + this.property, this.targetUpdated); + //em && em.on(`styleable:change:${this.property}`, this.targetUpdated); this.listenTo(this.propTarget, 'update', this.targetUpdated); this.listenTo(model, 'destroy remove', this.remove); this.listenTo(model, 'change:value', this.modelValueChanged); @@ -5024,9 +5027,9 @@ module.exports = Backbone.View.extend({ /** * Clear the property from the target */ - clear: function clear() { - var target = this.getTargetModel(); - target.removeStyle(this.model.get('property')); + clear: function clear(e) { + e && e.stopPropagation(); + this.model.clearValue(); this.targetUpdated(); }, @@ -5365,7 +5368,7 @@ module.exports = Backbone.View.extend({ * */ setValue: function setValue(value) { var model = this.model; - var val = value || model.getDefaultValue(); + var val = (0, _underscore.isUndefined)(value) ? model.getDefaultValue() : value; var input = this.getInputEl(); input && (input.value = val); }, @@ -16349,7 +16352,7 @@ var Property = __webpack_require__(12); module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.default).extend({ types: [{ id: 'stack', - model: __webpack_require__(119), + model: __webpack_require__(120), view: __webpack_require__(34), isType: function isType(value) { if (value && value.type == 'stack') { @@ -16403,8 +16406,8 @@ module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.d } }, { id: 'slider', - model: __webpack_require__(125), - view: __webpack_require__(126), + model: __webpack_require__(126), + view: __webpack_require__(127), isType: function isType(value) { if (value && value.type == 'slider') { return value; @@ -16475,6 +16478,8 @@ module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.d 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 _underscore = __webpack_require__(1); + module.exports = __webpack_require__(0).Model.extend({ defaults: { name: '', @@ -16511,6 +16516,18 @@ module.exports = __webpack_require__(0).Model.extend({ }, + /** + * Clear the value + * @return {this} + */ + clearValue: function clearValue() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.set({ value: undefined }, opts); + return this; + }, + + /** * Update value * @param {any} value @@ -16601,13 +16618,13 @@ module.exports = __webpack_require__(0).Model.extend({ */ getFullValue: function getFullValue(val) { var fn = this.get('functionName'); - var value = val || this.get('value'); + var value = (0, _underscore.isUndefined)(val) ? this.get('value') : val; - if (fn) { + if (fn && !(0, _underscore.isUndefined)(value)) { value = fn + '(' + value + ')'; } - return value; + return value || ''; } }); @@ -16636,6 +16653,7 @@ module.exports = Backbone.View.extend({ this.onChange = o.onChange; this.onInputRender = o.onInputRender || {}; this.customValue = o.customValue || {}; + this.properties = []; var coll = this.collection; this.listenTo(coll, 'add', this.addTo); this.listenTo(coll, 'reset', this.render); @@ -16661,6 +16679,7 @@ module.exports = Backbone.View.extend({ view.render(); var el = view.el; + this.properties.push(view); if (frag) { frag.appendChild(el); @@ -16671,6 +16690,7 @@ module.exports = Backbone.View.extend({ render: function render() { var _this = this; + this.properties = []; var fragment = document.createDocumentFragment(); this.collection.each(function (model) { return _this.add(model, fragment); @@ -16690,9 +16710,11 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */(function(Backbone) { var InputNumber = __webpack_require__(18); +var PropertyView = __webpack_require__(5); var $ = Backbone.$; +var timeout = void 0; -module.exports = __webpack_require__(5).extend({ +module.exports = PropertyView.extend({ templateInput: function templateInput() { return ''; }, @@ -16702,6 +16724,8 @@ module.exports = __webpack_require__(5).extend({ this.listenTo(model, 'el:change', this.elementUpdated); }, setValue: function setValue(value) { + var parsed = this.model.parseValue(value); + value = '' + parsed.value + parsed.unit; this.inputInst.setValue(value, { silent: 1 }); }, onRender: function onRender() { @@ -16872,6 +16896,13 @@ module.exports = PropertyView.extend({ PropertyView.prototype.inputValueChanged.apply(this, args); } }, + clear: function clear(e) { + var props = this.properties; + props && props.forEach(function (propView) { + return propView.clear(); + }); + PropertyView.prototype.clear.apply(this, arguments); + }, /** @@ -16881,6 +16912,7 @@ module.exports = PropertyView.extend({ var model = this.model; var props = model.get('properties') || []; var self = this; + this.properties = []; if (props.length) { if (!this.$input) { @@ -16905,6 +16937,7 @@ module.exports = PropertyView.extend({ var PropertiesView = __webpack_require__(13); var propsView = new PropertiesView(this.getPropsConfig()); this.$props = propsView.render().$el; + this.properties = propsView.properties; this.$el.find('#' + this.pfx + 'input-holder').append(this.$props); } } @@ -17218,7 +17251,8 @@ module.exports = Input.extend({ var force = 0; var opt = opts || {}; var model = this.model; - var val = value !== '' ? value : model.get('defaults'); + var defValue = ''; //model.get('defaults'); + var val = !(0, _underscore.isUndefined)(value) ? value : defValue; var units = model.get('units') || []; var unit = model.get('unit') || units.length && units[0] || ''; var max = model.get('max'); @@ -17238,7 +17272,7 @@ module.exports = Input.extend({ var valCopy = val + ''; val += ''; // Make it suitable for replace val = parseFloat(val.replace(',', '.')); - val = !isNaN(val) ? val : model.get('defaults'); + val = !isNaN(val) ? val : defValue; var uN = valCopy.replace(val, ''); // Check if exists as unit if (_.indexOf(units, uN) >= 0) unit = uN; @@ -17246,9 +17280,8 @@ module.exports = Input.extend({ } } - if (typeof max !== 'undefined' && max !== '') val = val > max ? max : val; - - if (typeof min !== 'undefined' && min !== '') val = val < min ? min : val; + if (!(0, _underscore.isUndefined)(max) && max !== '') val = val > max ? max : val; + if (!(0, _underscore.isUndefined)(min) && min !== '') val = val < min ? min : val; return { force: force, @@ -17463,8 +17496,8 @@ var _underscore = __webpack_require__(1); var _mixins = __webpack_require__(2); -var ToolbarView = __webpack_require__(187); -var Toolbar = __webpack_require__(189); +var ToolbarView = __webpack_require__(189); +var Toolbar = __webpack_require__(191); var key = __webpack_require__(23); var $ = __webpack_require__(0).$; var showOffsets = void 0; @@ -17516,7 +17549,7 @@ module.exports = { methods[method](body, 'mouseover', this.onHover); methods[method](body, 'mouseout', this.onOut); methods[method](body, 'click', this.onClick); - methods[method](win, 'scroll', this.onFrameScroll); + methods[method](win, 'scroll resize', this.onFrameScroll); methods[method](win, 'keydown', this.onKeyPress); em[method]('change:selectedComponent', this.onSelect, this); }, @@ -18062,7 +18095,7 @@ module.exports = { "use strict"; /* WEBPACK VAR INJECTION */(function(Backbone, _) { -var SelectPosition = __webpack_require__(54); +var SelectPosition = __webpack_require__(57); var $ = Backbone.$; module.exports = _.extend({}, SelectPosition, { @@ -18609,7 +18642,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _promisePolyfill = __webpack_require__(75); +var _promisePolyfill = __webpack_require__(76); var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill); @@ -19766,7 +19799,7 @@ module.exports = Backbone.Model.extend({ var Backbone = __webpack_require__(0); -var Button = __webpack_require__(109); +var Button = __webpack_require__(110); module.exports = Backbone.Collection.extend({ model: Button, @@ -19846,6 +19879,8 @@ module.exports = Backbone.Collection.extend({ "use strict"; +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__(30); @@ -19906,7 +19941,7 @@ module.exports = Backbone.View.extend({ cl = resz[3]; } - var resizer = editor.Utils.Resizer.init({ + var resizer = editor.Utils.Resizer.init(_extends({ tc: tc, cr: cr, bc: bc, @@ -19916,36 +19951,53 @@ module.exports = Backbone.View.extend({ bl: 0, br: 0, appendTo: this.el, + silentFrames: 1, + avoidContainerUpdate: 1, prefix: editor.getConfig().stylePrefix, - posFetcher: function posFetcher(el) { + onEnd: function onEnd() { + em && em.trigger('change:canvasOffset'); + }, + + posFetcher: function posFetcher(el, _ref) { + var target = _ref.target; + + var style = el.style; + var config = resizer.getConfig(); + var keyWidth = config.keyWidth; + var keyHeight = config.keyHeight; var rect = el.getBoundingClientRect(); + var forContainer = target == 'container'; + var styleWidth = style[keyWidth]; + var styleHeight = style[keyHeight]; + var width = styleWidth && !forContainer ? parseFloat(styleWidth) : rect.width; + var height = styleHeight && !forContainer ? parseFloat(styleHeight) : rect.height; return { left: 0, top: 0, - width: rect.width, - height: rect.height + width: width, + height: height }; } - }); + }, resizable)); resizer.blur = function () {}; resizer.focus(this.el); } }, render: function render() { - var el = this.$el; - var pfx = this.ppfx; - el.attr('class', this.className + ' ' + pfx + 'one-bg'); - this.id && el.attr('id', this.id); + var $el = this.$el; + var ppfx = this.ppfx; + var cls = this.className + ' ' + this.id + ' ' + ppfx + 'one-bg ' + ppfx + 'two-color'; + $el.addClass(cls); if (this.buttons.length) { var buttons = new ButtonsView({ collection: this.buttons, config: this.config }); - el.append(buttons.render().el); + $el.append(buttons.render().el); } - el.append(this.model.get('content')); + $el.append(this.model.get('content')); return this; } }); @@ -19958,7 +20010,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */(function(_) { var Backbone = __webpack_require__(0); -var ButtonView = __webpack_require__(111); +var ButtonView = __webpack_require__(112); module.exports = Backbone.View.extend({ initialize: function initialize(o) { @@ -20031,54 +20083,56 @@ module.exports = Backbone.View.extend({ "use strict"; -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 _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; }; /** + * With Style Manager you basically build categories (called sectors) of CSS properties which could + * be used to custom components and classes. + * You can init the editor with all sectors and properties via configuration + * + * ```js + * var editor = grapesjs.init({ + * ... + * styleManager: {...} // Check below for the possible properties + * ... + * }); + * ``` + * + * Before using methods you should get first the module from the editor instance, in this way: + * + * ```js + * var styleManager = editor.StyleManager; + * ``` + * + * @module StyleManager + * @param {Object} config Configurations + * @param {Array} [config.sectors=[]] Array of possible sectors + * @example + * ... + * styleManager: { + * sectors: [{ + * id: 'dim', + * name: 'Dimension', + * properties: [{ + * name: 'Width', + * property: 'width', + * type: 'integer', + * units: ['px', '%'], + * defaults: 'auto', + * min: 0, + }], + * }], + * } + * ... + */ + + +var _underscore = __webpack_require__(1); -/** - * With Style Manager you basically build categories (called sectors) of CSS properties which could - * be used to custom components and classes. - * You can init the editor with all sectors and properties via configuration - * - * ```js - * var editor = grapesjs.init({ - * ... - * styleManager: {...} // Check below for the possible properties - * ... - * }); - * ``` - * - * Before using methods you should get first the module from the editor instance, in this way: - * - * ```js - * var styleManager = editor.StyleManager; - * ``` - * - * @module StyleManager - * @param {Object} config Configurations - * @param {Array} [config.sectors=[]] Array of possible sectors - * @example - * ... - * styleManager: { - * sectors: [{ - * id: 'dim', - * name: 'Dimension', - * properties: [{ - * name: 'Width', - * property: 'width', - * type: 'integer', - * units: ['px', '%'], - * defaults: 'auto', - * min: 0, - }], - * }], - * } - * ... - */ module.exports = function () { var c = {}, - defaults = __webpack_require__(116), - Sectors = __webpack_require__(117), + defaults = __webpack_require__(117), + Sectors = __webpack_require__(118), Properties = __webpack_require__(11), - SectorsView = __webpack_require__(128); + SectorsView = __webpack_require__(129); var properties = void 0; var sectors, SectView; @@ -20122,6 +20176,14 @@ module.exports = function () { }); return this; }, + postRender: function postRender() { + var elTo = this.getConfig().appendTo; + + if (elTo) { + var el = (0, _underscore.isElement)(elTo) ? elTo : document.querySelector(elTo); + el.appendChild(this.render()); + } + }, /** @@ -20612,11 +20674,25 @@ module.exports = Property.extend({ }, + /** + * Clear the value + * @return {this} + */ + clearValue: function clearValue() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.get('properties').each(function (property) { + return property.clearValue(); + }); + return Property.prototype.clearValue.apply(this, arguments); + }, + + /** * Update property values */ updateValues: function updateValues() { - var values = this.get('value').split(this.get('separator')); + var values = this.getFullValue().split(this.get('separator')); this.get('properties').each(function (property, i) { var len = values.length; // Try to get value from a shorthand: @@ -20665,7 +20741,7 @@ module.exports = Property.extend({ var PropertyCompositeView = __webpack_require__(17); -var LayersView = __webpack_require__(123); +var LayersView = __webpack_require__(124); module.exports = PropertyCompositeView.extend({ templateInput: function templateInput() { @@ -20682,6 +20758,12 @@ module.exports = PropertyCompositeView.extend({ this.listenTo(model, 'updateValue', this.inputValueChanged); this.delegateEvents(); }, + clear: function clear(e) { + e && e.stopPropagation(); + this.model.get('layers').reset(); + this.model.clearValue(); + this.targetUpdated(); + }, /** @@ -21084,7 +21166,7 @@ module.exports = __webpack_require__(14).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; }; -__webpack_require__(122); +__webpack_require__(123); var Input = __webpack_require__(35); var $ = Backbone.$; @@ -21361,6 +21443,8 @@ module.exports = Property.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 _underscore = __webpack_require__(1); + var Property = __webpack_require__(12); var InputNumber = __webpack_require__(18); @@ -21391,6 +21475,12 @@ module.exports = Property.extend({ this.set('unit', units[0]); } }, + clearValue: function clearValue() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.set({ value: undefined, unit: undefined }, opts); + return this; + }, parseValue: function parseValue(val) { var parsed = Property.prototype.parseValue.apply(this, arguments); @@ -21405,7 +21495,11 @@ module.exports = Property.extend({ return parsed; }, getFullValue: function getFullValue() { - var value = this.get('value') + this.get('unit'); + var value = this.get('value'); + var unit = this.get('unit'); + value = !(0, _underscore.isUndefined)(value) ? value : ''; + unit = !(0, _underscore.isUndefined)(unit) && value ? unit : ''; + value = '' + value + unit; return Property.prototype.getFullValue.apply(this, [value]); } }); @@ -22207,7 +22301,12 @@ exports.default = { this.set('style', propNew, opts); var diff = (0, _mixins.shallowDiff)(propOrig, propNew); (0, _underscore.keys)(diff).forEach(function (pr) { - return _this.trigger('change:style:' + pr); + var em = _this.em; + _this.trigger('change:style:' + pr); + if (em) { + em.trigger('styleable:change'); + em.trigger('styleable:change:' + pr); + } }); return propNew; @@ -22730,202 +22829,111 @@ module.exports = ComponentView.extend({ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(Backbone) { - -var $ = Backbone.$; - -module.exports = { - /** - * Start select position event - * @param {HTMLElement} trg - * @private - * */ - startSelectPosition: function startSelectPosition(trg, doc) { - this.isPointed = false; - var utils = this.editorModel.get('Utils'); - if (utils && !this.sorter) this.sorter = new utils.Sorter({ - container: this.getCanvasBody(), - placer: this.canvas.getPlacerEl(), - containerSel: '*', - itemSel: '*', - pfx: this.ppfx, - direction: 'a', - document: doc, - wmargin: 1, - nested: 1, - em: this.editorModel, - canvasRelative: 1 - }); - this.sorter.startSort(trg); - }, - - - /** - * Get frame position - * @return {Object} - * @private - */ - getOffsetDim: function getOffsetDim() { - var frameOff = this.offset(this.canvas.getFrameEl()); - var canvasOff = this.offset(this.canvas.getElement()); - var top = frameOff.top - canvasOff.top; - var left = frameOff.left - canvasOff.left; - return { top: top, left: left }; - }, - /** - * Stop select position event - * @private - * */ - stopSelectPosition: function stopSelectPosition() { - this.posTargetCollection = null; - this.posIndex = this.posMethod == 'after' && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex; //Normalize - if (this.sorter) { - this.sorter.moved = 0; - this.sorter.endMove(); - } - if (this.cDim) { - this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == 'after' && this.posIndex == this.cDim.length; - this.posTargetEl = this.cDim.length === 0 ? $(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? $(this.cDim[this.posIndex][5]).parent() : $(this.outsideElem); - this.posTargetModel = this.posTargetEl.data('model'); - this.posTargetCollection = this.posTargetEl.data('model-comp'); - } - }, - - - /** - * Enabel select position - * @private - */ - enable: function enable() { - this.startSelectPosition(); - }, +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__(177); - /** - * Check if the pointer is near to the float component - * @param {number} index - * @param {string} method - * @param {Array} dims - * @return {Boolean} - * @private - * */ - nearFloat: function nearFloat(index, method, dims) { - var i = index || 0; - var m = method || 'before'; - var len = dims.length; - var isLast = len !== 0 && m == 'after' && i == len; - if (len !== 0 && (!isLast && !dims[i][4] || dims[i - 1] && !dims[i - 1][4] || isLast && !dims[i - 1][4])) return 1; - return 0; - }, - run: function run() { - this.enable(); - }, - stop: function stop() { - this.stopSelectPosition(); - this.$wrapper.css('cursor', ''); - this.$wrapper.unbind(); - } -}; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +var _config2 = _interopRequireDefault(_config); -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { +var _ItemView = __webpack_require__(55); -"use strict"; -/* WEBPACK VAR INJECTION */(function(_) { +var _ItemView2 = _interopRequireDefault(_ItemView); -var Backbone = __webpack_require__(0); -var CreateComponent = __webpack_require__(22); +var _ItemsView = __webpack_require__(56); -module.exports = _.extend({}, CreateComponent, { - init: function init() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } +var _ItemsView2 = _interopRequireDefault(_ItemsView); - CreateComponent.init.apply(this, args); - _.bindAll(this, 'insertComponent'); - this.allowDraw = 0; - }, +var _underscore = __webpack_require__(1); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Run method - * @private - * */ - run: function run(em, sender, options) { - this.em = em; - this.sender = sender; - this.opt = options || {}; - this.$wr = this.$wrapper; - this.enable(); - }, - enable: function enable() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } +module.exports = function () { + var em = void 0; + var layers = void 0; + var config = {}; + var View = _ItemsView2.default; - CreateComponent.enable.apply(this, args); - this.$wr.on('click', this.insertComponent); - }, + return { + name: 'LayerManager', + init: function init() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - /** - * Start insert event - * @private - * */ - insertComponent: function insertComponent() { - this.$wr.off('click', this.insertComponent); - this.stopSelectPosition(); - var object = this.buildContent(); - this.beforeInsert(object); - var index = this.sorter.lastPos.index; - // By default, collections do not trigger add event, so silent is used - var model = this.create(this.sorter.target, object, index, null, { - silent: false - }); + config = _extends({}, _config2.default, opts); + config.stylePrefix = opts.pStylePrefix; + em = config.em; - if (this.opt.terminateAfterInsert && this.sender) this.sender.set('active', false);else this.enable(); + return this; + }, + onLoad: function onLoad() { + var collection = em.get('DomComponents').getComponents(); + var parent = collection.parent; + var options = { + level: 0, + config: config, + opened: config.opened || {} + }; - if (!model) return; + // Show wrapper if requested + if (config.showWrapper && parent) { + View = _ItemView2.default; + options.model = parent; + } else { + options.collection = collection; + } - this.afterInsert(model, this); - }, + layers = new View(options); + em && em.on('component:selected', this.componentChanged); + this.componentChanged(); + }, + postRender: function postRender() { + var elTo = config.appendTo; + if (elTo) { + var el = (0, _underscore.isElement)(elTo) ? elTo : document.querySelector(elTo); + el.appendChild(this.render()); + } + }, - /** - * Trigger before insert - * @param {Object} obj - * @private - * */ - beforeInsert: function beforeInsert(obj) {}, + /** + * Return the view of layers + * @return {View} + */ + getAll: function getAll() { + return layers; + }, - /** - * Trigger after insert - * @param {Object} model Model created after insert - * @private - * */ - afterInsert: function afterInsert(model) {}, + /** + * Triggered when the selected component is changed + * @private + */ + componentChanged: function componentChanged(e, md) { + var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - /** - * Create different object, based on content, to insert inside canvas - * - * @return {Object} - * @private - * */ - buildContent: function buildContent() { - return this.opt.content || {}; - } -}); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) + if (opts.fromLayers) return; + var opened = em.get('opened'); + var model = em.getSelected(); + var parent = model && model.collection ? model.collection.parent : null; + for (var cid in opened) { + opened[cid].set('open', 0); + }while (parent) { + parent.set('open', 1); + opened[parent.cid] = parent; + parent = parent.collection ? parent.collection.parent : null; + } + }, + render: function render() { + return layers.render().el; + } + }; +}; /***/ }), -/* 56 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22934,6 +22942,7 @@ module.exports = _.extend({}, CreateComponent, { var _underscore = __webpack_require__(1); var ComponentView = __webpack_require__(3); +var inputProp = 'contentEditable'; var ItemsView = void 0; module.exports = __webpack_require__(0).View.extend({ @@ -22942,8 +22951,8 @@ module.exports = __webpack_require__(0).View.extend({ 'click [data-toggle-visible]': 'toggleVisibility', 'click [data-toggle-select]': 'handleSelect', 'click [data-toggle-open]': 'toggleOpening', - 'dblclick input': 'handleEdit', - 'focusout input': 'handleEditEnd' + 'dblclick [data-name]': 'handleEdit', + 'focusout [data-name]': 'handleEditEnd' }, template: function template(model) { @@ -22951,9 +22960,15 @@ module.exports = __webpack_require__(0).View.extend({ var ppfx = this.ppfx; var hidable = this.config.hidable; var count = this.countChildren(model); - var addClass = !count ? pfx + 'no-chld' : ''; + var addClass = !count ? this.clsNoChild : ''; + var clsTitle = this.clsTitle + ' ' + addClass; + var clsTitleC = this.clsTitleC + ' ' + ppfx + 'one-bg'; + var clsCaret = this.clsCaret + ' fa fa-chevron-right'; + var clsInput = this.inputNameCls + ' ' + ppfx + 'no-app'; var level = this.level + 1; - return '\n ' + (hidable ? '' : '') + '\n\n
\n
\n
\n \n ' + model.getIcon() + '\n \n
\n
\n
\n
' + (count ? count : '') + '
\n
\n \n
\n
\n '; + var gut = 30 + level * 10 + 'px'; + var name = model.getName(); + return '\n ' + (hidable ? '' : '') + '\n\n
\n
\n
\n \n ' + model.getIcon() + '\n ' + name + '\n
\n
\n
\n
' + (count || '') + '
\n
\n \n
\n
\n '; }, initialize: function initialize() { var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -22975,17 +22990,21 @@ module.exports = __webpack_require__(0).View.extend({ this.listenTo(model, 'change:status', this.updateStatus); this.listenTo(model, 'change:open', this.updateOpening); this.listenTo(model, 'change:style:display', this.updateVisibility); - this.className = pfx + 'item no-select'; - this.editBtnCls = pfx + 'nav-item-edit'; - this.inputNameCls = ppfx + 'nav-comp-name'; - this.caretCls = ppfx + 'nav-item-caret'; - this.titleCls = pfx + 'title'; + this.className = pfx + 'layer no-select ' + ppfx + 'two-color'; + this.inputNameCls = ppfx + 'layer-name'; + this.clsTitleC = pfx + 'layer-title-c'; + this.clsTitle = pfx + 'layer-title'; + this.clsCaret = pfx + 'layer-caret'; + this.clsCount = pfx + 'layer-count'; + this.clsMove = pfx + 'layer-move'; + this.clsChildren = pfx + 'layer-children'; + this.clsNoChild = pfx + 'layer-no-chld'; this.$el.data('model', model); this.$el.data('collection', components); }, getVisibilityEl: function getVisibilityEl() { if (!this.eyeEl) { - this.eyeEl = this.$el.children('#' + this.pfx + 'btn-eye'); + this.eyeEl = this.$el.children('.' + this.pfx + 'layer-vis'); } return this.eyeEl; @@ -22993,7 +23012,7 @@ module.exports = __webpack_require__(0).View.extend({ updateVisibility: function updateVisibility() { var pfx = this.pfx; var model = this.model; - var hClass = pfx + 'hide'; + var hClass = pfx + 'layer-hidden'; var hideIcon = 'fa-eye-slash'; var hidden = model.getStyle().display == 'none'; var method = hidden ? 'addClass' : 'removeClass'; @@ -23028,10 +23047,10 @@ module.exports = __webpack_require__(0).View.extend({ * Handle the edit of the component name */ handleEdit: function handleEdit(e) { - e.stopPropagation(); - var inputName = this.getInputName(); - inputName.readOnly = false; - inputName.focus(); + e && e.stopPropagation(); + var inputEl = this.getInputName(); + inputEl[inputProp] = true; + inputEl.focus(); }, @@ -23039,10 +23058,11 @@ module.exports = __webpack_require__(0).View.extend({ * Handle with the end of editing of the component name */ handleEditEnd: function handleEditEnd(e) { - e.stopPropagation(); - var inputName = this.getInputName(); - inputName.readOnly = true; - this.model.set('custom-name', inputName.value); + e && e.stopPropagation(); + var inputEl = this.getInputName(); + var name = inputEl.textContent; + inputEl[inputProp] = false; + this.model.set({ name: name }); }, @@ -23110,13 +23130,10 @@ module.exports = __webpack_require__(0).View.extend({ * */ startSort: function startSort(e) { e.stopPropagation(); - - //Right or middel click - if (e.button !== 0) { - return; - } - - this.sorter && this.sorter.startSort(e.target); + var sorter = this.sorter; + // Right or middel click + if (e.button !== 0) return; + sorter && sorter.startSort(e.target); }, @@ -23170,19 +23187,19 @@ module.exports = __webpack_require__(0).View.extend({ var model = this.model; var c = this.countChildren(model); var pfx = this.pfx; - var noChildCls = pfx + 'no-chld'; - var title = this.$el.children('.' + pfx + 'title-c').children('.' + pfx + 'title'); - //tC = `> .${pfx}title-c > .${pfx}title`; - if (!this.$counter) { - this.$counter = this.$el.children('#' + pfx + 'counter'); + var noChildCls = this.clsNoChild; + var title = this.$el.children('.' + this.clsTitleC).children('.' + this.clsTitle); + + if (!this.cnt) { + this.cnt = this.$el.children('.' + this.clsCount); } if (c) { title.removeClass(noChildCls); - this.$counter.html(c); + this.cnt.html(c); } else { title.addClass(noChildCls); - this.$counter.empty(); + this.cnt.empty(); model.set('open', 0); } }, @@ -23207,7 +23224,7 @@ module.exports = __webpack_require__(0).View.extend({ getCaret: function getCaret() { if (!this.caret) { var pfx = this.pfx; - this.caret = this.$el.children('.' + pfx + 'title-c').find('#' + pfx + 'caret'); + this.caret = this.$el.children('.' + this.clsTitleC).find('.' + this.clsCaret); } return this.caret; @@ -23221,7 +23238,7 @@ module.exports = __webpack_require__(0).View.extend({ el.html(this.template(model)); if ((0, _underscore.isUndefined)(ItemsView)) { - ItemsView = __webpack_require__(57); + ItemsView = __webpack_require__(56); } var children = new ItemsView({ @@ -23232,10 +23249,10 @@ module.exports = __webpack_require__(0).View.extend({ parent: model, level: level }).render().$el; - el.find('.' + pfx + 'children').append(children); + el.find('.' + this.clsChildren).append(children); if (!model.get('draggable') || !this.config.sortable) { - el.children('#' + pfx + 'move').remove(); + el.children('.' + this.clsMove).remove(); } !vis && (this.className += ' ' + pfx + 'hide'); @@ -23248,16 +23265,15 @@ module.exports = __webpack_require__(0).View.extend({ }); /***/ }), -/* 57 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Backbone = __webpack_require__(0); -var ItemView = __webpack_require__(56); +var ItemView = __webpack_require__(55); -module.exports = Backbone.View.extend({ +module.exports = __webpack_require__(0).View.extend({ initialize: function initialize() { var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; @@ -23269,33 +23285,39 @@ module.exports = Backbone.View.extend({ this.ppfx = config.pStylePrefix || ''; this.pfx = config.stylePrefix || ''; this.parent = o.parent; - this.listenTo(this.collection, 'add', this.addTo); - this.listenTo(this.collection, 'reset resetNavigator', this.render); - this.className = this.pfx + 'items'; + var pfx = this.pfx; + var ppfx = this.ppfx; + var parent = this.parent; + var coll = this.collection; + this.listenTo(coll, 'add', this.addTo); + this.listenTo(coll, 'reset resetNavigator', this.render); + this.className = pfx + 'layers'; + var em = config.em; if (config.sortable && !this.opt.sorter) { - var pfx = this.pfx; - var utils = config.em.get('Utils'); + var utils = em.get('Utils'); this.opt.sorter = new utils.Sorter({ container: config.sortContainer || this.el, - containerSel: '.' + pfx + 'items', - itemSel: '.' + pfx + 'item', - ppfx: this.ppfx, + containerSel: '.' + this.className, + itemSel: '.' + pfx + 'layer', ignoreViewChildren: 1, + onEndMove: function onEndMove(created, sorter) { + var srcModel = sorter.getSourceModel(); + em.setSelected(srcModel, { forceChange: 1 }); + }, + avoidSelectOnEnd: 1, - pfx: pfx, - nested: 1 + nested: 1, + ppfx: ppfx, + pfx: pfx }); } this.sorter = this.opt.sorter || ''; // For the sorter - this.$el.data('collection', this.collection); - - if (this.parent) { - this.$el.data('model', this.parent); - } + this.$el.data('collection', coll); + parent && this.$el.data('model', parent); }, @@ -23378,20 +23400,220 @@ module.exports = Backbone.View.extend({ var _this = this; var frag = document.createDocumentFragment(); - this.el.innerHTML = ''; + var el = this.el; + el.innerHTML = ''; this.collection.each(function (model) { return _this.addToCollection(model, frag); }); - this.el.appendChild(frag); - this.$el.attr('class', this.className); + el.appendChild(frag); + el.className = this.className; return this; } }); +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Backbone) { + +var $ = Backbone.$; + +module.exports = { + /** + * Start select position event + * @param {HTMLElement} trg + * @private + * */ + startSelectPosition: function startSelectPosition(trg, doc) { + this.isPointed = false; + var utils = this.editorModel.get('Utils'); + if (utils && !this.sorter) this.sorter = new utils.Sorter({ + container: this.getCanvasBody(), + placer: this.canvas.getPlacerEl(), + containerSel: '*', + itemSel: '*', + pfx: this.ppfx, + direction: 'a', + document: doc, + wmargin: 1, + nested: 1, + em: this.editorModel, + canvasRelative: 1 + }); + trg && this.sorter.startSort(trg); + }, + + + /** + * Get frame position + * @return {Object} + * @private + */ + getOffsetDim: function getOffsetDim() { + var frameOff = this.offset(this.canvas.getFrameEl()); + var canvasOff = this.offset(this.canvas.getElement()); + var top = frameOff.top - canvasOff.top; + var left = frameOff.left - canvasOff.left; + return { top: top, left: left }; + }, + + + /** + * Stop select position event + * @private + * */ + stopSelectPosition: function stopSelectPosition() { + this.posTargetCollection = null; + this.posIndex = this.posMethod == 'after' && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex; //Normalize + if (this.sorter) { + this.sorter.moved = 0; + this.sorter.endMove(); + } + if (this.cDim) { + this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == 'after' && this.posIndex == this.cDim.length; + this.posTargetEl = this.cDim.length === 0 ? $(this.outsideElem) : !this.posIsLastEl && this.cDim[this.posIndex] ? $(this.cDim[this.posIndex][5]).parent() : $(this.outsideElem); + this.posTargetModel = this.posTargetEl.data('model'); + this.posTargetCollection = this.posTargetEl.data('model-comp'); + } + }, + + + /** + * Enabel select position + * @private + */ + enable: function enable() { + this.startSelectPosition(); + }, + + + /** + * Check if the pointer is near to the float component + * @param {number} index + * @param {string} method + * @param {Array} dims + * @return {Boolean} + * @private + * */ + nearFloat: function nearFloat(index, method, dims) { + var i = index || 0; + var m = method || 'before'; + var len = dims.length; + var isLast = len !== 0 && m == 'after' && i == len; + if (len !== 0 && (!isLast && !dims[i][4] || dims[i - 1] && !dims[i - 1][4] || isLast && !dims[i - 1][4])) return 1; + return 0; + }, + run: function run() { + this.enable(); + }, + stop: function stop() { + this.stopSelectPosition(); + this.$wrapper.css('cursor', ''); + this.$wrapper.unbind(); + } +}; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; +/* WEBPACK VAR INJECTION */(function(_) { + +var Backbone = __webpack_require__(0); +var CreateComponent = __webpack_require__(22); + +module.exports = _.extend({}, CreateComponent, { + init: function init() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + CreateComponent.init.apply(this, args); + _.bindAll(this, 'insertComponent'); + this.allowDraw = 0; + }, + + + /** + * Run method + * @private + * */ + run: function run(em, sender, options) { + this.em = em; + this.sender = sender; + this.opt = options || {}; + this.$wr = this.$wrapper; + this.enable(); + }, + enable: function enable() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + CreateComponent.enable.apply(this, args); + this.$wr.on('click', this.insertComponent); + }, + + + /** + * Start insert event + * @private + * */ + insertComponent: function insertComponent() { + this.$wr.off('click', this.insertComponent); + this.stopSelectPosition(); + var object = this.buildContent(); + this.beforeInsert(object); + var index = this.sorter.lastPos.index; + // By default, collections do not trigger add event, so silent is used + var model = this.create(this.sorter.target, object, index, null, { + silent: false + }); + + if (this.opt.terminateAfterInsert && this.sender) this.sender.set('active', false);else this.enable(); + + if (!model) return; + + this.afterInsert(model, this); + }, + + + /** + * Trigger before insert + * @param {Object} obj + * @private + * */ + beforeInsert: function beforeInsert(obj) {}, + + + /** + * Trigger after insert + * @param {Object} model Model created after insert + * @private + * */ + afterInsert: function afterInsert(model) {}, + + + /** + * Create different object, based on content, to insert inside canvas + * + * @return {Object} + * @private + * */ + buildContent: function buildContent() { + return this.opt.content || {}; + } +}); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; @@ -23407,7 +23629,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 59 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23419,18 +23641,20 @@ var _cashDom = __webpack_require__(9); var _cashDom2 = _interopRequireDefault(_cashDom); -var _editor = __webpack_require__(60); +var _editor = __webpack_require__(61); var _editor2 = _interopRequireDefault(_editor); -var _plugin_manager = __webpack_require__(219); - -var _plugin_manager2 = _interopRequireDefault(_plugin_manager); +var _underscore = __webpack_require__(1); -var _polyfills = __webpack_require__(221); +var _polyfills = __webpack_require__(219); var _polyfills2 = _interopRequireDefault(_polyfills); +var _plugin_manager = __webpack_require__(220); + +var _plugin_manager2 = _interopRequireDefault(_plugin_manager); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } (0, _polyfills2.default)(); @@ -23480,8 +23704,7 @@ module.exports = function () { var els = config.container; if (!els) throw new Error("'container' is required"); config = _extends({}, defaultConfig, config); - var ilEl = els instanceof window.HTMLElement; - config.el = ilEl ? els : document.querySelector(els); + config.el = (0, _underscore.isElement)(els) ? els : document.querySelector(els); var editor = new _editor2.default(config).init(); // Load plugins @@ -23508,7 +23731,7 @@ module.exports = function () { }(); /***/ }), -/* 60 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -23522,8 +23745,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de module.exports = function (config) { var c = config || {}, - defaults = __webpack_require__(61), - EditorModel = __webpack_require__(62), + defaults = __webpack_require__(62), + EditorModel = __webpack_require__(63), EditorView = __webpack_require__(218); for (var name in defaults) { @@ -23552,6 +23775,12 @@ module.exports = function (config) { */ DomComponents: em.get('DomComponents'), + /** + * @property {LayerManager} + * @private + */ + LayerManager: em.get('LayerManager'), + /** * @property {CssComposer} * @private @@ -24140,7 +24369,7 @@ module.exports = function (config) { */ /***/ }), -/* 61 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24329,16 +24558,19 @@ module.exports = { }] }, - //Configurations for Block Manager + // Configurations for Block Manager blockManager: {}, + // Configurations for Trait Manager + traitManager: {}, + // Texts textViewCode: 'Code' }; /***/ }), -/* 62 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -24348,7 +24580,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument var _underscore = __webpack_require__(1); -var deps = [__webpack_require__(63), __webpack_require__(67), __webpack_require__(68), __webpack_require__(71), __webpack_require__(79), __webpack_require__(84), __webpack_require__(87), __webpack_require__(91), __webpack_require__(95), __webpack_require__(107), __webpack_require__(113), __webpack_require__(31), __webpack_require__(130), __webpack_require__(136), __webpack_require__(141), __webpack_require__(148), __webpack_require__(176), __webpack_require__(183), __webpack_require__(209)]; +var deps = [__webpack_require__(64), __webpack_require__(68), __webpack_require__(69), __webpack_require__(72), __webpack_require__(80), __webpack_require__(85), __webpack_require__(88), __webpack_require__(92), __webpack_require__(96), __webpack_require__(108), __webpack_require__(114), __webpack_require__(31), __webpack_require__(131), __webpack_require__(137), __webpack_require__(142), __webpack_require__(149), __webpack_require__(54), __webpack_require__(178), __webpack_require__(185), __webpack_require__(209)]; var Backbone = __webpack_require__(0); var timedInterval = void 0; @@ -24570,22 +24802,16 @@ module.exports = Backbone.Model.extend({ /** * Select a component * @param {Component|HTMLElement} el Component to select - * @param {Object} opts Options, optional + * @param {Object} [opts={}] Options, optional * @private */ setSelected: function setSelected(el) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var model = el; - - if (el instanceof window.HTMLElement) { - model = $(el).data('model'); - } - - if (model && !model.get('selectable')) { - return; - } - + (0, _underscore.isElement)(el) && (model = $(el).data('model')); + if (model && !model.get('selectable')) return; + opts.forceChange && this.set('selectedComponent', ''); this.set('selectedComponent', model, opts); }, @@ -24881,16 +25107,16 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 63 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function () { - var Sorter = __webpack_require__(64); - var Resizer = __webpack_require__(65); - var Dragger = __webpack_require__(66); + var Sorter = __webpack_require__(65); + var Resizer = __webpack_require__(66); + var Dragger = __webpack_require__(67); return { /** @@ -24915,7 +25141,7 @@ module.exports = function () { }; /***/ }), -/* 64 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25599,7 +25825,6 @@ module.exports = Backbone.View.extend({ var width = rect.width; var height = rect.height; - //console.log(pos, {top, left}); if (y < top + off || // near top edge y > top + height - off || // near bottom edge x < left + off || // near left edge @@ -25643,8 +25868,6 @@ module.exports = Backbone.View.extend({ width = el.offsetWidth; } - //console.log('get dim', top, left, this.canvasRelative); - return [top, left, height, width]; }, @@ -25840,12 +26063,11 @@ module.exports = Backbone.View.extend({ var clsReg = new RegExp('(?:^|\\s)' + this.freezeClass + '(?!\\S)', 'gi'); var src = this.eV; - if (src) { + if (src && this.selectOnEnd) { var srcModel = this.getSourceModel(); if (srcModel && srcModel.set) { srcModel.set('status', ''); srcModel.set('status', 'selected'); - //this.selectOnEnd && srcModel.set('status', 'selected'); } } @@ -25854,9 +26076,7 @@ module.exports = Backbone.View.extend({ } if (this.plh) this.plh.style.display = 'none'; - - if (typeof this.onEndMove === 'function') this.onEndMove(created); - + if ((0, _underscore.isFunction)(this.onEndMove)) this.onEndMove(created, this); var dragHelper = this.dragHelper; if (dragHelper) { @@ -25958,7 +26178,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 65 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26009,6 +26229,13 @@ var defaultOpts = { // from the current focused element (currently used only in SelectComponent) currentUnit: 1, + // With this option active the mousemove event won't be altered when + // the pointer comes over iframes + silentFrames: 0, + + // If true the container of handlers won't be updated + avoidContainerUpdate: 0, + // Handlers tl: 1, // Top left tc: 1, // Top center @@ -26124,6 +26351,22 @@ var Resizer = function () { this.onEnd = opts.onEnd; } + /** + * Toggle iframes pointer event + * @param {Boolean} silent If true, iframes will be silented + */ + + }, { + key: 'toggleFrames', + value: function toggleFrames(silent) { + if (this.opts.silentFrames) { + var frames = document.querySelectorAll('iframe'); + (0, _underscore.each)(frames, function (frame) { + return frame.style.pointerEvents = silent ? 'none' : ''; + }); + } + } + /** * Detects if the passed element is a resize handler * @param {HTMLElement} el @@ -26166,14 +26409,17 @@ var Resizer = function () { /** * Return element position * @param {HTMLElement} el + * @param {Object} opts Custom options * @return {Object} */ }, { key: 'getElementPos', value: function getElementPos(el) { + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var posFetcher = this.posFetcher || ''; - return posFetcher ? posFetcher(el) : getBoundingRect(el); + return posFetcher ? posFetcher(el, opts) : getBoundingRect(el); } /** @@ -26191,15 +26437,19 @@ var Resizer = function () { // Show the handlers this.el = el; + var config = this.opts; var unit = 'px'; - var rect = this.getElementPos(el); + var rect = this.getElementPos(el, { target: 'container' }); var container = this.container; var contStyle = container.style; - contStyle.left = rect.left + unit; - contStyle.top = rect.top + unit; - contStyle.width = rect.width + unit; - contStyle.height = rect.height + unit; - container.style.display = 'block'; + + if (!config.avoidContainerUpdate) { + contStyle.left = rect.left + unit; + contStyle.top = rect.top + unit; + contStyle.width = rect.width + unit; + contStyle.height = rect.height + unit; + contStyle.display = 'block'; + } (0, _mixins.on)(this.getDocumentEl(), 'mousedown', this.handleMouseDown); } @@ -26228,16 +26478,14 @@ var Resizer = function () { key: 'start', value: function start(e) { //Right or middel click - if (e.button !== 0) { - return; - } + if (e.button !== 0) return; e.preventDefault(); e.stopPropagation(); var el = this.el; var resizer = this; var config = this.opts || {}; var attrName = 'data-' + config.prefix + 'handler'; - var rect = this.getElementPos(el); + var rect = this.getElementPos(el, { target: 'el' }); this.handlerAttr = e.target.getAttribute(attrName); this.clickedHandler = e.target; this.startDim = { @@ -26263,6 +26511,7 @@ var Resizer = function () { (0, _mixins.on)(doc, 'keydown', this.handleKeyDown); (0, _mixins.on)(doc, 'mouseup', this.stop); (0, _underscore.isFunction)(this.onStart) && this.onStart(e, { docs: doc, config: config, el: el, resizer: resizer }); + this.toggleFrames(1); this.move(e); } @@ -26318,6 +26567,7 @@ var Resizer = function () { (0, _mixins.off)(doc, 'keydown', this.handleKeyDown); (0, _mixins.off)(doc, 'mouseup', this.stop); this.updateRect(1); + this.toggleFrames(); (0, _underscore.isFunction)(this.onEnd) && this.onEnd(e, { docs: doc, config: config }); } @@ -26336,7 +26586,9 @@ var Resizer = function () { var updateTarget = this.updateTarget; var selectedHandler = this.getSelectedHandler(); var unitHeight = config.unitHeight, - unitWidth = config.unitWidth; + unitWidth = config.unitWidth, + keyWidth = config.keyWidth, + keyHeight = config.keyHeight; // Use custom updating strategy if requested @@ -26349,16 +26601,18 @@ var Resizer = function () { }); } else { var elStyle = el.style; - elStyle.width = rect.w + unitWidth; - elStyle.height = rect.h + unitHeight; + elStyle[keyWidth] = rect.w + unitWidth; + elStyle[keyHeight] = rect.h + unitHeight; } var unitRect = 'px'; - var rectEl = this.getElementPos(el); - conStyle.left = rectEl.left + unitRect; - conStyle.top = rectEl.top + unitRect; - conStyle.width = rectEl.width + unitRect; - conStyle.height = rectEl.height + unitRect; + var rectEl = this.getElementPos(el, { target: 'container' }); + if (!config.avoidContainerUpdate) { + conStyle.left = rectEl.left + unitRect; + conStyle.top = rectEl.top + unitRect; + conStyle.width = rectEl.width + unitRect; + conStyle.height = rectEl.height + unitRect; + } } /** @@ -26498,7 +26752,7 @@ module.exports = { }; /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26844,7 +27098,7 @@ module.exports = { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27018,7 +27272,7 @@ module.exports = function () { }; /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27035,7 +27289,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument */ -var _backboneUndo = __webpack_require__(69); +var _backboneUndo = __webpack_require__(70); var _backboneUndo2 = _interopRequireDefault(_backboneUndo); @@ -27307,7 +27561,7 @@ module.exports = function () { }; /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -27324,7 +27578,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ (function (factory) { if (true) { // AMD support - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1), __webpack_require__(70)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1), __webpack_require__(71)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -28149,7 +28403,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.2.1 @@ -30030,7 +30284,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16))) /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30045,9 +30299,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ */ module.exports = function () { var c = {}, - defaults = __webpack_require__(72), - LocalStorage = __webpack_require__(73), - RemoteStorage = __webpack_require__(74); + defaults = __webpack_require__(73), + LocalStorage = __webpack_require__(74), + RemoteStorage = __webpack_require__(75); var storages = {}; var defaultStorages = {}; @@ -30241,16 +30495,20 @@ module.exports = function () { for (var i = 0, len = keys.length; i < len; i++) { keysF.push(c.id + keys[i]); - }st && st.load(keysF, function (res) { - // Restore keys name - var reg = new RegExp('^' + c.id + ''); - for (var itemKey in res) { - var itemKeyR = itemKey.replace(reg, ''); - result[itemKeyR] = res[itemKey]; - } + }if (st) { + st.load(keysF, function (res) { + // Restore keys name + var reg = new RegExp('^' + c.id + ''); + for (var itemKey in res) { + var itemKeyR = itemKey.replace(reg, ''); + result[itemKeyR] = res[itemKey]; + } + clb && clb(result); + }); + } else { clb && clb(result); - }); + } }, @@ -30278,7 +30536,7 @@ module.exports = function () { }; /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30345,7 +30603,7 @@ module.exports = { }; /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30414,7 +30672,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30578,7 +30836,7 @@ module.exports = __webpack_require__(0).Model.extend({ }); /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(setImmediate) {(function (root) { @@ -30815,10 +31073,10 @@ module.exports = __webpack_require__(0).Model.extend({ })(this); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(76).setImmediate)) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(77).setImmediate)) /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { var apply = Function.prototype.apply; @@ -30871,13 +31129,13 @@ exports._unrefActive = exports.active = function(item) { }; // setimmediate attaches itself to the global object -__webpack_require__(77); +__webpack_require__(78); exports.setImmediate = setImmediate; exports.clearImmediate = clearImmediate; /***/ }), -/* 77 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { @@ -31067,10 +31325,10 @@ exports.clearImmediate = clearImmediate; attachTo.clearImmediate = clearImmediate; }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(78))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16), __webpack_require__(79))) /***/ }), -/* 78 */ +/* 79 */ /***/ (function(module, exports) { // shim for using process in browser @@ -31260,7 +31518,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 79 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31277,9 +31535,9 @@ process.umask = function() { return 0; }; */ module.exports = function () { var c = {}, - defaults = __webpack_require__(80), - Devices = __webpack_require__(81), - DevicesView = __webpack_require__(83); + defaults = __webpack_require__(81), + Devices = __webpack_require__(82), + DevicesView = __webpack_require__(84); var devices, view; return { @@ -31380,7 +31638,7 @@ module.exports = function () { }; /***/ }), -/* 80 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31393,21 +31651,21 @@ module.exports = { }; /***/ }), -/* 81 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Backbone = __webpack_require__(0); -var Device = __webpack_require__(82); +var Device = __webpack_require__(83); module.exports = Backbone.Collection.extend({ model: Device }); /***/ }), -/* 82 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31440,7 +31698,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 83 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31530,7 +31788,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 84 */ +/* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31538,8 +31796,8 @@ module.exports = Backbone.View.extend({ module.exports = function () { var c = {}, - defaults = __webpack_require__(85), - parserCss = __webpack_require__(86), + defaults = __webpack_require__(86), + parserCss = __webpack_require__(87), parserHtml = __webpack_require__(25); var pHtml, pCss; @@ -31595,7 +31853,7 @@ module.exports = function () { }; /***/ }), -/* 85 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31606,7 +31864,7 @@ module.exports = { }; /***/ }), -/* 86 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31812,7 +32070,7 @@ module.exports = function (config) { }; /***/ }), -/* 87 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31873,10 +32131,10 @@ var _underscore = __webpack_require__(1); module.exports = function (config) { var c = config || {}, - defaults = __webpack_require__(88), + defaults = __webpack_require__(89), Selector = __webpack_require__(7), Selectors = __webpack_require__(10), - ClassTagsView = __webpack_require__(89); + ClassTagsView = __webpack_require__(90); var selectors, selectorTags; return { @@ -31891,6 +32149,11 @@ module.exports = function (config) { */ name: 'SelectorManager', + getConfig: function getConfig() { + return c; + }, + + /** * Initialize module. Automatically called with a new instance of the editor * @param {Object} config Configurations @@ -31924,6 +32187,14 @@ module.exports = function (config) { return this; }, + postRender: function postRender() { + var elTo = this.getConfig().appendTo; + + if (elTo) { + var el = (0, _underscore.isElement)(elTo) ? elTo : document.querySelector(elTo); + el.appendChild(this.render([])); + } + }, /** @@ -32032,7 +32303,7 @@ module.exports = function (config) { }; /***/ }), -/* 88 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32042,6 +32313,10 @@ module.exports = { // Style prefix stylePrefix: 'clm-', + // Specify the element to use as a container, string (query) or HTMLElement + // With the empty value, nothing will be rendered + appendTo: '', + // Default selectors selectors: [], @@ -32058,14 +32333,14 @@ module.exports = { }; /***/ }), -/* 89 */ +/* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(_) { var Backbone = __webpack_require__(0); -var ClassTagView = __webpack_require__(90); +var ClassTagView = __webpack_require__(91); module.exports = Backbone.View.extend({ template: _.template('\n
\n
<%= label %>
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
<%= selectedLabel %>
\n
\n
\n
'), @@ -32342,29 +32617,31 @@ module.exports = Backbone.View.extend({ return this.$statesC; }, render: function render() { + var ppfx = this.ppfx; var config = this.config; - this.$el.html(this.template({ + var $el = this.$el; + $el.html(this.template({ selectedLabel: config.selectedLabel, statesLabel: config.statesLabel, label: config.label, pfx: this.pfx, ppfx: this.ppfx })); - this.$input = this.$el.find('input#' + this.newInputId); - this.$addBtn = this.$el.find('#' + this.addBtnId); - this.$classes = this.$el.find('#' + this.pfx + 'tags-c'); - this.$states = this.$el.find('#' + this.stateInputId); - this.$statesC = this.$el.find('#' + this.stateInputC); + this.$input = $el.find('input#' + this.newInputId); + this.$addBtn = $el.find('#' + this.addBtnId); + this.$classes = $el.find('#' + this.pfx + 'tags-c'); + this.$states = $el.find('#' + this.stateInputId); + this.$statesC = $el.find('#' + this.stateInputC); this.$states.append(this.getStateOptions()); this.renderClasses(); - this.$el.attr('class', this.className); + $el.attr('class', this.className + ' ' + ppfx + 'one-bg ' + ppfx + 'two-color'); return this; } }); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 90 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32506,7 +32783,7 @@ module.exports = __webpack_require__(0).View.extend({ }); /***/ }), -/* 91 */ +/* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32530,9 +32807,9 @@ module.exports = __webpack_require__(0).View.extend({ */ module.exports = function () { var c = {}, - defaults = __webpack_require__(92), - ModalM = __webpack_require__(93), - ModalView = __webpack_require__(94); + defaults = __webpack_require__(93), + ModalM = __webpack_require__(94), + ModalView = __webpack_require__(95); var model, modal; return { @@ -32565,9 +32842,9 @@ module.exports = function () { return this; }, - postRender: function postRender(editorView) { - // c.em.config.el || 'body' - this.render().appendTo(editorView.el); + postRender: function postRender(view) { + var el = view.model.getConfig().el || view.el; + this.render().appendTo(el); }, @@ -32677,7 +32954,7 @@ module.exports = function () { }; /***/ }), -/* 92 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32694,7 +32971,7 @@ module.exports = { }; /***/ }), -/* 93 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32711,7 +32988,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 94 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32724,7 +33001,7 @@ module.exports = __webpack_require__(0).View.extend({ content = _ref.content, title = _ref.title; - return '
\n
\n
' + title + '
\n
⨯
\n
\n
\n
' + content + '
\n
\n
\n
\n
\n '; + return '
\n
\n
' + title + '
\n
⨯
\n
\n
\n
' + content + '
\n
\n
\n
\n
\n '; }, @@ -32849,7 +33126,7 @@ module.exports = __webpack_require__(0).View.extend({ }); /***/ }), -/* 95 */ +/* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32876,13 +33153,13 @@ module.exports = __webpack_require__(0).View.extend({ */ module.exports = function () { var c = {}, - defaults = __webpack_require__(96), - gHtml = __webpack_require__(97), - gCss = __webpack_require__(98), - gJson = __webpack_require__(99), - gJs = __webpack_require__(100), - eCM = __webpack_require__(101), - editorView = __webpack_require__(106); + defaults = __webpack_require__(97), + gHtml = __webpack_require__(98), + gCss = __webpack_require__(99), + gJson = __webpack_require__(100), + gJs = __webpack_require__(101), + eCM = __webpack_require__(102), + editorView = __webpack_require__(107); var generators = {}, defGenerators = {}, @@ -33078,7 +33355,7 @@ module.exports = function () { }; /***/ }), -/* 96 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33092,7 +33369,7 @@ module.exports = { }; /***/ }), -/* 97 */ +/* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33122,7 +33399,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 98 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33260,7 +33537,7 @@ module.exports = __webpack_require__(0).Model.extend({ }); /***/ }), -/* 99 */ +/* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33304,7 +33581,7 @@ module.exports = Backbone.Model.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 100 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33365,7 +33642,7 @@ module.exports = Backbone.Model.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 101 */ +/* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -33375,9 +33652,9 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument var Backbone = __webpack_require__(0); var CodeMirror = __webpack_require__(6); -var htmlMode = __webpack_require__(102); +var htmlMode = __webpack_require__(103); var cssMode = __webpack_require__(26); -var formatting = __webpack_require__(105); +var formatting = __webpack_require__(106); module.exports = Backbone.Model.extend({ defaults: { @@ -33414,7 +33691,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 102 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { // CodeMirror, copyright (c) by Marijn Haverbeke and others @@ -33422,7 +33699,7 @@ module.exports = Backbone.Model.extend({ (function(mod) { if (true) // CommonJS - mod(__webpack_require__(6), __webpack_require__(103), __webpack_require__(104), __webpack_require__(26)); + mod(__webpack_require__(6), __webpack_require__(104), __webpack_require__(105), __webpack_require__(26)); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); else // Plain browser env @@ -33572,7 +33849,7 @@ module.exports = Backbone.Model.extend({ /***/ }), -/* 103 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { // CodeMirror, copyright (c) by Marijn Haverbeke and others @@ -33972,7 +34249,7 @@ if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) /***/ }), -/* 104 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { // CodeMirror, copyright (c) by Marijn Haverbeke and others @@ -34833,7 +35110,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript /***/ }), -/* 105 */ +/* 106 */ /***/ (function(module, exports, __webpack_require__) { (function(mod) { @@ -34960,7 +35237,7 @@ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript /***/ }), -/* 106 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -34987,7 +35264,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 107 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35042,11 +35319,11 @@ module.exports = Backbone.View.extend({ */ module.exports = function () { var c = {}, - defaults = __webpack_require__(108), + defaults = __webpack_require__(109), Panel = __webpack_require__(27), - Panels = __webpack_require__(110), + Panels = __webpack_require__(111), PanelView = __webpack_require__(29), - PanelsView = __webpack_require__(112); + PanelsView = __webpack_require__(113); var panels, PanelsViewObj; return { @@ -35263,7 +35540,7 @@ module.exports = function () { }; /***/ }), -/* 108 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35348,7 +35625,7 @@ module.exports = { }; /***/ }), -/* 109 */ +/* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35381,7 +35658,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 110 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35395,7 +35672,7 @@ module.exports = Backbone.Collection.extend({ }); /***/ }), -/* 111 */ +/* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35731,7 +36008,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 112 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -35774,14 +36051,18 @@ module.exports = Backbone.View.extend({ * */ addToCollection: function addToCollection(model, fragmentEl) { var fragment = fragmentEl || null; + var config = this.config; + var el = model.get('el'); var view = new PanelView({ + el: el, model: model, - config: this.config + config: config }); var rendered = view.render().el; var appendTo = model.get('appendTo'); - if (appendTo) { + // Do nothing if the panel was requested to be another element + if (el) {} else if (appendTo) { var appendEl = document.querySelector(appendTo); appendEl.appendChild(rendered); } else { @@ -35796,27 +36077,28 @@ module.exports = Backbone.View.extend({ return rendered; }, render: function render() { - var fragment = document.createDocumentFragment(); - this.$el.empty(); + var _this = this; + var $el = this.$el; + var frag = document.createDocumentFragment(); + $el.empty(); this.collection.each(function (model) { - this.addToCollection(model, fragment); - }, this); - - this.$el.append(fragment); - this.$el.attr('class', this.className); + return _this.addToCollection(model, frag); + }); + $el.append(frag); + $el.attr('class', this.className); return this; } }); /***/ }), -/* 113 */ +/* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _RichTextEditor = __webpack_require__(114); +var _RichTextEditor = __webpack_require__(115); var _RichTextEditor2 = _interopRequireDefault(_RichTextEditor); @@ -35841,7 +36123,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ module.exports = function () { var config = {}; - var defaults = __webpack_require__(115); + var defaults = __webpack_require__(116); var toolbar = void 0, actions = void 0, lastEl = void 0, @@ -36129,7 +36411,7 @@ module.exports = function () { }; /***/ }), -/* 114 */ +/* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36447,7 +36729,7 @@ var RichTextEditor = function () { exports.default = RichTextEditor; /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36465,7 +36747,7 @@ module.exports = { }; /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36476,6 +36758,10 @@ module.exports = { sectors: [], + // Specify the element to use as a container, string (query) or HTMLElement + // With the empty value, nothing will be rendered + appendTo: '', + // Text to show in case no element selected textNoElement: 'Select an element before using Style Manager', @@ -36501,20 +36787,20 @@ module.exports = { }; /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Sector = __webpack_require__(118); +var Sector = __webpack_require__(119); module.exports = __webpack_require__(0).Collection.extend({ model: Sector }); /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36524,7 +36810,7 @@ var _underscore = __webpack_require__(1); var Backbone = __webpack_require__(0); var Properties = __webpack_require__(11); -var PropertyFactory = __webpack_require__(127); +var PropertyFactory = __webpack_require__(128); module.exports = Backbone.Model.extend({ defaults: { @@ -36614,7 +36900,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36623,7 +36909,7 @@ module.exports = Backbone.Model.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 Property = __webpack_require__(33); -var Layers = __webpack_require__(120); +var Layers = __webpack_require__(121); module.exports = Property.extend({ defaults: _extends({}, Property.prototype.defaults, { @@ -36647,7 +36933,7 @@ module.exports = Property.extend({ }); /***/ }), -/* 120 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36655,7 +36941,7 @@ module.exports = Property.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 Layer = __webpack_require__(121); +var Layer = __webpack_require__(122); module.exports = Backbone.Collection.extend({ model: Layer, @@ -36777,7 +37063,7 @@ module.exports = Backbone.Collection.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 121 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -36832,7 +37118,7 @@ module.exports = Backbone.Model.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 122 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39058,14 +39344,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 123 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Backbone = __webpack_require__(0); -var LayerView = __webpack_require__(124); +var LayerView = __webpack_require__(125); module.exports = Backbone.View.extend({ initialize: function initialize(o) { @@ -39189,7 +39475,7 @@ module.exports = Backbone.View.extend({ }); /***/ }), -/* 124 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39348,7 +39634,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 125 */ +/* 126 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39365,20 +39651,24 @@ module.exports = Property.extend({ }); /***/ }), -/* 126 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +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 Property = __webpack_require__(14); module.exports = Property.extend({ - events: { - 'change [type=range]': 'inputValueChanged', - 'input [type=range]': 'inputValueChangedSoft' + events: function events() { + return _extends({}, Property.prototype.events, { + 'change [type=range]': 'inputValueChanged', + 'input [type=range]': 'inputValueChangedSoft', + change: '' + }); }, - templateInput: function templateInput(model) { var ppfx = this.ppfx; return '\n
\n \n
\n '; @@ -39417,7 +39707,7 @@ module.exports = Property.extend({ }); /***/ }), -/* 127 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39904,7 +40194,7 @@ module.exports = function () { }; /***/ }), -/* 128 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -39914,13 +40204,17 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument var _underscore = __webpack_require__(1); -var SectorView = __webpack_require__(129); +var SectorView = __webpack_require__(130); module.exports = Backbone.View.extend({ - initialize: function initialize(o) { - this.config = o.config || {}; - this.pfx = this.config.stylePrefix || ''; + initialize: function initialize() { + var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var config = o.config || {}; + this.pfx = config.stylePrefix || ''; + this.ppfx = config.pStylePrefix || ''; this.target = o.target || {}; + this.config = config; // The target that will emit events for properties var target = {}; @@ -40029,22 +40323,25 @@ module.exports = Backbone.View.extend({ return rendered; }, render: function render() { - var fragment = document.createDocumentFragment(); - this.$el.empty(); + var _this = this; + var frag = document.createDocumentFragment(); + var $el = this.$el; + var pfx = this.pfx; + var ppfx = this.ppfx; + $el.empty(); this.collection.each(function (model) { - this.addToCollection(model, fragment); - }, this); - - this.$el.attr('id', this.pfx + 'sectors'); - this.$el.append(fragment); + return _this.addToCollection(model, frag); + }); + $el.append(frag); + $el.addClass(pfx + 'sectors ' + ppfx + 'one-bg ' + ppfx + 'two-color'); return this; } }); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 129 */ +/* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40154,7 +40451,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 130 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40202,9 +40499,9 @@ module.exports = Backbone.View.extend({ module.exports = function () { var c = {}; - var defaults = __webpack_require__(131); - var Assets = __webpack_require__(132); - var AssetsView = __webpack_require__(135); + var defaults = __webpack_require__(132); + var Assets = __webpack_require__(133); + var AssetsView = __webpack_require__(136); var FileUpload = __webpack_require__(45); var assets = void 0, am = void 0, @@ -40544,7 +40841,7 @@ module.exports = function () { }; /***/ }), -/* 131 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40636,7 +40933,7 @@ module.exports = { }; /***/ }), -/* 132 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40651,7 +40948,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.default).extend({ types: [{ id: 'image', - model: __webpack_require__(133), + model: __webpack_require__(134), view: __webpack_require__(43), isType: function isType(value) { if (typeof value == 'string') { @@ -40666,7 +40963,7 @@ module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.d }); /***/ }), -/* 133 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40674,7 +40971,7 @@ module.exports = __webpack_require__(0).Collection.extend(_TypeableCollection2.d 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 Asset = __webpack_require__(134); +var Asset = __webpack_require__(135); module.exports = Asset.extend({ defaults: _extends({}, Asset.prototype.defaults, { @@ -40686,7 +40983,7 @@ module.exports = Asset.extend({ }); /***/ }), -/* 134 */ +/* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40721,7 +41018,7 @@ module.exports = __webpack_require__(0).Model.extend({ }); /***/ }), -/* 135 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40739,7 +41036,7 @@ module.exports = Backbone.View.extend({ template: function template(view) { var pfx = view.pfx; var ppfx = view.ppfx; - return '\n
\n
\n
\n
\n \n
\n \n
\n
\n \n
\n
\n
\n
\n '; + return '\n
\n
\n
\n
\n \n
\n \n
\n
\n
\n
\n
\n
\n '; }, initialize: function initialize(o) { this.options = o; @@ -40909,7 +41206,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 136 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -40938,10 +41235,10 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument module.exports = function () { var em = void 0; var c = {}, - defaults = __webpack_require__(137), + defaults = __webpack_require__(138), CssRule = __webpack_require__(46), - CssRules = __webpack_require__(138), - CssRulesView = __webpack_require__(139); + CssRules = __webpack_require__(139), + CssRulesView = __webpack_require__(140); var Selectors = __webpack_require__(10); var Selector = __webpack_require__(7); @@ -41317,7 +41614,7 @@ module.exports = function () { }; /***/ }), -/* 137 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41335,7 +41632,7 @@ module.exports = { }; /***/ }), -/* 138 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41375,14 +41672,14 @@ module.exports = Backbone.Collection.extend({ }); /***/ }), -/* 139 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var CssRuleView = __webpack_require__(48); -var CssGroupRuleView = __webpack_require__(140); +var CssGroupRuleView = __webpack_require__(141); module.exports = __webpack_require__(0).View.extend({ initialize: function initialize(o) { @@ -41470,7 +41767,7 @@ module.exports = __webpack_require__(0).View.extend({ }); /***/ }), -/* 140 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41490,7 +41787,7 @@ module.exports = __webpack_require__(48).extend({ }); /***/ }), -/* 141 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41498,10 +41795,11 @@ module.exports = __webpack_require__(48).extend({ var _underscore = __webpack_require__(1); +var defaultOpts = __webpack_require__(143); +var TraitsView = __webpack_require__(144); + module.exports = function () { var c = {}; - var defaultOpts = __webpack_require__(142); - var TraitsView = __webpack_require__(143); var TraitsViewer = void 0; return { @@ -41542,6 +41840,14 @@ module.exports = function () { }); return this; }, + postRender: function postRender() { + var elTo = this.getConfig().appendTo; + + if (elTo) { + var el = (0, _underscore.isElement)(elTo) ? elTo : document.querySelector(elTo); + el.appendChild(this.render()); + } + }, /** @@ -41572,12 +41878,15 @@ module.exports = function () { */ getType: function getType(name) { return TraitsViewer.itemsView[name]; + }, + render: function render() { + return TraitsViewer.render().el; } }; }; /***/ }), -/* 142 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41586,6 +41895,10 @@ module.exports = function () { module.exports = { stylePrefix: 'trt-', + // Specify the element to use as a container, string (query) or HTMLElement + // With the empty value, nothing will be rendered + appendTo: '', + labelContainer: 'Component settings', // Placeholder label for text input types @@ -41599,7 +41912,7 @@ module.exports = { }; /***/ }), -/* 143 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41607,10 +41920,10 @@ module.exports = { var DomainViews = __webpack_require__(49); var TraitView = __webpack_require__(8); -var TraitSelectView = __webpack_require__(144); -var TraitCheckboxView = __webpack_require__(145); -var TraitNumberView = __webpack_require__(146); -var TraitColorView = __webpack_require__(147); +var TraitSelectView = __webpack_require__(145); +var TraitCheckboxView = __webpack_require__(146); +var TraitNumberView = __webpack_require__(147); +var TraitColorView = __webpack_require__(148); module.exports = DomainViews.extend({ itemView: TraitView, @@ -41623,10 +41936,14 @@ module.exports = DomainViews.extend({ color: TraitColorView }, - initialize: function initialize(o) { - this.config = o.config || {}; + initialize: function initialize() { + var o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var config = o.config || {}; + this.config = config; this.em = o.editor; - this.pfx = this.config.stylePrefix || ''; + this.pfx = config.stylePrefix || ''; + this.ppfx = config.pStylePrefix || ''; this.className = this.pfx + 'traits'; this.listenTo(this.em, 'change:selectedComponent', this.updatedCollection); this.updatedCollection(); @@ -41638,7 +41955,8 @@ module.exports = DomainViews.extend({ * @private */ updatedCollection: function updatedCollection() { - this.el.className = this.className; + var ppfx = this.ppfx; + this.el.className = this.className + ' ' + ppfx + 'one-bg ' + ppfx + 'two-color'; var comp = this.em.get('selectedComponent'); if (comp) { this.collection = comp.get('traits'); @@ -41648,7 +41966,7 @@ module.exports = DomainViews.extend({ }); /***/ }), -/* 144 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41717,7 +42035,7 @@ module.exports = TraitView.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41772,7 +42090,7 @@ module.exports = TraitView.extend({ }); /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41827,7 +42145,7 @@ module.exports = TraitView.extend({ }); /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41874,7 +42192,7 @@ module.exports = TraitView.extend({ }); /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -41919,7 +42237,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument module.exports = function () { var c = {}; var em = void 0; - var defaults = __webpack_require__(149); + var defaults = __webpack_require__(150); var Component = __webpack_require__(4); var ComponentView = __webpack_require__(3); var Components = __webpack_require__(50); @@ -41928,56 +42246,56 @@ module.exports = function () { var component, componentView; var componentTypes = [{ id: 'cell', - model: __webpack_require__(153), - view: __webpack_require__(154) + model: __webpack_require__(154), + view: __webpack_require__(155) }, { id: 'row', - model: __webpack_require__(155), - view: __webpack_require__(156) + model: __webpack_require__(156), + view: __webpack_require__(157) }, { id: 'table', - model: __webpack_require__(157), - view: __webpack_require__(158) + model: __webpack_require__(158), + view: __webpack_require__(159) }, { id: 'thead', - model: __webpack_require__(159), - view: __webpack_require__(160) + model: __webpack_require__(160), + view: __webpack_require__(161) }, { id: 'tbody', model: __webpack_require__(19), - view: __webpack_require__(161) + view: __webpack_require__(162) }, { id: 'tfoot', - model: __webpack_require__(162), - view: __webpack_require__(163) + model: __webpack_require__(163), + view: __webpack_require__(164) }, { id: 'map', - model: __webpack_require__(164), - view: __webpack_require__(165) + model: __webpack_require__(165), + view: __webpack_require__(166) }, { id: 'link', - model: __webpack_require__(166), - view: __webpack_require__(167) + model: __webpack_require__(167), + view: __webpack_require__(168) }, { id: 'video', - model: __webpack_require__(168), - view: __webpack_require__(169) + model: __webpack_require__(169), + view: __webpack_require__(170) }, { id: 'image', model: __webpack_require__(20), view: __webpack_require__(15) }, { id: 'script', - model: __webpack_require__(170), - view: __webpack_require__(171) + model: __webpack_require__(171), + view: __webpack_require__(172) }, { id: 'svg', - model: __webpack_require__(172), - view: __webpack_require__(173) + model: __webpack_require__(173), + view: __webpack_require__(174) }, { id: 'textnode', - model: __webpack_require__(174), - view: __webpack_require__(175) + model: __webpack_require__(175), + view: __webpack_require__(176) }, { id: 'text', model: __webpack_require__(52), @@ -42395,12 +42713,10 @@ module.exports = function () { var previousModel = em.previous('selectedComponent'); // Deselect the previous component - if (previousModel) { - previousModel.set({ - status: '', - state: '' - }); - } + previousModel && previousModel.set({ + status: '', + state: '' + }); model && model.set('status', 'selected'); } @@ -42408,7 +42724,7 @@ module.exports = function () { }; /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42450,7 +42766,7 @@ module.exports = { }; /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42459,8 +42775,8 @@ module.exports = { var _underscore = __webpack_require__(1); var Backbone = __webpack_require__(0); -var Trait = __webpack_require__(151); -var TraitFactory = __webpack_require__(152); +var Trait = __webpack_require__(152); +var TraitFactory = __webpack_require__(153); module.exports = Backbone.Collection.extend({ model: Trait, @@ -42499,7 +42815,7 @@ module.exports = Backbone.Collection.extend({ }); /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42595,7 +42911,7 @@ module.exports = __webpack_require__(0).Model.extend({ }); /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42654,7 +42970,7 @@ module.exports = function () { }; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42687,7 +43003,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42699,7 +43015,7 @@ var ComponentView = __webpack_require__(3); module.exports = ComponentView.extend({}); /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42741,7 +43057,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42753,7 +43069,7 @@ var ComponentView = __webpack_require__(3); module.exports = ComponentView.extend({}); /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42788,7 +43104,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42802,7 +43118,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42830,7 +43146,7 @@ module.exports = ComponentTableBody.extend({ }); /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42842,7 +43158,7 @@ var ComponentView = __webpack_require__(3); module.exports = ComponentView.extend({}); /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42854,7 +43170,7 @@ var ComponentView = __webpack_require__(3); module.exports = ComponentView.extend({}); /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42882,7 +43198,7 @@ module.exports = ComponentTableBody.extend({ }); /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42894,7 +43210,7 @@ var ComponentView = __webpack_require__(3); module.exports = ComponentView.extend({}); /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -42996,7 +43312,7 @@ module.exports = Component.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43048,7 +43364,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43111,7 +43427,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43137,7 +43453,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43453,7 +43769,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43581,7 +43897,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43613,7 +43929,7 @@ module.exports = Component.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43653,7 +43969,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43692,7 +44008,7 @@ module.exports = Component.extend({ }); /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43707,7 +44023,7 @@ module.exports = ComponentView.extend({ }); /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43739,7 +44055,7 @@ module.exports = Component.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43748,7 +44064,34 @@ module.exports = Component.extend({ module.exports = __webpack_require__(0).View.extend({}); /***/ }), -/* 176 */ +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + stylePrefix: '', + + // Specify the element to use as a container, string (query) or HTMLElement + // With the empty value, nothing will be rendered + appendTo: '', + + // Enable/Disable globally the possibility to sort layers + sortable: 1, + + // Enable/Disable globally the possibility to hide layers + hidable: 1, + + // Hide textnodes + hideTextnode: 1, + + // Indicates if the wrapper is visible in layers + showWrapper: 1 +}; + +/***/ }), +/* 178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -43756,7 +44099,7 @@ module.exports = __webpack_require__(0).View.extend({}); var _mixins = __webpack_require__(2); -var _Droppable = __webpack_require__(177); +var _Droppable = __webpack_require__(179); var _Droppable2 = _interopRequireDefault(_Droppable); @@ -43764,9 +44107,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de module.exports = function () { var c = {}, - defaults = __webpack_require__(178), - Canvas = __webpack_require__(179), - CanvasView = __webpack_require__(181); + defaults = __webpack_require__(180), + Canvas = __webpack_require__(181), + CanvasView = __webpack_require__(183); var canvas; var frameRect; @@ -44198,7 +44541,7 @@ module.exports = function () { }; /***/ }), -/* 177 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44382,7 +44725,7 @@ var Droppable = function () { exports.default = Droppable; /***/ }), -/* 178 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44424,14 +44767,14 @@ module.exports = { }; /***/ }), -/* 179 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Backbone = __webpack_require__(0); -var Frame = __webpack_require__(180); +var Frame = __webpack_require__(182); module.exports = Backbone.Model.extend({ defaults: { @@ -44447,7 +44790,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 180 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44465,7 +44808,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 181 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44473,7 +44816,7 @@ module.exports = Backbone.Model.extend({ var _mixins = __webpack_require__(2); -var FrameView = __webpack_require__(182); +var FrameView = __webpack_require__(184); var $ = Backbone.$; module.exports = Backbone.View.extend({ @@ -44581,7 +44924,7 @@ module.exports = Backbone.View.extend({ // CKEditor's issue // I need all this styles to make the editor work properly - var frameCss = '\n ' + baseCss + '\n\n .' + ppfx + 'dashed *[data-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -3px\n }\n\n .' + ppfx + 'comp-selected {\n outline: 3px solid #3b97e3 !important;\n }\n\n .' + ppfx + 'comp-selected-parent {\n outline: 2px solid ' + colorWarn + ' !important\n }\n\n .' + ppfx + 'no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .' + ppfx + 'freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .' + ppfx + 'no-pointer {\n pointer-events: none;\n }\n\n .' + ppfx + 'plh-image {\n background: #f5f5f5;\n border: none;\n height: 50px;\n width: 50px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .' + ppfx + 'grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n\n ' + (conf.canvasCss || '') + '\n ' + (protCss || '') + '\n '; + var frameCss = '\n ' + baseCss + '\n\n .' + ppfx + 'dashed *[data-highlightable] {\n outline: 1px dashed rgba(170,170,170,0.7);\n outline-offset: -2px;\n }\n\n .' + ppfx + 'comp-selected {\n outline: 3px solid #3b97e3 !important;\n outline-offset: -3px;\n }\n\n .' + ppfx + 'comp-selected-parent {\n outline: 2px solid ' + colorWarn + ' !important\n }\n\n .' + ppfx + 'no-select {\n user-select: none;\n -webkit-user-select:none;\n -moz-user-select: none;\n }\n\n .' + ppfx + 'freezed {\n opacity: 0.5;\n pointer-events: none;\n }\n\n .' + ppfx + 'no-pointer {\n pointer-events: none;\n }\n\n .' + ppfx + 'plh-image {\n background: #f5f5f5;\n border: none;\n height: 50px;\n width: 50px;\n display: block;\n outline: 3px solid #ffca6f;\n cursor: pointer;\n outline-offset: -2px\n }\n\n .' + ppfx + 'grabbing {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n }\n\n * ::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.1)\n }\n\n * ::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.2)\n }\n\n * ::-webkit-scrollbar {\n width: 10px\n }\n\n ' + (conf.canvasCss || '') + '\n ' + (protCss || '') + '\n '; if (externalStyles) { body.append(externalStyles); @@ -44603,8 +44946,8 @@ module.exports = Backbone.View.extend({ // the keyCode/which will be always `0`. Even if it's an old/deprecated // property keymaster (and many others) still use it... using `defineProperty` // hack seems the only way - var createCustomEvent = function createCustomEvent(e) { - var oEvent = new KeyboardEvent(e.type, e); + var createCustomEvent = function createCustomEvent(e, cls) { + var oEvent = new window[cls](e.type, e); oEvent.keyCodeVal = e.keyCode; ['keyCode', 'which'].forEach(function (prop) { Object.defineProperty(oEvent, prop, { @@ -44615,11 +44958,15 @@ module.exports = Backbone.View.extend({ }); return oEvent; }; - fdoc.addEventListener('keydown', function (e) { - doc.dispatchEvent(createCustomEvent(e)); - }); - fdoc.addEventListener('keyup', function (e) { - doc.dispatchEvent(createCustomEvent(e)); + + [{ event: 'keydown keyup', class: 'KeyboardEvent' + //{ event: 'mousedown mousemove mouseup', class: 'MouseEvent' }, + }].forEach(function (obj) { + return obj.event.split(' ').forEach(function (event) { + fdoc.addEventListener(event, function (e) { + return doc.dispatchEvent(createCustomEvent(e, obj.class)); + }); + }); }); } }, @@ -44783,7 +45130,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 182 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44850,7 +45197,7 @@ module.exports = __webpack_require__(0).View.extend({ }); /***/ }), -/* 183 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -44863,8 +45210,8 @@ module.exports = function () { var c = {}, commands = {}, defaultCommands = {}, - defaults = __webpack_require__(184), - AbsCommands = __webpack_require__(185); + defaults = __webpack_require__(186), + AbsCommands = __webpack_require__(187); // Need it here as it would be used below var add = function add(id, obj) { @@ -44905,17 +45252,17 @@ module.exports = function () { if (obj.id) this.add(obj.id, obj); } - var ViewCode = __webpack_require__(186); + var ViewCode = __webpack_require__(188); defaultCommands['select-comp'] = __webpack_require__(21); defaultCommands['create-comp'] = __webpack_require__(22); - defaultCommands['delete-comp'] = __webpack_require__(191); - defaultCommands['image-comp'] = __webpack_require__(192); - defaultCommands['move-comp'] = __webpack_require__(193); - defaultCommands['text-comp'] = __webpack_require__(194); - defaultCommands['insert-custom'] = __webpack_require__(55); + defaultCommands['delete-comp'] = __webpack_require__(193); + defaultCommands['image-comp'] = __webpack_require__(194); + defaultCommands['move-comp'] = __webpack_require__(195); + defaultCommands['text-comp'] = __webpack_require__(196); + defaultCommands['insert-custom'] = __webpack_require__(58); defaultCommands['export-template'] = ViewCode; - defaultCommands['sw-visibility'] = __webpack_require__(195); - defaultCommands['open-layers'] = __webpack_require__(196); + defaultCommands['sw-visibility'] = __webpack_require__(197); + defaultCommands['open-layers'] = __webpack_require__(198); defaultCommands['open-sm'] = __webpack_require__(199); defaultCommands['open-tm'] = __webpack_require__(200); defaultCommands['open-blocks'] = __webpack_require__(201); @@ -45024,7 +45371,7 @@ module.exports = function () { cmdMove.initSorterFromModel(sel); } - sel.set('status', 'selected'); + sel.set('status', 'freezed-selected'); } }; @@ -45172,7 +45519,7 @@ module.exports = function () { */ /***/ }), -/* 184 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45202,7 +45549,7 @@ module.exports = { }; /***/ }), -/* 185 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45328,7 +45675,7 @@ module.exports = Backbone.View.extend({ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 186 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45390,7 +45737,7 @@ module.exports = { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), -/* 187 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45398,7 +45745,7 @@ module.exports = { var Backbone = __webpack_require__(0); var DomainViews = __webpack_require__(49); -var ToolbarButtonView = __webpack_require__(188); +var ToolbarButtonView = __webpack_require__(190); module.exports = DomainViews.extend({ itemView: ToolbarButtonView, @@ -45410,7 +45757,7 @@ module.exports = DomainViews.extend({ }); /***/ }), -/* 188 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45456,19 +45803,19 @@ module.exports = Backbone.View.extend({ }); /***/ }), -/* 189 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Backbone = __webpack_require__(0); -var ToolbarButton = __webpack_require__(190); +var ToolbarButton = __webpack_require__(192); module.exports = Backbone.Collection.extend({ model: ToolbarButton }); /***/ }), -/* 190 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45484,7 +45831,7 @@ module.exports = Backbone.Model.extend({ }); /***/ }), -/* 191 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45567,14 +45914,14 @@ module.exports = _.extend({}, SelectComponent, { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 192 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(_) { var Backbone = __webpack_require__(0); -var InsertCustom = __webpack_require__(55); +var InsertCustom = __webpack_require__(58); module.exports = _.extend({}, InsertCustom, { /** @@ -45607,7 +45954,7 @@ module.exports = _.extend({}, InsertCustom, { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 193 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45616,7 +45963,7 @@ module.exports = _.extend({}, InsertCustom, { var _mixins = __webpack_require__(2); var SelectComponent = __webpack_require__(21); -var SelectPosition = __webpack_require__(54); +var SelectPosition = __webpack_require__(57); var $ = Backbone.$; module.exports = _.extend({}, SelectPosition, SelectComponent, { @@ -45774,7 +46121,7 @@ module.exports = _.extend({}, SelectPosition, SelectComponent, { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) /***/ }), -/* 194 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45810,7 +46157,7 @@ module.exports = _.extend({}, CreateComponent, { /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) /***/ }), -/* 195 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45826,152 +46173,38 @@ module.exports = { }; /***/ }), -/* 196 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Backbone) { -var Layers = __webpack_require__(197); +var Layers = __webpack_require__(54); var $ = Backbone.$; module.exports = { - run: function run(em, sender) { - if (!this.toAppend) { - var collection = em.DomComponents.getComponent().get('components'); - var config = em.getConfig(); - var pfx = config.stylePrefix; - var panels = em.Panels; - var lyStylePfx = config.layers.stylePrefix || 'nv-'; - - config.layers.stylePrefix = config.stylePrefix + lyStylePfx; - config.layers.pStylePrefix = config.stylePrefix; - config.layers.em = em.editor; - config.layers.opened = em.editor.get('opened'); - - // Check if panel exists otherwise crate it - if (!panels.getPanel('views-container')) this.panel = panels.addPanel({ id: 'views-container' });else this.panel = panels.getPanel('views-container'); + run: function run(editor) { + var lm = editor.LayerManager; + var pn = editor.Panels; - var toAppend = $('
'); - this.panel.set('appendContent', toAppend).trigger('change:appendContent'); - config.layers.sortContainer = toAppend.get(0); - var layers = new Layers().init(collection, config.layers); - this.$layers = layers.render(); - toAppend.append(this.$layers); - this.toAppend = toAppend; + if (!this.layers) { + var id = 'views-container'; + var layers = document.createElement('div'); + var panels = pn.getPanel(id) || pn.addPanel({ id: id }); + layers.appendChild(lm.render()); + panels.set('appendContent', layers).trigger('change:appendContent'); + this.layers = layers; } - this.toAppend.show(); + + this.layers.style.display = 'block'; }, stop: function stop() { - this.toAppend && this.toAppend.hide(); + var layers = this.layers; + layers && (layers.style.display = 'none'); } }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function () { - var itemsView = void 0; - var config = {}; - var defaults = __webpack_require__(198); - var ItemView = __webpack_require__(56); - var ItemsView = __webpack_require__(57); - - return { - init: function init(collection, opts) { - config = opts || config; - var em = config.em; - - // Set default options - for (var name in defaults) { - if (!(name in config)) config[name] = defaults[name]; - } - - var View = ItemsView; - var level = 0; - var opened = opts.opened || {}; - var options = { - level: level, - config: config, - opened: opened - }; - - // Show wrapper if requested - if (config.showWrapper && collection.parent) { - View = ItemView; - options.model = collection.parent; - } else { - options.collection = collection; - } - - itemsView = new View(options); - em && em.on('change:selectedComponent', this.componentChanged); - this.componentChanged(); - - return this; - }, - - - /** - * Triggered when the selected component is changed - * @private - */ - componentChanged: function componentChanged(e, md) { - var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - if (opts.fromLayers) { - return; - } - - var em = config.em; - var opened = em.get('opened'); - var model = em.get('selectedComponent'); - var parent = model && model.collection ? model.collection.parent : null; - - for (var cid in opened) { - opened[cid].set('open', 0); - } - - while (parent) { - parent.set('open', 1); - opened[parent.cid] = parent; - parent = parent.collection ? parent.collection.parent : null; - } - }, - render: function render() { - return itemsView.render().$el; - } - }; -}; - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = { - stylePrefix: 'nv-', - - // Enable/Disable globally the possibility to sort layers - sortable: 1, - - // Enable/Disable globally the possibility to hide layers - hidable: 1, - - // Hide textnodes - hideTextnode: 1, - - // Indicates if the wrapper is visible in layers - showWrapper: 1 -}; - /***/ }), /* 199 */ /***/ (function(module, exports, __webpack_require__) { @@ -46548,36 +46781,8 @@ module.exports = { "use strict"; -/** - * * [add](#add) - * * [get](#get) - * * [getAll](#getall) - * * [getAllVisible](#getallvisible) - * * [getCategories](#getcategories) - * * [getContainer](#getcontainer) - * * [render](#render) - * - * Block manager helps managing various, draggable, piece of contents that could be easily reused inside templates. - * - * Before using methods you should get first the module from the editor instance, in this way: - * - * ```js - * var blockManager = editor.BlockManager; - * ``` - * - * @module BlockManager - * @param {Object} config Configurations - * @param {Array} [config.blocks=[]] Default blocks - * @example - * ... - * { - * blocks: [ - * {id:'h1-block' label: 'Heading', content:'

...

'}, - * ... - * ], - * } - * ... - */ +var _underscore = __webpack_require__(1); + module.exports = function () { var c = {}, defaults = __webpack_require__(210), @@ -46655,6 +46860,14 @@ module.exports = function () { var blocks = this.getAll(); !blocks.length && blocks.reset(c.blocks); }, + postRender: function postRender() { + var elTo = this.getConfig().appendTo; + + if (elTo) { + var el = (0, _underscore.isElement)(elTo) ? elTo : document.querySelector(elTo); + el.appendChild(this.render()); + } + }, /** @@ -46755,6 +46968,7 @@ module.exports = function () { * Render blocks * @param {Array} blocks Blocks to render, without the argument will render * all global blocks + * @return {HTMLElement} Rendered element * @example * // Render all blocks (inside the global collection) * blockManager.render(); @@ -46781,9 +46995,39 @@ module.exports = function () { } blocksView.collection.reset(toRender); + return this.getContainer(); } }; -}; +}; /** + * * [add](#add) + * * [get](#get) + * * [getAll](#getall) + * * [getAllVisible](#getallvisible) + * * [getCategories](#getcategories) + * * [getContainer](#getcontainer) + * * [render](#render) + * + * Block manager helps managing various, draggable, piece of contents that could be easily reused inside templates. + * + * Before using methods you should get first the module from the editor instance, in this way: + * + * ```js + * var blockManager = editor.BlockManager; + * ``` + * + * @module BlockManager + * @param {Object} config Configurations + * @param {Array} [config.blocks=[]] Default blocks + * @example + * ... + * { + * blocks: [ + * {id:'h1-block' label: 'Heading', content:'

...

'}, + * ... + * ], + * } + * ... + */ /***/ }), /* 210 */ @@ -46792,11 +47036,16 @@ module.exports = function () { "use strict"; -module.exports = { - blocks: [], +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - appendTo: '' -}; +module.exports = _defineProperty({ + // Specify the element to use as a container, string (query) or HTMLElement + // With the empty value, nothing will be rendered + appendTo: '', + + blocks: [] + +}, 'appendTo', ''); /***/ }), /* 211 */ @@ -46820,7 +47069,7 @@ module.exports = Backbone.Collection.extend({ var Backbone = __webpack_require__(0); -var Category = __webpack_require__(58); +var Category = __webpack_require__(59); module.exports = Backbone.Model.extend({ defaults: { @@ -46856,7 +47105,7 @@ module.exports = Backbone.Model.extend({ var Backbone = __webpack_require__(0); module.exports = Backbone.Collection.extend({ - model: __webpack_require__(58) + model: __webpack_require__(59) }); /***/ }), @@ -47035,6 +47284,7 @@ module.exports = __webpack_require__(0).View.extend({ render: function render() { var _this = this; + var ppfx = this.ppfx; var frag = document.createDocumentFragment(); this.catsEl = null; this.blocksEl = null; @@ -47045,7 +47295,8 @@ module.exports = __webpack_require__(0).View.extend({ return _this.add(model, frag); }); this.append(frag); - this.$el.addClass(this.blockContClass + 's'); + var cls = this.blockContClass + 's ' + ppfx + 'one-bg ' + ppfx + 'two-color'; + this.$el.addClass(cls); return this; } }); @@ -47591,9 +47842,53 @@ module.exports = Backbone.View.extend({ "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +/** + * File made for IE/Edge support + * https://github.com/artf/grapesjs/issues/214 + */ + +exports.default = function () { + /** + * Check if IE/Edge + * @return {Boolean} + */ + var isIE = function isIE() { + var match = void 0; + var agent = window.navigator.userAgent; + var rules = [['edge', /Edge\/([0-9\._]+)/], ['ie', /MSIE\s(7\.0)/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]]; + + for (var i = 0; i < rules.length; i++) { + var rule = rules[i]; + match = rule[1].exec(agent); + if (match) break; + } + + return !!match; + }; + + if (isIE()) { + var originalCreateHTMLDocument = DOMImplementation.prototype.createHTMLDocument; + DOMImplementation.prototype.createHTMLDocument = function (title) { + if (!title) title = ''; + return originalCreateHTMLDocument.apply(document.implementation, [title]); + }; + } +}; + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + module.exports = function (config) { var c = config || {}, - defaults = __webpack_require__(220); + defaults = __webpack_require__(221); // Set default options for (var name in defaults) { @@ -47651,7 +47946,7 @@ module.exports = function (config) { }; /***/ }), -/* 220 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47661,50 +47956,6 @@ module.exports = { plugins: [] }; -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -/** - * File made for IE/Edge support - * https://github.com/artf/grapesjs/issues/214 - */ - -exports.default = function () { - /** - * Check if IE/Edge - * @return {Boolean} - */ - var isIE = function isIE() { - var match = void 0; - var agent = window.navigator.userAgent; - var rules = [['edge', /Edge\/([0-9\._]+)/], ['ie', /MSIE\s(7\.0)/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/]]; - - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - match = rule[1].exec(agent); - if (match) break; - } - - return !!match; - }; - - if (isIE()) { - var originalCreateHTMLDocument = DOMImplementation.prototype.createHTMLDocument; - DOMImplementation.prototype.createHTMLDocument = function (title) { - if (!title) title = ''; - return originalCreateHTMLDocument.apply(document.implementation, [title]); - }; - } -}; - /***/ }) /******/ ]); }); \ No newline at end of file