/**
 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
 */

import {
	CS_CONFIG,
	ClassicEditor,
	getViewportTopOffsetConfig,
	setViewportTopOffsetDynamically
} from '@snippets/index.js';

ClassicEditor
	.create( document.querySelector( '#snippet-classic-editor-short' ), {
		cloudServices: CS_CONFIG,
		ui: {
			viewportOffset: {
				top: getViewportTopOffsetConfig()
			}
		}
	} )
	.then( editor => {
		window.editor = editor;

		setViewportTopOffsetDynamically( editor );
	} )
	.catch( err => {
		console.error( err );
	} );
