0&&y g+p-3&&(c.scrollLeft=n+(m?0:10)-g),c}function Qi(t,e,i){null==e&&null==i||en(t),null!=e&&(t.curOp.scrollLeft=(null==t.curOp.scrollLeft?t.doc.scrollLeft:t.curOp.scrollLeft)+e),null!=i&&(t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+i)}function tn(t){en(t);var e=t.getCursor(),i=e,n=e;t.options.lineWrapping||(i=e.ch?O(e.line,e.ch-1):e,n=O(e.line,e.ch+1)),t.curOp.scrollToPos={from:i,to:n,margin:t.options.cursorScrollMargin,isCursor:!0}}function en(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var i=di(t,e.from),n=di(t,e.to),r=Zi(t,Math.min(i.left,n.left),Math.min(i.top,n.top)-e.margin,Math.max(i.right,n.right),Math.max(i.bottom,n.bottom)+e.margin);t.scrollTo(r.scrollLeft,r.scrollTop)}}function nn(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ra},we(t.curOp)}function rn(t){ke(t.curOp,function(t){for(var e=0;e Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua0){if(s==o.length-1)return null;r=a+o[s].size-e,s++}else r=a-e;e+=r,i+=r}for(;ut(t.doc,i)!=i;){if(s==(n<0?0:o.length-1))return null;i+=n*o[s-(n<0?1:0)].size,s+=n}return{index:s,lineN:i}}function bn(t,e,i){var n=t.display;0==n.view.length||e>=n.viewTo||i<=n.viewFrom?(n.view=xe(t,e,i),n.viewFrom=e):(n.viewFrom>e?n.view=xe(t,e,n.viewFrom).concat(n.view):n.viewFromx&&r.push(new Dn(O(m,x),O(m,f(y,c,s))))}r.length||r.push(new Dn(i,i)),pr(h,In(g.ranges.slice(0,p).concat(r),p),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var w=d,C=w.anchor,k=e;if("single"!=n){var S;S="double"==n?t.findWordAt(e):new Dn(O(e.line,0),H(h,O(e.line+1,0))),D(S.anchor,C)>0?(k=S.head,C=z(w.from(),S.anchor)):(k=S.anchor,C=_(w.to(),S.head))}var M=g.ranges.slice(0);M[p]=new Dn(H(h,C),k),pr(h,In(M,p),$o)}}function a(e){var i=++w,r=Ci(t,e,!0,"rect"==n);if(r)if(0!=D(r,b)){t.curOp.focus=s(),o(r);var l=zi(c,h);(r.line>=l.to||r.lines&&(t=s,r=!0),n=T(this.doc,t)}else n=t;return li(this,n,{top:0,left:0},e||"page",i).top+(r?this.doc.height-pt(n):0)},defaultTextHeight:function(){return mi(this.display)},defaultCharWidth:function(){return vi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,i,n,r){var s=this.display;t=hi(this,H(this.doc,t));var o=t.bottom,a=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),s.sizer.appendChild(e),"over"==n)o=t.top;else if("above"==n||"near"==n){var l=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?o=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(o=t.bottom),a+e.offsetWidth>c&&(a=c-e.offsetWidth)}e.style.top=o+"px",e.style.left=e.style.right="","right"==r?(a=s.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(s.sizer.clientWidth-e.offsetWidth)/2),e.style.left=a+"px"),i&&Ji(this,a,o,a+e.offsetWidth,o+e.offsetHeight)},triggerOnKeyDown:fn(ms),triggerOnKeyPress:fn(bs),triggerOnKeyUp:ys,execCommand:function(t){if(va.hasOwnProperty(t))return va[t].call(null,this)},triggerElectric:fn(function(t){Fs(this,t)}),findPosH:function(t,e,i,n){var r=this,s=1;e<0&&(s=-1,e=-e);for(var o=H(this.doc,t),a=0;aInsert title here
'+
- '
'+
- '
'+
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
',
- attributes: {class:'fa fa-quote-right'}
- },{
- id: 'link',
- label: 'Link',
- category: 'Basic',
- attributes: {class:'fa fa-link'},
- content: {
- type:'link',
- content:'Link',
- style:{color: '#d983a6'}
- },
- },{
- id: 'map',
- label: 'Map',
- category: 'Extra',
- attributes: {class:'fa fa-map-o'},
- content: {
- type: 'map',
- style: {height: '350px'}
- },
- },{
- id: 'video',
- label: 'Video',
- category: 'Basic',
- attributes: {class:'fa fa-youtube-play'},
- content: {
- type: 'video',
- src: 'img/video2.webm',
- style: {
- height: '350px',
- width: '615px',
- }
- },
- }/*,{
- id: 'table',
- label: 'Table',
- attributes: {class:'fa fa-table'},
- content: {
- type: 'table',
- columns: 3,
- rows: 5,
- style: {height: '150px', width: '100%'}
- },
- }*/],
- },
+ blockManager: {},
};
diff --git a/src/editor/index.js b/src/editor/index.js
index e11db0a8d..4df32e796 100644
--- a/src/editor/index.js
+++ b/src/editor/index.js
@@ -10,6 +10,7 @@
* * [getStyle](#getstyle)
* * [setStyle](#setstyle)
* * [getSelected](#getselected)
+ * * [getSelectedToStyle](#getselectedtostyle)
* * [setDevice](#setdevice)
* * [getDevice](#getdevice)
* * [runCommand](#runcommand)
@@ -36,6 +37,8 @@
* component:update:{propertyName} - Listen any property change
* component:styleUpdate - Triggered when the style of the component is updated
* component:styleUpdate:{propertyName} - Listen for a specific style property change
+ * styleManager:change - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback
+ * styleManager:change:{propertyName} - As above but for a specific style property
* storage:load - Triggered when something was loaded from the storage, loaded object passed as an argumnet
* storage:store - Triggered when something is stored to the storage, stored object passed as an argumnet
* canvasScroll - Triggered when the canvas is scrolled
@@ -82,10 +85,9 @@ module.exports = config => {
if (!(name in c))
c[name] = defaults[name];
}
- c.pStylePrefix = c.stylePrefix;
+ c.pStylePrefix = c.stylePrefix;
var em = new EditorModel(c);
-
var editorView = new EditorView({
model: em,
config: c,
@@ -260,6 +262,10 @@ module.exports = config => {
/**
* Add components
* @param {Array