@ckeditor/ckeditor5-editor-inline
Advanced tools
Comparing version 29.2.0 to 30.0.0
@@ -5,2 +5,2 @@ /*! | ||
*/ | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.editorInline=function(t){var e={};function o(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(i,r,function(e){return t[e]}.bind(null,r));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e,o){t.exports=o(3)("./src/utils.js")},function(t,e,o){t.exports=o(3)("./src/core.js")},function(t,e,o){t.exports=o(3)("./src/ui.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,o){t.exports=o(3)("./src/engine.js")},function(t,e,o){"use strict";(function(t){var o="object"==typeof t&&t&&t.Object===Object&&t;e.a=o}).call(this,o(6))},function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){"use strict";o.r(e),o.d(e,"InlineEditor",(function(){return D}));var i=o(1),r=o(0);var n=function(t){return null!=t&&"object"==typeof t},s=o(5),l="object"==typeof self&&self&&self.Object===Object&&self,a=(s.a||l||Function("return this")()).Symbol,c=Object.prototype,u=c.hasOwnProperty,d=c.toString,h=a?a.toStringTag:void 0;var f=function(t){var e=u.call(t,h),o=t[h];try{t[h]=void 0;var i=!0}catch(t){}var r=d.call(t);return i&&(e?t[h]=o:delete t[h]),r},p=Object.prototype.toString;var b=function(t){return p.call(t)},g=a?a.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?f(t):b(t)};var v=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object),m=Function.prototype,O=Object.prototype,y=m.toString,j=O.hasOwnProperty,T=y.call(Object);var E=function(t){if(!n(t)||"[object Object]"!=w(t))return!1;var e=v(t);if(null===e)return!0;var o=j.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&y.call(o)==T};var P=function(t){return n(t)&&1===t.nodeType&&!E(t)},_=o(2),x=o(4);class F extends i.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Object(_.normalizeToolbarConfig)(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,o=t.editing.view,i=e.editable,r=o.document.getRoot();i.name=r.rootName,e.render();const n=i.element;this.setEditableElement(i.name,n),this.focusTracker.add(n),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=t.editing.view,r=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),this._toolbarConfig.viewportTopOffset&&(e.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.listenTo(t.ui,"update",()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})}),r.fillFromConfig(this._toolbarConfig,this.componentFactory),Object(_.enableToolbarKeyboardFocus)({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:r})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.sourceElement,r=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");r&&Object(x.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}const C=Object(r.toUnit)("px");class S extends _.EditorUIView{constructor(t,e,o,i={}){super(t),this.toolbar=new _.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new _.BalloonPanelView(t),this.panel.withArrow=!1,this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new _.InlineEditableUIView(t,e,o),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new r.ResizeObserver(t,()=>{this.toolbar.maxWidth=C(new r.Rect(t).width)})}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let o;return o=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,o}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west"}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east"})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class D extends i.Editor{constructor(t,e){super(e),this.model.document.createRoot(),P(t)&&(this.sourceElement=t,Object(i.secureSourceElement)(this));const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new S(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:o});this.ui=new F(this,r),Object(i.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Object(r.setDataInElement)(this.sourceElement,t)})}static create(t,e={}){return new Promise(o=>{const i=P(t);if(i&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const n=new this(t,e);o(n.initPlugins().then(()=>{n.ui.init()}).then(()=>{if(!i&&e.initialData)throw new r.CKEditorError("editor-create-initial-data",null);const o=void 0!==e.initialData?e.initialData:function(t){return P(t)?Object(r.getDataFromElement)(t):t}(t);return n.data.init(o)}).then(()=>n.fire("ready")).then(()=>n))})}}Object(r.mix)(D,i.DataApiMixin),Object(r.mix)(D,i.ElementApiMixin)}]); | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.editorInline=function(t){var e={};function o(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(i,r,function(e){return t[e]}.bind(null,r));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e,o){t.exports=o(3)("./src/utils.js")},function(t,e,o){t.exports=o(3)("./src/core.js")},function(t,e,o){t.exports=o(3)("./src/ui.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,o){t.exports=o(3)("./src/engine.js")},function(t,e,o){"use strict";(function(t){var o="object"==typeof t&&t&&t.Object===Object&&t;e.a=o}).call(this,o(6))},function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){"use strict";o.r(e),o.d(e,"InlineEditor",(function(){return D}));var i=o(1),r=o(0);var n=function(t){return null!=t&&"object"==typeof t},s=o(5),l="object"==typeof self&&self&&self.Object===Object&&self,a=(s.a||l||Function("return this")()).Symbol,c=Object.prototype,u=c.hasOwnProperty,d=c.toString,h=a?a.toStringTag:void 0;var f=function(t){var e=u.call(t,h),o=t[h];try{t[h]=void 0;var i=!0}catch(t){}var r=d.call(t);return i&&(e?t[h]=o:delete t[h]),r},p=Object.prototype.toString;var b=function(t){return p.call(t)},g=a?a.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?f(t):b(t)};var v=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object),m=Function.prototype,y=Object.prototype,O=m.toString,j=y.hasOwnProperty,T=O.call(Object);var E=function(t){if(!n(t)||"[object Object]"!=w(t))return!1;var e=v(t);if(null===e)return!0;var o=j.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&O.call(o)==T};var P=function(t){return n(t)&&1===t.nodeType&&!E(t)},x=o(2),_=o(4);class F extends i.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Object(x.normalizeToolbarConfig)(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,o=t.editing.view,i=e.editable,r=o.document.getRoot();i.name=r.rootName,e.render();const n=i.element;this.setEditableElement(i.name,n),this.focusTracker.add(n),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=t.editing.view,r=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",({top:t})=>t),e.listenTo(t.ui,"update",()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})}),r.fillFromConfig(this._toolbarConfig,this.componentFactory),Object(x.enableToolbarKeyboardFocus)({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:r})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.sourceElement,r=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");r&&Object(_.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}const C=Object(r.toUnit)("px");class S extends x.EditorUIView{constructor(t,e,o,i={}){super(t),this.toolbar=new x.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new x.BalloonPanelView(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new x.InlineEditableUIView(t,e,o),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new r.ResizeObserver(t,()=>{this.toolbar.maxWidth=C(new r.Rect(t).width)})}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let o;return o=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,o}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west",config:{withArrow:!1}}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east",config:{withArrow:!1}})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class D extends i.Editor{constructor(t,e){super(e),this.model.document.createRoot(),P(t)&&(this.sourceElement=t,Object(i.secureSourceElement)(this));const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new S(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:o});this.ui=new F(this,r),Object(i.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Object(r.setDataInElement)(this.sourceElement,t)})}static create(t,e={}){return new Promise(o=>{const i=P(t);if(i&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const n=new this(t,e);o(n.initPlugins().then(()=>{n.ui.init()}).then(()=>{if(!i&&e.initialData)throw new r.CKEditorError("editor-create-initial-data",null);const o=void 0!==e.initialData?e.initialData:function(t){return P(t)?Object(r.getDataFromElement)(t):t}(t);return n.data.init(o)}).then(()=>n.fire("ready")).then(()=>n))})}}Object(r.mix)(D,i.DataApiMixin),Object(r.mix)(D,i.ElementApiMixin)}]); |
{ | ||
"name": "@ckeditor/ckeditor5-editor-inline", | ||
"version": "29.2.0", | ||
"version": "30.0.0", | ||
"description": "Inline editor implementation for CKEditor 5.", | ||
@@ -14,18 +14,18 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^29.2.0", | ||
"ckeditor5": "^30.0.0", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^29.2.0", | ||
"@ckeditor/ckeditor5-core": "^29.2.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^30.0.0", | ||
"@ckeditor/ckeditor5-core": "^30.0.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^25.4.0", | ||
"@ckeditor/ckeditor5-engine": "^29.2.0", | ||
"@ckeditor/ckeditor5-enter": "^29.2.0", | ||
"@ckeditor/ckeditor5-heading": "^29.2.0", | ||
"@ckeditor/ckeditor5-paragraph": "^29.2.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^29.2.0", | ||
"@ckeditor/ckeditor5-typing": "^29.2.0", | ||
"@ckeditor/ckeditor5-ui": "^29.2.0", | ||
"@ckeditor/ckeditor5-undo": "^29.2.0", | ||
"@ckeditor/ckeditor5-utils": "^29.2.0", | ||
"@ckeditor/ckeditor5-engine": "^30.0.0", | ||
"@ckeditor/ckeditor5-enter": "^30.0.0", | ||
"@ckeditor/ckeditor5-heading": "^30.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^30.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^30.0.0", | ||
"@ckeditor/ckeditor5-typing": "^30.0.0", | ||
"@ckeditor/ckeditor5-ui": "^30.0.0", | ||
"@ckeditor/ckeditor5-undo": "^30.0.0", | ||
"@ckeditor/ckeditor5-utils": "^30.0.0", | ||
"webpack": "^4.43.0", | ||
@@ -32,0 +32,0 @@ "webpack-cli": "^3.3.11" |
@@ -128,5 +128,3 @@ /** | ||
if ( this._toolbarConfig.viewportTopOffset ) { | ||
view.viewportTopOffset = this._toolbarConfig.viewportTopOffset; | ||
} | ||
view.bind( 'viewportTopOffset' ).to( this, 'viewportOffset', ( { top } ) => top ); | ||
@@ -133,0 +131,0 @@ // https://github.com/ckeditor/ckeditor5-editor-inline/issues/4 |
@@ -55,4 +55,9 @@ /** | ||
* | ||
* @readonly | ||
* Bound to {@link module:core/editor/editorui~EditorUI#viewportOffset `EditorUI#viewportOffset`}. | ||
* | ||
* If {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset.top`} is defined, then | ||
* it will override the default value. | ||
* | ||
* @observable | ||
* @default 0 | ||
* @member {Number} #viewportTopOffset | ||
@@ -70,4 +75,2 @@ */ | ||
this.panel.withArrow = false; | ||
/** | ||
@@ -118,3 +121,3 @@ * A set of positioning functions used by the {@link #panel} to float around | ||
* @readonly | ||
* @type {Array.<Function>} | ||
* @type {Array.<module:utils/dom/position~positioningFunction>} | ||
*/ | ||
@@ -210,3 +213,3 @@ this.panelPositions = this._getPanelPositions(); | ||
* @private | ||
* @returns {Array.<Function>} | ||
* @returns {Array.<module:utils/dom/position~positioningFunction>} | ||
*/ | ||
@@ -219,3 +222,6 @@ _getPanelPositions() { | ||
left: editableRect.left, | ||
name: 'toolbar_west' | ||
name: 'toolbar_west', | ||
config: { | ||
withArrow: false | ||
} | ||
}; | ||
@@ -227,3 +233,6 @@ }, | ||
left: editableRect.left + editableRect.width - panelRect.width, | ||
name: 'toolbar_east' | ||
name: 'toolbar_east', | ||
config: { | ||
withArrow: false | ||
} | ||
}; | ||
@@ -230,0 +239,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
588
32520
8
+ Added@ckeditor/ckeditor5-clipboard@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-core@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-engine@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-enter@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-paragraph@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-select-all@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-typing@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-ui@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-undo@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-upload@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-utils@30.0.0(transitive)
+ Added@ckeditor/ckeditor5-widget@30.0.0(transitive)
+ Addedckeditor5@30.0.0(transitive)
- Removed@ckeditor/ckeditor5-clipboard@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-core@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-engine@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-enter@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-paragraph@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-select-all@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-typing@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-ui@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-undo@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-upload@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-utils@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-widget@29.2.0(transitive)
- Removedckeditor5@29.2.0(transitive)
Updatedckeditor5@^30.0.0