Forked from ckeditor5-build-classic
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
rules: {
|
||||||
|
'ckeditor5-rules/ckeditor-imports': 'off'
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Changelog
|
||||||
|
=========
|
||||||
|
|
||||||
|
All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Contributing
|
||||||
|
========================================
|
||||||
|
|
||||||
|
See the [official contributors' guide to CKEditor 5](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html) to learn more.
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
Software License Agreement
|
||||||
|
==========================
|
||||||
|
|
||||||
|
**CKEditor 5 classic editor build** – https://github.com/ckeditor/ckeditor5-build-classic <br>
|
||||||
|
Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
||||||
|
|
||||||
|
Sources of Intellectual Property Included in CKEditor
|
||||||
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
|
||||||
|
|
||||||
|
The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
|
||||||
|
|
||||||
|
* lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
||||||
|
|
||||||
|
Trademarks
|
||||||
|
----------
|
||||||
|
|
||||||
|
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# ckeditor5-classic-free-full-feature
|
||||||
|
|
||||||
|
Forked from https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-build-classic
|
||||||
|
|
||||||
|
Live Demo - https://facia.dev
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
{
|
||||||
|
"name": "ckeditor5-classic-free-full-feature",
|
||||||
|
"version": "35.4.0",
|
||||||
|
"description": "Faica.dev websites custom classic editor forked and build of CKEditor 5 – the best browser-based rich text editor.",
|
||||||
|
"keywords": [
|
||||||
|
"ckeditor5-build",
|
||||||
|
"ckeditor",
|
||||||
|
"ckeditor5",
|
||||||
|
"ckeditor 5",
|
||||||
|
"wysiwyg",
|
||||||
|
"rich text",
|
||||||
|
"editor",
|
||||||
|
"html",
|
||||||
|
"contentEditable",
|
||||||
|
"editing",
|
||||||
|
"operational transformation",
|
||||||
|
"ot",
|
||||||
|
"collaboration",
|
||||||
|
"collaborative",
|
||||||
|
"real-time",
|
||||||
|
"framework"
|
||||||
|
],
|
||||||
|
"main": "./build/ckeditor.js",
|
||||||
|
"files": [
|
||||||
|
"build",
|
||||||
|
"ckeditor5-metadata.json",
|
||||||
|
"CHANGELOG.md"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@ckeditor/ckeditor5-adapter-ckfinder": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-autoformat": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-basic-styles": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-block-quote": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-ckbox": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-ckfinder": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-cloud-services": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-easy-image": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-editor-classic": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-essentials": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-heading": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-image": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-indent": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-link": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-list": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-media-embed": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-paragraph": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-paste-from-office": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-table": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-typing": "^35.4.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@ckeditor/ckeditor5-core": "^35.4.0",
|
||||||
|
"@ckeditor/ckeditor5-dev-translations": "^32.0.0",
|
||||||
|
"@ckeditor/ckeditor5-dev-utils": "^32.0.0",
|
||||||
|
"@ckeditor/ckeditor5-theme-lark": "^35.4.0",
|
||||||
|
"css-loader": "^5.2.7",
|
||||||
|
"postcss-loader": "^4.3.0",
|
||||||
|
"raw-loader": "^4.0.1",
|
||||||
|
"style-loader": "^2.0.0",
|
||||||
|
"terser-webpack-plugin": "^4.2.3",
|
||||||
|
"ts-loader": "^9.3.0",
|
||||||
|
"webpack": "^5.58.1",
|
||||||
|
"webpack-cli": "^4.9.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0",
|
||||||
|
"npm": ">=5.7.1"
|
||||||
|
},
|
||||||
|
"author": "CKSource (http://cksource.com/)",
|
||||||
|
"license": "GPL-2.0-or-later",
|
||||||
|
"homepage": "https://facia.dev",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/SubhashKarupusamy/ckeditor5-classic-free-full-feature.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "webpack --mode production",
|
||||||
|
"preversion": "npm run build"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CKEditor 5 – classic editor build – development sample</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>CKEditor 5 – classic editor build – development sample</h1>
|
||||||
|
|
||||||
|
<div id="editor">
|
||||||
|
<h2>Sample</h2>
|
||||||
|
|
||||||
|
<p>This is an instance of the <a href="https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/predefined-builds.html#classic-editor">classic editor build</a>.</p>
|
||||||
|
|
||||||
|
<figure class="image">
|
||||||
|
<img src="../tests/manual/sample.jpg" alt="Autumn fields" />
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<p>You can use this sample to validate whether your <a href="https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/custom-builds.html">custom build</a> works fine.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../build/ckeditor.js"></script>
|
||||||
|
<script>
|
||||||
|
ClassicEditor.create( document.querySelector( '#editor' ) )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Vendored
+110
@@ -0,0 +1,110 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
// The editor creator to use.
|
||||||
|
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
|
||||||
|
|
||||||
|
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
|
||||||
|
import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
|
||||||
|
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
|
||||||
|
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
|
||||||
|
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
|
||||||
|
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
|
||||||
|
import CKBox from '@ckeditor/ckeditor5-ckbox/src/ckbox';
|
||||||
|
import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder';
|
||||||
|
import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage';
|
||||||
|
import Heading from '@ckeditor/ckeditor5-heading/src/heading';
|
||||||
|
import Image from '@ckeditor/ckeditor5-image/src/image';
|
||||||
|
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
|
||||||
|
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
|
||||||
|
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
|
||||||
|
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
|
||||||
|
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
|
||||||
|
import Link from '@ckeditor/ckeditor5-link/src/link';
|
||||||
|
import List from '@ckeditor/ckeditor5-list/src/list';
|
||||||
|
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
|
||||||
|
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
|
||||||
|
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice';
|
||||||
|
import PictureEditing from '@ckeditor/ckeditor5-image/src/pictureediting';
|
||||||
|
import Table from '@ckeditor/ckeditor5-table/src/table';
|
||||||
|
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';
|
||||||
|
import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation';
|
||||||
|
import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices';
|
||||||
|
|
||||||
|
export default class ClassicEditor extends ClassicEditorBase {}
|
||||||
|
|
||||||
|
// Plugins to include in the build.
|
||||||
|
ClassicEditor.builtinPlugins = [
|
||||||
|
Essentials,
|
||||||
|
UploadAdapter,
|
||||||
|
Autoformat,
|
||||||
|
Bold,
|
||||||
|
Italic,
|
||||||
|
BlockQuote,
|
||||||
|
CKBox,
|
||||||
|
CKFinder,
|
||||||
|
CloudServices,
|
||||||
|
EasyImage,
|
||||||
|
Heading,
|
||||||
|
Image,
|
||||||
|
ImageCaption,
|
||||||
|
ImageStyle,
|
||||||
|
ImageToolbar,
|
||||||
|
ImageUpload,
|
||||||
|
Indent,
|
||||||
|
Link,
|
||||||
|
List,
|
||||||
|
MediaEmbed,
|
||||||
|
Paragraph,
|
||||||
|
PasteFromOffice,
|
||||||
|
PictureEditing,
|
||||||
|
Table,
|
||||||
|
TableToolbar,
|
||||||
|
TextTransformation
|
||||||
|
];
|
||||||
|
|
||||||
|
// Editor configuration.
|
||||||
|
ClassicEditor.defaultConfig = {
|
||||||
|
toolbar: {
|
||||||
|
items: [
|
||||||
|
'heading',
|
||||||
|
'|',
|
||||||
|
'bold',
|
||||||
|
'italic',
|
||||||
|
'link',
|
||||||
|
'bulletedList',
|
||||||
|
'numberedList',
|
||||||
|
'|',
|
||||||
|
'outdent',
|
||||||
|
'indent',
|
||||||
|
'|',
|
||||||
|
'uploadImage',
|
||||||
|
'blockQuote',
|
||||||
|
'insertTable',
|
||||||
|
'mediaEmbed',
|
||||||
|
'undo',
|
||||||
|
'redo'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
toolbar: [
|
||||||
|
'imageStyle:inline',
|
||||||
|
'imageStyle:block',
|
||||||
|
'imageStyle:side',
|
||||||
|
'|',
|
||||||
|
'toggleImageCaption',
|
||||||
|
'imageTextAlternative'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
contentToolbar: [
|
||||||
|
'tableColumn',
|
||||||
|
'tableRow',
|
||||||
|
'mergeTableCells'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// This value must be kept in sync with the language defined in webpack.config.js.
|
||||||
|
language: 'en'
|
||||||
|
};
|
||||||
Vendored
+237
@@ -0,0 +1,237 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* globals document */
|
||||||
|
|
||||||
|
import ClassicEditor from '../src/ckeditor';
|
||||||
|
import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
|
||||||
|
import { describeMemoryUsage, testMemoryUsage } from '@ckeditor/ckeditor5-core/tests/_utils/memory';
|
||||||
|
|
||||||
|
describe( 'ClassicEditor build', () => {
|
||||||
|
let editor, editorElement;
|
||||||
|
|
||||||
|
beforeEach( () => {
|
||||||
|
editorElement = document.createElement( 'div' );
|
||||||
|
editorElement.innerHTML = '<p><strong>foo</strong> bar</p>';
|
||||||
|
|
||||||
|
document.body.appendChild( editorElement );
|
||||||
|
} );
|
||||||
|
|
||||||
|
afterEach( () => {
|
||||||
|
editorElement.remove();
|
||||||
|
editor = null;
|
||||||
|
} );
|
||||||
|
|
||||||
|
describe( 'build', () => {
|
||||||
|
it( 'contains plugins', () => {
|
||||||
|
expect( ClassicEditor.builtinPlugins ).to.not.be.empty;
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'contains config', () => {
|
||||||
|
expect( ClassicEditor.defaultConfig.toolbar ).to.not.be.empty;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
describe( 'create()', () => {
|
||||||
|
beforeEach( () => {
|
||||||
|
return ClassicEditor.create( editorElement )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
afterEach( () => {
|
||||||
|
return editor.destroy();
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'creates an instance which inherits from the ClassicEditor', () => {
|
||||||
|
expect( editor ).to.be.instanceof( ClassicEditor );
|
||||||
|
expect( editor ).to.be.instanceof( BaseClassicEditor );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'loads data from the editor element', () => {
|
||||||
|
expect( editor.getData() ).to.equal( '<p><strong>foo</strong> bar</p>' );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
describe( 'destroy()', () => {
|
||||||
|
beforeEach( () => {
|
||||||
|
return ClassicEditor.create( editorElement )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'clears editor element if config.updateSourceElementOnDestroy flag is not set', () => {
|
||||||
|
editor.setData( '<p>foo</p>' );
|
||||||
|
|
||||||
|
return editor.destroy()
|
||||||
|
.then( () => {
|
||||||
|
expect( editorElement.innerHTML ).to.equal( '' );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'sets the data back to the editor element if config.updateSourceElementOnDestroy flag is set', () => {
|
||||||
|
editor.setData( '<p>foo</p>' );
|
||||||
|
editor.config.set( 'updateSourceElementOnDestroy', true );
|
||||||
|
|
||||||
|
return editor.destroy()
|
||||||
|
.then( () => {
|
||||||
|
expect( editorElement.innerHTML ).to.equal( '<p>foo</p>' );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'restores the editor element', () => {
|
||||||
|
expect( editor.sourceElement.style.display ).to.equal( 'none' );
|
||||||
|
|
||||||
|
return editor.destroy()
|
||||||
|
.then( () => {
|
||||||
|
expect( editor.sourceElement.style.display ).to.equal( '' );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
describe( 'plugins', () => {
|
||||||
|
beforeEach( () => {
|
||||||
|
return ClassicEditor.create( editorElement )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
afterEach( () => {
|
||||||
|
return editor.destroy();
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'paragraph works', () => {
|
||||||
|
const data = '<p>Some text inside a paragraph.</p>';
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'basic-styles work', () => {
|
||||||
|
const data = [
|
||||||
|
'<p>',
|
||||||
|
'<strong>Test:strong</strong>',
|
||||||
|
'<i>Test:i</i>',
|
||||||
|
'</p>'
|
||||||
|
].join( '' );
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'block-quote works', () => {
|
||||||
|
const data = '<blockquote><p>Quote</p></blockquote>';
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'heading works', () => {
|
||||||
|
const data = [
|
||||||
|
'<h2>Heading 1.</h2>',
|
||||||
|
'<h3>Heading 1.1</h3>',
|
||||||
|
'<h4>Heading 1.1.1</h4>',
|
||||||
|
'<h4>Heading 1.1.2</h4>',
|
||||||
|
'<h3>Heading 1.2</h3>',
|
||||||
|
'<h4>Heading 1.2.1</h4>',
|
||||||
|
'<h2>Heading 2</h2>'
|
||||||
|
].join( '' );
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'image works', () => {
|
||||||
|
const data = '<figure class="image"><img src="/assets/sample.png"></figure>';
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'list works', () => {
|
||||||
|
const data = [
|
||||||
|
'<ul>',
|
||||||
|
'<li>Item 1.</li>',
|
||||||
|
'<li>Item 2.</li>',
|
||||||
|
'</ul>',
|
||||||
|
'<ol>',
|
||||||
|
'<li>Item 1.</li>',
|
||||||
|
'<li>Item 2.</li>',
|
||||||
|
'</ol>'
|
||||||
|
].join( '' );
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'link works', () => {
|
||||||
|
const data = '<p><a href="//ckeditor.com">CKEditor.com</a></p>';
|
||||||
|
|
||||||
|
editor.setData( data );
|
||||||
|
expect( editor.getData() ).to.equal( data );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
describe( 'config', () => {
|
||||||
|
afterEach( () => {
|
||||||
|
return editor.destroy();
|
||||||
|
} );
|
||||||
|
|
||||||
|
// https://github.com/ckeditor/ckeditor5/issues/572
|
||||||
|
it( 'allows configuring toolbar items through config.toolbar', () => {
|
||||||
|
return ClassicEditor
|
||||||
|
.create( editorElement, {
|
||||||
|
toolbar: [ 'bold' ]
|
||||||
|
} )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
|
||||||
|
expect( editor.ui.view.toolbar.items.length ).to.equal( 1 );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
// https://github.com/ckeditor/ckeditor5/issues/572
|
||||||
|
it( 'allows configuring toolbar offset without overriding toolbar items', () => {
|
||||||
|
return ClassicEditor
|
||||||
|
.create( editorElement, {
|
||||||
|
ui: {
|
||||||
|
viewportOffset: {
|
||||||
|
top: 42
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
|
||||||
|
expect( editor.ui.view.toolbar.items.length ).to.equal( 17 );
|
||||||
|
expect( editor.ui.view.stickyPanel.viewportTopOffset ).to.equal( 42 );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
it( 'allows removing built-in toolbar items', () => {
|
||||||
|
return ClassicEditor
|
||||||
|
.create( editorElement, {
|
||||||
|
toolbar: {
|
||||||
|
removeItems: [ 'italic' ]
|
||||||
|
}
|
||||||
|
} )
|
||||||
|
.then( newEditor => {
|
||||||
|
editor = newEditor;
|
||||||
|
|
||||||
|
expect( editor.ui.view.toolbar.items.length ).to.equal( 16 );
|
||||||
|
expect( editor.ui.view.toolbar.items.find( item => item.label === 'Italic' ) ).to.be.undefined;
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
describeMemoryUsage( () => {
|
||||||
|
testMemoryUsage(
|
||||||
|
'should not grow on multiple create/destroy',
|
||||||
|
() => ClassicEditor.create( document.querySelector( '#mem-editor' ) ) );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CKEditor 5 – classic editor build – RequireJS integration test</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>CKEditor 5 – classic editor build – RequireJS integration test (see <a href="https://github.com/ckeditor/ckeditor5/issues/914">#914</a>)</h1>
|
||||||
|
|
||||||
|
<h2>In the default language</h2>
|
||||||
|
|
||||||
|
<div id="editor">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>In German</h2>
|
||||||
|
|
||||||
|
<div id="editor-de">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.js"></script>
|
||||||
|
<script>
|
||||||
|
require( [ '../../build/ckeditor.js' ], ( ClassicEditor ) => {
|
||||||
|
ClassicEditor.create( document.getElementById( 'editor' ) )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
require( [ '../../build/ckeditor.js', '../../build/translations/de.js' ], ( ClassicEditor ) => {
|
||||||
|
ClassicEditor
|
||||||
|
.create( document.getElementById( 'editor-de' ), {
|
||||||
|
language: 'de'
|
||||||
|
} )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<div id="editor">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
|
||||||
|
<figure class="image">
|
||||||
|
<img src="./sample.jpg" alt="Autumn fields" />
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
|
||||||
|
|
||||||
|
<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">“CKEditor 5: The future of rich text editing“</a>:</p>
|
||||||
|
|
||||||
|
<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote>
|
||||||
|
|
||||||
|
<h3>Notes</h3>
|
||||||
|
|
||||||
|
<p><a href="https://ckeditor.com">CKEditor 5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li>
|
||||||
|
<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">“dom.select_events.enabled”</a> option.</li>
|
||||||
|
<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>It has <em>bugs</em> that we are aware of — and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* eslint-env commonjs */
|
||||||
|
/* globals window, document, console */
|
||||||
|
|
||||||
|
const ClassicEditor = require( '../../build/ckeditor' );
|
||||||
|
|
||||||
|
ClassicEditor.create( document.querySelector( '#editor' ) )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# CKEditor 5 classic build – standard version (CommonJS `require()`)
|
||||||
|
|
||||||
|
Just play with it.
|
||||||
|
|
||||||
|
**Note:** Remember to rebuild the bundles by running `npm run build` in build's package directory. You can also run Webpack in the watch mode:
|
||||||
|
|
||||||
|
```
|
||||||
|
./node_modules/.bin/webpack -w
|
||||||
|
```
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>CKEditor 5 – classic editor build – global variable test</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>CKEditor 5 – classic editor build – global variable test</h1>
|
||||||
|
|
||||||
|
<h2>In the default language</h2>
|
||||||
|
|
||||||
|
<div id="editor">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>In German</h2>
|
||||||
|
|
||||||
|
<div id="editor-de">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../../build/ckeditor.js"></script>
|
||||||
|
<script src="../../build/translations/de.js"></script>
|
||||||
|
<script>
|
||||||
|
ClassicEditor.create( document.querySelector( '#editor' ) )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
|
|
||||||
|
ClassicEditor
|
||||||
|
.create( document.querySelector( '#editor-de' ), {
|
||||||
|
language: 'de'
|
||||||
|
} )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<div id="editor">
|
||||||
|
<h2>About CKEditor 5</h2>
|
||||||
|
|
||||||
|
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p>
|
||||||
|
|
||||||
|
<figure class="image">
|
||||||
|
<img src="./sample.jpg" alt="Autumn fields" />
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
|
||||||
|
|
||||||
|
<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">“CKEditor 5: The future of rich text editing“</a>:</p>
|
||||||
|
|
||||||
|
<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote>
|
||||||
|
|
||||||
|
<h3>Notes</h3>
|
||||||
|
|
||||||
|
<p><a href="https://ckeditor.com">CKEditor 5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li>
|
||||||
|
<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">“dom.select_events.enabled”</a> option.</li>
|
||||||
|
<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>It has <em>bugs</em> that we are aware of — and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p>
|
||||||
|
</div>
|
||||||
Vendored
+16
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* globals window, document, console */
|
||||||
|
|
||||||
|
import ClassicEditor from '../../build/ckeditor';
|
||||||
|
|
||||||
|
ClassicEditor.create( document.querySelector( '#editor' ) )
|
||||||
|
.then( editor => {
|
||||||
|
window.editor = editor;
|
||||||
|
} )
|
||||||
|
.catch( error => {
|
||||||
|
console.error( 'There was a problem initializing the editor.', error );
|
||||||
|
} );
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# CKEditor 5 classic build – standard version
|
||||||
|
|
||||||
|
Just play with it.
|
||||||
|
|
||||||
|
**Note:** Remember to rebuild the bundles by running `npm run build` in build's package directory. You can also run Webpack in the watch mode:
|
||||||
|
|
||||||
|
```
|
||||||
|
./node_modules/.bin/webpack -w
|
||||||
|
```
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
@@ -0,0 +1,103 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
|
const path = require( 'path' );
|
||||||
|
const webpack = require( 'webpack' );
|
||||||
|
const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' );
|
||||||
|
const { CKEditorTranslationsPlugin } = require( '@ckeditor/ckeditor5-dev-translations' );
|
||||||
|
const TerserPlugin = require( 'terser-webpack-plugin' );
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
devtool: 'source-map',
|
||||||
|
performance: { hints: false },
|
||||||
|
|
||||||
|
entry: path.resolve( __dirname, 'src', 'ckeditor.js' ),
|
||||||
|
|
||||||
|
output: {
|
||||||
|
// The name under which the editor will be exported.
|
||||||
|
library: 'ClassicEditor',
|
||||||
|
|
||||||
|
path: path.resolve( __dirname, 'build' ),
|
||||||
|
filename: 'ckeditor.js',
|
||||||
|
libraryTarget: 'umd',
|
||||||
|
libraryExport: 'default'
|
||||||
|
},
|
||||||
|
|
||||||
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
new TerserPlugin( {
|
||||||
|
sourceMap: true,
|
||||||
|
terserOptions: {
|
||||||
|
output: {
|
||||||
|
// Preserve CKEditor 5 license comments.
|
||||||
|
comments: /^!/
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extractComments: false
|
||||||
|
} )
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
new CKEditorTranslationsPlugin( {
|
||||||
|
// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
|
||||||
|
// When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js).
|
||||||
|
language: 'en',
|
||||||
|
additionalLanguages: 'all'
|
||||||
|
} ),
|
||||||
|
new webpack.BannerPlugin( {
|
||||||
|
banner: bundler.getLicenseBanner(),
|
||||||
|
raw: true
|
||||||
|
} )
|
||||||
|
],
|
||||||
|
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.svg$/,
|
||||||
|
use: [ 'raw-loader' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'style-loader',
|
||||||
|
options: {
|
||||||
|
injectType: 'singletonStyleTag',
|
||||||
|
attributes: {
|
||||||
|
'data-cke': true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'css-loader',
|
||||||
|
{
|
||||||
|
loader: 'postcss-loader',
|
||||||
|
options: {
|
||||||
|
postcssOptions: styles.getPostCssConfig( {
|
||||||
|
themeImporter: {
|
||||||
|
themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' )
|
||||||
|
},
|
||||||
|
minify: true
|
||||||
|
} )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
use: [ 'ts-loader' ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
resolve: {
|
||||||
|
extensions: [ '.ts', '.js', '.json' ]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Reference in New Issue
Block a user