-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,5 @@ cd ckeditor5-demos/headless && yarn | |
3. Start the demo: | ||
|
||
```shell | ||
yarn start | ||
yarn dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
import { | ||
DecoupledEditor, | ||
Alignment, | ||
Autoformat, | ||
BlockQuote, | ||
Bold, | ||
Code, | ||
CodeBlock, | ||
Essentials, | ||
Heading, | ||
Image, | ||
ImageCaption, | ||
ImageResize, | ||
ImageStyle, | ||
ImageToolbar, | ||
Indent, | ||
IndentBlock, | ||
Italic, | ||
Link, | ||
List, | ||
ListProperties, | ||
Paragraph, | ||
PasteFromOffice, | ||
PictureEditing, | ||
RemoveFormat, | ||
Strikethrough, | ||
Table, | ||
TableToolbar, | ||
TextTransformation, | ||
Underline, | ||
} from 'ckeditor5'; | ||
|
||
import 'ckeditor5/index.css'; | ||
|
||
class HeadlessEditor extends DecoupledEditor {} | ||
|
||
HeadlessEditor.builtinPlugins = [ | ||
Alignment, | ||
Autoformat, | ||
BlockQuote, | ||
Bold, | ||
Code, | ||
CodeBlock, | ||
Essentials, | ||
Heading, | ||
Image, | ||
ImageCaption, | ||
ImageResize, | ||
ImageStyle, | ||
ImageToolbar, | ||
Indent, | ||
IndentBlock, | ||
Italic, | ||
Link, | ||
List, | ||
ListProperties, | ||
Paragraph, | ||
PasteFromOffice, | ||
PictureEditing, | ||
RemoveFormat, | ||
Strikethrough, | ||
Table, | ||
TableToolbar, | ||
TextTransformation, | ||
Underline, | ||
]; | ||
|
||
// Editor configuration. | ||
HeadlessEditor.defaultConfig = { | ||
codeBlock: { | ||
languages: [ | ||
{ language: 'css', label: 'CSS' }, | ||
{ language: 'html', label: 'HTML' }, | ||
{ language: 'javascript', label: 'JavaScript' }, | ||
{ language: 'php', label: 'PHP' }, | ||
], | ||
}, | ||
image: { | ||
resizeUnit: 'px', | ||
toolbar: [ | ||
'imageStyle:inline', | ||
'imageStyle:wrapText', | ||
'imageStyle:breakText', | ||
'|', | ||
'toggleImageCaption', | ||
'imageTextAlternative', | ||
], | ||
}, | ||
table: { | ||
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells'], | ||
}, | ||
language: 'en', | ||
}; | ||
|
||
export default HeadlessEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,25 @@ | ||
{ | ||
"name": "headless", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"version": "0.1.0", | ||
"repository": "https://github.com/ckeditor/ckeditor5-demos", | ||
"author": "CKSource (http://cksource.com/)", | ||
"license": "GPL-2.0-or-later", | ||
"private": true, | ||
"type": "module", | ||
"engines": { | ||
"node": ">=18.0.0" | ||
}, | ||
"scripts": { | ||
"dev": "vite --open", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.20.7", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-react": "^7.18.6", | ||
"@ckeditor/ckeditor5-alignment": "40.2.0", | ||
"@ckeditor/ckeditor5-autoformat": "40.2.0", | ||
"@ckeditor/ckeditor5-basic-styles": "40.2.0", | ||
"@ckeditor/ckeditor5-block-quote": "40.2.0", | ||
"@ckeditor/ckeditor5-code-block": "40.2.0", | ||
"@ckeditor/ckeditor5-core": "40.2.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^39.5.0", | ||
"@ckeditor/ckeditor5-editor-decoupled": "40.2.0", | ||
"@ckeditor/ckeditor5-engine": "40.2.0", | ||
"@ckeditor/ckeditor5-enter": "40.2.0", | ||
"@ckeditor/ckeditor5-essentials": "40.2.0", | ||
"@ckeditor/ckeditor5-heading": "40.2.0", | ||
"@ckeditor/ckeditor5-image": "40.2.0", | ||
"@ckeditor/ckeditor5-indent": "40.2.0", | ||
"@ckeditor/ckeditor5-link": "40.2.0", | ||
"@ckeditor/ckeditor5-list": "40.2.0", | ||
"@ckeditor/ckeditor5-paragraph": "40.2.0", | ||
"@ckeditor/ckeditor5-paste-from-office": "40.2.0", | ||
"@ckeditor/ckeditor5-react": "5.0.5", | ||
"@ckeditor/ckeditor5-remove-format": "40.2.0", | ||
"@ckeditor/ckeditor5-table": "40.2.0", | ||
"@ckeditor/ckeditor5-theme-lark": "40.2.0", | ||
"@ckeditor/ckeditor5-typing": "40.2.0", | ||
"@ckeditor/ckeditor5-ui": "40.2.0", | ||
"@ckeditor/ckeditor5-undo": "40.2.0", | ||
"@ckeditor/ckeditor5-utils": "40.2.0", | ||
"babel-loader": "^9.1.0", | ||
"css-loader": "^6.7.3", | ||
"postcss": "^8.4.19", | ||
"postcss-loader": "^4.3.0", | ||
"raw-loader": "^4.0.2", | ||
"ckeditor5": "nightly", | ||
"ckeditor5-premium-features": "nightly", | ||
"vite": "^5.0.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"sass": "^1.57.1", | ||
"sass-loader": "^13.2.0", | ||
"style-loader": "^3.3.1", | ||
"terser-webpack-plugin": "^4.2.3", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^4.10.0", | ||
"webpack-dev-server": "^4.11.1" | ||
}, | ||
"scripts": { | ||
"build": "webpack --mode production", | ||
"build-dev": "webpack --mode development", | ||
"start": "webpack serve --open /index.html --mode development" | ||
"react-dom": "^18.2.0" | ||
} | ||
} |
Oops, something went wrong.