UNPKG

ckeditor4-angular

Version:

Official CKEditor 4 component for Angular.

1 lines 26.2 kB
{"version":3,"file":"ckeditor4-angular.mjs","sources":["../../src/ckeditor/ckeditor.component.ts","../../src/ckeditor/ckeditor.ts","../../src/ckeditor/ckeditor.module.ts","../../src/ckeditor/ckeditor4-angular.ts"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport {\n\tComponent,\n\tNgZone,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tforwardRef,\n\tElementRef,\n\tAfterViewInit, OnDestroy\n} from '@angular/core';\n\nimport {\n\tControlValueAccessor,\n\tNG_VALUE_ACCESSOR\n} from '@angular/forms';\n\nimport { getEditorNamespace } from 'ckeditor4-integrations-common';\n\nimport { CKEditor4 } from './ckeditor';\n\ndeclare let CKEDITOR: any;\n\n@Component( {\n\tselector: 'ckeditor',\n\ttemplate: '<ng-template></ng-template>',\n\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef( () => CKEditorComponent ),\n\t\t\tmulti: true,\n\t\t}\n\t]\n} )\nexport class CKEditorComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {\n\t/**\n\t * The configuration of the editor.\n\t *\n\t * See https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html\n\t * to learn more.\n\t */\n\t@Input() config?: CKEditor4.Config;\n\n\t/**\n\t * CKEditor 4 script url address. Script will be loaded only if CKEDITOR namespace is missing.\n\t *\n\t * Defaults to 'https://cdn.ckeditor.com/4.25.1-lts/standard-all/ckeditor.js'\n\t */\n\t@Input() editorUrl = 'https://cdn.ckeditor.com/4.25.1-lts/standard-all/ckeditor.js';\n\n\t/**\n\t * Tag name of the editor component.\n\t *\n\t * The default tag is `textarea`.\n\t */\n\t@Input() tagName = 'textarea';\n\n\t/**\n\t * The type of the editor interface.\n\t *\n\t * By default editor interface will be initialized as `classic` editor.\n\t * You can also choose to create an editor with `inline` interface type instead.\n\t *\n\t * See https://ckeditor.com/docs/ckeditor4/latest/guide/dev_uitypes.html\n\t * and https://ckeditor.com/docs/ckeditor4/latest/examples/fixedui.html\n\t * to learn more.\n\t */\n\t@Input() type: CKEditor4.EditorType = CKEditor4.EditorType.CLASSIC;\n\n\t/**\n\t * Keeps track of the editor's data.\n\t *\n\t * It's also decorated as an input which is useful when not using the ngModel.\n\t *\n\t * See https://angular.io/api/forms/NgModel to learn more.\n\t */\n\t@Input() set data( data: string ) {\n\t\tif ( data === this._data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.instance ) {\n\t\t\tthis.instance.setData( data );\n\t\t\t// Data may be changed by ACF.\n\t\t\tthis._data = this.instance.getData();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._data = data;\n\t}\n\n\tget data(): string {\n\t\treturn this._data;\n\t}\n\n\t/**\n\t * When set to `true`, the editor becomes read-only.\n\t *\n\t * See https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#property-readOnly\n\t * to learn more.\n\t */\n\t@Input() set readOnly( isReadOnly: boolean ) {\n\t\tif ( this.instance ) {\n\t\t\tthis.instance.setReadOnly( isReadOnly );\n\t\t\treturn;\n\t\t}\n\n\t\t// Delay setting read-only state until editor initialization.\n\t\tthis._readOnly = isReadOnly;\n\t}\n\n\tget readOnly(): boolean {\n\t\tif ( this.instance ) {\n\t\t\treturn this.instance.readOnly;\n\t\t}\n\n\t\treturn this._readOnly;\n\t}\n\n\t/**\n\t * Fired when the CKEDITOR https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR.html namespace\n\t * is loaded. It only triggers once, no matter how many CKEditor 4 components are initialised.\n\t * Can be used for convenient changes in the namespace, e.g. for adding external plugins.\n\t */\n\t@Output() namespaceLoaded = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the editor is ready. It corresponds with the `editor#instanceReady`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-instanceReady\n\t * event.\n\t */\n\t@Output() ready = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the editor data is loaded, e.g. after calling setData()\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#method-setData\n\t * editor's method. It corresponds with the `editor#dataReady`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-dataReady event.\n\t */\n\t@Output() dataReady = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the content of the editor has changed. It corresponds with the `editor#change`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-change\n\t * event. For performance reasons this event may be called even when data didn't really changed.\n\t * Please note that this event will only be fired when `undo` plugin is loaded. If you need to\n\t * listen for editor changes (e.g. for two-way data binding), use `dataChange` event instead.\n\t */\n\t@Output() change = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the content of the editor has changed. In contrast to `change` - only emits when\n\t * data really changed thus can be successfully used with `[data]` and two way `[(data)]` binding.\n\t *\n\t * See more: https://angular.io/guide/template-syntax#two-way-binding---\n\t */\n\t@Output() dataChange = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the native dragStart event occurs. It corresponds with the `editor#dragstart`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-dragstart\n\t * event.\n\t */\n\t@Output() dragStart = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the native dragEnd event occurs. It corresponds with the `editor#dragend`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-dragend\n\t * event.\n\t */\n\t@Output() dragEnd = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the native drop event occurs. It corresponds with the `editor#drop`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-drop\n\t * event.\n\t */\n\t@Output() drop = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the file loader response is received. It corresponds with the `editor#fileUploadResponse`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-fileUploadResponse\n\t * event.\n\t */\n\t@Output() fileUploadResponse = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the file loader should send XHR. It corresponds with the `editor#fileUploadRequest`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-fileUploadRequest\n\t * event.\n\t */\n\t@Output() fileUploadRequest = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the editing area of the editor is focused. It corresponds with the `editor#focus`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-focus\n\t * event.\n\t */\n\t@Output() focus = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires after the user initiated a paste action, but before the data is inserted.\n\t * It corresponds with the `editor#paste`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-paste\n\t * event.\n\t */\n\t@Output() paste = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires after the `paste` event if content was modified. It corresponds with the `editor#afterPaste`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-afterPaste\n\t * event.\n\t */\n\t@Output() afterPaste = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * Fires when the editing view of the editor is blurred. It corresponds with the `editor#blur`\n\t * https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#event-blur\n\t * event.\n\t */\n\t@Output() blur = new EventEmitter<CKEditor4.EventInfo>();\n\n\t/**\n\t * A callback executed when the content of the editor changes. Part of the\n\t * `ControlValueAccessor` (https://angular.io/api/forms/ControlValueAccessor) interface.\n\t *\n\t * Note: Unset unless the component uses the `ngModel`.\n\t */\n\tonChange?: ( data: string ) => void;\n\n\t/**\n\t * A callback executed when the editor has been blurred. Part of the\n\t * `ControlValueAccessor` (https://angular.io/api/forms/ControlValueAccessor) interface.\n\t *\n\t * Note: Unset unless the component uses the `ngModel`.\n\t */\n\tonTouched?: () => void;\n\n\t/**\n\t * The instance of the editor created by this component.\n\t */\n\tinstance: any;\n\n\t/**\n\t * If the component is read–only before the editor instance is created, it remembers that state,\n\t * so the editor can become read–only once it is ready.\n\t */\n\tprivate _readOnly: boolean = null;\n\n\tprivate _data: string = null;\n\n\tprivate _destroyed: boolean = false;\n\n\tconstructor( private elementRef: ElementRef, private ngZone: NgZone ) {}\n\n\tngAfterViewInit(): void {\n\t\tgetEditorNamespace( this.editorUrl, namespace => {\n\t\t\tthis.namespaceLoaded.emit( namespace );\n\t\t} ).then( () => {\n\t\t\t// Check if component instance was destroyed before `ngAfterViewInit` call (#110).\n\t\t\t// Here, `this.instance` is still not initialized and so additional flag is needed.\n\t\t\tif ( this._destroyed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.ngZone.runOutsideAngular( this.createEditor.bind( this ) );\n\t\t} ).catch( window.console.error );\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._destroyed = true;\n\n\t\tthis.ngZone.runOutsideAngular( () => {\n\t\t\tif ( this.instance ) {\n\t\t\t\tthis.instance.destroy();\n\t\t\t\tthis.instance = null;\n\t\t\t}\n\t\t} );\n\t}\n\n\twriteValue( value: string ): void {\n\t\tthis.data = value;\n\t}\n\n\tregisterOnChange( callback: ( data: string ) => void ): void {\n\t\tthis.onChange = callback;\n\t}\n\n\tregisterOnTouched( callback: () => void ): void {\n\t\tthis.onTouched = callback;\n\t}\n\n\tprivate createEditor(): void {\n\t\tconst element = document.createElement( this.tagName );\n\t\tthis.elementRef.nativeElement.appendChild( element );\n\n\t\tconst userInstanceReadyCallback = this.config?.on?.instanceReady;\n\t\tconst defaultConfig: Partial<CKEditor4.Config> = {\n\t\t\tdelayIfDetached: true\n\t\t};\n\t\tconst config: Partial<CKEditor4.Config> = { ...defaultConfig, ...this.config };\n\n\t\tif ( typeof config.on === 'undefined' ) {\n\t\t\tconfig.on = {};\n\t\t}\n\n\t\tconfig.on.instanceReady = evt => {\n\t\t\tconst editor = evt.editor;\n\n\t\t\tthis.instance = editor;\n\n\t\t\t// Read only state may change during instance initialization.\n\t\t\tthis.readOnly = this._readOnly !== null ? this._readOnly : this.instance.readOnly;\n\n\t\t\tthis.subscribe( this.instance );\n\n\t\t\tconst undo = editor.undoManager;\n\n\t\t\tif ( this.data !== null ) {\n\t\t\t\tundo && undo.lock();\n\n\t\t\t\teditor.setData( this.data, { callback: () => {\n\t\t\t\t\t// Locking undoManager prevents 'change' event.\n\t\t\t\t\t// Trigger it manually to updated bound data.\n\t\t\t\t\tif ( this.data !== editor.getData() ) {\n\t\t\t\t\t\tundo ? editor.fire( 'change' ) : editor.fire( 'dataReady' );\n\t\t\t\t\t}\n\t\t\t\t\tundo && undo.unlock();\n\n\t\t\t\t\tthis.ngZone.run( () => {\n\t\t\t\t\t\tif ( typeof userInstanceReadyCallback === 'function' ) {\n\t\t\t\t\t\t\tuserInstanceReadyCallback( evt );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.ready.emit( evt );\n\t\t\t\t\t} );\n\t\t\t\t} } );\n\t\t\t} else {\n\t\t\t\tthis.ngZone.run( () => {\n\t\t\t\t\tif ( typeof userInstanceReadyCallback === 'function' ) {\n\t\t\t\t\t\tuserInstanceReadyCallback( evt );\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.ready.emit( evt );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tif ( this.type === CKEditor4.EditorType.INLINE ) {\n\t\t\tCKEDITOR.inline( element, config );\n\t\t} else {\n\t\t\tCKEDITOR.replace( element, config );\n\t\t}\n\t}\n\n\tprivate subscribe( editor: any ): void {\n\t\teditor.on( 'focus', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.focus.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'paste', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.paste.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'afterPaste', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.afterPaste.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'dragend', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.dragEnd.emit( evt );\n\t\t\t} );\n\t\t});\n\n\t\teditor.on( 'dragstart', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.dragStart.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'drop', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.drop.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'fileUploadRequest', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.fileUploadRequest.emit(evt);\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'fileUploadResponse', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tthis.fileUploadResponse.emit(evt);\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'blur', evt => {\n\t\t\tthis.ngZone.run( () => {\n\t\t\t\tif ( this.onTouched ) {\n\t\t\t\t\tthis.onTouched();\n\t\t\t\t}\n\n\t\t\t\tthis.blur.emit( evt );\n\t\t\t} );\n\t\t} );\n\n\t\teditor.on( 'dataReady', this.propagateChange, this );\n\n\t\tif ( this.instance.undoManager ) {\n\t\t\teditor.on( 'change', this.propagateChange, this );\n\t\t}\n\t\t// If 'undo' plugin is not loaded, listen to 'selectionCheck' event instead. (#54).\n\t\telse {\n\t\t\teditor.on( 'selectionCheck', this.propagateChange, this );\n\t\t}\n\t}\n\n\tprivate propagateChange( event: any ): void {\n\t\tthis.ngZone.run( () => {\n\t\t\tconst newData = this.instance.getData();\n\n\t\t\tif ( event.name === 'change' ) {\n\t\t\t\tthis.change.emit( event );\n\t\t\t} else if ( event.name === 'dataReady' ) {\n\t\t\t\tthis.dataReady.emit( event );\n\t\t\t}\n\n\t\t\tif ( newData === this.data ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._data = newData;\n\t\t\tthis.dataChange.emit( newData );\n\n\t\t\tif ( this.onChange ) {\n\t\t\t\tthis.onChange( newData );\n\t\t\t}\n\t\t} );\n\t}\n\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * Basic typings for the CKEditor4 elements.\n */\nexport namespace CKEditor4 {\n\t/**\n\t * The CKEditor4 editor constructor.\n\t */\n\texport interface Config {\n\t\t[ key: string ]: any;\n\t}\n\n\t/**\n\t * The CKEditor4 editor.\n\t */\n\texport interface Editor {\n\t\t[ key: string ]: any;\n\t}\n\n\t/**\n\t * The CKEditor4 editor interface type.\n\t * See https://ckeditor.com/docs/ckeditor4/latest/guide/dev_uitypes.html\n\t * to learn more.\n\t */\n\texport const enum EditorType {\n\t\tINLINE = 'inline',\n\t\tCLASSIC = 'classic'\n\t}\n\n\t/**\n\t * The event object passed to CKEditor4 event callbacks.\n\t *\n\t * See https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_eventInfo.html\n\t * to learn more.\n\t */\n\texport interface EventInfo {\n\t\treadonly name: string;\n\t\treadonly editor: any;\n\t\treadonly data: {\n\t\t\t[ key: string ]: any;\n\t\t};\n\t\treadonly listenerData: {\n\t\t\t[ key: string ]: any;\n\t\t};\n\t\treadonly sender: {\n\t\t\t[ key: string ]: any;\n\t\t};\n\n\t\tcancel(): void;\n\n\t\tremoveListener(): void;\n\n\t\tstop(): void;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { CKEditorComponent } from './ckeditor.component';\n\n@NgModule( {\n\timports: [ FormsModule, CommonModule ],\n\tdeclarations: [ CKEditorComponent ],\n\texports: [ CKEditorComponent ]\n} )\nexport class CKEditorModule {\n}\nexport * from './ckeditor';\nexport { CKEditorComponent } from './ckeditor.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './ckeditor.module';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAoCU,iBAAiB,CAAA;IA2N7B,WAAqB,CAAA,UAAsB,EAAU,MAAc,EAAA;QAA9C,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;QAAU,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;AAlNnE;;;;AAIG;QACM,IAAS,CAAA,SAAA,GAAG,8DAA8D,CAAC;AAEpF;;;;AAIG;QACM,IAAO,CAAA,OAAA,GAAG,UAAU,CAAC;AAE9B;;;;;;;;;AASG;AACM,QAAA,IAAA,CAAA,IAAI,GAAsD,SAAA,eAAA;AAoDnE;;;;AAIG;AACO,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAuB,CAAC;AAEpE;;;;AAIG;AACO,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE1D;;;;;AAKG;AACO,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE9D;;;;;;AAMG;AACO,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE3D;;;;;AAKG;AACO,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE/D;;;;AAIG;AACO,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE9D;;;;AAIG;AACO,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAuB,CAAC;AAE5D;;;;AAIG;AACO,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,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