UNPKG

@ckeditor/ckeditor5-vue

Version:

Official Vue.js 3+ component for CKEditor 5 – the best browser-based rich text editor.

1 lines 38.5 kB
{"version":3,"file":"ckeditor.umd.cjs","names":[],"sources":["../src/plugins/VueIntegrationUsageDataPlugin.ts","../src/utils/cleanupOrphanEditorElements.ts","../src/utils/wrapWithWatchdogIfPresent.ts","../src/composables/useIsUnmounted.ts","../src/composables/useEditorLifecycleEvents.ts","../src/composables/useEditorVModel.ts","../src/composables/useEditorReadOnly.ts","../src/composables/useEditorVersionCheck.ts","../src/ckeditor.vue","../src/ckeditor.vue","../src/composables/useAsync.ts","../src/useCKEditorCloud.ts","../src/plugin.ts"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { version } from 'vue';\nimport {\n\tcreateIntegrationUsageDataPlugin,\n\tappendExtraPluginsToEditorConfig,\n\tisCKEditorFreeLicense\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport type { EditorConfig } from 'ckeditor5';\n\n/**\n * This part of the code is not executed in open-source implementations using a GPL key.\n * It only runs when a specific license key is provided. If you are uncertain whether\n * this applies to your installation, please contact our support team.\n */\nexport const VueIntegrationUsageDataPlugin = createIntegrationUsageDataPlugin(\n\t'vue',\n\t{\n\t\tversion: __VUE_INTEGRATION_VERSION__,\n\t\tframeworkVersion: version\n\t}\n);\n\n/**\n * Appends all integration plugins to the editor configuration.\n *\n * @param editorConfig The editor configuration.\n * @returns The editor configuration with all integration plugins appended.\n */\nexport function appendUsageDataPluginToConfig( editorConfig: EditorConfig ): EditorConfig {\n\t/**\n\t * Do not modify the editor configuration if the editor is using a free license.\n\t */\n\tif ( isCKEditorFreeLicense( editorConfig.licenseKey ) ) {\n\t\treturn editorConfig;\n\t}\n\n\treturn appendExtraPluginsToEditorConfig( editorConfig, [\n\t\t/**\n\t\t * This part of the code is not executed in open-source implementations using a GPL key.\n\t\t * It only runs when a specific license key is provided. If you are uncertain whether\n\t\t * this applies to your installation, please contact our support team.\n\t\t */\n\t\tVueIntegrationUsageDataPlugin\n\t] );\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor } from 'ckeditor5';\n\n/**\n * Removes all DOM elements injected by a specific CKEditor instance.\n * Call this before assigning a new instance (e.g. in the 'restart' watchdog handler),\n * because the watchdog does not clean up the previous editor's DOM on its own.\n */\nexport function cleanupOrphanEditorElements( editor: Editor ): void {\n\tconst uiElement = editor.ui?.element;\n\n\tif ( uiElement?.isConnected ) {\n\t\tuiElement.remove();\n\t}\n\n\tconst bodyCollectionContainer = ( editor.ui as any )?.view?.body?._bodyCollectionContainer;\n\n\tif ( bodyCollectionContainer?.isConnected ) {\n\t\tbodyCollectionContainer.remove();\n\t}\n\n\tconst editingView = editor.editing?.view;\n\n\tif ( editingView ) {\n\t\tfor ( const domRoot of editingView.domRoots.values() ) {\n\t\t\tif ( !( domRoot instanceof HTMLElement ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdomRoot.removeAttribute( 'contenteditable' );\n\t\t\tdomRoot.removeAttribute( 'role' );\n\t\t\tdomRoot.removeAttribute( 'aria-label' );\n\t\t\tdomRoot.removeAttribute( 'aria-multiline' );\n\t\t\tdomRoot.removeAttribute( 'spellcheck' );\n\t\t\tdomRoot.classList.remove(\n\t\t\t\t'ck',\n\t\t\t\t'ck-content',\n\t\t\t\t'ck-editor__editable',\n\t\t\t\t'ck-rounded-corners',\n\t\t\t\t'ck-editor__editable_inline',\n\t\t\t\t'ck-blurred',\n\t\t\t\t'ck-focused'\n\t\t\t);\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { EditorRelaxedConstructor } from '@ckeditor/ckeditor5-integrations-common';\nimport type { EditorWithWatchdogRelaxedConstructor } from '../types.js';\nimport type { Editor, EditorWatchdog, WatchdogConfig } from 'ckeditor5';\n\nconst EDITOR_WATCHDOG_SYMBOL = Symbol.for( 'vue-editor-watchdog' );\n\nexport type EditorWithAttachedWatchdog<TEditor extends Editor = Editor> = TEditor & {\n\t[EDITOR_WATCHDOG_SYMBOL]?: EditorWatchdog;\n};\n\n/**\n * `EditorWatchdog#create` method does not return editor instance (returns `undefined` instead).\n * This function wraps editor constructor with EditorWatchdog and returns fake constructor that\n * returns editor instance assigned to initialized watchdog.\n *\n * It stores watchdog instance in hidden symbol assigned to editor. It simplifies storing both\n * instances in component's state (it's no longer required to store them separately).\n *\n * @param Editor The Editor creator to wrap.\n * @param watchdogConfig Watchdog configuration.\n * @returns The Editor creator wrapped with a watchdog.\n */\nexport function wrapWithWatchdogIfPresent<TEditor extends Editor>(\n\tEditor: EditorWithWatchdogRelaxedConstructor<TEditor>,\n\twatchdogConfig?: WatchdogConfig\n): EditorRelaxedConstructor<EditorWithAttachedWatchdog<TEditor>> {\n\tconst { EditorWatchdog } = Editor;\n\n\tif ( !EditorWatchdog ) {\n\t\treturn Editor;\n\t}\n\n\tconst watchdog = new EditorWatchdog( Editor, watchdogConfig );\n\n\twatchdog.setCreator( async ( ...args: Parameters<typeof Editor['create']> ) => {\n\t\tconst editor = await Editor.create( ...args );\n\n\t\t( editor as EditorWithAttachedWatchdog )[ EDITOR_WATCHDOG_SYMBOL ] = watchdog;\n\n\t\treturn editor;\n\t} );\n\n\treturn {\n\t\t...Editor,\n\t\tcreate: async ( ...args: Parameters<typeof watchdog.create> ) => {\n\t\t\tawait watchdog.create( ...args );\n\n\t\t\treturn watchdog.editor!;\n\t\t}\n\t};\n}\n\n/**\n * Unwraps the EditorWatchdog from the editor instance.\n *\n * @param editor Editor with attached watchdog.\n */\nexport function unwrapEditorWatchdog( editor: EditorWithAttachedWatchdog ): EditorWatchdog | null {\n\treturn editor[ EDITOR_WATCHDOG_SYMBOL ] ?? null;\n}\n\n/**\n * It destroys the editor watchdog if it is assigned to the editor. If it is not, the editor is destroyed.\n *\n * @param editor Editor with attached watchdog.\n */\nexport async function destroyEditorWithWatchdog( editor: EditorWithAttachedWatchdog ): Promise<void> {\n\tconst watchdog = unwrapEditorWatchdog( editor );\n\n\tif ( watchdog ) {\n\t\t// If watchdog is present on the editor, then destroy the watchdog. It'll automatically kill assigned editors.\n\t\tawait watchdog.destroy();\n\t} else {\n\t\t// If there is no watchdog, kill the editor.\n\t\tawait editor.destroy();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { ref, onBeforeUnmount, type Ref } from 'vue';\n\nexport function useIsUnmounted(): Ref<boolean> {\n\tconst isUnmounted = ref( false );\n\n\tonBeforeUnmount( () => {\n\t\tisUnmounted.value = true;\n\t} );\n\n\treturn isUnmounted;\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor, EventInfo } from 'ckeditor5';\nimport { watch, type Ref, type EmitFn } from 'vue';\n\n/**\n * Hook that watches editor lifecycle events and maps them to Vue event emitters.\n */\nexport function useEditorLifecycleEvents<TEditor extends Editor>(\n\tinstance: Ref<TEditor | undefined>,\n\temit: EmitFn<EditorLifecycleEvents<TEditor>>\n): void {\n\twatch( instance, newInstance => {\n\t\t/* istanbul ignore if -- @preserve - Defensive check, instance never becomes undefined. */\n\t\tif ( !newInstance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { document } = newInstance.editing.view;\n\n\t\tdocument.on( 'focus', ( evt: EventInfo ) => emit( 'focus', evt, newInstance ) );\n\t\tdocument.on( 'blur', ( evt: EventInfo ) => emit( 'blur', evt, newInstance ) );\n\n\t\t// Let the world know the editor is ready.\n\t\temit( 'ready', newInstance );\n\n\t\tnewInstance.once( 'destroy', () => {\n\t\t\temit( 'destroy', newInstance );\n\t\t} );\n\t}, { flush: 'post' } );\n}\n\nexport type EditorLifecycleEvents<TEditor extends Editor> = {\n\tready: [ editor: TEditor ];\n\tdestroy: [ editor: TEditor ];\n\tblur: [ event: EventInfo, editor: TEditor ];\n\tfocus: [ event: EventInfo, editor: TEditor ];\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport type { Editor, EventInfo } from 'ckeditor5';\nimport { debounce } from 'lodash-es';\nimport {\n\tref, watch, toValue,\n\ttype Ref, type EmitFn, type ModelRef, type MaybeRefOrGetter\n} from 'vue';\n\nimport { useIsUnmounted } from './useIsUnmounted.js';\n\nconst INPUT_EVENT_DEBOUNCE_WAIT = 300;\n\n/**\n * Hook that synchronizes editor state with currently set vue model.\n */\nexport function useEditorVModel<TEditor extends Editor>(\n\t{\n\t\tdisableTwoWayDataBinding,\n\t\temit,\n\t\tinstance,\n\t\tmodel\n\t}: Attrs<TEditor>\n): Result<TEditor> {\n\tconst lastEditorData = ref<string>();\n\tconst isUnmounted = useIsUnmounted();\n\n\t/**\n\t * Updates the internal cache and emits Vue-compatible events.\n\t */\n\tfunction assignEditorDataToModel( editor: TEditor, evt: EventInfo | null = null ) {\n\t\tconst data = lastEditorData.value = editor.data.get();\n\n\t\temit( 'update:modelValue', data, evt, editor );\n\t\temit( 'input', data, evt, editor );\n\t}\n\n\twatch( model, newModel => {\n\t\t// Synchronize changes of #modelValue. There are two sources of changes:\n\t\t//\n\t\t// External modelValue change ──────╮\n\t\t// ╰─────> ┏━━━━━━━━━━━┓\n\t\t// ┃ Component ┃\n\t\t// ╭─────> ┗━━━━━━━━━━━┛\n\t\t// Internal data change ──────╯\n\t\t// (typing, commands, collaboration)\n\t\t//\n\t\t// Case 1: If the change was external (via props), the editor data must be synced with\n\t\t// the component using instance#setData() and it is OK to destroy the selection.\n\t\t//\n\t\t// Case 2: If the change is the result of internal data change, the #modelValue is the\n\t\t// same as this.lastEditorData, which has been cached on #change:data. If we called\n\t\t// instance#setData() at this point, that would demolish the selection.\n\t\t//\n\t\t// To limit the number of instance#setData() which is time-consuming when there is a\n\t\t// lot of data we make sure:\n\t\t// * the new modelValue is at least different than the old modelValue (Case 1.)\n\t\t// * the new modelValue is different than the last internal instance state (Case 2.)\n\t\t//\n\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42.\n\t\tif ( instance.value && newModel !== lastEditorData.value ) {\n\t\t\tinstance.value.data.set( newModel );\n\t\t}\n\t} );\n\n\twatch( instance, ( newInstance, _oldInstance, onCleanup ) => {\n\t\t/* istanbul ignore if -- @preserve - Defensive check, instance never becomes undefined. */\n\t\tif ( !newInstance ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst emitDebouncedInputEvent = debounce( ( evt: EventInfo ) => {\n\t\t\tif ( toValue( disableTwoWayDataBinding ) || isUnmounted.value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tassignEditorDataToModel( newInstance, evt );\n\t\t}, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } );\n\n\t\t// Debounce emitting the #input event. When data is huge, instance#getData()\n\t\t// takes a lot of time to execute on every single key press and ruins the UX.\n\t\t//\n\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42\n\t\tnewInstance.model.document.on( 'change:data', emitDebouncedInputEvent );\n\n\t\tnewInstance.once( 'destroy', () => {\n\t\t\temitDebouncedInputEvent.cancel();\n\t\t} );\n\n\t\tonCleanup( () => {\n\t\t\temitDebouncedInputEvent.cancel();\n\t\t} );\n\t} );\n\n\treturn {\n\t\tlastEditorData,\n\t\tassignEditorDataToModel\n\t};\n}\n\ntype Attrs<TEditor extends Editor> = {\n\tdisableTwoWayDataBinding: MaybeRefOrGetter<boolean>;\n\tmodel: ModelRef<string>;\n\temit: EmitFn<EditorVModelEvents<TEditor>>;\n\tinstance: Ref<TEditor | undefined>;\n};\n\ntype Result<TEditor extends Editor> = {\n\tlastEditorData: Ref<string | undefined>;\n\tassignEditorDataToModel( editor: TEditor, evt?: EventInfo | null ): void;\n};\n\nexport type EditorVModelEvents<TEditor extends Editor> = {\n\tinput: [ data: string, event: EventInfo | null, editor: TEditor ];\n\t'update:modelValue': [ data: string, event: EventInfo | null, editor: TEditor ];\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { toValue, watchEffect, type MaybeRefOrGetter } from 'vue';\nimport type { Editor } from 'ckeditor5';\n\nconst INTEGRATION_READ_ONLY_LOCK_ID = 'Lock from Vue integration (@ckeditor/ckeditor5-vue)';\n\n/**\n * Hook that toggles readonly state on provided instance.\n */\nexport function useEditorReadOnly(\n\tinstance: MaybeRefOrGetter<Editor | undefined>,\n\tdisabled: MaybeRefOrGetter<boolean | undefined>\n): void {\n\twatchEffect( () => {\n\t\tconst editor = toValue( instance );\n\t\tconst isDisabled = !!toValue( disabled );\n\n\t\tif ( editor ) {\n\t\t\ttoggleEditorReadOnly( editor, isDisabled );\n\t\t}\n\t}, { flush: 'sync' } );\n}\n\n/**\n * Toggles editor to readonly state.\n */\nfunction toggleEditorReadOnly( editor: Editor, readOnly: boolean ): void {\n\tif ( readOnly ) {\n\t\teditor.enableReadOnlyMode( INTEGRATION_READ_ONLY_LOCK_ID );\n\t} else {\n\t\teditor.disableReadOnlyMode( INTEGRATION_READ_ONLY_LOCK_ID );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { compareInstalledCKBaseVersion } from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * Hook that check if integration is compatible with installed version of the editor.\n */\nexport function useEditorVersionCheck(): void {\n\tswitch ( compareInstalledCKBaseVersion( '42.0.0' ) ) {\n\t\tcase null:\n\t\t\tconsole.warn( 'Cannot find the \"CKEDITOR_VERSION\" in the \"window\" scope.' );\n\t\t\tbreak;\n\n\t\tcase -1:\n\t\t\tconsole.warn( 'The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.' );\n\t\t\tbreak;\n\t}\n}\n","<template>\n <component\n :is=\"tagName\"\n ref=\"element\"\n />\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends EditorWithWatchdogRelaxedConstructor\"\n>\nimport {\n\tref,\n\tonMounted,\n\tonBeforeUnmount,\n\tmarkRaw,\n\ttype Raw,\n\tgetCurrentInstance\n} from 'vue';\n\nimport type { CKEditorError, EditorConfig } from 'ckeditor5';\nimport type { EditorErrorDescription, EditorWithWatchdogRelaxedConstructor, Props } from './types.js';\n\nimport {\n\tassignElementToEditorConfig,\n\tassignInitialDataToEditorConfig,\n\tExtractEditorType,\n\tgetInstalledCKBaseFeatures\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport { appendUsageDataPluginToConfig } from './plugins/VueIntegrationUsageDataPlugin.js';\nimport { cleanupOrphanEditorElements } from './utils/cleanupOrphanEditorElements.js';\nimport {\n\tdestroyEditorWithWatchdog,\n\tunwrapEditorWatchdog,\n\twrapWithWatchdogIfPresent,\n\ttype EditorWithAttachedWatchdog\n} from './utils/wrapWithWatchdogIfPresent.js';\n\nimport { useIsUnmounted } from './composables/useIsUnmounted.js';\nimport { EditorLifecycleEvents, useEditorLifecycleEvents } from './composables/useEditorLifecycleEvents.js';\nimport { EditorVModelEvents, useEditorVModel } from './composables/useEditorVModel.js';\nimport { useEditorReadOnly } from './composables/useEditorReadOnly.js';\nimport { useEditorVersionCheck } from './composables/useEditorVersionCheck.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor>;\n\ndefineOptions( {\n\tname: 'CKEditor'\n} );\n\nconst model = defineModel( 'modelValue', { type: String, default: '' } );\nconst props = withDefaults( defineProps<Props<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\ttagName: 'div',\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& EditorLifecycleEvents<TEditor>\n\t& EditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: EditorErrorDescription<TEditor> ],\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst element = ref<HTMLElement>();\nconst instance = ref<Raw<EditorWithAttachedWatchdog<TEditor>>>();\nconst isUnmounted = useIsUnmounted();\n\nconst { lastEditorData, assignEditorDataToModel } = useEditorVModel<TEditor>( {\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\tmodel,\n\temit,\n\tinstance\n} );\n\nuseEditorVersionCheck();\nuseEditorLifecycleEvents( instance, emit );\nuseEditorReadOnly( instance, () => props.disabled );\n\ndefineExpose( {\n\tinstance,\n\tlastEditorData\n} );\n\nonMounted( async () => {\n\tconst supports = getInstalledCKBaseFeatures();\n\n\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\tlet editorConfig: EditorConfig = appendUsageDataPluginToConfig( { ...props.config } );\n\n\t// Store model value before initialization to verify if it changed in the meantime.\n\tlet prevModelValue = model.value;\n\n\tif ( model.value ) {\n\t\teditorConfig = assignInitialDataToEditorConfig( editorConfig, model.value, true );\n\t}\n\n\t// Wrap editor with watchdog unless disabled.\n\tlet Constructor = props.editor;\n\n\tif ( !props.disableWatchdog ) {\n\t\tConstructor = wrapWithWatchdogIfPresent( props.editor, props.watchdogConfig ) as TEditorConstructor;\n\t}\n\n\ttry {\n\t\tconst editor = await (\n\t\t\tsupports.elementConfigAttachment ?\n\t\t\t\tConstructor.create( assignElementToEditorConfig( Constructor, element.value!, editorConfig ) ) :\n\t\t\t\tConstructor.create( element.value, editorConfig )\n\t\t) as unknown as EditorWithAttachedWatchdog<TEditor>;\n\n\t\tif ( isUnmounted.value ) {\n\t\t\tawait destroyEditorWithWatchdog( editor );\n\t\t\treturn;\n\t\t}\n\n\t\t// Synchronize the editor content. The #modelValue may change while the editor is being created, so the editor content has\n\t\t// to be synchronized with these potential changes as soon as it is ready.\n\t\tif ( model.value !== prevModelValue ) {\n\t\t\teditor.data.set( model.value );\n\t\t}\n\n\t\t// If it's editor watchdog instance, then it attach error handlers.\n\t\tconst watchdog = unwrapEditorWatchdog( editor );\n\n\t\tif ( watchdog ) {\n\t\t\twatchdog.on( 'error', ( _, { error, causesRestart } ) => {\n\t\t\t\tif ( isUnmounted.value ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( !hasErrorHandler() ) {\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t}\n\n\t\t\t\temit( 'error', error, {\n\t\t\t\t\tphase: 'runtime',\n\t\t\t\t\twatchdog,\n\t\t\t\t\teditor: watchdog.editor as TEditor,\n\t\t\t\t\tcausesRestart\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\twatchdog.on( 'restart', () => {\n\t\t\t\t// Sometimes editor leave a lot of orphaned elements. Try to remove them.\n\t\t\t\ttry {\n\t\t\t\t\tif ( instance.value ) {\n\t\t\t\t\t\tcleanupOrphanEditorElements( instance.value );\n\t\t\t\t\t}\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tconsole.error( err );\n\t\t\t\t}\n\n\t\t\t\tif ( !isUnmounted.value ) {\n\t\t\t\t\tinstance.value = markRaw( watchdog.editor! as TEditor );\n\n\t\t\t\t\t// Rewind vue model back to old working state.\n\t\t\t\t\tassignEditorDataToModel( instance.value );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tinstance.value = markRaw( editor );\n\t} catch ( error: any ) {\n\t\tif ( isUnmounted.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, {\n\t\t\tphase: 'initialization'\n\t\t} );\n\t}\n} );\n\nonBeforeUnmount( async () => {\n\tconst editor = instance.value;\n\n\tif ( !editor ) {\n\t\treturn;\n\t}\n\n\tinstance.value = undefined;\n\n\tawait destroyEditorWithWatchdog( editor );\n} );\n</script>\n","<template>\n <component\n :is=\"tagName\"\n ref=\"element\"\n />\n</template>\n\n<script\n\tsetup\n\tlang=\"ts\"\n\tgeneric=\"TEditorConstructor extends EditorWithWatchdogRelaxedConstructor\"\n>\nimport {\n\tref,\n\tonMounted,\n\tonBeforeUnmount,\n\tmarkRaw,\n\ttype Raw,\n\tgetCurrentInstance\n} from 'vue';\n\nimport type { CKEditorError, EditorConfig } from 'ckeditor5';\nimport type { EditorErrorDescription, EditorWithWatchdogRelaxedConstructor, Props } from './types.js';\n\nimport {\n\tassignElementToEditorConfig,\n\tassignInitialDataToEditorConfig,\n\tExtractEditorType,\n\tgetInstalledCKBaseFeatures\n} from '@ckeditor/ckeditor5-integrations-common';\n\nimport { appendUsageDataPluginToConfig } from './plugins/VueIntegrationUsageDataPlugin.js';\nimport { cleanupOrphanEditorElements } from './utils/cleanupOrphanEditorElements.js';\nimport {\n\tdestroyEditorWithWatchdog,\n\tunwrapEditorWatchdog,\n\twrapWithWatchdogIfPresent,\n\ttype EditorWithAttachedWatchdog\n} from './utils/wrapWithWatchdogIfPresent.js';\n\nimport { useIsUnmounted } from './composables/useIsUnmounted.js';\nimport { EditorLifecycleEvents, useEditorLifecycleEvents } from './composables/useEditorLifecycleEvents.js';\nimport { EditorVModelEvents, useEditorVModel } from './composables/useEditorVModel.js';\nimport { useEditorReadOnly } from './composables/useEditorReadOnly.js';\nimport { useEditorVersionCheck } from './composables/useEditorVersionCheck.js';\n\ntype TEditor = ExtractEditorType<TEditorConstructor>;\n\ndefineOptions( {\n\tname: 'CKEditor'\n} );\n\nconst model = defineModel( 'modelValue', { type: String, default: '' } );\nconst props = withDefaults( defineProps<Props<TEditorConstructor>>(), {\n\tconfig: () => ( {} ),\n\ttagName: 'div',\n\tdisableWatchdog: false,\n\tdisabled: false,\n\tdisableTwoWayDataBinding: false\n} );\n\nconst emit = defineEmits<\n\t& EditorLifecycleEvents<TEditor>\n\t& EditorVModelEvents<TEditor>\n\t& {\n\t\terror: [ error: Error | CKEditorError, description: EditorErrorDescription<TEditor> ],\n\t}\n>();\n\nconst currentInstance = getCurrentInstance();\nconst hasErrorHandler = () => !!currentInstance?.vnode.props?.onError;\n\nconst element = ref<HTMLElement>();\nconst instance = ref<Raw<EditorWithAttachedWatchdog<TEditor>>>();\nconst isUnmounted = useIsUnmounted();\n\nconst { lastEditorData, assignEditorDataToModel } = useEditorVModel<TEditor>( {\n\tdisableTwoWayDataBinding: () => props.disableTwoWayDataBinding,\n\tmodel,\n\temit,\n\tinstance\n} );\n\nuseEditorVersionCheck();\nuseEditorLifecycleEvents( instance, emit );\nuseEditorReadOnly( instance, () => props.disabled );\n\ndefineExpose( {\n\tinstance,\n\tlastEditorData\n} );\n\nonMounted( async () => {\n\tconst supports = getInstalledCKBaseFeatures();\n\n\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\tlet editorConfig: EditorConfig = appendUsageDataPluginToConfig( { ...props.config } );\n\n\t// Store model value before initialization to verify if it changed in the meantime.\n\tlet prevModelValue = model.value;\n\n\tif ( model.value ) {\n\t\teditorConfig = assignInitialDataToEditorConfig( editorConfig, model.value, true );\n\t}\n\n\t// Wrap editor with watchdog unless disabled.\n\tlet Constructor = props.editor;\n\n\tif ( !props.disableWatchdog ) {\n\t\tConstructor = wrapWithWatchdogIfPresent( props.editor, props.watchdogConfig ) as TEditorConstructor;\n\t}\n\n\ttry {\n\t\tconst editor = await (\n\t\t\tsupports.elementConfigAttachment ?\n\t\t\t\tConstructor.create( assignElementToEditorConfig( Constructor, element.value!, editorConfig ) ) :\n\t\t\t\tConstructor.create( element.value, editorConfig )\n\t\t) as unknown as EditorWithAttachedWatchdog<TEditor>;\n\n\t\tif ( isUnmounted.value ) {\n\t\t\tawait destroyEditorWithWatchdog( editor );\n\t\t\treturn;\n\t\t}\n\n\t\t// Synchronize the editor content. The #modelValue may change while the editor is being created, so the editor content has\n\t\t// to be synchronized with these potential changes as soon as it is ready.\n\t\tif ( model.value !== prevModelValue ) {\n\t\t\teditor.data.set( model.value );\n\t\t}\n\n\t\t// If it's editor watchdog instance, then it attach error handlers.\n\t\tconst watchdog = unwrapEditorWatchdog( editor );\n\n\t\tif ( watchdog ) {\n\t\t\twatchdog.on( 'error', ( _, { error, causesRestart } ) => {\n\t\t\t\tif ( isUnmounted.value ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( !hasErrorHandler() ) {\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t}\n\n\t\t\t\temit( 'error', error, {\n\t\t\t\t\tphase: 'runtime',\n\t\t\t\t\twatchdog,\n\t\t\t\t\teditor: watchdog.editor as TEditor,\n\t\t\t\t\tcausesRestart\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\twatchdog.on( 'restart', () => {\n\t\t\t\t// Sometimes editor leave a lot of orphaned elements. Try to remove them.\n\t\t\t\ttry {\n\t\t\t\t\tif ( instance.value ) {\n\t\t\t\t\t\tcleanupOrphanEditorElements( instance.value );\n\t\t\t\t\t}\n\t\t\t\t} catch ( err ) {\n\t\t\t\t\tconsole.error( err );\n\t\t\t\t}\n\n\t\t\t\tif ( !isUnmounted.value ) {\n\t\t\t\t\tinstance.value = markRaw( watchdog.editor! as TEditor );\n\n\t\t\t\t\t// Rewind vue model back to old working state.\n\t\t\t\t\tassignEditorDataToModel( instance.value );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tinstance.value = markRaw( editor );\n\t} catch ( error: any ) {\n\t\tif ( isUnmounted.value ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !hasErrorHandler() ) {\n\t\t\tconsole.error( error );\n\t\t}\n\n\t\temit( 'error', error, {\n\t\t\tphase: 'initialization'\n\t\t} );\n\t}\n} );\n\nonBeforeUnmount( async () => {\n\tconst editor = instance.value;\n\n\tif ( !editor ) {\n\t\treturn;\n\t}\n\n\tinstance.value = undefined;\n\n\tawait destroyEditorWithWatchdog( editor );\n} );\n</script>\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport {\n\tcomputed, ref,\n\tshallowReadonly, watchEffect,\n\ttype ComputedRef, type Ref\n} from 'vue';\n\nimport { uid } from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * A composable that executes an async function and provides the result.\n *\n * @param asyncFunc The async function to execute.\n * @returns The result of the async function.\n * @example\n *\n * ```ts\n * const { loading, data, error } = useAsync( async () => {\n * \tconst response = await fetch( 'https://api.example.com/data' );\n * \treturn response.json();\n * } );\n * ```\n */\nexport const useAsync = <R>(\n\tasyncFunc: () => Promise<R>\n): AsyncComposableResult<R> => {\n\t// The UUID of the last query to prevent race conditions between multiple queries.\n\tconst lastQueryUUID = ref<string | null>( null );\n\n\t// The error thrown by the async function.\n\tconst error = ref<Error | null>( null );\n\n\t// The data returned by the async function.\n\tconst data: Ref<R | null> = ref( null );\n\n\t// Whether the async function is currently loading.\n\tconst loading = computed( () => lastQueryUUID.value !== null );\n\n\t// Execute the async function and update the result. This will be re-executed\n\t// whenever refs used inside the `asyncFunc` change.\n\twatchEffect( async () => {\n\t\tconst currentQueryUID = uid();\n\n\t\tlastQueryUUID.value = currentQueryUID;\n\t\tdata.value = null;\n\t\terror.value = null;\n\n\t\t// This function is called before updating `data`, `error` or `loading`\n\t\t// because the `watchEffect` could be re-triggered with the new data\n\t\t// while waiting for the previous `asyncFunc` to resolve.\n\t\tconst shouldDiscardQuery = () => lastQueryUUID.value !== currentQueryUID;\n\n\t\ttry {\n\t\t\tconst result = await asyncFunc();\n\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\tdata.value = result;\n\t\t\t}\n\t\t} catch ( err: any ) {\n\t\t\tconsole.error( err );\n\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t} finally {\n\t\t\tif ( !shouldDiscardQuery() ) {\n\t\t\t\tlastQueryUUID.value = null;\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn {\n\t\tloading: shallowReadonly( loading ),\n\t\tdata: shallowReadonly( data ),\n\t\terror: shallowReadonly( error )\n\t};\n};\n\n/**\n * The result of the `useAsync` composable.\n */\nexport type AsyncComposableResult<R> = {\n\n\t/**\n\t * Whether the async function is currently loading.\n\t */\n\tloading: ComputedRef<boolean>;\n\n\t/**\n\t * \tThe data returned by the async function.\n\t */\n\tdata: Ref<R | null>;\n\n\t/**\n\t * The error thrown by the async function.\n\t */\n\terror: Ref<Error | null>;\n};\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport { toValue, type MaybeRefOrGetter } from 'vue';\nimport { useAsync, type AsyncComposableResult } from './composables/useAsync.js';\n\nimport {\n\tloadCKEditorCloud,\n\ttype CKEditorCloudConfig,\n\ttype CKEditorCloudResult\n} from '@ckeditor/ckeditor5-integrations-common';\n\n/**\n * A composable function that loads CKEditor Cloud services.\n *\n * @param config The configuration of the CKEditor Cloud services.\n * @returns The result of the loaded CKEditor Cloud services.\n * @template Config The type of the CKEditor Cloud configuration.\n * @example\n * ```ts\n * const { data } = useCKEditorCloud( {\n * \tversion: '43.0.0',\n * \tlanguages: [ 'en', 'de' ],\n * \tpremium: true\n * } );\n *\n * if ( data.value ) {\n * \tconst { CKEditor, CKEditorPremiumFeatures } = data.value;\n * \tconst { Paragraph } = CKEditor;\n *\n * \t// ..\n * }\n */\nexport default function useCKEditorCloud<Config extends CKEditorCloudConfig>(\n\tconfig: MaybeRefOrGetter<Config>\n): AsyncComposableResult<CKEditorCloudResult<Config>> {\n\treturn useAsync(\n\t\t(): Promise<CKEditorCloudResult<Config>> => loadCKEditorCloud(\n\t\t\ttoValue( config )\n\t\t)\n\t);\n}\n","/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\nimport * as Vue from 'vue';\nimport Ckeditor from './ckeditor.vue';\n\n/* istanbul ignore if -- @preserve */\nif ( !Vue.version || !Vue.version.startsWith( '3.' ) ) {\n\tthrow new Error(\n\t\t'The CKEditor plugin works only with Vue 3+. ' +\n\t\t'For more information, please refer to ' +\n\t\t'https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html'\n\t);\n}\n\nconst CkeditorPlugin = {\n\t/**\n\t * Installs the plugin, registering the `<ckeditor>` component.\n\t *\n\t * @param app The application instance.\n\t */\n\tinstall( app: Vue.App ): void {\n\t\tapp.component( 'Ckeditor', Ckeditor );\n\t}\n};\n\n/**\n * The component is exported as `Ckeditor` and not `CKEditor`, because of how Vue handles components with\n * capitalized names. The component with more than one consecutive capital letter will also be be available\n * in kebab-case, where each capital letter is separated by `-`. This way, the `CKEditor` component will\n * be available as `c-k-editor`, which doesn't look good.\n */\nexport {\n\tCkeditorPlugin,\n\tCkeditor\n};\n\nexport type { EditorErrorDescription } from './types.js';\n\n/**\n * CDN related exports.\n */\n\nexport { default as useCKEditorCloud } from './useCKEditorCloud.js';\n\nexport {\n\tloadCKEditorCloud,\n\ttype CKEditorCloudResult,\n\ttype CKEditorCloudConfig,\n\ttype CdnPluginsPacks\n} from '@ckeditor/ckeditor5-integrations-common';\n\ndeclare module 'vue' {\n\tinterface GlobalComponents {\n\t\tCkeditor: typeof Ckeditor;\n\t\tckeditor: typeof Ckeditor;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;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