@ckeditor/ckeditor5-editor-decoupled 37.0.0-alpha.1 → 37.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/editor-decoupled.js +1 -1
- package/package.json +15 -14
- package/src/decouplededitor.d.ts +20 -1
- package/src/decouplededitor.js +20 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{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:()=>_});var t=o(704),e=o(209),i=o(
|
|
4
|
+
*/(()=>{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(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:()=>_});var t=o(704),e=o(209),i=o(434),n=o(273),s=o(492);class c extends n.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();r.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),e.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view;e.toolbar.fillFromConfig(t.config.get("toolbar"),this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=(t.sourceElement,t.config.get("placeholder"));if(r){const t="string"==typeof r?r:r[o.rootName];t&&(0,s.enablePlaceholder)({view:e,element:o,text:t,isDirectHost:!1,keepOnFocus:!0})}}}class l extends n.EditorUIView{constructor(t,e,o={}){super(t);const r=t.t;this.toolbar=new n.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new n.InlineEditableUIView(t,e,o.editableElement,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}const a=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 b=Object.prototype,p=b.hasOwnProperty,g=b.toString,f=h?h.toStringTag:void 0;const m=function(t){var e=p.call(t,f),o=t[f];try{t[f]=void 0;var r=!0}catch(t){}var i=g.call(t);return r&&(e?t[f]=o:delete t[f]),i};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 T="[object Object]",D=Function.prototype,S=Object.prototype,P=D.toString,C=S.hasOwnProperty,F=P.call(Object);const W=function(t){if(!a(t)||x(t)!=T)return!1;var e=O(t);if(null===e)return!0;var o=C.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&P.call(o)==F};const R=function(t){return a(t)&&1===t.nodeType&&!W(t)};class _ extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,r={}){if(!K(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 K(t)?(0,e.getDataFromElement)(t):t}(o)),K(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this,o)),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new l(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:i});this.ui=new c(this,n)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((r=>{if(K(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)))}))}}function K(t){return R(t)}_.Context=t.Context,_.EditorWatchdog=i.EditorWatchdog,_.ContextWatchdog=i.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-decoupled",
|
|
3
|
-
"version": "37.0.0-alpha.
|
|
3
|
+
"version": "37.0.0-alpha.3",
|
|
4
4
|
"description": "Decoupled editor implementation for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -11,23 +11,24 @@
|
|
|
11
11
|
],
|
|
12
12
|
"main": "src/index.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"ckeditor5": "^37.0.0-alpha.
|
|
14
|
+
"ckeditor5": "^37.0.0-alpha.3",
|
|
15
15
|
"lodash-es": "^4.17.15"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.
|
|
19
|
-
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.
|
|
18
|
+
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.3",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.3",
|
|
20
20
|
"@ckeditor/ckeditor5-dev-utils": "^35.0.0",
|
|
21
|
-
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.
|
|
22
|
-
"@ckeditor/ckeditor5-enter": "^37.0.0-alpha.
|
|
23
|
-
"@ckeditor/ckeditor5-heading": "^37.0.0-alpha.
|
|
24
|
-
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-typing": "^37.0.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-undo": "^37.0.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.
|
|
21
|
+
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.3",
|
|
22
|
+
"@ckeditor/ckeditor5-enter": "^37.0.0-alpha.3",
|
|
23
|
+
"@ckeditor/ckeditor5-heading": "^37.0.0-alpha.3",
|
|
24
|
+
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.3",
|
|
25
|
+
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.3",
|
|
26
|
+
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.3",
|
|
27
|
+
"@ckeditor/ckeditor5-typing": "^37.0.0-alpha.3",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.3",
|
|
29
|
+
"@ckeditor/ckeditor5-undo": "^37.0.0-alpha.3",
|
|
30
|
+
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.3",
|
|
31
|
+
"@ckeditor/ckeditor5-watchdog": "^37.0.0-alpha.3",
|
|
31
32
|
"typescript": "^4.8.4",
|
|
32
33
|
"webpack": "^5.58.1",
|
|
33
34
|
"webpack-cli": "^4.9.0"
|
package/src/decouplededitor.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-decoupled/decouplededitor
|
|
7
7
|
*/
|
|
8
|
-
import { Editor, type EditorConfig } from 'ckeditor5/src/core';
|
|
8
|
+
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core';
|
|
9
|
+
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
|
9
10
|
import DecoupledEditorUI from './decouplededitorui';
|
|
10
11
|
declare const DecoupledEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
|
|
11
12
|
/**
|
|
@@ -192,5 +193,23 @@ export default class DecoupledEditor extends DecoupledEditor_base {
|
|
|
192
193
|
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
|
193
194
|
*/
|
|
194
195
|
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<DecoupledEditor>;
|
|
196
|
+
/**
|
|
197
|
+
* The {@link module:core/context~Context} class.
|
|
198
|
+
*
|
|
199
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
200
|
+
*/
|
|
201
|
+
static Context: typeof Context;
|
|
202
|
+
/**
|
|
203
|
+
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
|
204
|
+
*
|
|
205
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
206
|
+
*/
|
|
207
|
+
static EditorWatchdog: typeof EditorWatchdog;
|
|
208
|
+
/**
|
|
209
|
+
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
|
210
|
+
*
|
|
211
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
212
|
+
*/
|
|
213
|
+
static ContextWatchdog: typeof ContextWatchdog;
|
|
195
214
|
}
|
|
196
215
|
export {};
|
package/src/decouplededitor.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-decoupled/decouplededitor
|
|
7
7
|
*/
|
|
8
|
-
import { Editor, ElementApiMixin, DataApiMixin, secureSourceElement } from 'ckeditor5/src/core';
|
|
8
|
+
import { Editor, Context, ElementApiMixin, DataApiMixin, secureSourceElement } from 'ckeditor5/src/core';
|
|
9
9
|
import { CKEditorError, getDataFromElement } from 'ckeditor5/src/utils';
|
|
10
|
+
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
|
10
11
|
import DecoupledEditorUI from './decouplededitorui';
|
|
11
12
|
import DecoupledEditorUIView from './decouplededitoruiview';
|
|
12
13
|
import { isElement as _isElement } from 'lodash-es';
|
|
@@ -238,6 +239,24 @@ export default class DecoupledEditor extends DataApiMixin(ElementApiMixin(Editor
|
|
|
238
239
|
});
|
|
239
240
|
}
|
|
240
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* The {@link module:core/context~Context} class.
|
|
244
|
+
*
|
|
245
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
246
|
+
*/
|
|
247
|
+
DecoupledEditor.Context = Context;
|
|
248
|
+
/**
|
|
249
|
+
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
|
250
|
+
*
|
|
251
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
252
|
+
*/
|
|
253
|
+
DecoupledEditor.EditorWatchdog = EditorWatchdog;
|
|
254
|
+
/**
|
|
255
|
+
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
|
256
|
+
*
|
|
257
|
+
* Exposed as static editor field for easier access in editor builds.
|
|
258
|
+
*/
|
|
259
|
+
DecoupledEditor.ContextWatchdog = ContextWatchdog;
|
|
241
260
|
function getInitialData(sourceElementOrData) {
|
|
242
261
|
return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
|
|
243
262
|
}
|