Socket
Socket
Sign inDemoInstall

@ckeditor/ckeditor5-editor-decoupled

Package Overview
Dependencies
Maintainers
1
Versions
640
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-editor-decoupled - npm Package Compare versions

Comparing version 32.0.0 to 33.0.0

build/editor-decoupled.js.map

4

build/editor-decoupled.js
/*!
* @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, 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(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>S});var t=o(704),e=o(209);const i=function(t){return null!=t&&"object"==typeof t};const n="object"==typeof global&&global&&global.Object===Object&&global;var s="object"==typeof self&&self&&self.Object===Object&&self;const l=(n||s||Function("return this")()).Symbol;var a=Object.prototype,c=a.hasOwnProperty,u=a.toString,d=l?l.toStringTag:void 0;const h=function(t){var e=c.call(t,d),o=t[d];try{t[d]=void 0;var r=!0}catch(t){}var i=u.call(t);return r&&(e?t[d]=o:delete t[d]),i};var b=Object.prototype.toString;const p=function(t){return b.call(t)};var g=l?l.toStringTag:void 0;const f=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?h(t):p(t)};const m=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var v=Function.prototype,y=Object.prototype,w=v.toString,j=y.hasOwnProperty,E=w.call(Object);const O=function(t){if(!i(t)||"[object Object]"!=f(t))return!1;var e=m(t);if(null===e)return!0;var o=j.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&w.call(o)==E};const T=function(t){return i(t)&&1===t.nodeType&&!O(t)};var x=o(273),D=o(492);class F extends t.EditorUI{constructor(t,e){super(t),this.view=e}init(){const t=this.editor,e=this.view,o=t.editing.view,r=e.editable,i=o.document.getRoot();e.editable.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),this.focusTracker.add(n),e.editable.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.toolbar;e.fillFromConfig(t.config.get("toolbar"),this.componentFactory),(0,x.enableToolbarKeyboardFocus)({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=t.sourceElement,i=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");i&&(0,D.enablePlaceholder)({view:e,element:o,text:i,isDirectHost:!1,keepOnFocus:!0})}}class P extends x.EditorUIView{constructor(t,e,o={}){super(t),this.toolbar=new x.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new x.InlineEditableUIView(t,e,o.editableElement),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class S extends t.Editor{constructor(e,o){super(o),T(e)&&(this.sourceElement=e,(0,t.secureSourceElement)(this)),this.model.document.createRoot();const r=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new P(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:r});this.ui=new F(this,i)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&(0,e.setDataInElement)(this.sourceElement,t)}))}static create(t,o={}){return new Promise((r=>{const i=T(t);if(i&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const n=new this(t,o);r(n.initPlugins().then((()=>{n.ui.init()})).then((()=>{if(!i&&o.initialData)throw new e.CKEditorError("editor-create-initial-data",null);const r=void 0!==o.initialData?o.initialData:function(t){return T(t)?(0,e.getDataFromElement)(t):t}(t);return n.data.init(r)})).then((()=>n.fire("ready"))).then((()=>n)))}))}}(0,e.mix)(S,t.DataApiMixin)})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})();
*/(()=>{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(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>S});var t=o(704),e=o(209);const i=function(t){return null!=t&&"object"==typeof t};const n="object"==typeof global&&global&&global.Object===Object&&global;var s="object"==typeof self&&self&&self.Object===Object&&self;const l=(n||s||Function("return this")()).Symbol;var a=Object.prototype,c=a.hasOwnProperty,d=a.toString,u=l?l.toStringTag:void 0;const h=function(t){var e=c.call(t,u),o=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=d.call(t);return r&&(e?t[u]=o:delete t[u]),i};var b=Object.prototype.toString;const g=function(t){return b.call(t)};var p=l?l.toStringTag:void 0;const f=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":p&&p in Object(t)?h(t):g(t)};const m=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var v=Function.prototype,y=Object.prototype,w=v.toString,j=y.hasOwnProperty,E=w.call(Object);const O=function(t){if(!i(t)||"[object Object]"!=f(t))return!1;var e=m(t);if(null===e)return!0;var o=j.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&w.call(o)==E};const T=function(t){return i(t)&&1===t.nodeType&&!O(t)};var x=o(273),D=o(492);class F extends t.EditorUI{constructor(t,e){super(t),this.view=e}init(){const t=this.editor,e=this.view,o=t.editing.view,r=e.editable,i=o.document.getRoot();e.editable.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),this.focusTracker.add(n),e.editable.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.toolbar;e.fillFromConfig(t.config.get("toolbar"),this.componentFactory),(0,x.enableToolbarKeyboardFocus)({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=t.sourceElement,i=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");i&&(0,D.enablePlaceholder)({view:e,element:o,text:i,isDirectHost:!1,keepOnFocus:!0})}}class P extends x.EditorUIView{constructor(t,e,o={}){super(t),this.toolbar=new x.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new x.InlineEditableUIView(t,e,o.editableElement),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class S extends t.Editor{constructor(o,r={}){if(!T(o)&&void 0!==r.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(r),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return T(t)?(0,e.getDataFromElement)(t):t}(o)),T(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this)),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new P(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:i});this.ui=new F(this,n)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&(0,e.setDataInElement)(this.sourceElement,t)}))}static create(t,o={}){return new Promise((r=>{if(T(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const i=new this(t,o);r(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}(0,e.mix)(S,t.DataApiMixin)})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})();
{
"name": "@ckeditor/ckeditor5-editor-decoupled",
"version": "32.0.0",
"version": "33.0.0",
"description": "Decoupled editor implementation for CKEditor 5.",

@@ -14,18 +14,18 @@ "keywords": [

"dependencies": {
"ckeditor5": "^32.0.0",
"ckeditor5": "^33.0.0",
"lodash-es": "^4.17.15"
},
"devDependencies": {
"@ckeditor/ckeditor5-basic-styles": "^32.0.0",
"@ckeditor/ckeditor5-core": "^32.0.0",
"@ckeditor/ckeditor5-dev-utils": "^27.1.0",
"@ckeditor/ckeditor5-engine": "^32.0.0",
"@ckeditor/ckeditor5-enter": "^32.0.0",
"@ckeditor/ckeditor5-heading": "^32.0.0",
"@ckeditor/ckeditor5-paragraph": "^32.0.0",
"@ckeditor/ckeditor5-theme-lark": "^32.0.0",
"@ckeditor/ckeditor5-typing": "^32.0.0",
"@ckeditor/ckeditor5-ui": "^32.0.0",
"@ckeditor/ckeditor5-undo": "^32.0.0",
"@ckeditor/ckeditor5-utils": "^32.0.0",
"@ckeditor/ckeditor5-basic-styles": "^33.0.0",
"@ckeditor/ckeditor5-core": "^33.0.0",
"@ckeditor/ckeditor5-dev-utils": "^28.0.1",
"@ckeditor/ckeditor5-engine": "^33.0.0",
"@ckeditor/ckeditor5-enter": "^33.0.0",
"@ckeditor/ckeditor5-heading": "^33.0.0",
"@ckeditor/ckeditor5-paragraph": "^33.0.0",
"@ckeditor/ckeditor5-theme-lark": "^33.0.0",
"@ckeditor/ckeditor5-typing": "^33.0.0",
"@ckeditor/ckeditor5-ui": "^33.0.0",
"@ckeditor/ckeditor5-undo": "^33.0.0",
"@ckeditor/ckeditor5-utils": "^33.0.0",
"webpack": "^5.58.1",

@@ -32,0 +32,0 @@ "webpack-cli": "^4.9.0"

@@ -61,7 +61,18 @@ /**

* {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
* @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
* @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
*/
constructor( sourceElementOrData, config ) {
constructor( sourceElementOrData, config = {} ) {
// If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.
if ( !isElement( sourceElementOrData ) && config.initialData !== undefined ) {
// Documented in core/editor/editorconfig.jsdoc.
// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
throw new CKEditorError( 'editor-create-initial-data', null );
}
super( config );
if ( this.config.get( 'initialData' ) === undefined ) {
this.config.set( 'initialData', getInitialData( sourceElementOrData ) );
}
if ( isElement( sourceElementOrData ) ) {

@@ -220,5 +231,3 @@ this.sourceElement = sourceElementOrData;

return new Promise( resolve => {
const isHTMLElement = isElement( sourceElementOrData );
if ( isHTMLElement && sourceElementOrData.tagName === 'TEXTAREA' ) {
if ( isElement( sourceElementOrData ) && sourceElementOrData.tagName === 'TEXTAREA' ) {
// Documented in core/editor/editor.js

@@ -233,16 +242,4 @@ // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message

editor.initPlugins()
.then( () => {
editor.ui.init();
} )
.then( () => {
if ( !isHTMLElement && config.initialData ) {
// Documented in core/editor/editorconfig.jdoc.
// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
throw new CKEditorError( 'editor-create-initial-data', null );
}
const initialData = config.initialData !== undefined ? config.initialData : getInitialData( sourceElementOrData );
return editor.data.init( initialData );
} )
.then( () => editor.ui.init() )
.then( () => editor.data.init( editor.config.get( 'initialData' ) ) )
.then( () => editor.fire( 'ready' ) )

@@ -249,0 +246,0 @@ .then( () => editor )

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc