@ckeditor/ckeditor5-editor-balloon
Advanced tools
Comparing version 37.0.0-alpha.2 to 37.0.0-alpha.3
/*! | ||
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{BalloonEditor:()=>K});var t=o(704),e=o(273),r=o(209),n=o(492);class s extends e.EditorUI{constructor(t,e){super(t),this.view=e}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),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=(t.sourceElement,t.config.get("placeholder"));if(i){const t="string"==typeof i?i:i[o.rootName];t&&(0,n.enablePlaceholder)({view:e,element:o,text:t,isDirectHost:!1,keepOnFocus:!0})}}}class c extends e.EditorUIView{constructor(t,o,i){super(t);const r=t.t;this.editable=new e.InlineEditableUIView(t,o,i,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)})}render(){super.render(),this.registerChild(this.editable)}}const l=function(t){return null!=t&&"object"==typeof t};const a="object"==typeof global&&global&&global.Object===Object&&global;var d="object"==typeof self&&self&&self.Object===Object&&self;const u=(a||d||Function("return this")()).Symbol;var h=Object.prototype,f=h.hasOwnProperty,g=h.toString,p=u?u.toStringTag:void 0;const b=function(t){var e=f.call(t,p),o=t[p];try{t[p]=void 0;var i=!0}catch(t){}var r=g.call(t);return i&&(e?t[p]=o:delete t[p]),r};var m=Object.prototype.toString;const v=function(t){return m.call(t)};var y="[object Null]",w="[object Undefined]",j=u?u.toStringTag:void 0;const E=function(t){return null==t?void 0===t?w:y:j&&j in Object(t)?b(t):v(t)};const O=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var x="[object Object]",S=Function.prototype,P=Object.prototype,T=S.toString,D=P.hasOwnProperty,R=T.call(Object);const C=function(t){if(!l(t)||E(t)!=x)return!1;var e=O(t);if(null===e)return!0;var o=D.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&T.call(o)==R};const F=function(t){return l(t)&&1===t.nodeType&&!C(t)};class K extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,i={}){if(!A(o)&&void 0!==i.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return A(t)?(0,r.getDataFromElement)(t):t}(o)),A(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this,o));const n=this.config.get("plugins");n.push(e.BalloonToolbar),this.config.set("plugins",n),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const l=new c(this.locale,this.editing.view,this.sourceElement);this.ui=new s(this,l),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,e={}){return new Promise((o=>{if(A(t)&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function A(t){return F(t)}})(),(window.CKEditor5=window.CKEditor5||{}).editorBalloon=i})(); | ||
*/(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},434:(t,e,o)=>{t.exports=o(79)("./src/watchdog.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{BalloonEditor:()=>A});var t=o(704),e=o(273),r=o(209),n=o(434),s=o(492);class c extends e.EditorUI{constructor(t,e){super(t),this.view=e}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),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=(t.sourceElement,t.config.get("placeholder"));if(i){const t="string"==typeof i?i:i[o.rootName];t&&(0,s.enablePlaceholder)({view:e,element:o,text:t,isDirectHost:!1,keepOnFocus:!0})}}}class a extends e.EditorUIView{constructor(t,o,i){super(t);const r=t.t;this.editable=new e.InlineEditableUIView(t,o,i,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)})}render(){super.render(),this.registerChild(this.editable)}}const l=function(t){return null!=t&&"object"==typeof t};const d="object"==typeof global&&global&&global.Object===Object&&global;var u="object"==typeof self&&self&&self.Object===Object&&self;const h=(d||u||Function("return this")()).Symbol;var g=Object.prototype,f=g.hasOwnProperty,p=g.toString,b=h?h.toStringTag:void 0;const m=function(t){var e=f.call(t,b),o=t[b];try{t[b]=void 0;var i=!0}catch(t){}var r=p.call(t);return i&&(e?t[b]=o:delete t[b]),r};var v=Object.prototype.toString;const y=function(t){return v.call(t)};var w="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;const x=function(t){return null==t?void 0===t?E:w:j&&j in Object(t)?m(t):y(t)};const O=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var S="[object Object]",P=Function.prototype,T=Object.prototype,C=P.toString,D=T.hasOwnProperty,R=C.call(Object);const F=function(t){if(!l(t)||x(t)!=S)return!1;var e=O(t);if(null===e)return!0;var o=D.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&C.call(o)==R};const K=function(t){return l(t)&&1===t.nodeType&&!F(t)};class A extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,i={}){if(!I(o)&&void 0!==i.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return I(t)?(0,r.getDataFromElement)(t):t}(o)),I(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this,o));const n=this.config.get("plugins");n.push(e.BalloonToolbar),this.config.set("plugins",n),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const s=new a(this.locale,this.editing.view,this.sourceElement);this.ui=new c(this,s),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,e={}){return new Promise((o=>{if(I(t)&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function I(t){return K(t)}A.Context=t.Context,A.EditorWatchdog=n.EditorWatchdog,A.ContextWatchdog=n.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorBalloon=i})(); |
{ | ||
"name": "@ckeditor/ckeditor5-editor-balloon", | ||
"version": "37.0.0-alpha.2", | ||
"version": "37.0.0-alpha.3", | ||
"description": "Balloon editor implementation for CKEditor 5.", | ||
@@ -14,19 +14,20 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^37.0.0-alpha.2", | ||
"ckeditor5": "^37.0.0-alpha.3", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-dev-utils": "^35.0.0", | ||
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-enter": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-heading": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-typing": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-undo": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-enter": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-heading": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-typing": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-undo": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.3", | ||
"@ckeditor/ckeditor5-watchdog": "^37.0.0-alpha.3", | ||
"typescript": "^4.8.4", | ||
@@ -33,0 +34,0 @@ "webpack": "^5.58.1", |
@@ -8,3 +8,4 @@ /** | ||
*/ | ||
import { Editor, type EditorConfig } from 'ckeditor5/src/core'; | ||
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core'; | ||
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog'; | ||
import BalloonEditorUI from './ballooneditorui'; | ||
@@ -158,3 +159,21 @@ declare const BalloonEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>; | ||
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<BalloonEditor>; | ||
/** | ||
* The {@link module:core/context~Context} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
static Context: typeof Context; | ||
/** | ||
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
static EditorWatchdog: typeof EditorWatchdog; | ||
/** | ||
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
static ContextWatchdog: typeof ContextWatchdog; | ||
} | ||
export {}; |
@@ -8,5 +8,6 @@ /** | ||
*/ | ||
import { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core'; | ||
import { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core'; | ||
import { BalloonToolbar } from 'ckeditor5/src/ui'; | ||
import { CKEditorError, getDataFromElement } from 'ckeditor5/src/utils'; | ||
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog'; | ||
import BalloonEditorUI from './ballooneditorui'; | ||
@@ -206,2 +207,20 @@ import BalloonEditorUIView from './ballooneditoruiview'; | ||
} | ||
/** | ||
* The {@link module:core/context~Context} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
BalloonEditor.Context = Context; | ||
/** | ||
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
BalloonEditor.EditorWatchdog = EditorWatchdog; | ||
/** | ||
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class. | ||
* | ||
* Exposed as static editor field for easier access in editor builds. | ||
*/ | ||
BalloonEditor.ContextWatchdog = ContextWatchdog; | ||
function getInitialData(sourceElementOrData) { | ||
@@ -208,0 +227,0 @@ return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData; |
45379
628
17
Updatedckeditor5@^37.0.0-alpha.3