diff --git a/.eslintrc.js b/.eslintrc.js index 21c1bccbd81..880651d7f44 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,6 +7,32 @@ 'use strict'; +const fs = require( 'fs' ); +const path = require( 'path' ); + +const dllPackages = fs.readdirSync( path.join( __dirname, 'src' ) ).map( directory => directory.replace( /\.js$/, '' ) ); + module.exports = { - extends: 'ckeditor5' + extends: 'ckeditor5', + settings: { + dllPackages + }, + rules: { + 'ckeditor5-rules/ckeditor-imports': 'error' + }, + overrides: [ + { + files: [ '**/tests/**/*.js' ], + rules: { + 'no-unused-expressions': 'off', + 'ckeditor5-rules/ckeditor-imports': 'off' + } + }, + { + files: [ '**/docs/**/*.js' ], + rules: { + 'ckeditor5-rules/ckeditor-imports': 'off' + } + } + ] }; diff --git a/docs/_snippets/examples/custom-build.js b/docs/_snippets/examples/custom-build.js index 301787aaaa4..ff7dc26443c 100644 --- a/docs/_snippets/examples/custom-build.js +++ b/docs/_snippets/examples/custom-build.js @@ -15,6 +15,9 @@ import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'; import Code from '@ckeditor/ckeditor5-basic-styles/src/code'; import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import Image from '@ckeditor/ckeditor5-image/src/image'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -29,7 +32,10 @@ ClassicEditor Strikethrough, Code, Highlight, - EasyImage + EasyImage, + Image, + ImageUpload, + CloudServices ], toolbar: { items: [ 'bold', 'italic', 'underline', 'strikethrough', 'code', '|', 'highlight', '|', 'undo', 'redo' ], diff --git a/docs/_snippets/examples/multi-root-editor.js b/docs/_snippets/examples/multi-root-editor.js index 1c5adba0113..da09bf79517 100644 --- a/docs/_snippets/examples/multi-root-editor.js +++ b/docs/_snippets/examples/multi-root-editor.js @@ -37,6 +37,7 @@ import Table from '@ckeditor/ckeditor5-table/src/table'; import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar'; import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; /** @@ -388,7 +389,7 @@ MultirootEditor footerright: document.querySelector( '#footer-right' ) }, { plugins: [ Essentials, Paragraph, Heading, Bold, Italic, List, Link, BlockQuote, Image, ImageCaption, - ImageStyle, ImageToolbar, ImageUpload, Table, TableToolbar, MediaEmbed, EasyImage ], + ImageStyle, ImageToolbar, ImageUpload, Table, TableToolbar, MediaEmbed, EasyImage, CloudServices ], toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'imageUpload', 'blockQuote', 'insertTable', 'mediaEmbed', 'undo', 'redo' ], image: { diff --git a/docs/_snippets/features/mathtype.js b/docs/_snippets/features/mathtype.js index 529d748684d..6e72006d509 100644 --- a/docs/_snippets/features/mathtype.js +++ b/docs/_snippets/features/mathtype.js @@ -8,6 +8,8 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import MathType from '@wiris/mathtype-ckeditor5'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -16,6 +18,8 @@ ClassicEditor plugins: [ ArticlePluginSet, EasyImage, + ImageUpload, + CloudServices, MathType ], toolbar: { diff --git a/docs/_snippets/features/wproofreader.js b/docs/_snippets/features/wproofreader.js index 9604e0d9f10..19033fde0ee 100644 --- a/docs/_snippets/features/wproofreader.js +++ b/docs/_snippets/features/wproofreader.js @@ -8,13 +8,15 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import WProofreader from '@webspellchecker/wproofreader-ckeditor5/src/wproofreader'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; ClassicEditor .create( document.querySelector( '#snippet-wproofreader' ), { - plugins: [ ArticlePluginSet, EasyImage, WProofreader ], + plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices, WProofreader ], wproofreader: { serviceId: '1:Eebp63-lWHbt2-ASpHy4-AYUpy2-fo3mk4-sKrza1-NsuXy4-I1XZC2-0u2F54-aqYWd1-l3Qf14-umd', lang: 'en_AI', diff --git a/docs/builds/guides/development/dll-builds.md b/docs/builds/guides/development/dll-builds.md new file mode 100644 index 00000000000..27b5e053441 --- /dev/null +++ b/docs/builds/guides/development/dll-builds.md @@ -0,0 +1,480 @@ +--- +menu-title: DLL +category: builds-development +order: 30 +--- + +# CKEditor 5 DLL builds + +CKEditor 5 can be integrated into the application using DLL compatible builds. A DLL builds uses [DLL webpack plugin](https://webpack.js.org/plugins/dll-plugin/) to provide a CKEditor 5 base DLL and set of [DLL consumer plugins](https://webpack.js.org/plugins/dll-plugin/#dllreferenceplugin). In contrary to the approach of {@link builds/guides/development/custom-builds creating custom builds}, when using DLL builds you don't have to build everything from sources. To use CKEditor 5 base DLL and editor features you need to add proper `` tags to the page. + +A minimal example of an editor using `ClassicEditor` build is presented below: + +```html + + + Example CKEditor 5 DLL page + + +
+ + + + + + + + + + + + + +``` + + + The DLL builds bundles full plugins code even if not used by the editor. To create a size-optimized file use a {@link builds/guides/development/custom-builds creating custom build}. + + +## DLL packages anatomy + +To use DLL compatible editor you need to use the base DLL build, a DLL-consumer editor build, and a DLL-consumer editor features build for every package. + +### Base DLL bundle + +The base DLL build contains: + +* Core editor plugins: + * `@ckeditor/ckeditor5-engine` + * `@ckeditor/ckeditor5-core` + * `@ckeditor/ckeditor5-ui` + * `@ckeditor/ckeditor5-utils` +* The essential plugins: + * `@ckeditor/ckeditor5-enter` + * `@ckeditor/ckeditor5-paragraph` + * `@ckeditor/ckeditor5-select-all` + * `@ckeditor/ckeditor5-typing` + * `@ckeditor/ckeditor5-undo` + * `@ckeditor/ckeditor5-widget` +* Other, frequently required plugins: + * `@ckeditor/ckeditor5-upload` +* Cloud Services plugins: + * `@ckeditor/ckeditor-cloud-services-core` + +### The editor bundles + +Each DLL-consumer editor build has a limited set of bundled features that are required for a base editing experience: + +```js +const builtinPlugins = [ + Clipboard, + Enter, + Paragraph, + SelectAll, + ShiftEnter, + Typing, + Undo +]; +``` + + + The DLL-consumer editor builds differ from standard editor builds and do not bundle any other feature. + + +### The editor features bundles + +As explained above, the editor dll build contains only bare minimum set of plugins required to provide plain-text editing. To add other features, like bold, table, or image you need to add them to the editor configuration and attach their ` + + + + + + + + + + + + + + + + + + + + + +``` + +## DLL developer guide + +The CKEditor 5 DLL build can be used to add plugins to existing editor build in two ways: + +1. Using webpack to create a DLL consumer plugin. +2. Using DLL directly from a script. + +TODO: Mention about using the `@ckeditor/ckeditor5-dev-utils` package. + +### Creating DLL consumer plugins + +To create a DLL consumer plugin using webpack you need to use provide DLL manifest in your build: + +```js + +const path = require( 'path' ); +const webpack = require( 'webpack' ); + +module.exports = { + mode: 'development', + optimization: { + minimize: false, + moduleIds: 'named' + }, + entry: { + path: path.resolve( __dirname, 'src/dllconsumerplugin.js' ) + }, + output: { + path: path.resolve( __dirname, 'build' ), + filename: 'dll-consumer-plugin.js', + library: 'DLLConsumerPlugin', + libraryTarget: 'umd', + libraryExport: 'default' + }, + plugins: [ + new webpack.DllReferencePlugin( { + manifest: require( 'node_modules/ckeditor5/build/ckeditor5-dll.manifest.json' ), + scope: 'ckeditor5/src' + } ) + ] +}; +``` + +In the above example webpack config we use [`DLLReferencePlugin`](https://webpack.js.org/plugins/dll-plugin/#dllreferenceplugin) to tell the bundler that all packages from `ckeditor5/src` will be loaded during the run-time using the `window.CKEditor5.dll()`. Every imported dependency from base CKEditor 5 DLL should be loaded from `ckeditor5` package: + +```js +import { Plugin, Command } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; + +class ExampleCommand extends Command { + execute() { + const model = this.editor.model; + + model.change( writer => { + model.insertContent( writer.createText( 'The cake is a lie!' ) ); + } ); + } +} + +class DLLConsumerPlugin extends Plugin { + constructor( editor ) { + super( editor ); + + editor.commands.add( 'example-command', new ExampleCommand( editor ) ); + + editor.ui.componentFactory.add( 'example-button', locale => { + const button = new ButtonView( locale ); + + const command = editor.commands.get( 'example-command' ); + + button.set( { + withText: true, + icon: false, + label: 'Click me!' + } ); + + button.bind( 'isEnabled' ).to( command ); + + button.on( 'execute', () => editor.execute( 'example-command' ) ); + + return button; + } ); + } +} + +export default DLLConsumerPlugin; +``` + +After building your plugin using webpack, you can then use it together with the editor DLL build: + +```html + + + + + + + + + + + + + +``` + +### Using DLL directly from a script. + +The code bundled in the DLL can be used directly in a ` + + + + + + + + + + + +``` + +## Building DLL and writing for DLLs + +### Code guidelines + +To allow simultaneous development of standard and DLL builds you need to follow the below rules: + +1. You are allowed to import only from base DLL packages listed in [Base DLL bundle](#base-dll-bundle) using `ckeditor5` package. + For instance, import public API from the `ckeditor5` package: + ```js + import { Plugin } from 'ckeditor5/core'; + ``` + Do not import by a full path: + ```js + import Plugin from '@ckeditor5-core/src/plugin'; + ``` +2. Do not import anything from other packages. + Imports from other packages are disallowed. Their API should be provided on the editor plugin: + Do not: + ```js + import { doBar } from '@ckeditor/ckeditor5-foo-bar/src/utils/bar'; + + doBar(); + ``` + Do instead: + ```js + editor.plugins.get( 'Foo' ).doBar(); + ``` + +### Building the DLL builds + +In the main repo you can run `build:dll` task which will build the base DLL build and all DLL-enabled builds: + +```shell +yarn run build:dll +``` + +This script will look for `build:dll` script inside any packages from `./packages` folder. + +The full rebuild is not necessary for the DLL consumer plugins if the main DLL bundle has not changed. You can run `yarn run build:dll` in the DLL consumer plugin after changes. + +Additionally, if the main bundle has been changed but its exports remain the same (ie bugfix in `ckeditor5-core`), the rebuild of DLL consumer plugins is not needed. diff --git a/docs/framework/guides/contributing/development-environment.md b/docs/framework/guides/contributing/development-environment.md index 2fbf640fc6c..952fe12ed2f 100644 --- a/docs/framework/guides/contributing/development-environment.md +++ b/docs/framework/guides/contributing/development-environment.md @@ -119,6 +119,28 @@ After building documentation, you can quickly start an HTTP server to serve them yarn run docs:serve ``` +### Verifying documentation + +To verify that all pages in our documentation can be opened without any errors, you do not need to do that manually, page by page. Instead, there is a web crawler that automatically traverses the documentation and it visits all pages that have been found. The crawler opens a headless Chromium browser and logs to the console any error that has been found. + +To check pages in the documentation, build it (`yarn run docs`), serve it (`yarn run docs:serve`), and then run the crawler: + +``` +yarn run docs:verify +``` + + + By default, the crawler scans `http://fake.ckeditor.com:8080`, so you need to adjust your hosts file first. + + +This script collects and opens all links from the documentation, except the API and assets. + +The web crawler accepts the following arguments: + +* `--url`, `-u` – The URL to start crawling. This argument is required. Thanks to it you can verify e.g. a deployed documentation. +* `--depth`, `-d` – Defines how many nested page levels should be examined. Infinity by default. +* `--exclude`, `-e` – A comma-separated string with URL exclusions – links that match the excluded part are skipped. Nothing is excluded by default. + ## Generating content styles It is possible to generate a stylesheet containing content styles brought by all CKEditor 5 features. In order to do that, execute: diff --git a/docs/framework/guides/contributing/testing-environment.md b/docs/framework/guides/contributing/testing-environment.md index f8cdbbbb460..e3808f5e9f0 100644 --- a/docs/framework/guides/contributing/testing-environment.md +++ b/docs/framework/guides/contributing/testing-environment.md @@ -130,6 +130,18 @@ ClassicEditor We recommend using the official {@link framework/guides/development-tools#ckeditor-5-inspector CKEditor 5 inspector} for development and debugging. It will give you tons of useful information about the state of the editor such as internal data structures, selection, commands, and many more. +### Verifying all manual tests + +To verify that all manual tests can be **opened** without any errors (the crawler does not execute the manual test steps, it just visits the page), you do not need to do that manually, page by page. Instead, there is a web crawler that automatically traverses the documentation and it visits all pages that have been found. The crawler opens a headless Chromium browser and logs to the console any error that has been found. + +To check manual tests, start the server (`yarn manual --files=XYZ`), and then run the crawler: + +``` +yarn run manual:verify +``` + +Read more about the crawler in {@link framework/guides/contributing/development-environment#verifying-documentation Verifying documentation}. + ## Test suite and CI To ensure the highest quality, we maintain a complete test suite with a stable 100% of code coverage for each of the packages. As of September 2019, this means over 11000 tests and the number is growing. Since every package is tested separately, we implement lower-level tests for libraries and higher-level tests for end-user features. diff --git a/package.json b/package.json index 9e627aea9b5..25912cdf1ab 100644 --- a/package.json +++ b/package.json @@ -93,10 +93,11 @@ "@webspellchecker/wproofreader-ckeditor5": "^2.0.1", "@wiris/mathtype-ckeditor5": "^7.24.0", "babel-standalone": "^6.26.0", + "chalk": "^4.1.0", "cli-table": "^0.3.1", "coveralls": "^3.1.0", "css-loader": "^3.5.3", - "eslint": "^7.1.0", + "eslint": "^7.19.0", "eslint-config-ckeditor5": "^3.0.0", "glob": "^7.1.6", "http-server": "^0.12.3", @@ -104,11 +105,14 @@ "lint-staged": "^10.2.6", "mini-css-extract-plugin": "^0.9.0", "minimatch": "^3.0.4", + "minimist": "^1.2.5", "mkdirp": "^1.0.4", "nyc": "^15.0.1", + "ora": "^5.2.0", "popper": "^1.0.1", "postcss-loader": "^3.0.0", "progress-bar-webpack-plugin": "^2.1.0", + "puppeteer": "^5.5.0", "raw-loader": "^4.0.1", "react": "^16.13.1", "react-dom": "^16.13.1", @@ -139,6 +143,7 @@ "stylelint": "stylelint --quiet --allow-empty-input 'packages/**/*.css' 'docs/**/*.css'", "test": "node --max_old_space_size=8192 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test.js", "manual": "node --max_old_space_size=8192 node_modules/@ckeditor/ckeditor5-dev-tests/bin/test-manual.js", + "manual:verify": "node ./scripts/web-crawler.js --manual", "bootstrap": "yarn install", "clean": "node ./scripts/remove-lock-files.js && rm -rf ./node_modules && rm -rf ./external/*/node_modules", "reset": "rm -rf ./node_modules && yarn run bootstrap", @@ -149,6 +154,7 @@ "docs:build-and-publish-nightly": "node ./scripts/docs/build-and-publish-nightly.js", "docs:content-styles": "node ./scripts/docs/build-content-styles.js", "docs:serve": "http-server ./build/docs/", + "docs:verify": "node ./scripts/web-crawler.js --docs", "translations:collect": "ckeditor5-dev-env-translations collect", "translations:download": "ckeditor5-dev-env-translations download", "translations:upload": "ckeditor5-dev-env-translations upload", @@ -158,6 +164,7 @@ "release:publish": "node ./scripts/release/publish.js", "switch-to-dev-dev": "sh ./scripts/switch-to-dev-dev.sh", "clean-up-svg-icons": "sh ./scripts/clean-up-svg-icons.sh", + "build:dll": "node ./scripts/dll/build-dlls.js", "check-dependencies": "ckeditor5-dev-tests-check-dependencies" }, "lint-staged": { diff --git a/packages/ckeditor-cloud-services-core/package.json b/packages/ckeditor-cloud-services-core/package.json index 68aca9ba437..ea13dfb738b 100644 --- a/packages/ckeditor-cloud-services-core/package.json +++ b/packages/ckeditor-cloud-services-core/package.json @@ -6,7 +6,11 @@ "ckeditor5", "ckeditor5-lib" ], + "main": "src/index.js", "dependencies": { + "ckeditor5": "^25.0.0" + }, + "devDependencies": { "@ckeditor/ckeditor5-utils": "^25.0.0" }, "engines": { @@ -25,6 +29,7 @@ "files": [ "lang", "src", - "theme" + "theme", + "build" ] } diff --git a/packages/ckeditor-cloud-services-core/src/index.js b/packages/ckeditor-cloud-services-core/src/index.js new file mode 100644 index 00000000000..00970babb0a --- /dev/null +++ b/packages/ckeditor-cloud-services-core/src/index.js @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module cloud-services-core + */ + +export { default as Token } from './token/token'; +export { default as FileUploader } from './uploadgateway/fileuploader'; +export { default as UploadGateway } from './uploadgateway/uploadgateway'; diff --git a/packages/ckeditor-cloud-services-core/src/token/token.js b/packages/ckeditor-cloud-services-core/src/token/token.js index cf574e9c9b5..8fd285106ab 100644 --- a/packages/ckeditor-cloud-services-core/src/token/token.js +++ b/packages/ckeditor-cloud-services-core/src/token/token.js @@ -9,9 +9,7 @@ /* globals XMLHttpRequest, setTimeout, clearTimeout, atob */ -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { mix, ObservableMixin, CKEditorError } from 'ckeditor5/src/utils'; const DEFAULT_OPTIONS = { autoRefresh: true }; const DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME = 3600000; diff --git a/packages/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js b/packages/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js index 238eef26301..6b9e79f9bf0 100644 --- a/packages/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js +++ b/packages/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js @@ -9,9 +9,7 @@ /* globals XMLHttpRequest, FormData, Blob, atob */ -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { mix, EmitterMixin, CKEditorError } from 'ckeditor5/src/utils'; const BASE64_HEADER_REG_EXP = /^data:(\S*?);base64,/; diff --git a/packages/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js b/packages/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js index a01d70e5139..5c85b7e379a 100644 --- a/packages/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js +++ b/packages/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js @@ -8,7 +8,7 @@ */ import FileUploader from './fileuploader'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { CKEditorError } from 'ckeditor5/src/utils'; /** * UploadGateway abstracts file uploads to CKEditor Cloud Services. diff --git a/packages/ckeditor5-adapter-ckfinder/package.json b/packages/ckeditor5-adapter-ckfinder/package.json index a4af02bce04..ee566e86c6c 100644 --- a/packages/ckeditor5-adapter-ckfinder/package.json +++ b/packages/ckeditor5-adapter-ckfinder/package.json @@ -9,21 +9,27 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-upload": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-upload": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -41,6 +47,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-adapter-ckfinder/src/index.js b/packages/ckeditor5-adapter-ckfinder/src/index.js new file mode 100644 index 00000000000..d2883812518 --- /dev/null +++ b/packages/ckeditor5-adapter-ckfinder/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module adapter-ckfinder + */ + +import UploadAdapter from './uploadadapter'; + +export default { + UploadAdapter +}; diff --git a/packages/ckeditor5-adapter-ckfinder/src/uploadadapter.js b/packages/ckeditor5-adapter-ckfinder/src/uploadadapter.js index 0058204300a..2a24e5cd7c3 100644 --- a/packages/ckeditor5-adapter-ckfinder/src/uploadadapter.js +++ b/packages/ckeditor5-adapter-ckfinder/src/uploadadapter.js @@ -9,8 +9,9 @@ * @module adapter-ckfinder/uploadadapter */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; +import { Plugin } from 'ckeditor5/src/core'; +import { FileRepository } from 'ckeditor5/src/upload'; + import { getCsrfToken } from './utils'; /** diff --git a/packages/ckeditor5-adapter-ckfinder/webpack.config.js b/packages/ckeditor5-adapter-ckfinder/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-adapter-ckfinder/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-alignment/package.json b/packages/ckeditor5-alignment/package.json index 358b8f4ce8b..0f28b66d09d 100644 --- a/packages/ckeditor5-alignment/package.json +++ b/packages/ckeditor5-alignment/package.json @@ -9,13 +9,14 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", @@ -23,7 +24,10 @@ "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -41,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-alignment/src/alignment.js b/packages/ckeditor5-alignment/src/alignment.js index ab39e02e03f..6012d44ce7e 100644 --- a/packages/ckeditor5-alignment/src/alignment.js +++ b/packages/ckeditor5-alignment/src/alignment.js @@ -7,7 +7,7 @@ * @module alignment/alignment */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AlignmentEditing from './alignmentediting'; import AlignmentUI from './alignmentui'; diff --git a/packages/ckeditor5-alignment/src/alignmentcommand.js b/packages/ckeditor5-alignment/src/alignmentcommand.js index 8a2070127cb..8b170153bb4 100644 --- a/packages/ckeditor5-alignment/src/alignmentcommand.js +++ b/packages/ckeditor5-alignment/src/alignmentcommand.js @@ -7,8 +7,8 @@ * @module alignment/alignmentcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; import { isDefault } from './utils'; diff --git a/packages/ckeditor5-alignment/src/alignmentediting.js b/packages/ckeditor5-alignment/src/alignmentediting.js index 62ba3ba83ed..b44320e5428 100644 --- a/packages/ckeditor5-alignment/src/alignmentediting.js +++ b/packages/ckeditor5-alignment/src/alignmentediting.js @@ -7,7 +7,7 @@ * @module alignment/alignmentediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AlignmentCommand from './alignmentcommand'; import { isDefault, isSupported, supportedOptions } from './utils'; diff --git a/packages/ckeditor5-alignment/src/alignmentui.js b/packages/ckeditor5-alignment/src/alignmentui.js index 5bd017aeec1..483345fd68e 100644 --- a/packages/ckeditor5-alignment/src/alignmentui.js +++ b/packages/ckeditor5-alignment/src/alignmentui.js @@ -7,22 +7,16 @@ * @module alignment/alignmentui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import { createDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui'; import { isSupported } from './utils'; -import alignLeftIcon from '@ckeditor/ckeditor5-core/theme/icons/align-left.svg'; -import alignRightIcon from '@ckeditor/ckeditor5-core/theme/icons/align-right.svg'; -import alignCenterIcon from '@ckeditor/ckeditor5-core/theme/icons/align-center.svg'; -import alignJustifyIcon from '@ckeditor/ckeditor5-core/theme/icons/align-justify.svg'; - -const icons = new Map( [ - [ 'left', alignLeftIcon ], - [ 'right', alignRightIcon ], - [ 'center', alignCenterIcon ], - [ 'justify', alignJustifyIcon ] +const iconsMap = new Map( [ + [ 'left', icons.alignLeft ], + [ 'right', icons.alignRight ], + [ 'center', icons.alignCenter ], + [ 'justify', icons.alignJustify ] ] ); /** @@ -102,7 +96,7 @@ export default class AlignmentUI extends Plugin { } ); // The default icon depends on the direction of the content. - const defaultIcon = locale.contentLanguageDirection === 'rtl' ? alignRightIcon : alignLeftIcon; + const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get( 'right' ) : iconsMap.get( 'left' ); // Change icon to reflect current selection's alignment. dropdownView.buttonView.bind( 'icon' ).toMany( buttons, 'isOn', ( ...areActive ) => { @@ -140,7 +134,7 @@ export default class AlignmentUI extends Plugin { buttonView.set( { label: this.localizedOptionTitles[ option ], - icon: icons.get( option ), + icon: iconsMap.get( option ), tooltip: true, isToggleable: true } ); diff --git a/packages/ckeditor5-alignment/src/index.js b/packages/ckeditor5-alignment/src/index.js new file mode 100644 index 00000000000..739c6418470 --- /dev/null +++ b/packages/ckeditor5-alignment/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module alignment + */ + +import Alignment from './alignment'; +import AlignmentEditing from './alignmentediting'; +import AlignmentUI from './alignmentui'; + +export default { + Alignment, + AlignmentEditing, + AlignmentUI +}; diff --git a/packages/ckeditor5-alignment/webpack.config.js b/packages/ckeditor5-alignment/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-alignment/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-autoformat/package.json b/packages/ckeditor5-autoformat/package.json index a5702ec0ba8..91b4ae864fa 100644 --- a/packages/ckeditor5-autoformat/package.json +++ b/packages/ckeditor5-autoformat/package.json @@ -9,23 +9,28 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-code-block": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", + "@ckeditor/ckeditor5-horizontal-line": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", - "@ckeditor/ckeditor5-horizontal-line": "^25.0.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -43,9 +48,13 @@ "files": [ "lang", "src", - "theme" + "theme", + "build" ], "depcheckIgnore": [ "eslint-plugin-ckeditor5-rules" - ] + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-autoformat/src/autoformat.js b/packages/ckeditor5-autoformat/src/autoformat.js index 9bf82d2f340..654644cc0e5 100644 --- a/packages/ckeditor5-autoformat/src/autoformat.js +++ b/packages/ckeditor5-autoformat/src/autoformat.js @@ -7,9 +7,10 @@ * @module autoformat/autoformat */ +import { Plugin } from 'ckeditor5/src/core'; + import blockAutoformatEditing from './blockautoformatediting'; import inlineAutoformatEditing from './inlineautoformatediting'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; /** * Enables a set of predefined autoformatting actions. diff --git a/packages/ckeditor5-autoformat/src/blockautoformatediting.js b/packages/ckeditor5-autoformat/src/blockautoformatediting.js index b03c954a530..58f6550227b 100644 --- a/packages/ckeditor5-autoformat/src/blockautoformatediting.js +++ b/packages/ckeditor5-autoformat/src/blockautoformatediting.js @@ -3,8 +3,8 @@ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { LiveRange } from 'ckeditor5/src/engine'; +import { first } from 'ckeditor5/src/utils'; /** * The block autoformatting engine. It allows to format various block patterns. For example, diff --git a/packages/ckeditor5-autoformat/src/index.js b/packages/ckeditor5-autoformat/src/index.js new file mode 100644 index 00000000000..82f158f4720 --- /dev/null +++ b/packages/ckeditor5-autoformat/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module autoformat + */ + +import Autoformat from './autoformat'; + +export default { + Autoformat +}; diff --git a/packages/ckeditor5-autoformat/webpack.config.js b/packages/ckeditor5-autoformat/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-autoformat/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-autosave/package.json b/packages/ckeditor5-autosave/package.json index 6a02ba71ab0..c14527b5b7e 100644 --- a/packages/ckeditor5-autosave/package.json +++ b/packages/ckeditor5-autosave/package.json @@ -9,14 +9,19 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -34,6 +39,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-autosave/src/autosave.js b/packages/ckeditor5-autosave/src/autosave.js index 004c0a7baa7..499ee08d59f 100644 --- a/packages/ckeditor5-autosave/src/autosave.js +++ b/packages/ckeditor5-autosave/src/autosave.js @@ -7,11 +7,8 @@ * @module autosave/autosave */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import PendingActions from '@ckeditor/ckeditor5-core/src/pendingactions'; -import DomEmitterMixin from '@ckeditor/ckeditor5-utils/src/dom/emittermixin'; -import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; +import { Plugin, PendingActions } from 'ckeditor5/src/core'; +import { DomEmitterMixin, ObservableMixin, mix } from 'ckeditor5/src/utils'; import { debounce } from 'lodash-es'; /* globals window */ diff --git a/packages/ckeditor5-autosave/src/index.js b/packages/ckeditor5-autosave/src/index.js new file mode 100644 index 00000000000..60273d300b6 --- /dev/null +++ b/packages/ckeditor5-autosave/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module autosave + */ + +import Autosave from './autosave'; + +export default { + Autosave +}; diff --git a/packages/ckeditor5-autosave/webpack.config.js b/packages/ckeditor5-autosave/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-autosave/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-basic-styles/package.json b/packages/ckeditor5-basic-styles/package.json index e7bcf2b4102..11a773251ec 100644 --- a/packages/ckeditor5-basic-styles/package.json +++ b/packages/ckeditor5-basic-styles/package.json @@ -9,17 +9,22 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -37,6 +42,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-basic-styles/src/attributecommand.js b/packages/ckeditor5-basic-styles/src/attributecommand.js index a2ce599ccc9..c875f4f4264 100644 --- a/packages/ckeditor5-basic-styles/src/attributecommand.js +++ b/packages/ckeditor5-basic-styles/src/attributecommand.js @@ -7,7 +7,7 @@ * @module basic-styles/attributecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command diff --git a/packages/ckeditor5-basic-styles/src/bold.js b/packages/ckeditor5-basic-styles/src/bold.js index 2fd73ee53a7..25c1962fae5 100644 --- a/packages/ckeditor5-basic-styles/src/bold.js +++ b/packages/ckeditor5-basic-styles/src/bold.js @@ -7,7 +7,7 @@ * @module basic-styles/bold */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import BoldEditing from './bold/boldediting'; import BoldUI from './bold/boldui'; diff --git a/packages/ckeditor5-basic-styles/src/bold/boldediting.js b/packages/ckeditor5-basic-styles/src/bold/boldediting.js index 9768738262f..30a9866a70c 100644 --- a/packages/ckeditor5-basic-styles/src/bold/boldediting.js +++ b/packages/ckeditor5-basic-styles/src/bold/boldediting.js @@ -7,7 +7,7 @@ * @module basic-styles/bold/boldediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const BOLD = 'bold'; diff --git a/packages/ckeditor5-basic-styles/src/bold/boldui.js b/packages/ckeditor5-basic-styles/src/bold/boldui.js index 40df2f1077d..0d17993901a 100644 --- a/packages/ckeditor5-basic-styles/src/bold/boldui.js +++ b/packages/ckeditor5-basic-styles/src/bold/boldui.js @@ -7,8 +7,8 @@ * @module basic-styles/bold/boldui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import boldIcon from '../../theme/icons/bold.svg'; diff --git a/packages/ckeditor5-basic-styles/src/code.js b/packages/ckeditor5-basic-styles/src/code.js index cbf8f4f29d6..2d90287c9dc 100644 --- a/packages/ckeditor5-basic-styles/src/code.js +++ b/packages/ckeditor5-basic-styles/src/code.js @@ -7,7 +7,7 @@ * @module basic-styles/code */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import CodeEditing from './code/codeediting'; import CodeUI from './code/codeui'; diff --git a/packages/ckeditor5-basic-styles/src/code/codeediting.js b/packages/ckeditor5-basic-styles/src/code/codeediting.js index bc978fee056..a117c378a4e 100644 --- a/packages/ckeditor5-basic-styles/src/code/codeediting.js +++ b/packages/ckeditor5-basic-styles/src/code/codeediting.js @@ -7,10 +7,10 @@ * @module basic-styles/code/codeediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing'; + import AttributeCommand from '../attributecommand'; -import TwoStepCaretMovement from '@ckeditor/ckeditor5-typing/src/twostepcaretmovement'; -import setupHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight'; const CODE = 'code'; const HIGHLIGHT_CLASS = 'ck-code_selected'; @@ -68,6 +68,6 @@ export default class CodeEditing extends Plugin { editor.plugins.get( TwoStepCaretMovement ).registerAttribute( CODE ); // Setup highlight over selected element. - setupHighlight( editor, CODE, 'code', HIGHLIGHT_CLASS ); + inlineHighlight( editor, CODE, 'code', HIGHLIGHT_CLASS ); } } diff --git a/packages/ckeditor5-basic-styles/src/code/codeui.js b/packages/ckeditor5-basic-styles/src/code/codeui.js index f48f8aef68b..a5c708355d6 100644 --- a/packages/ckeditor5-basic-styles/src/code/codeui.js +++ b/packages/ckeditor5-basic-styles/src/code/codeui.js @@ -7,8 +7,8 @@ * @module basic-styles/code/codeui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import codeIcon from '../../theme/icons/code.svg'; diff --git a/packages/ckeditor5-basic-styles/src/index.js b/packages/ckeditor5-basic-styles/src/index.js new file mode 100644 index 00000000000..495cdf0eae1 --- /dev/null +++ b/packages/ckeditor5-basic-styles/src/index.js @@ -0,0 +1,54 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module basic-styles + */ + +import Bold from './bold'; +import BoldEditing from './bold/boldediting'; +import BoldUI from './bold/boldui'; +import Code from './code'; +import CodeEditing from './code/codeediting'; +import CodeUI from './code/codeui'; +import Italic from './italic'; +import ItalicEditing from './italic/italicediting'; +import ItalicUI from './italic/italicui'; +import Strikethrough from './strikethrough'; +import StrikethroughEditing from './strikethrough/strikethroughediting'; +import StrikethroughUI from './strikethrough/strikethroughui'; +import Subscript from './subscript'; +import SubscriptEditing from './subscript/subscriptediting'; +import SubscriptUI from './subscript/subscriptui'; +import Superscript from './superscript'; +import SuperscriptEditing from './superscript/superscriptediting'; +import SuperscriptUI from './superscript/superscriptui'; +import Underline from './underline'; +import UnderlineEditing from './underline/underlineediting'; +import UnderlineUI from './underline/underlineui'; + +export default { + Bold, + BoldEditing, + BoldUI, + Code, + CodeEditing, + CodeUI, + Italic, + ItalicEditing, + ItalicUI, + Strikethrough, + StrikethroughEditing, + StrikethroughUI, + Subscript, + SubscriptEditing, + SubscriptUI, + Superscript, + SuperscriptEditing, + SuperscriptUI, + Underline, + UnderlineEditing, + UnderlineUI +}; diff --git a/packages/ckeditor5-basic-styles/src/italic.js b/packages/ckeditor5-basic-styles/src/italic.js index 9bed5cf75fb..c5694dcec3f 100644 --- a/packages/ckeditor5-basic-styles/src/italic.js +++ b/packages/ckeditor5-basic-styles/src/italic.js @@ -7,7 +7,7 @@ * @module basic-styles/italic */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ItalicEditing from './italic/italicediting'; import ItalicUI from './italic/italicui'; diff --git a/packages/ckeditor5-basic-styles/src/italic/italicediting.js b/packages/ckeditor5-basic-styles/src/italic/italicediting.js index c18dd8fbeff..8f579f414e4 100644 --- a/packages/ckeditor5-basic-styles/src/italic/italicediting.js +++ b/packages/ckeditor5-basic-styles/src/italic/italicediting.js @@ -7,7 +7,7 @@ * @module basic-styles/italic/italicediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const ITALIC = 'italic'; diff --git a/packages/ckeditor5-basic-styles/src/italic/italicui.js b/packages/ckeditor5-basic-styles/src/italic/italicui.js index 787fea1d308..0f9ec47ca49 100644 --- a/packages/ckeditor5-basic-styles/src/italic/italicui.js +++ b/packages/ckeditor5-basic-styles/src/italic/italicui.js @@ -7,8 +7,8 @@ * @module basic-styles/italic/italicui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import italicIcon from '../../theme/icons/italic.svg'; diff --git a/packages/ckeditor5-basic-styles/src/strikethrough.js b/packages/ckeditor5-basic-styles/src/strikethrough.js index 505a7bd691b..8bce682b9fd 100644 --- a/packages/ckeditor5-basic-styles/src/strikethrough.js +++ b/packages/ckeditor5-basic-styles/src/strikethrough.js @@ -7,7 +7,7 @@ * @module basic-styles/strikethrough */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import StrikethroughEditing from './strikethrough/strikethroughediting'; import StrikethroughUI from './strikethrough/strikethroughui'; diff --git a/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js b/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js index bb7070e80d9..14a98285160 100644 --- a/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js +++ b/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js @@ -7,7 +7,7 @@ * @module basic-styles/strikethrough/strikethroughediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const STRIKETHROUGH = 'strikethrough'; diff --git a/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js b/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js index e74c1a44f58..78c470adb7f 100644 --- a/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js +++ b/packages/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js @@ -7,8 +7,8 @@ * @module basic-styles/strikethrough/strikethroughui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import strikethroughIcon from '../../theme/icons/strikethrough.svg'; diff --git a/packages/ckeditor5-basic-styles/src/subscript.js b/packages/ckeditor5-basic-styles/src/subscript.js index 0e92ca7584b..5082f8269ff 100644 --- a/packages/ckeditor5-basic-styles/src/subscript.js +++ b/packages/ckeditor5-basic-styles/src/subscript.js @@ -7,7 +7,7 @@ * @module basic-styles/subscript */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import SubscriptEditing from './subscript/subscriptediting'; import SubscriptUI from './subscript/subscriptui'; diff --git a/packages/ckeditor5-basic-styles/src/subscript/subscriptediting.js b/packages/ckeditor5-basic-styles/src/subscript/subscriptediting.js index 19fb8554d4f..cdaa0009a77 100644 --- a/packages/ckeditor5-basic-styles/src/subscript/subscriptediting.js +++ b/packages/ckeditor5-basic-styles/src/subscript/subscriptediting.js @@ -7,7 +7,7 @@ * @module basic-styles/subscript/subscriptediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const SUBSCRIPT = 'subscript'; diff --git a/packages/ckeditor5-basic-styles/src/subscript/subscriptui.js b/packages/ckeditor5-basic-styles/src/subscript/subscriptui.js index cf834ffecc9..a083d10818f 100644 --- a/packages/ckeditor5-basic-styles/src/subscript/subscriptui.js +++ b/packages/ckeditor5-basic-styles/src/subscript/subscriptui.js @@ -7,8 +7,8 @@ * @module basic-styles/subscript/subscriptui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import subscriptIcon from '../../theme/icons/subscript.svg'; diff --git a/packages/ckeditor5-basic-styles/src/superscript.js b/packages/ckeditor5-basic-styles/src/superscript.js index 6c7d6e00584..3561258b071 100644 --- a/packages/ckeditor5-basic-styles/src/superscript.js +++ b/packages/ckeditor5-basic-styles/src/superscript.js @@ -7,7 +7,7 @@ * @module basic-styles/superscript */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import SuperscriptEditing from './superscript/superscriptediting'; import SuperscriptUI from './superscript/superscriptui'; diff --git a/packages/ckeditor5-basic-styles/src/superscript/superscriptediting.js b/packages/ckeditor5-basic-styles/src/superscript/superscriptediting.js index 219ddfe7685..6dc953e9d20 100644 --- a/packages/ckeditor5-basic-styles/src/superscript/superscriptediting.js +++ b/packages/ckeditor5-basic-styles/src/superscript/superscriptediting.js @@ -7,7 +7,7 @@ * @module basic-styles/superscript/superscriptediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const SUPERSCRIPT = 'superscript'; diff --git a/packages/ckeditor5-basic-styles/src/superscript/superscriptui.js b/packages/ckeditor5-basic-styles/src/superscript/superscriptui.js index 5f513f9c07d..f5fe5a02ddc 100644 --- a/packages/ckeditor5-basic-styles/src/superscript/superscriptui.js +++ b/packages/ckeditor5-basic-styles/src/superscript/superscriptui.js @@ -7,8 +7,8 @@ * @module basic-styles/superscript/superscriptui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import superscriptIcon from '../../theme/icons/superscript.svg'; diff --git a/packages/ckeditor5-basic-styles/src/underline.js b/packages/ckeditor5-basic-styles/src/underline.js index 10ecdafbc1f..84fe5b27e3b 100644 --- a/packages/ckeditor5-basic-styles/src/underline.js +++ b/packages/ckeditor5-basic-styles/src/underline.js @@ -7,7 +7,7 @@ * @module basic-styles/underline */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import UnderlineEditing from './underline/underlineediting'; import UnderlineUI from './underline/underlineui'; diff --git a/packages/ckeditor5-basic-styles/src/underline/underlineediting.js b/packages/ckeditor5-basic-styles/src/underline/underlineediting.js index 3ec3d1a47a1..79a02dd32d9 100644 --- a/packages/ckeditor5-basic-styles/src/underline/underlineediting.js +++ b/packages/ckeditor5-basic-styles/src/underline/underlineediting.js @@ -7,7 +7,7 @@ * @module basic-styles/underline/underlineediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import AttributeCommand from '../attributecommand'; const UNDERLINE = 'underline'; diff --git a/packages/ckeditor5-basic-styles/src/underline/underlineui.js b/packages/ckeditor5-basic-styles/src/underline/underlineui.js index 6adb05b5463..a8034a49df4 100644 --- a/packages/ckeditor5-basic-styles/src/underline/underlineui.js +++ b/packages/ckeditor5-basic-styles/src/underline/underlineui.js @@ -7,8 +7,8 @@ * @module basic-styles/underline/underlineui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import underlineIcon from '../../theme/icons/underline.svg'; diff --git a/packages/ckeditor5-basic-styles/webpack.config.js b/packages/ckeditor5-basic-styles/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-basic-styles/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-block-quote/package.json b/packages/ckeditor5-block-quote/package.json index 54d06578c98..f60277e6fe4 100644 --- a/packages/ckeditor5-block-quote/package.json +++ b/packages/ckeditor5-block-quote/package.json @@ -9,13 +9,14 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", @@ -24,7 +25,10 @@ "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -42,6 +46,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-block-quote/src/blockquote.js b/packages/ckeditor5-block-quote/src/blockquote.js index 5e8bd465395..9e4351589fb 100644 --- a/packages/ckeditor5-block-quote/src/blockquote.js +++ b/packages/ckeditor5-block-quote/src/blockquote.js @@ -7,7 +7,8 @@ * @module block-quote/blockquote */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import BlockQuoteEditing from './blockquoteediting'; import BlockQuoteUI from './blockquoteui'; diff --git a/packages/ckeditor5-block-quote/src/blockquotecommand.js b/packages/ckeditor5-block-quote/src/blockquotecommand.js index a44b4aa3f77..48b3019033a 100644 --- a/packages/ckeditor5-block-quote/src/blockquotecommand.js +++ b/packages/ckeditor5-block-quote/src/blockquotecommand.js @@ -7,9 +7,8 @@ * @module block-quote/blockquotecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; - -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The block quote command plugin. diff --git a/packages/ckeditor5-block-quote/src/blockquoteediting.js b/packages/ckeditor5-block-quote/src/blockquoteediting.js index 2854a112d70..661088862c4 100644 --- a/packages/ckeditor5-block-quote/src/blockquoteediting.js +++ b/packages/ckeditor5-block-quote/src/blockquoteediting.js @@ -7,8 +7,8 @@ * @module block-quote/blockquoteediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import priorities from '@ckeditor/ckeditor5-utils/src/priorities'; +import { Plugin } from 'ckeditor5/src/core'; +import { priorities } from 'ckeditor5/src/utils'; import BlockQuoteCommand from './blockquotecommand'; diff --git a/packages/ckeditor5-block-quote/src/blockquoteui.js b/packages/ckeditor5-block-quote/src/blockquoteui.js index 8cf0a5cc6d2..563afed2bcc 100644 --- a/packages/ckeditor5-block-quote/src/blockquoteui.js +++ b/packages/ckeditor5-block-quote/src/blockquoteui.js @@ -7,10 +7,9 @@ * @module block-quote/blockquoteui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; -import quoteIcon from '@ckeditor/ckeditor5-core/theme/icons/quote.svg'; import '../theme/blockquote.css'; /** @@ -34,7 +33,7 @@ export default class BlockQuoteUI extends Plugin { buttonView.set( { label: t( 'Block quote' ), - icon: quoteIcon, + icon: icons.quote, tooltip: true, isToggleable: true } ); diff --git a/packages/ckeditor5-block-quote/src/index.js b/packages/ckeditor5-block-quote/src/index.js new file mode 100644 index 00000000000..ea2f207273e --- /dev/null +++ b/packages/ckeditor5-block-quote/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module block-quote + */ + +import BlockQuote from './blockquote'; +import BlockQuoteEditing from './blockquoteediting'; +import BlockQuoteUI from './blockquoteui'; + +export default { + BlockQuote, + BlockQuoteEditing, + BlockQuoteUI +}; diff --git a/packages/ckeditor5-block-quote/tests/manual/blockquote.js b/packages/ckeditor5-block-quote/tests/manual/blockquote.js index 37990d31984..938ada6b695 100644 --- a/packages/ckeditor5-block-quote/tests/manual/blockquote.js +++ b/packages/ckeditor5-block-quote/tests/manual/blockquote.js @@ -8,8 +8,6 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; -import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; - ClassicEditor .create( document.querySelector( '#editor' ), { plugins: [ @@ -23,7 +21,3 @@ ClassicEditor .catch( err => { console.error( err.stack ); } ); - -window.setInterval( function() { - console.log( getData( window.editor.model ) ); -}, 3000 ); diff --git a/packages/ckeditor5-block-quote/webpack.config.js b/packages/ckeditor5-block-quote/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-block-quote/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-build-balloon-block/.eslintrc.js b/packages/ckeditor5-build-balloon-block/.eslintrc.js new file mode 100644 index 00000000000..8f63c92875a --- /dev/null +++ b/packages/ckeditor5-build-balloon-block/.eslintrc.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. 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' + } +}; diff --git a/packages/ckeditor5-build-balloon-block/package.json b/packages/ckeditor5-build-balloon-block/package.json index fee36dc5965..daf6a05008b 100644 --- a/packages/ckeditor5-build-balloon-block/package.json +++ b/packages/ckeditor5-build-balloon-block/package.json @@ -30,6 +30,7 @@ "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-balloon": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", @@ -43,8 +44,7 @@ "@ckeditor/ckeditor5-paste-from-office": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "webpack-cli": "^3.3.11" + "@ckeditor/ckeditor5-ui": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", @@ -55,7 +55,8 @@ "raw-loader": "^4.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.2", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-build-balloon-block/src/ckeditor.js b/packages/ckeditor5-build-balloon-block/src/ckeditor.js index dd69ad0e12b..5e0f44d745e 100644 --- a/packages/ckeditor5-build-balloon-block/src/ckeditor.js +++ b/packages/ckeditor5-build-balloon-block/src/ckeditor.js @@ -30,6 +30,7 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom 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'; import '../theme/theme.css'; @@ -45,6 +46,7 @@ BalloonEditor.builtinPlugins = [ Italic, BlockQuote, CKFinder, + CloudServices, EasyImage, Heading, Image, diff --git a/packages/ckeditor5-build-balloon/.eslintrc.js b/packages/ckeditor5-build-balloon/.eslintrc.js new file mode 100644 index 00000000000..8f63c92875a --- /dev/null +++ b/packages/ckeditor5-build-balloon/.eslintrc.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. 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' + } +}; diff --git a/packages/ckeditor5-build-balloon/package.json b/packages/ckeditor5-build-balloon/package.json index d6e6a32eda6..f02d5dbb159 100644 --- a/packages/ckeditor5-build-balloon/package.json +++ b/packages/ckeditor5-build-balloon/package.json @@ -30,6 +30,7 @@ "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-balloon": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", @@ -42,8 +43,7 @@ "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-paste-from-office": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "webpack-cli": "^3.3.11" + "@ckeditor/ckeditor5-typing": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", @@ -54,7 +54,8 @@ "raw-loader": "^4.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.2", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-build-balloon/src/ckeditor.js b/packages/ckeditor5-build-balloon/src/ckeditor.js index f2b189eea1c..438059593cb 100644 --- a/packages/ckeditor5-build-balloon/src/ckeditor.js +++ b/packages/ckeditor5-build-balloon/src/ckeditor.js @@ -29,6 +29,7 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom 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 BalloonEditor extends BalloonEditorBase {} @@ -41,6 +42,7 @@ BalloonEditor.builtinPlugins = [ Italic, BlockQuote, CKFinder, + CloudServices, EasyImage, Heading, Image, diff --git a/packages/ckeditor5-build-classic/.eslintrc.js b/packages/ckeditor5-build-classic/.eslintrc.js new file mode 100644 index 00000000000..8f63c92875a --- /dev/null +++ b/packages/ckeditor5-build-classic/.eslintrc.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. 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' + } +}; diff --git a/packages/ckeditor5-build-classic/package.json b/packages/ckeditor5-build-classic/package.json index 03f01aca87b..31edc0b3ee2 100644 --- a/packages/ckeditor5-build-classic/package.json +++ b/packages/ckeditor5-build-classic/package.json @@ -30,6 +30,7 @@ "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", @@ -42,8 +43,7 @@ "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-paste-from-office": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "webpack-cli": "^3.3.11" + "@ckeditor/ckeditor5-typing": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", @@ -54,7 +54,8 @@ "raw-loader": "^4.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.2", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-build-classic/src/ckeditor.js b/packages/ckeditor5-build-classic/src/ckeditor.js index 4b309fca119..355e715728c 100644 --- a/packages/ckeditor5-build-classic/src/ckeditor.js +++ b/packages/ckeditor5-build-classic/src/ckeditor.js @@ -29,6 +29,7 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom 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 {} @@ -41,6 +42,7 @@ ClassicEditor.builtinPlugins = [ Italic, BlockQuote, CKFinder, + CloudServices, EasyImage, Heading, Image, diff --git a/packages/ckeditor5-build-decoupled-document/.eslintrc.js b/packages/ckeditor5-build-decoupled-document/.eslintrc.js new file mode 100644 index 00000000000..8f63c92875a --- /dev/null +++ b/packages/ckeditor5-build-decoupled-document/.eslintrc.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. 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' + } +}; diff --git a/packages/ckeditor5-build-decoupled-document/package.json b/packages/ckeditor5-build-decoupled-document/package.json index e2ec61bd4f6..e0ab7846a62 100644 --- a/packages/ckeditor5-build-decoupled-document/package.json +++ b/packages/ckeditor5-build-decoupled-document/package.json @@ -31,6 +31,7 @@ "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-decoupled": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", @@ -44,8 +45,7 @@ "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-paste-from-office": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "webpack-cli": "^3.3.11" + "@ckeditor/ckeditor5-typing": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", @@ -56,7 +56,8 @@ "raw-loader": "^4.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.2", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-build-decoupled-document/src/ckeditor.js b/packages/ckeditor5-build-decoupled-document/src/ckeditor.js index 7227cec938a..72cafc87c6a 100644 --- a/packages/ckeditor5-build-decoupled-document/src/ckeditor.js +++ b/packages/ckeditor5-build-decoupled-document/src/ckeditor.js @@ -38,6 +38,7 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom 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 DecoupledEditor extends DecoupledEditorBase {} @@ -57,6 +58,7 @@ DecoupledEditor.builtinPlugins = [ Underline, BlockQuote, CKFinder, + CloudServices, EasyImage, Heading, Image, diff --git a/packages/ckeditor5-build-inline/.eslintrc.js b/packages/ckeditor5-build-inline/.eslintrc.js new file mode 100644 index 00000000000..8f63c92875a --- /dev/null +++ b/packages/ckeditor5-build-inline/.eslintrc.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. 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' + } +}; diff --git a/packages/ckeditor5-build-inline/package.json b/packages/ckeditor5-build-inline/package.json index 8b68fcb8895..b8211f32345 100644 --- a/packages/ckeditor5-build-inline/package.json +++ b/packages/ckeditor5-build-inline/package.json @@ -30,6 +30,7 @@ "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-inline": "^25.0.0", "@ckeditor/ckeditor5-essentials": "^25.0.0", @@ -42,8 +43,7 @@ "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-paste-from-office": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "webpack-cli": "^3.3.11" + "@ckeditor/ckeditor5-typing": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", @@ -54,7 +54,8 @@ "raw-loader": "^4.0.1", "style-loader": "^1.2.1", "terser-webpack-plugin": "^3.0.2", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-build-inline/src/ckeditor.js b/packages/ckeditor5-build-inline/src/ckeditor.js index 11c46d7e18d..9415c718959 100644 --- a/packages/ckeditor5-build-inline/src/ckeditor.js +++ b/packages/ckeditor5-build-inline/src/ckeditor.js @@ -29,6 +29,7 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom 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 InlineEditor extends InlineEditorBase {} @@ -41,6 +42,7 @@ InlineEditor.builtinPlugins = [ Italic, BlockQuote, CKFinder, + CloudServices, EasyImage, Heading, Image, diff --git a/packages/ckeditor5-ckfinder/package.json b/packages/ckeditor5-ckfinder/package.json index 48088ce5670..2fdcb39809c 100644 --- a/packages/ckeditor5-ckfinder/package.json +++ b/packages/ckeditor5-ckfinder/package.json @@ -9,19 +9,25 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { + "ckeditor5": "^25.0.0" + }, + "devDependencies": { "@ckeditor/ckeditor5-adapter-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" - }, - "devDependencies": { - "@ckeditor/ckeditor5-editor-classic": "^25.0.0", - "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-ckfinder/src/ckfinder.js b/packages/ckeditor5-ckfinder/src/ckfinder.js index 53ab3251817..b5c9eee7a39 100644 --- a/packages/ckeditor5-ckfinder/src/ckfinder.js +++ b/packages/ckeditor5-ckfinder/src/ckfinder.js @@ -7,11 +7,10 @@ * @module ckfinder/ckfinder */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import CKFinderUI from './ckfinderui'; import CKFinderEditing from './ckfinderediting'; -import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; /** * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the @@ -43,7 +42,7 @@ export default class CKFinder extends Plugin { * @inheritDoc */ static get requires() { - return [ CKFinderEditing, CKFinderUI, CKFinderUploadAdapter ]; + return [ 'Image', 'Link', 'CKFinderUploadAdapter', CKFinderEditing, CKFinderUI ]; } } diff --git a/packages/ckeditor5-ckfinder/src/ckfindercommand.js b/packages/ckeditor5-ckfinder/src/ckfindercommand.js index a478fa1e5c9..03695c86265 100644 --- a/packages/ckeditor5-ckfinder/src/ckfindercommand.js +++ b/packages/ckeditor5-ckfinder/src/ckfindercommand.js @@ -9,8 +9,8 @@ * @module ckfinder/ckfindercommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { Command } from 'ckeditor5/src/core'; +import { CKEditorError } from 'ckeditor5/src/utils'; /** * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature} diff --git a/packages/ckeditor5-ckfinder/src/ckfinderediting.js b/packages/ckeditor5-ckfinder/src/ckfinderediting.js index 34e3e707aaf..b7d76d0a6d5 100644 --- a/packages/ckeditor5-ckfinder/src/ckfinderediting.js +++ b/packages/ckeditor5-ckfinder/src/ckfinderediting.js @@ -7,10 +7,8 @@ * @module ckfinder/ckfinderediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ImageEditing from '@ckeditor/ckeditor5-image/src/image/imageediting'; -import LinkEditing from '@ckeditor/ckeditor5-link/src/linkediting'; -import Notification from '@ckeditor/ckeditor5-ui/src/notification/notification'; +import { Plugin } from 'ckeditor5/src/core'; +import { Notification } from 'ckeditor5/src/ui'; import CKFinderCommand from './ckfindercommand'; @@ -31,7 +29,7 @@ export default class CKFinderEditing extends Plugin { * @inheritDoc */ static get requires() { - return [ Notification, ImageEditing, LinkEditing ]; + return [ Notification, 'ImageEditing', 'LinkEditing' ]; } /** diff --git a/packages/ckeditor5-ckfinder/src/ckfinderui.js b/packages/ckeditor5-ckfinder/src/ckfinderui.js index 0104c1b843e..122f69d0305 100644 --- a/packages/ckeditor5-ckfinder/src/ckfinderui.js +++ b/packages/ckeditor5-ckfinder/src/ckfinderui.js @@ -7,8 +7,8 @@ * @module ckfinder/ckfinderui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import browseFilesIcon from '../theme/icons/browse-files.svg'; diff --git a/packages/ckeditor5-ckfinder/src/index.js b/packages/ckeditor5-ckfinder/src/index.js new file mode 100644 index 00000000000..b5d8efb1cab --- /dev/null +++ b/packages/ckeditor5-ckfinder/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckfinder + */ + +import CKFinder from './ckfinder'; + +export default { + CKFinder +}; diff --git a/packages/ckeditor5-ckfinder/tests/ckfinder.js b/packages/ckeditor5-ckfinder/tests/ckfinder.js index 2bf4d4d290c..d032abbe115 100644 --- a/packages/ckeditor5-ckfinder/tests/ckfinder.js +++ b/packages/ckeditor5-ckfinder/tests/ckfinder.js @@ -5,11 +5,13 @@ import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor'; import global from '@ckeditor/ckeditor5-utils/src/dom/global'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; +import Image from '@ckeditor/ckeditor5-image/src/image'; +import Link from '@ckeditor/ckeditor5-link/src/link'; import CKFinder from '../src/ckfinder'; import CKFinderUI from '../src/ckfinderui'; import CKFinderEditing from '../src/ckfinderediting'; -import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; describe( 'CKFinder', () => { let editorElement, editor; @@ -20,7 +22,7 @@ describe( 'CKFinder', () => { return ClassicTestEditor .create( editorElement, { - plugins: [ CKFinder ] + plugins: [ CKFinderUploadAdapter, Image, Link, CKFinder ] } ) .then( newEditor => { editor = newEditor; @@ -45,8 +47,8 @@ describe( 'CKFinder', () => { expect( editor.plugins.get( CKFinderEditing ) ).to.instanceOf( CKFinderEditing ); } ); - it( 'should load AdapterCKFinder plugin', () => { - expect( editor.plugins.get( CKFinderUploadAdapter ) ).to.instanceOf( CKFinderUploadAdapter ); + it( 'should require CKFinderUploadAdapter by name', () => { + expect( CKFinder.requires ).to.contain( 'CKFinderUploadAdapter' ); } ); it( 'has proper name', () => { diff --git a/packages/ckeditor5-ckfinder/tests/ckfinderediting.js b/packages/ckeditor5-ckfinder/tests/ckfinderediting.js index e718a1db760..839e9db3f83 100644 --- a/packages/ckeditor5-ckfinder/tests/ckfinderediting.js +++ b/packages/ckeditor5-ckfinder/tests/ckfinderediting.js @@ -13,6 +13,9 @@ import global from '@ckeditor/ckeditor5-utils/src/dom/global'; import CKFinder from '../src/ckfinder'; import CKFinderEditing from '../src/ckfinderediting'; +import Image from '@ckeditor/ckeditor5-image/src/image'; +import Link from '@ckeditor/ckeditor5-link/src/link'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; describe( 'CKFinderEditing', () => { let editorElement, editor; @@ -25,7 +28,7 @@ describe( 'CKFinderEditing', () => { return ClassicTestEditor .create( editorElement, { - plugins: [ CKFinder ] + plugins: [ CKFinderUploadAdapter, Image, Link, CKFinder ] } ) .then( newEditor => { diff --git a/packages/ckeditor5-ckfinder/tests/ckfinderui.js b/packages/ckeditor5-ckfinder/tests/ckfinderui.js index dd5ea4cbf6a..81f2261bffc 100644 --- a/packages/ckeditor5-ckfinder/tests/ckfinderui.js +++ b/packages/ckeditor5-ckfinder/tests/ckfinderui.js @@ -8,6 +8,9 @@ import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor'; import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; import global from '@ckeditor/ckeditor5-utils/src/dom/global'; +import Image from '@ckeditor/ckeditor5-image/src/image'; +import Link from '@ckeditor/ckeditor5-link/src/link'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; @@ -25,7 +28,7 @@ describe( 'CKFinderUI', () => { return ClassicTestEditor .create( editorElement, { - plugins: [ CKFinder ] + plugins: [ CKFinderUploadAdapter, Image, Link, CKFinder ] } ) .then( newEditor => { diff --git a/packages/ckeditor5-ckfinder/tests/manual/ckfinder.js b/packages/ckeditor5-ckfinder/tests/manual/ckfinder.js index 356f6cc8d22..dd9e47360d9 100644 --- a/packages/ckeditor5-ckfinder/tests/manual/ckfinder.js +++ b/packages/ckeditor5-ckfinder/tests/manual/ckfinder.js @@ -6,14 +6,15 @@ /* globals console, window, document */ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; - -import CKFinder from '../../src/ckfinder'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CKFinder from '../../src/ckfinder'; + ClassicEditor .create( document.querySelector( '#editor' ), { - plugins: [ ArticlePluginSet, ImageUpload, CKFinder ], + plugins: [ ArticlePluginSet, ImageUpload, CKFinderUploadAdapter, CKFinder ], toolbar: [ 'heading', '|', 'undo', 'redo', 'ckfinder' ], image: { toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ] diff --git a/packages/ckeditor5-ckfinder/webpack.config.js b/packages/ckeditor5-ckfinder/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-ckfinder/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-clipboard/package.json b/packages/ckeditor5-clipboard/package.json index 2b7c054e27a..e3c0d1e86a0 100644 --- a/packages/ckeditor5-clipboard/package.json +++ b/packages/ckeditor5-clipboard/package.json @@ -7,8 +7,10 @@ "ckeditor5", "ckeditor 5", "ckeditor5-feature", - "ckeditor5-plugin" + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", diff --git a/packages/ckeditor5-clipboard/src/index.js b/packages/ckeditor5-clipboard/src/index.js new file mode 100644 index 00000000000..84fe247fd4b --- /dev/null +++ b/packages/ckeditor5-clipboard/src/index.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module clipboard + */ + +export { default as Clipboard } from './clipboard'; diff --git a/packages/ckeditor5-cloud-services/package.json b/packages/ckeditor5-cloud-services/package.json index fca3a36cc3b..4152daf86d9 100644 --- a/packages/ckeditor5-cloud-services/package.json +++ b/packages/ckeditor5-cloud-services/package.json @@ -8,13 +8,19 @@ "ckeditor 5", "ckeditor5-lib" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor-cloud-services-core": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { - "@ckeditor/ckeditor5-editor-classic": "^25.0.0" + "@ckeditor/ckeditor-cloud-services-core": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -32,6 +38,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-cloud-services/src/cloudservices.js b/packages/ckeditor5-cloud-services/src/cloudservices.js index 0a55284c13f..c42ab87c4bc 100644 --- a/packages/ckeditor5-cloud-services/src/cloudservices.js +++ b/packages/ckeditor5-cloud-services/src/cloudservices.js @@ -7,9 +7,9 @@ * @module cloud-services/cloudservices */ -import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin'; -import Token from '@ckeditor/ckeditor-cloud-services-core/src/token/token'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { ContextPlugin } from 'ckeditor5/src/core'; +import { Token } from 'ckeditor5/src/cloud-services-core'; +import { CKEditorError } from 'ckeditor5/src/utils'; /** * Plugin introducing the integration between CKEditor 5 and CKEditor Cloud Services . diff --git a/packages/ckeditor5-cloud-services/src/index.js b/packages/ckeditor5-cloud-services/src/index.js new file mode 100644 index 00000000000..119264379f2 --- /dev/null +++ b/packages/ckeditor5-cloud-services/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module cloud-services + */ + +import CloudServices from './cloudservices'; + +export default { + CloudServices +}; diff --git a/packages/ckeditor5-cloud-services/webpack.config.js b/packages/ckeditor5-cloud-services/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-cloud-services/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-code-block/package.json b/packages/ckeditor5-code-block/package.json index bca7795bac2..5fafa89fc9b 100644 --- a/packages/ckeditor5-code-block/package.json +++ b/packages/ckeditor5-code-block/package.json @@ -9,23 +9,28 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-enter": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-alignment": "^25.0.0", "@ckeditor/ckeditor5-autoformat": "^25.0.0", "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-indent": "^25.0.0", "@ckeditor/ckeditor5-markdown-gfm": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -43,6 +48,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-code-block/src/codeblock.js b/packages/ckeditor5-code-block/src/codeblock.js index 3faf2f166b7..876aa5bacfb 100644 --- a/packages/ckeditor5-code-block/src/codeblock.js +++ b/packages/ckeditor5-code-block/src/codeblock.js @@ -7,7 +7,8 @@ * @module code-block/codeblock */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import CodeBlockEditing from './codeblockediting'; import CodeBlockUI from './codeblockui'; diff --git a/packages/ckeditor5-code-block/src/codeblockcommand.js b/packages/ckeditor5-code-block/src/codeblockcommand.js index ff2286470c4..ad6e35ea2be 100644 --- a/packages/ckeditor5-code-block/src/codeblockcommand.js +++ b/packages/ckeditor5-code-block/src/codeblockcommand.js @@ -7,8 +7,9 @@ * @module code-block/codeblockcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; + import { getNormalizedAndLocalizedLanguageDefinitions } from './utils'; /** diff --git a/packages/ckeditor5-code-block/src/codeblockediting.js b/packages/ckeditor5-code-block/src/codeblockediting.js index 83543132ca4..b419ca75883 100644 --- a/packages/ckeditor5-code-block/src/codeblockediting.js +++ b/packages/ckeditor5-code-block/src/codeblockediting.js @@ -7,8 +7,9 @@ * @module code-block/codeblockediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter'; +import { Plugin } from 'ckeditor5/src/core'; +import { ShiftEnter } from 'ckeditor5/src/enter'; + import CodeBlockCommand from './codeblockcommand'; import IndentCodeBlockCommand from './indentcodeblockcommand'; import OutdentCodeBlockCommand from './outdentcodeblockcommand'; diff --git a/packages/ckeditor5-code-block/src/codeblockui.js b/packages/ckeditor5-code-block/src/codeblockui.js index 3a349f92060..1707be2823d 100644 --- a/packages/ckeditor5-code-block/src/codeblockui.js +++ b/packages/ckeditor5-code-block/src/codeblockui.js @@ -7,11 +7,10 @@ * @module code-block/codeblockui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { Plugin } from 'ckeditor5/src/core'; +import { Collection } from 'ckeditor5/src/utils'; +import { Model, SplitButtonView, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; + import { getNormalizedAndLocalizedLanguageDefinitions } from './utils'; import codeBlockIcon from '../theme/icons/codeblock.svg'; diff --git a/packages/ckeditor5-code-block/src/indentcodeblockcommand.js b/packages/ckeditor5-code-block/src/indentcodeblockcommand.js index bd180e66871..facd90e3abc 100644 --- a/packages/ckeditor5-code-block/src/indentcodeblockcommand.js +++ b/packages/ckeditor5-code-block/src/indentcodeblockcommand.js @@ -7,7 +7,8 @@ * @module code-block/indentcodeblockcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; + import { getIndentOutdentPositions, isModelSelectionInCodeBlock diff --git a/packages/ckeditor5-code-block/src/index.js b/packages/ckeditor5-code-block/src/index.js new file mode 100644 index 00000000000..1f348263a0c --- /dev/null +++ b/packages/ckeditor5-code-block/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module code-block + */ + +import CodeBlock from './codeblock'; +import CodeBlockEditing from './codeblockediting'; +import CodeBlockUI from './codeblockui'; + +export default { + CodeBlock, + CodeBlockEditing, + CodeBlockUI +}; diff --git a/packages/ckeditor5-code-block/src/outdentcodeblockcommand.js b/packages/ckeditor5-code-block/src/outdentcodeblockcommand.js index 18e9df5845f..ce9ed2b133a 100644 --- a/packages/ckeditor5-code-block/src/outdentcodeblockcommand.js +++ b/packages/ckeditor5-code-block/src/outdentcodeblockcommand.js @@ -7,7 +7,8 @@ * @module code-block/outdentcodeblockcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; + import { getLeadingWhiteSpaces, getIndentOutdentPositions, diff --git a/packages/ckeditor5-code-block/src/utils.js b/packages/ckeditor5-code-block/src/utils.js index 15ead07fe9c..25c5cf03b31 100644 --- a/packages/ckeditor5-code-block/src/utils.js +++ b/packages/ckeditor5-code-block/src/utils.js @@ -7,7 +7,7 @@ * @module code-block/utils */ -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { first } from 'ckeditor5/src/utils'; /** * Returns code block languages as defined in `config.codeBlock.languages` but processed: diff --git a/packages/ckeditor5-code-block/webpack.config.js b/packages/ckeditor5-code-block/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-code-block/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-core/package.json b/packages/ckeditor5-core/package.json index b033cb2e115..0af089f3f58 100644 --- a/packages/ckeditor5-core/package.json +++ b/packages/ckeditor5-core/package.json @@ -3,10 +3,6 @@ "version": "25.0.0", "description": "The core architecture of CKEditor 5 – the best browser-based rich text editor.", "keywords": [ - "ckeditor5-lib", - "ckeditor", - "ckeditor5", - "ckeditor 5", "wysiwyg", "rich text", "editor", @@ -18,8 +14,14 @@ "collaboration", "collaborative", "real-time", - "framework" + "framework", + "ckeditor", + "ckeditor5", + "ckeditor 5", + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", diff --git a/packages/ckeditor5-core/src/index.js b/packages/ckeditor5-core/src/index.js new file mode 100644 index 00000000000..039c9edf91f --- /dev/null +++ b/packages/ckeditor5-core/src/index.js @@ -0,0 +1,77 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module core + */ + +export { default as Plugin } from './plugin'; +export { default as Command } from './command'; +export { default as MultiCommand } from './multicommand'; + +export { default as Context } from './context'; +export { default as ContextPlugin } from './contextplugin'; + +export { default as Editor } from './editor/editor'; +export { default as EditorUI } from './editor/editorui'; + +export { default as attachToForm } from './editor/utils/attachtoform'; +export { default as DataApiMixin } from './editor/utils/dataapimixin'; +export { default as ElementApiMixin } from './editor/utils/elementapimixin'; +export { default as secureSourceElement } from './editor/utils/securesourceelement'; + +export { default as PendingActions } from './pendingactions'; + +import cancel from './../theme/icons/cancel.svg'; +import check from './../theme/icons/check.svg'; +import eraser from './../theme/icons/eraser.svg'; +import lowVision from './../theme/icons/low-vision.svg'; +import image from './../theme/icons/image.svg'; +import alignBottom from './../theme/icons/align-bottom.svg'; +import alignMiddle from './../theme/icons/align-middle.svg'; +import alignTop from './../theme/icons/align-top.svg'; +import alignLeft from './../theme/icons/align-left.svg'; +import alignCenter from './../theme/icons/align-center.svg'; +import alignRight from './../theme/icons/align-right.svg'; +import alignJustify from './../theme/icons/align-justify.svg'; +import objectLeft from './../theme/icons/object-left.svg'; +import objectCenter from './../theme/icons/object-center.svg'; +import objectRight from './../theme/icons/object-right.svg'; +import objectFullWidth from './../theme/icons/object-full-width.svg'; +import objectSizeFull from './../theme/icons/object-size-full.svg'; +import objectSizeLarge from './../theme/icons/object-size-large.svg'; +import objectSizeSmall from './../theme/icons/object-size-small.svg'; +import objectSizeMedium from './../theme/icons/object-size-medium.svg'; +import pencil from './../theme/icons/pencil.svg'; +import pilcrow from './../theme/icons/pilcrow.svg'; +import quote from './../theme/icons/quote.svg'; +import threeVerticalDots from './../theme/icons/three-vertical-dots.svg'; + +export const icons = { + cancel, + check, + eraser, + lowVision, + image, + alignBottom, + alignMiddle, + alignTop, + alignLeft, + alignCenter, + alignRight, + alignJustify, + objectLeft, + objectCenter, + objectRight, + objectFullWidth, + objectSizeFull, + objectSizeLarge, + objectSizeSmall, + objectSizeMedium, + pencil, + pilcrow, + quote, + threeVerticalDots +}; diff --git a/packages/ckeditor5-core/src/plugincollection.js b/packages/ckeditor5-core/src/plugincollection.js index aa7e388d8dc..10c57af61db 100644 --- a/packages/ckeditor5-core/src/plugincollection.js +++ b/packages/ckeditor5-core/src/plugincollection.js @@ -175,6 +175,15 @@ export default class PluginCollection { const context = this._context; const loading = new Set(); const loaded = []; + const loadedPluginsNames = new Set(); + + const pluginsMap = new Map(); + + for ( const pluginOrName of plugins ) { + if ( typeof pluginOrName == 'function' && pluginOrName.pluginName ) { + pluginsMap.set( pluginOrName.pluginName, pluginOrName ); + } + } const pluginConstructors = mapToAvailableConstructors( plugins ); const removePluginConstructors = mapToAvailableConstructors( removePlugins ); @@ -230,11 +239,9 @@ export default class PluginCollection { /** * It was not possible to load the plugin. * - * This is a generic error logged to the console when a JavaScript error is thrown during the initialization - * of one of the plugins. - * * If you correctly handled the promise returned by the editor's `create()` method (as shown below), - * you will find the original error logged to the console, too: + * you will find the error details (i.e. the required plugin's name and the plugin's name that was + * requiring the failed one) logged to the console: * * ClassicEditor.create( document.getElementById( 'editor' ) ) * .then( editor => { @@ -243,11 +250,7 @@ export default class PluginCollection { * .catch( error => { * console.error( error ); * } ); - * - * @error plugincollection-load - * @param {String} plugin The name of the plugin that could not be loaded. */ - logError( 'plugincollection-load', { plugin: PluginConstructor } ); throw err; } ); @@ -273,8 +276,36 @@ export default class PluginCollection { if ( PluginConstructor.requires ) { PluginConstructor.requires.forEach( RequiredPluginConstructorOrName => { + if ( loadedPluginsNames.has( RequiredPluginConstructorOrName ) ) { + return; + } + const RequiredPluginConstructor = getPluginConstructor( RequiredPluginConstructorOrName ); + if ( !RequiredPluginConstructor ) { + /** + * A required "soft" dependency was not found on plugin list. + * + * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name. + * This is usually done in CKEditor 5 builds by setting the + * {@link module:core/editor/editor~Editor.builtinPlugins} property. Alternatively they can be provided using + * {@link module:core/editor/editorconfig~EditorConfig#plugins} or + * {@link module:core/editor/editorconfig~EditorConfig#extraPlugins} configuration. + * + * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means + * that you didn't add the required plugin to the plugins list when loading the editor. + * + * @error plugincollection-soft-required + * @param {String} plugin The name of the required plugin. + * @param {String} requiredBy The name of the plugin that was requiring other plugin. + */ + throw new CKEditorError( + 'plugincollection-soft-required', + null, + { plugin: RequiredPluginConstructorOrName, requiredBy: PluginConstructor.name } + ); + } + if ( PluginConstructor.isContextPlugin && !RequiredPluginConstructor.isContextPlugin ) { /** * If a plugin is a context plugin, all plugins it requires should also be context plugins @@ -318,6 +349,10 @@ export default class PluginCollection { that._add( PluginConstructor, plugin ); loaded.push( plugin ); + if ( PluginConstructor.pluginName ) { + loadedPluginsNames.add( PluginConstructor.pluginName ); + } + resolve(); } ); } @@ -327,7 +362,7 @@ export default class PluginCollection { return PluginConstructorOrName; } - return that._availablePlugins.get( PluginConstructorOrName ); + return that._availablePlugins.get( PluginConstructorOrName ) || pluginsMap.get( PluginConstructorOrName ); } function getMissingPluginNames( plugins ) { diff --git a/packages/ckeditor5-core/tests/plugincollection.js b/packages/ckeditor5-core/tests/plugincollection.js index 6e5a0651d35..febd499d834 100644 --- a/packages/ckeditor5-core/tests/plugincollection.js +++ b/packages/ckeditor5-core/tests/plugincollection.js @@ -241,8 +241,6 @@ describe( 'PluginCollection', () => { } ); it( 'should reject on broken plugins (forward the error thrown in a plugin)', () => { - const consoleErrorStub = sinon.stub( console, 'error' ); - const plugins = new PluginCollection( editor, availablePlugins ); return plugins.init( [ PluginA, PluginX, PluginB ] ) @@ -253,9 +251,6 @@ describe( 'PluginCollection', () => { .catch( err => { expect( err ).to.be.an.instanceof( TestError ); expect( err ).to.have.property( 'message', 'Some error inside a plugin' ); - - sinon.assert.calledOnce( consoleErrorStub ); - expect( consoleErrorStub.args[ 0 ][ 0 ] ).to.match( /^plugincollection-load/ ); } ); } ); @@ -345,7 +340,6 @@ describe( 'PluginCollection', () => { const plugins = new PluginCollection( editor, [ FooContextPlugin, PluginA ] ); - const consoleErrorStub = sinon.stub( console, 'error' ); let error; try { @@ -355,7 +349,6 @@ describe( 'PluginCollection', () => { } assertCKEditorError( error, /^plugincollection-context-required/ ); - sinon.assert.calledOnce( consoleErrorStub ); } ); it( 'should not throw when non context plugin requires context plugin', async () => { @@ -385,7 +378,6 @@ describe( 'PluginCollection', () => { } ); it( 'should reject when loaded plugin requires not allowed plugins', () => { - const consoleErrorStub = sinon.stub( console, 'error' ); const plugins = new PluginCollection( editor, availablePlugins ); return plugins.init( [ PluginA, PluginB, PluginC, PluginD ], [ PluginA, PluginB ] ) @@ -395,14 +387,11 @@ describe( 'PluginCollection', () => { } ) .catch( err => { assertCKEditorError( err, /^plugincollection-required/, editor ); - - sinon.assert.calledTwice( consoleErrorStub ); } ); } ); it( 'should reject when loading more than one plugin with the same name', () => { const plugins = new PluginCollection( editor ); - const consoleErrorStub = sinon.stub( console, 'error' ); return plugins.init( [ PluginFoo, AnotherPluginFoo ] ) .then( () => { @@ -414,7 +403,6 @@ describe( 'PluginCollection', () => { plugin1: PluginFoo, plugin2: AnotherPluginFoo } ); - sinon.assert.calledOnce( consoleErrorStub ); } ); } ); @@ -422,7 +410,6 @@ describe( 'PluginCollection', () => { PluginFoo.requires = [ AnotherPluginFoo ]; const plugins = new PluginCollection( editor ); - const consoleErrorStub = sinon.stub( console, 'error' ); return plugins.init( [ PluginFoo ] ) .then( () => { @@ -430,17 +417,14 @@ describe( 'PluginCollection', () => { } ) .catch( err => { assertCKEditorError( err, /^plugincollection-plugin-name-conflict/, null ); - - sinon.assert.calledOnce( consoleErrorStub ); } ); } ); - it( 'should reject when loading more than one plugin with the same name' + + it( 'should reject when loading more than one plugin with the same name ' + '(plugin with the same name is built-in the PluginCollection)', () => { availablePlugins = [ PluginFoo ]; const plugins = new PluginCollection( editor, availablePlugins ); - const consoleErrorStub = sinon.stub( console, 'error' ); return plugins.init( [ 'Foo', AnotherPluginFoo ] ) .then( () => { @@ -448,7 +432,6 @@ describe( 'PluginCollection', () => { } ) .catch( err => { assertCKEditorError( err, /^plugincollection-plugin-name-conflict/, null ); - sinon.assert.calledOnce( consoleErrorStub ); } ); } ); @@ -485,6 +468,51 @@ describe( 'PluginCollection', () => { expect( plugins.get( PluginB ) ).to.equal( externalPlugins.get( PluginB ) ).to.instanceof( PluginB ); expect( plugins.get( PluginC ) ).to.instanceof( PluginC ); } ); + + it( 'should load dependency plugins using soft requirement', () => { + const plugins = new PluginCollection( editor, availablePlugins ); + const spy = sinon.spy( plugins, '_add' ); + + return plugins.init( [ PluginJ ] ) + .then( loadedPlugins => { + expect( getPlugins( plugins ).length ).to.equal( 3 ); + + expect( getPluginNames( getPluginsFromSpy( spy ) ) ) + .to.deep.equal( [ 'A', 'K', 'J' ], 'order by plugins._add()' ); + expect( getPluginNames( loadedPlugins ) ) + .to.deep.equal( [ 'A', 'K', 'J' ], 'order by returned value' ); + } ); + } ); + + it( 'should reject dependency plugins using soft requirement when plugin is unavailable', () => { + PluginFoo.requires = [ 'A', 'Baz' ]; + const plugins = new PluginCollection( editor, availablePlugins ); + + return plugins.init( [ PluginFoo ] ) + // Throw here, so if by any chance plugins.init() was resolved correctly catch() will be still executed. + .then( () => { + throw new Error( 'Test error: this promise should not be resolved successfully' ); + } ) + .catch( err => { + assertCKEditorError( err, /^plugincollection-soft-required/, null, { plugin: 'Baz', requiredBy: 'P' } ); + } ); + } ); + + it( 'should not reject dependency plugins using soft requirement when plugin was loaded as dependency of other plugin', () => { + PluginFoo.requires = [ 'A' ]; + const plugins = new PluginCollection( editor, availablePlugins ); + const spy = sinon.spy( plugins, '_add' ); + + return plugins.init( [ PluginD, PluginFoo ] ) + .then( loadedPlugins => { + expect( getPlugins( plugins ).length ).to.equal( 5 ); + + expect( getPluginNames( getPluginsFromSpy( spy ) ) ) + .to.deep.equal( [ 'A', 'B', 'C', 'D', 'Foo' ], 'order by plugins._add()' ); + expect( getPluginNames( loadedPlugins ) ) + .to.deep.equal( [ 'A', 'B', 'C', 'D', 'Foo' ], 'order by returned value' ); + } ); + } ); } ); describe( 'get()', () => { diff --git a/packages/ckeditor5-easy-image/package.json b/packages/ckeditor5-easy-image/package.json index 23ff2a0e08f..3f90fd239db 100644 --- a/packages/ckeditor5-easy-image/package.json +++ b/packages/ckeditor5-easy-image/package.json @@ -9,18 +9,23 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor-cloud-services-core": "^25.0.0", - "@ckeditor/ckeditor5-cloud-services": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-image": "^25.0.0", - "@ckeditor/ckeditor5-upload": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-upload": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -38,6 +43,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-easy-image/src/cloudservicesuploadadapter.js b/packages/ckeditor5-easy-image/src/cloudservicesuploadadapter.js index f43aad41a4a..b6c32033520 100644 --- a/packages/ckeditor5-easy-image/src/cloudservicesuploadadapter.js +++ b/packages/ckeditor5-easy-image/src/cloudservicesuploadadapter.js @@ -7,10 +7,9 @@ * @module easy-image/cloudservicesuploadadapter */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; -import UploadGateway from '@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway'; -import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; +import { Plugin } from 'ckeditor5/src/core'; +import { FileRepository } from 'ckeditor5/src/upload'; +import { UploadGateway } from 'ckeditor5/src/cloud-services-core'; /** * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/). @@ -27,7 +26,7 @@ export default class CloudServicesUploadAdapter extends Plugin { * @inheritDoc */ static get requires() { - return [ FileRepository, CloudServices ]; + return [ 'CloudServices', FileRepository ]; } /** @@ -36,7 +35,7 @@ export default class CloudServicesUploadAdapter extends Plugin { init() { const editor = this.editor; - const cloudServices = editor.plugins.get( CloudServices ); + const cloudServices = editor.plugins.get( 'CloudServices' ); const token = cloudServices.token; const uploadUrl = cloudServices.uploadUrl; diff --git a/packages/ckeditor5-easy-image/src/easyimage.js b/packages/ckeditor5-easy-image/src/easyimage.js index 6d6f470230e..cff46e81f45 100644 --- a/packages/ckeditor5-easy-image/src/easyimage.js +++ b/packages/ckeditor5-easy-image/src/easyimage.js @@ -7,10 +7,9 @@ * @module easy-image/easyimage */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import CloudServicesUploadAdapter from './cloudservicesuploadadapter'; -import Image from '@ckeditor/ckeditor5-image/src/image'; -import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; /** * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero @@ -19,9 +18,12 @@ import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; * * This is a "glue" plugin which enables: * + * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}. + * + * This plugin requires plugin to be present in the editor configuration: + * * * {@link module:image/image~Image}, * * {@link module:image/imageupload~ImageUpload}, - * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}. * * See the {@glink features/image-upload/easy-image "Easy Image integration" guide} to learn how to configure * and use this feature. @@ -40,11 +42,7 @@ export default class EasyImage extends Plugin { * @inheritDoc */ static get requires() { - return [ - CloudServicesUploadAdapter, - Image, - ImageUpload - ]; + return [ CloudServicesUploadAdapter, 'Image', 'ImageUpload' ]; } /** diff --git a/packages/ckeditor5-easy-image/src/index.js b/packages/ckeditor5-easy-image/src/index.js new file mode 100644 index 00000000000..75308a2cae7 --- /dev/null +++ b/packages/ckeditor5-easy-image/src/index.js @@ -0,0 +1,16 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module easy-image + */ + +import EasyImage from './easyimage'; +import CloudServicesUploadAdapter from './cloudservicesuploadadapter'; + +export default { + EasyImage, + CloudServicesUploadAdapter +}; diff --git a/packages/ckeditor5-easy-image/tests/cloudservicesuploadadapter.js b/packages/ckeditor5-easy-image/tests/cloudservicesuploadadapter.js index 0212c509609..51f9b1f48ba 100644 --- a/packages/ckeditor5-easy-image/tests/cloudservicesuploadadapter.js +++ b/packages/ckeditor5-easy-image/tests/cloudservicesuploadadapter.js @@ -47,7 +47,7 @@ describe( 'CloudServicesUploadAdapter', () => { return ClassicTestEditor .create( div, { - plugins: [ CloudServicesUploadAdapter ], + plugins: [ CloudServices, CloudServicesUploadAdapter ], cloudServices: { tokenUrl: 'abc', uploadUrl: 'http://upload.mock.url/' @@ -65,7 +65,7 @@ describe( 'CloudServicesUploadAdapter', () => { return ClassicTestEditor .create( div, { - plugins: [ CloudServicesUploadAdapter ] + plugins: [ CloudServices, CloudServicesUploadAdapter ] } ) .then( editor => { expect( UploadGatewayMock.lastToken ).to.be.undefined; @@ -80,7 +80,7 @@ describe( 'CloudServicesUploadAdapter', () => { beforeEach( () => { return ClassicTestEditor.create( div, { - plugins: [ CloudServicesUploadAdapter ], + plugins: [ CloudServices, CloudServicesUploadAdapter ], cloudServices: { tokenUrl: 'abc', uploadUrl: 'http://upload.mock.url/' diff --git a/packages/ckeditor5-easy-image/tests/easyimage.js b/packages/ckeditor5-easy-image/tests/easyimage.js index d223e353472..6c8d3750187 100644 --- a/packages/ckeditor5-easy-image/tests/easyimage.js +++ b/packages/ckeditor5-easy-image/tests/easyimage.js @@ -32,11 +32,15 @@ describe( 'EasyImage', () => { } ); it( 'should require other plugins', () => { - const plugins = EasyImage.requires; + expect( EasyImage.requires ).to.include( CloudServicesUploadAdapter ); + } ); + + it( 'should require Image by name', () => { + expect( EasyImage.requires ).to.include( 'Image' ); + } ); - expect( plugins ).to.include( CloudServicesUploadAdapter ); - expect( plugins ).to.include( Image ); - expect( plugins ).to.include( ImageUpload ); + it( 'should require ImageUpload by name', () => { + expect( EasyImage.requires ).to.include( 'ImageUpload' ); } ); it( 'should be able to initialize editor with itself', () => { @@ -45,7 +49,7 @@ describe( 'EasyImage', () => { return ClassicTestEditor .create( div, { - plugins: [ Clipboard, EasyImage ], + plugins: [ Clipboard, Image, ImageUpload, CloudServices, EasyImage ], cloudServices: { tokenUrl: 'abc', uploadUrl: 'def' @@ -99,7 +103,7 @@ describe( 'EasyImage', () => { return ClassicTestEditor .create( div, { plugins: [ - Clipboard, Paragraph, EasyImage + Clipboard, Image, ImageUpload, CloudServices, Paragraph, EasyImage ], cloudServices: { tokenUrl: 'abc', diff --git a/packages/ckeditor5-easy-image/tests/manual/easyimage.js b/packages/ckeditor5-easy-image/tests/manual/easyimage.js index 4a295582f1c..17dd70966b4 100644 --- a/packages/ckeditor5-easy-image/tests/manual/easyimage.js +++ b/packages/ckeditor5-easy-image/tests/manual/easyimage.js @@ -6,16 +6,17 @@ /* globals console, window, document */ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; - -import EasyImage from '../../src/easyimage'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; +import EasyImage from '../../src/easyimage'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; ClassicEditor .create( document.querySelector( '#editor' ), { cloudServices: CS_CONFIG, - plugins: [ ArticlePluginSet, EasyImage ], + plugins: [ ArticlePluginSet, CloudServices, ImageUpload, EasyImage ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-easy-image/webpack.config.js b/packages/ckeditor5-easy-image/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-easy-image/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-editor-balloon/package.json b/packages/ckeditor5-editor-balloon/package.json index 601a659c457..4693fc2e9cd 100644 --- a/packages/ckeditor5-editor-balloon/package.json +++ b/packages/ckeditor5-editor-balloon/package.json @@ -8,20 +8,26 @@ "ckeditor 5", "ckeditor5-editor" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-editor-balloon/src/ballooneditor.js b/packages/ckeditor5-editor-balloon/src/ballooneditor.js index a59e8dd4af8..76f10221da8 100644 --- a/packages/ckeditor5-editor-balloon/src/ballooneditor.js +++ b/packages/ckeditor5-editor-balloon/src/ballooneditor.js @@ -7,19 +7,14 @@ * @module editor-balloon/ballooneditor */ -import Editor from '@ckeditor/ckeditor5-core/src/editor/editor'; -import BalloonToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar'; +import { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core'; +import { BalloonToolbar } from 'ckeditor5/src/ui'; +import { CKEditorError, setDataInElement, getDataFromElement, mix } from 'ckeditor5/src/utils'; + +import { isElement } from 'lodash-es'; + import BalloonEditorUI from './ballooneditorui'; import BalloonEditorUIView from './ballooneditoruiview'; -import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement'; -import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement'; -import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin'; -import ElementApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin'; -import attachToForm from '@ckeditor/ckeditor5-core/src/editor/utils/attachtoform'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import { isElement } from 'lodash-es'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import secureSourceElement from '@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement'; /** * The {@glink builds/guides/overview#balloon-editor balloon editor} implementation (Medium-like editor). diff --git a/packages/ckeditor5-editor-balloon/src/ballooneditorui.js b/packages/ckeditor5-editor-balloon/src/ballooneditorui.js index 0195a41ba8a..16d68e5fb73 100644 --- a/packages/ckeditor5-editor-balloon/src/ballooneditorui.js +++ b/packages/ckeditor5-editor-balloon/src/ballooneditorui.js @@ -7,9 +7,9 @@ * @module editor-balloon/ballooneditorui */ -import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui'; -import enableToolbarKeyboardFocus from '@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus'; -import { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder'; +import { EditorUI } from 'ckeditor5/src/core'; +import { enableToolbarKeyboardFocus } from 'ckeditor5/src/ui'; +import { enablePlaceholder } from 'ckeditor5/src/engine'; /** * The balloon editor UI class. diff --git a/packages/ckeditor5-editor-balloon/src/ballooneditoruiview.js b/packages/ckeditor5-editor-balloon/src/ballooneditoruiview.js index 9ba26cd0fb1..bb615f7f5d7 100644 --- a/packages/ckeditor5-editor-balloon/src/ballooneditoruiview.js +++ b/packages/ckeditor5-editor-balloon/src/ballooneditoruiview.js @@ -7,8 +7,7 @@ * @module editor-balloon/ballooneditoruiview */ -import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview'; -import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview'; +import { EditorUIView, InlineEditableUIView } from 'ckeditor5/src/ui'; /** * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}. diff --git a/packages/ckeditor5-editor-balloon/src/index.js b/packages/ckeditor5-editor-balloon/src/index.js new file mode 100644 index 00000000000..9271637ffef --- /dev/null +++ b/packages/ckeditor5-editor-balloon/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module editor-balloon + */ + +import BalloonEditor from './ballooneditor'; + +export default { + BalloonEditor +}; diff --git a/packages/ckeditor5-editor-balloon/webpack.config.js b/packages/ckeditor5-editor-balloon/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-editor-balloon/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-editor-classic/package.json b/packages/ckeditor5-editor-classic/package.json index d69b8faf0cc..f45c642420d 100644 --- a/packages/ckeditor5-editor-classic/package.json +++ b/packages/ckeditor5-editor-classic/package.json @@ -8,20 +8,26 @@ "ckeditor 5", "ckeditor5-editor" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-editor-classic/src/classiceditor.js b/packages/ckeditor5-editor-classic/src/classiceditor.js index 0cfe876acab..0918753b653 100644 --- a/packages/ckeditor5-editor-classic/src/classiceditor.js +++ b/packages/ckeditor5-editor-classic/src/classiceditor.js @@ -7,16 +7,13 @@ * @module editor-classic/classiceditor */ -import Editor from '@ckeditor/ckeditor5-core/src/editor/editor'; -import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin'; -import ElementApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin'; -import attachToForm from '@ckeditor/ckeditor5-core/src/editor/utils/attachtoform'; +import { Editor, DataApiMixin, ElementApiMixin, attachToForm } from 'ckeditor5/src/core'; +import { mix, getDataFromElement, CKEditorError } from 'ckeditor5/src/utils'; + +import { isElement } from 'lodash-es'; + import ClassicEditorUI from './classiceditorui'; import ClassicEditorUIView from './classiceditoruiview'; -import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import { isElement } from 'lodash-es'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; /** * The {@glink builds/guides/overview#classic-editor classic editor} implementation. diff --git a/packages/ckeditor5-editor-classic/src/classiceditorui.js b/packages/ckeditor5-editor-classic/src/classiceditorui.js index de585227db6..f36f4805a91 100644 --- a/packages/ckeditor5-editor-classic/src/classiceditorui.js +++ b/packages/ckeditor5-editor-classic/src/classiceditorui.js @@ -7,11 +7,10 @@ * @module editor-classic/classiceditorui */ -import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui'; -import enableToolbarKeyboardFocus from '@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus'; -import normalizeToolbarConfig from '@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig'; -import { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder'; -import ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer'; +import { EditorUI } from 'ckeditor5/src/core'; +import { enableToolbarKeyboardFocus, normalizeToolbarConfig } from 'ckeditor5/src/ui'; +import { enablePlaceholder } from 'ckeditor5/src/engine'; +import { ElementReplacer } from 'ckeditor5/src/utils'; /** * The classic editor UI class. diff --git a/packages/ckeditor5-editor-classic/src/classiceditoruiview.js b/packages/ckeditor5-editor-classic/src/classiceditoruiview.js index 88f6db12509..a661c993843 100644 --- a/packages/ckeditor5-editor-classic/src/classiceditoruiview.js +++ b/packages/ckeditor5-editor-classic/src/classiceditoruiview.js @@ -7,10 +7,7 @@ * @module editor-classic/classiceditoruiview */ -import BoxedEditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview'; -import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview'; -import StickyPanelView from '@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview'; -import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview'; +import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui'; import '../theme/classiceditor.css'; diff --git a/packages/ckeditor5-editor-classic/src/index.js b/packages/ckeditor5-editor-classic/src/index.js new file mode 100644 index 00000000000..7fcf61c268e --- /dev/null +++ b/packages/ckeditor5-editor-classic/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module editor-classic + */ + +import ClassicEditor from './classiceditor'; + +export default { + ClassicEditor +}; diff --git a/packages/ckeditor5-editor-classic/webpack.config.js b/packages/ckeditor5-editor-classic/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-editor-classic/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-editor-decoupled/package.json b/packages/ckeditor5-editor-decoupled/package.json index 13b5f1a07f0..e41a1623bc2 100644 --- a/packages/ckeditor5-editor-decoupled/package.json +++ b/packages/ckeditor5-editor-decoupled/package.json @@ -8,20 +8,26 @@ "ckeditor 5", "ckeditor5-editor" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-editor-decoupled/src/decouplededitor.js b/packages/ckeditor5-editor-decoupled/src/decouplededitor.js index a44f1a739d4..7f6790e04fc 100644 --- a/packages/ckeditor5-editor-decoupled/src/decouplededitor.js +++ b/packages/ckeditor5-editor-decoupled/src/decouplededitor.js @@ -7,16 +7,13 @@ * @module editor-decoupled/decouplededitor */ -import Editor from '@ckeditor/ckeditor5-core/src/editor/editor'; -import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin'; +import { Editor, DataApiMixin, secureSourceElement } from 'ckeditor5/src/core'; +import { CKEditorError, getDataFromElement, setDataInElement, mix } from 'ckeditor5/src/utils'; + +import { isElement } from 'lodash-es'; + import DecoupledEditorUI from './decouplededitorui'; import DecoupledEditorUIView from './decouplededitoruiview'; -import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement'; -import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import { isElement } from 'lodash-es'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import secureSourceElement from '@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement'; /** * The {@glink builds/guides/overview#document-editor decoupled editor} implementation. diff --git a/packages/ckeditor5-editor-decoupled/src/decouplededitorui.js b/packages/ckeditor5-editor-decoupled/src/decouplededitorui.js index a03cb64010f..5f95f73c72a 100644 --- a/packages/ckeditor5-editor-decoupled/src/decouplededitorui.js +++ b/packages/ckeditor5-editor-decoupled/src/decouplededitorui.js @@ -7,9 +7,9 @@ * @module editor-decoupled/decouplededitorui */ -import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui'; -import enableToolbarKeyboardFocus from '@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus'; -import { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder'; +import { EditorUI } from 'ckeditor5/src/core'; +import { enableToolbarKeyboardFocus } from 'ckeditor5/src/ui'; +import { enablePlaceholder } from 'ckeditor5/src/engine'; /** * The decoupled editor UI class. diff --git a/packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js b/packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js index 25e2e15312e..fbc8621d026 100644 --- a/packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js +++ b/packages/ckeditor5-editor-decoupled/src/decouplededitoruiview.js @@ -7,9 +7,7 @@ * @module editor-decoupled/decouplededitoruiview */ -import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview'; -import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview'; -import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview'; +import { EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui'; /** * The decoupled editor UI view. It is a virtual view providing an inline diff --git a/packages/ckeditor5-editor-decoupled/src/index.js b/packages/ckeditor5-editor-decoupled/src/index.js new file mode 100644 index 00000000000..77ffbf9a642 --- /dev/null +++ b/packages/ckeditor5-editor-decoupled/src/index.js @@ -0,0 +1,15 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module editor-decoupled + */ + +import DecoupledEditor from './decouplededitor'; + +export default { + DecoupledEditor +}; + diff --git a/packages/ckeditor5-editor-decoupled/webpack.config.js b/packages/ckeditor5-editor-decoupled/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-editor-decoupled/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-editor-inline/package.json b/packages/ckeditor5-editor-inline/package.json index 0b32f5325b7..97779134998 100644 --- a/packages/ckeditor5-editor-inline/package.json +++ b/packages/ckeditor5-editor-inline/package.json @@ -8,20 +8,26 @@ "ckeditor 5", "ckeditor5-editor" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,6 +45,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-editor-inline/src/index.js b/packages/ckeditor5-editor-inline/src/index.js new file mode 100644 index 00000000000..2a57a6c2463 --- /dev/null +++ b/packages/ckeditor5-editor-inline/src/index.js @@ -0,0 +1,15 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module editor-inline + */ + +import InlineEditor from './inlineeditor'; + +export default { + InlineEditor +}; + diff --git a/packages/ckeditor5-editor-inline/src/inlineeditor.js b/packages/ckeditor5-editor-inline/src/inlineeditor.js index 853dced6d23..fa5f4e5fc18 100644 --- a/packages/ckeditor5-editor-inline/src/inlineeditor.js +++ b/packages/ckeditor5-editor-inline/src/inlineeditor.js @@ -7,18 +7,13 @@ * @module editor-inline/inlineeditor */ -import Editor from '@ckeditor/ckeditor5-core/src/editor/editor'; -import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin'; -import ElementApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin'; -import attachToForm from '@ckeditor/ckeditor5-core/src/editor/utils/attachtoform'; +import { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core'; +import { mix, getDataFromElement, setDataInElement, CKEditorError } from 'ckeditor5/src/utils'; + +import { isElement } from 'lodash-es'; + import InlineEditorUI from './inlineeditorui'; import InlineEditorUIView from './inlineeditoruiview'; -import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement'; -import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; -import { isElement } from 'lodash-es'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import secureSourceElement from '@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement'; /** * The {@glink builds/guides/overview#inline-editor inline editor} implementation. diff --git a/packages/ckeditor5-editor-inline/src/inlineeditorui.js b/packages/ckeditor5-editor-inline/src/inlineeditorui.js index dc0aec8e518..8c1c324a97f 100644 --- a/packages/ckeditor5-editor-inline/src/inlineeditorui.js +++ b/packages/ckeditor5-editor-inline/src/inlineeditorui.js @@ -7,10 +7,9 @@ * @module editor-inline/inlineeditorui */ -import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui'; -import enableToolbarKeyboardFocus from '@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus'; -import normalizeToolbarConfig from '@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig'; -import { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder'; +import { EditorUI } from 'ckeditor5/src/core'; +import { enableToolbarKeyboardFocus, normalizeToolbarConfig } from 'ckeditor5/src/ui'; +import { enablePlaceholder } from 'ckeditor5/src/engine'; /** * The inline editor UI class. diff --git a/packages/ckeditor5-editor-inline/src/inlineeditoruiview.js b/packages/ckeditor5-editor-inline/src/inlineeditoruiview.js index 12a69e285ea..3386f1a7969 100644 --- a/packages/ckeditor5-editor-inline/src/inlineeditoruiview.js +++ b/packages/ckeditor5-editor-inline/src/inlineeditoruiview.js @@ -6,14 +6,8 @@ /** * @module editor-inline/inlineeditoruiview */ - -import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview'; -import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview'; -import BalloonPanelView from '@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview'; -import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview'; -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; -import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver'; -import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit'; +import { BalloonPanelView, EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui'; +import { Rect, ResizeObserver, toUnit } from 'ckeditor5/src/utils'; const toPx = toUnit( 'px' ); diff --git a/packages/ckeditor5-editor-inline/webpack.config.js b/packages/ckeditor5-editor-inline/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-editor-inline/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-engine/package.json b/packages/ckeditor5-engine/package.json index 005233cda43..6e2ebf611b6 100644 --- a/packages/ckeditor5-engine/package.json +++ b/packages/ckeditor5-engine/package.json @@ -15,11 +15,13 @@ "collaborative", "real-time", "framework", - "ckeditor5-lib", "ckeditor", "ckeditor5", - "ckeditor 5" + "ckeditor 5", + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-utils": "^25.0.0", "lodash-es": "^4.17.15" @@ -42,7 +44,9 @@ "@ckeditor/ckeditor5-typing": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "@ckeditor/ckeditor5-widget": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-engine/src/index.js b/packages/ckeditor5-engine/src/index.js new file mode 100644 index 00000000000..4e1971d6441 --- /dev/null +++ b/packages/ckeditor5-engine/src/index.js @@ -0,0 +1,51 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module engine + */ + +export * from './view/placeholder'; + +export { default as EditingController } from './controller/editingcontroller'; +export { default as DataController } from './controller/datacontroller'; + +export { default as Conversion } from './conversion/conversion'; + +export { default as HtmlDataProcessor } from './dataprocessor/htmldataprocessor'; + +export { default as InsertOperation } from './model/operation/insertoperation'; +export { default as MarkerOperation } from './model/operation/markeroperation'; +export { default as OperationFactory } from './model/operation/operationfactory'; +export { transformSets } from './model/operation/transform'; + +export { default as DocumentSelection } from './model/documentselection'; +export { default as Range } from './model/range'; +export { default as LiveRange } from './model/liverange'; +export { default as LivePosition } from './model/liveposition'; +export { default as Model } from './model/model'; +export { default as TreeWalker } from './model/treewalker'; +export { default as Element } from './model/element'; + +export { default as DomConverter } from './view/domconverter'; +export { default as ViewDocument } from './view/document'; + +export { getFillerOffset } from './view/containerelement'; +export { default as Observer } from './view/observer/observer'; +export { default as ClickObserver } from './view/observer/clickobserver'; +export { default as DomEventObserver } from './view/observer/domeventobserver'; +export { default as MouseObserver } from './view/observer/mouseobserver'; +export { default as DowncastWriter } from './view/downcastwriter'; +export { default as UpcastWriter } from './view/upcastwriter'; +export { default as Matcher } from './view/matcher'; + +export { default as DomEventData } from './view/observer/domeventdata'; + +export { StylesProcessor } from './view/stylesmap'; +export * from './view/styles/background'; +export * from './view/styles/border'; +export * from './view/styles/margin'; +export * from './view/styles/padding'; +export * from './view/styles/utils'; diff --git a/packages/ckeditor5-engine/src/view/downcastwriter.js b/packages/ckeditor5-engine/src/view/downcastwriter.js index 0bf595073c1..a553106408b 100644 --- a/packages/ckeditor5-engine/src/view/downcastwriter.js +++ b/packages/ckeditor5-engine/src/view/downcastwriter.js @@ -142,6 +142,17 @@ export default class DowncastWriter { this.document.selection._setFocus( itemOrPosition, offset ); } + /** + * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance. + * + * @param {module:engine/view/node~Node|Iterable.} [children] + * A list of nodes to be inserted into the created document fragment. + * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment. + */ + createDocumentFragment( children ) { + return new DocumentFragment( this.document, children ); + } + /** * Creates a new {@link module:engine/view/text~Text text node}. * diff --git a/packages/ckeditor5-engine/tests/view/downcastwriter/writer.js b/packages/ckeditor5-engine/tests/view/downcastwriter/writer.js index 42c6a4b0439..e3d887e340b 100644 --- a/packages/ckeditor5-engine/tests/view/downcastwriter/writer.js +++ b/packages/ckeditor5-engine/tests/view/downcastwriter/writer.js @@ -12,6 +12,8 @@ import createViewRoot from '../_utils/createroot'; import ViewElement from '../../../src/view/element'; import ViewSelection from '../../../src/view/selection'; import { StylesProcessor } from '../../../src/view/stylesmap'; +import DocumentFragment from '../../../src/view/documentfragment'; +import HtmlDataProcessor from '../../../src/dataprocessor/htmldataprocessor'; describe( 'DowncastWriter', () => { let writer, attributes, root, doc; @@ -57,6 +59,40 @@ describe( 'DowncastWriter', () => { } ); } ); + describe( 'createDocumentFragment', () => { + let view; + + beforeEach( () => { + const dataProcessor = new HtmlDataProcessor( doc ); + + const html = '' + + '

Heading 1

' + + '

Foo Bar Bold

' + + '

Some underlined text

' + + ''; + + view = dataProcessor.toView( html ); + } ); + + it( 'should create empty document fragment', () => { + const df = writer.createDocumentFragment(); + + expect( df ).to.instanceOf( DocumentFragment ); + expect( df.childCount ).to.equal( 0 ); + } ); + + it( 'should create document fragment with children', () => { + const df = writer.createDocumentFragment( [ view.getChild( 0 ), view.getChild( 1 ) ] ); + + expect( df ).to.instanceOf( DocumentFragment ); + expect( df.childCount ).to.equal( 2 ); + } ); + } ); + describe( 'createText()', () => { it( 'should create Text instance', () => { const text = writer.createText( 'foo bar' ); diff --git a/packages/ckeditor5-enter/package.json b/packages/ckeditor5-enter/package.json index 175132265dc..eeb374c6a6b 100644 --- a/packages/ckeditor5-enter/package.json +++ b/packages/ckeditor5-enter/package.json @@ -7,8 +7,10 @@ "ckeditor5", "ckeditor 5", "ckeditor5-feature", - "ckeditor5-plugin" + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", diff --git a/packages/ckeditor5-enter/src/index.js b/packages/ckeditor5-enter/src/index.js new file mode 100644 index 00000000000..15684484c13 --- /dev/null +++ b/packages/ckeditor5-enter/src/index.js @@ -0,0 +1,11 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module enter + */ + +export { default as Enter } from './enter'; +export { default as ShiftEnter } from './shiftenter'; diff --git a/packages/ckeditor5-essentials/package.json b/packages/ckeditor5-essentials/package.json index b0dc7253bc2..af97b9b9622 100644 --- a/packages/ckeditor5-essentials/package.json +++ b/packages/ckeditor5-essentials/package.json @@ -9,17 +9,23 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { + "ckeditor5": "^25.0.0" + }, + "devDependencies": { "@ckeditor/ckeditor5-clipboard": "^25.0.0", "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-select-all": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" - }, - "devDependencies": { - "@ckeditor/ckeditor5-editor-classic": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-undo": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -37,6 +43,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-essentials/src/essentials.js b/packages/ckeditor5-essentials/src/essentials.js index 1904bc37fb9..f9f1207ba4c 100644 --- a/packages/ckeditor5-essentials/src/essentials.js +++ b/packages/ckeditor5-essentials/src/essentials.js @@ -7,14 +7,13 @@ * @module essentials/essentials */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; -import Enter from '@ckeditor/ckeditor5-enter/src/enter'; -import ShiftEnter from '@ckeditor/ckeditor5-enter/src/shiftenter'; -import SelectAll from '@ckeditor/ckeditor5-select-all/src/selectall'; -import Typing from '@ckeditor/ckeditor5-typing/src/typing'; -import Undo from '@ckeditor/ckeditor5-undo/src/undo'; +import { Clipboard } from 'ckeditor5/src/clipboard'; +import { Enter, ShiftEnter } from 'ckeditor5/src/enter'; +import { SelectAll } from 'ckeditor5/src/select-all'; +import { Typing } from 'ckeditor5/src/typing'; +import { Undo } from 'ckeditor5/src/undo'; /** * A plugin including all essential editing features. It represents a set of features that enables similar functionalities diff --git a/packages/ckeditor5-essentials/src/index.js b/packages/ckeditor5-essentials/src/index.js new file mode 100644 index 00000000000..7877c2289aa --- /dev/null +++ b/packages/ckeditor5-essentials/src/index.js @@ -0,0 +1,15 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module essentials + */ + +import Essentials from './essentials'; + +export default { + Essentials +}; + diff --git a/packages/ckeditor5-essentials/webpack.config.js b/packages/ckeditor5-essentials/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-essentials/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-font/package.json b/packages/ckeditor5-font/package.json index 5bbb10d1182..c7d18e80441 100644 --- a/packages/ckeditor5-font/package.json +++ b/packages/ckeditor5-font/package.json @@ -9,16 +9,22 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-highlight": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -36,6 +42,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-font/src/documentcolorcollection.js b/packages/ckeditor5-font/src/documentcolorcollection.js index aed7fd9241b..88703c8976e 100644 --- a/packages/ckeditor5-font/src/documentcolorcollection.js +++ b/packages/ckeditor5-font/src/documentcolorcollection.js @@ -7,9 +7,7 @@ * @module font/documentcolorcollection */ -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; +import { Collection, ObservableMixin, mix } from 'ckeditor5/src/utils'; /** * A collection to store document colors. It enforces colors to be unique. diff --git a/packages/ckeditor5-font/src/font.js b/packages/ckeditor5-font/src/font.js index 5440ec8c636..c832451d636 100644 --- a/packages/ckeditor5-font/src/font.js +++ b/packages/ckeditor5-font/src/font.js @@ -7,7 +7,7 @@ * @module font/font */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontFamily from './fontfamily'; import FontSize from './fontsize'; diff --git a/packages/ckeditor5-font/src/fontbackgroundcolor.js b/packages/ckeditor5-font/src/fontbackgroundcolor.js index 1f91595a4be..3233aaaf957 100644 --- a/packages/ckeditor5-font/src/fontbackgroundcolor.js +++ b/packages/ckeditor5-font/src/fontbackgroundcolor.js @@ -7,7 +7,7 @@ * @module font/fontbackgroundcolor */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontBackgroundColorEditing from './fontbackgroundcolor/fontbackgroundcolorediting'; import FontBackgroundColorUI from './fontbackgroundcolor/fontbackgroundcolorui'; diff --git a/packages/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js b/packages/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js index ac0ac770e60..2134e0d8855 100644 --- a/packages/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js +++ b/packages/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js @@ -7,10 +7,11 @@ * @module font/fontbackgroundcolor/fontbackgroundcolorediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { addBackgroundRules } from 'ckeditor5/src/engine'; + import FontBackgroundColorCommand from './fontbackgroundcolorcommand'; import { FONT_BACKGROUND_COLOR, renderDowncastElement, renderUpcastAttribute } from '../utils'; -import { addBackgroundRules } from '@ckeditor/ckeditor5-engine/src/view/styles/background'; /** * The font background color editing feature. diff --git a/packages/ckeditor5-font/src/fontcolor.js b/packages/ckeditor5-font/src/fontcolor.js index 1fcb36bfba7..5ea19c4ddd7 100644 --- a/packages/ckeditor5-font/src/fontcolor.js +++ b/packages/ckeditor5-font/src/fontcolor.js @@ -7,7 +7,7 @@ * @module font/fontcolor */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontColorEditing from './fontcolor/fontcolorediting'; import FontColorUI from './fontcolor/fontcolorui'; diff --git a/packages/ckeditor5-font/src/fontcolor/fontcolorediting.js b/packages/ckeditor5-font/src/fontcolor/fontcolorediting.js index 7467e27d5ba..d89708a1852 100644 --- a/packages/ckeditor5-font/src/fontcolor/fontcolorediting.js +++ b/packages/ckeditor5-font/src/fontcolor/fontcolorediting.js @@ -7,7 +7,7 @@ * @module font/fontcolor/fontcolorediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontColorCommand from './fontcolorcommand'; import { FONT_COLOR, renderDowncastElement, renderUpcastAttribute } from '../utils'; diff --git a/packages/ckeditor5-font/src/fontcommand.js b/packages/ckeditor5-font/src/fontcommand.js index 9fd89ce4937..ed3430b8ab8 100644 --- a/packages/ckeditor5-font/src/fontcommand.js +++ b/packages/ckeditor5-font/src/fontcommand.js @@ -7,7 +7,7 @@ * @module font/fontcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * The base font command. diff --git a/packages/ckeditor5-font/src/fontfamily.js b/packages/ckeditor5-font/src/fontfamily.js index 83a3f7c262e..55a813ae392 100644 --- a/packages/ckeditor5-font/src/fontfamily.js +++ b/packages/ckeditor5-font/src/fontfamily.js @@ -7,7 +7,7 @@ * @module font/fontfamily */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontFamilyEditing from './fontfamily/fontfamilyediting'; import FontFamilyUI from './fontfamily/fontfamilyui'; diff --git a/packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js b/packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js index e9d68b160e5..4e3218d4fa6 100644 --- a/packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js +++ b/packages/ckeditor5-font/src/fontfamily/fontfamilyediting.js @@ -7,7 +7,7 @@ * @module font/fontfamily/fontfamilyediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontFamilyCommand from './fontfamilycommand'; import { normalizeOptions } from './utils'; diff --git a/packages/ckeditor5-font/src/fontfamily/fontfamilyui.js b/packages/ckeditor5-font/src/fontfamily/fontfamilyui.js index 3981ec8cf99..b43d3cd4dd6 100644 --- a/packages/ckeditor5-font/src/fontfamily/fontfamilyui.js +++ b/packages/ckeditor5-font/src/fontfamily/fontfamilyui.js @@ -7,13 +7,13 @@ * @module font/fontfamily/fontfamilyui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin } from 'ckeditor5/src/core'; +import { Collection } from 'ckeditor5/src/utils'; +import { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; import { normalizeOptions } from './utils'; import { FONT_FAMILY } from '../utils'; + import fontFamilyIcon from '../../theme/icons/font-family.svg'; /** diff --git a/packages/ckeditor5-font/src/fontsize.js b/packages/ckeditor5-font/src/fontsize.js index 6bf305c06ce..2eb737296e1 100644 --- a/packages/ckeditor5-font/src/fontsize.js +++ b/packages/ckeditor5-font/src/fontsize.js @@ -7,7 +7,7 @@ * @module font/fontsize */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import FontSizeEditing from './fontsize/fontsizeediting'; import FontSizeUI from './fontsize/fontsizeui'; diff --git a/packages/ckeditor5-font/src/fontsize/fontsizeediting.js b/packages/ckeditor5-font/src/fontsize/fontsizeediting.js index d350ae62e07..9535e99c332 100644 --- a/packages/ckeditor5-font/src/fontsize/fontsizeediting.js +++ b/packages/ckeditor5-font/src/fontsize/fontsizeediting.js @@ -7,12 +7,12 @@ * @module font/fontsize/fontsizeediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { CKEditorError } from 'ckeditor5/src/utils'; import FontSizeCommand from './fontsizecommand'; import { normalizeOptions } from './utils'; import { buildDefinition, FONT_SIZE } from '../utils'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; /** * The font size editing feature. diff --git a/packages/ckeditor5-font/src/fontsize/fontsizeui.js b/packages/ckeditor5-font/src/fontsize/fontsizeui.js index 542e9c0fa07..0346da5feb9 100644 --- a/packages/ckeditor5-font/src/fontsize/fontsizeui.js +++ b/packages/ckeditor5-font/src/fontsize/fontsizeui.js @@ -7,11 +7,10 @@ * @module font/fontsize/fontsizeui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin } from 'ckeditor5/src/core'; +import { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; +import { Collection } from 'ckeditor5/src/utils'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; import { normalizeOptions } from './utils'; import { FONT_SIZE } from '../utils'; diff --git a/packages/ckeditor5-font/src/fontsize/utils.js b/packages/ckeditor5-font/src/fontsize/utils.js index 26200eaa748..6b0aedb3c3b 100644 --- a/packages/ckeditor5-font/src/fontsize/utils.js +++ b/packages/ckeditor5-font/src/fontsize/utils.js @@ -7,7 +7,7 @@ * @module font/fontsize/utils */ -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { CKEditorError } from 'ckeditor5/src/utils'; /** * Normalizes and translates the {@link module:font/fontsize~FontSizeConfig#options configuration options} diff --git a/packages/ckeditor5-font/src/index.js b/packages/ckeditor5-font/src/index.js new file mode 100644 index 00000000000..55e4ea305b7 --- /dev/null +++ b/packages/ckeditor5-font/src/index.js @@ -0,0 +1,38 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module font + */ + +import Font from './font'; +import FontBackgroundColor from './fontbackgroundcolor'; +import FontColor from './fontcolor'; +import FontFamily from './fontfamily'; +import FontSize from './fontsize'; +import FontBackgroundColorEditing from './fontbackgroundcolor/fontbackgroundcolorediting'; +import FontBackgroundColorUI from './fontbackgroundcolor/fontbackgroundcolorui'; +import FontColorEditing from './fontcolor/fontcolorediting'; +import FontColorUI from './fontcolor/fontcolorui'; +import FontFamilyEditing from './fontfamily/fontfamilyediting'; +import FontFamilyUI from './fontfamily/fontfamilyui'; +import FontSizeEditing from './fontsize/fontsizeediting'; +import FontSizeUI from './fontsize/fontsizeui'; + +export default { + Font, + FontBackgroundColor, + FontColor, + FontFamily, + FontSize, + FontBackgroundColorEditing, + FontBackgroundColorUI, + FontColorEditing, + FontColorUI, + FontFamilyEditing, + FontFamilyUI, + FontSizeEditing, + FontSizeUI +}; diff --git a/packages/ckeditor5-font/src/ui/colortableview.js b/packages/ckeditor5-font/src/ui/colortableview.js index 2c98bb15801..ac1c0a174c5 100644 --- a/packages/ckeditor5-font/src/ui/colortableview.js +++ b/packages/ckeditor5-font/src/ui/colortableview.js @@ -7,17 +7,12 @@ * @module font/ui/colortableview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import ColorTileView from '@ckeditor/ckeditor5-ui/src/colorgrid/colortileview'; -import ColorGridView from '@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview'; -import LabelView from '@ckeditor/ckeditor5-ui/src/label/labelview'; +import { icons } from 'ckeditor5/src/core'; +import { ButtonView, ColorGridView, ColorTileView, FocusCycler, LabelView, Template, View } from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; + import DocumentColorCollection from '../documentcolorcollection'; -import Template from '@ckeditor/ckeditor5-ui/src/template'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; -import removeButtonIcon from '@ckeditor/ckeditor5-core/theme/icons/eraser.svg'; + import '../../theme/fontcolor.css'; /** @@ -297,7 +292,7 @@ export default class ColorTableView extends View { buttonView.set( { withText: true, - icon: removeButtonIcon, + icon: icons.eraser, tooltip: true, label: this.removeButtonLabel } ); diff --git a/packages/ckeditor5-font/src/ui/colorui.js b/packages/ckeditor5-font/src/ui/colorui.js index 8a4b2edab91..678fe1257a8 100644 --- a/packages/ckeditor5-font/src/ui/colorui.js +++ b/packages/ckeditor5-font/src/ui/colorui.js @@ -7,9 +7,9 @@ * @module font/ui/colorui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import { normalizeColorOptions, getLocalizedColorOptions } from '@ckeditor/ckeditor5-ui/src/colorgrid/utils'; +import { Plugin } from 'ckeditor5/src/core'; +import { createDropdown, normalizeColorOptions, getLocalizedColorOptions } from 'ckeditor5/src/ui'; + import { addColorTableToDropdown } from '../utils'; /** diff --git a/packages/ckeditor5-font/webpack.config.js b/packages/ckeditor5-font/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-font/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-heading/package.json b/packages/ckeditor5-heading/package.json index 88b764174b1..461ebfe820a 100644 --- a/packages/ckeditor5-heading/package.json +++ b/packages/ckeditor5-heading/package.json @@ -9,24 +9,30 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-alignment": "^25.0.0", "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", - "@ckeditor/ckeditor5-upload": "^25.0.0" + "@ckeditor/ckeditor5-upload": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -44,6 +50,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-heading/src/heading.js b/packages/ckeditor5-heading/src/heading.js index 3949c1b5272..795689325d1 100644 --- a/packages/ckeditor5-heading/src/heading.js +++ b/packages/ckeditor5-heading/src/heading.js @@ -7,9 +7,10 @@ * @module heading/heading */ +import { Plugin } from 'ckeditor5/src/core'; + import HeadingEditing from './headingediting'; import HeadingUI from './headingui'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; import '../theme/heading.css'; diff --git a/packages/ckeditor5-heading/src/headingbuttonsui.js b/packages/ckeditor5-heading/src/headingbuttonsui.js index 4188487bc8b..57c7b289472 100644 --- a/packages/ckeditor5-heading/src/headingbuttonsui.js +++ b/packages/ckeditor5-heading/src/headingbuttonsui.js @@ -7,8 +7,8 @@ * @module heading/headingbuttonsui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import { getLocalizedOptions } from './utils'; import iconHeading1 from '../theme/icons/heading1.svg'; diff --git a/packages/ckeditor5-heading/src/headingcommand.js b/packages/ckeditor5-heading/src/headingcommand.js index d005a446508..9b9abab2244 100644 --- a/packages/ckeditor5-heading/src/headingcommand.js +++ b/packages/ckeditor5-heading/src/headingcommand.js @@ -7,8 +7,8 @@ * @module heading/headingcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings. diff --git a/packages/ckeditor5-heading/src/headingediting.js b/packages/ckeditor5-heading/src/headingediting.js index d84355d13ec..87c8900c62b 100644 --- a/packages/ckeditor5-heading/src/headingediting.js +++ b/packages/ckeditor5-heading/src/headingediting.js @@ -7,11 +7,11 @@ * @module heading/headingediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -import HeadingCommand from './headingcommand'; +import { Plugin } from 'ckeditor5/src/core'; +import { Paragraph } from 'ckeditor5/src/paragraph'; +import { priorities } from 'ckeditor5/src/utils'; -import priorities from '@ckeditor/ckeditor5-utils/src/priorities'; +import HeadingCommand from './headingcommand'; const defaultModelElement = 'paragraph'; diff --git a/packages/ckeditor5-heading/src/headingui.js b/packages/ckeditor5-heading/src/headingui.js index ff3d12211ed..14617299d9d 100644 --- a/packages/ckeditor5-heading/src/headingui.js +++ b/packages/ckeditor5-heading/src/headingui.js @@ -7,14 +7,12 @@ * @module heading/headingui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; +import { Plugin } from 'ckeditor5/src/core'; +import { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; +import { Collection } from 'ckeditor5/src/utils'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; import { getLocalizedOptions } from './utils'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; - import '../theme/heading.css'; /** diff --git a/packages/ckeditor5-heading/src/index.js b/packages/ckeditor5-heading/src/index.js new file mode 100644 index 00000000000..12a3a4d36dc --- /dev/null +++ b/packages/ckeditor5-heading/src/index.js @@ -0,0 +1,20 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module heading + */ + +import Heading from './heading'; +import HeadingEditing from './headingediting'; +import HeadingUI from './headingui'; +import HeadingButtonsUI from './headingbuttonsui'; + +export default { + Heading, + HeadingEditing, + HeadingUI, + HeadingButtonsUI +}; diff --git a/packages/ckeditor5-heading/src/title.js b/packages/ckeditor5-heading/src/title.js index 238a0b73ad1..672985a5cf4 100644 --- a/packages/ckeditor5-heading/src/title.js +++ b/packages/ckeditor5-heading/src/title.js @@ -7,18 +7,16 @@ * @module heading/title */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; +import { Plugin } from 'ckeditor5/src/core'; -import ViewDocumentFragment from '@ckeditor/ckeditor5-engine/src/view/documentfragment'; -import ViewDowncastWriter from '@ckeditor/ckeditor5-engine/src/view/downcastwriter'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { first } from 'ckeditor5/src/utils'; import { + DowncastWriter, needsPlaceholder, showPlaceholder, hidePlaceholder, enablePlaceholder -} from '@ckeditor/ckeditor5-engine/src/view/placeholder'; +} from 'ckeditor5/src/engine'; // A list of element names that should be treated by the Title plugin as title-like. // This means that an element of a type from this list will be changed to a title element @@ -44,7 +42,7 @@ export default class Title extends Plugin { * @inheritDoc */ static get requires() { - return [ Paragraph ]; + return [ 'Paragraph' ]; } /** @@ -149,10 +147,11 @@ export default class Title extends Plugin { const data = editor.data; const model = editor.model; const root = editor.model.document.getRoot(); - const viewWriter = new ViewDowncastWriter( editor.editing.view.document ); + const view = editor.editing.view; + const viewWriter = new DowncastWriter( view.document ); const rootRange = model.createRangeIn( root ); - const viewDocumentFragment = new ViewDocumentFragment( editor.editing.view.document ); + const viewDocumentFragment = viewWriter.createDocumentFragment(); data.downcastDispatcher.conversionApi.options = options; diff --git a/packages/ckeditor5-heading/tests/title.js b/packages/ckeditor5-heading/tests/title.js index 49b55446c38..105c8719e1b 100644 --- a/packages/ckeditor5-heading/tests/title.js +++ b/packages/ckeditor5-heading/tests/title.js @@ -28,7 +28,7 @@ describe( 'Title', () => { document.body.appendChild( element ); return ClassicTestEditor.create( element, { - plugins: [ Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ] + plugins: [ Paragraph, Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ] } ).then( _editor => { editor = _editor; model = editor.model; @@ -40,7 +40,7 @@ describe( 'Title', () => { } ); it( 'should requires Paragraph plugin', () => { - expect( Title.requires ).to.have.members( [ Paragraph ] ); + expect( Title.requires ).to.have.members( [ 'Paragraph' ] ); } ); it( 'should have plugin name property', () => { @@ -713,7 +713,7 @@ describe( 'Title', () => { document.body.appendChild( element ); return ClassicTestEditor.create( element, { - plugins: [ Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ], + plugins: [ Paragraph, Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ], title: { placeholder: 'foo' }, @@ -756,7 +756,7 @@ describe( 'Title', () => { document.body.appendChild( element ); return ClassicTestEditor.create( element, { - plugins: [ Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ], + plugins: [ Paragraph, Title, Heading, BlockQuote, Clipboard, Image, ImageUpload, Enter, Undo ], title: { placeholder: 'foo' } diff --git a/packages/ckeditor5-heading/webpack.config.js b/packages/ckeditor5-heading/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-heading/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-highlight/package.json b/packages/ckeditor5-highlight/package.json index 84e00402040..13c08c6761a 100644 --- a/packages/ckeditor5-highlight/package.json +++ b/packages/ckeditor5-highlight/package.json @@ -9,12 +9,14 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", @@ -22,8 +24,11 @@ "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -41,6 +46,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-highlight/src/highlight.js b/packages/ckeditor5-highlight/src/highlight.js index 76bae4bd7e3..fb2708659fb 100644 --- a/packages/ckeditor5-highlight/src/highlight.js +++ b/packages/ckeditor5-highlight/src/highlight.js @@ -7,7 +7,7 @@ * @module highlight/highlight */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import HighlightEditing from './highlightediting'; import HighlightUI from './highlightui'; diff --git a/packages/ckeditor5-highlight/src/highlightcommand.js b/packages/ckeditor5-highlight/src/highlightcommand.js index 64ee94b22d2..418fdcf1870 100644 --- a/packages/ckeditor5-highlight/src/highlightcommand.js +++ b/packages/ckeditor5-highlight/src/highlightcommand.js @@ -7,7 +7,7 @@ * @module highlight/highlightcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature} diff --git a/packages/ckeditor5-highlight/src/highlightediting.js b/packages/ckeditor5-highlight/src/highlightediting.js index 51a45e82b1d..9515017a090 100644 --- a/packages/ckeditor5-highlight/src/highlightediting.js +++ b/packages/ckeditor5-highlight/src/highlightediting.js @@ -7,7 +7,7 @@ * @module highlight/highlightediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import HighlightCommand from './highlightcommand'; diff --git a/packages/ckeditor5-highlight/src/highlightui.js b/packages/ckeditor5-highlight/src/highlightui.js index 2b048773fbc..0c6a545f635 100644 --- a/packages/ckeditor5-highlight/src/highlightui.js +++ b/packages/ckeditor5-highlight/src/highlightui.js @@ -7,17 +7,11 @@ * @module highlight/highlightui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; - -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView, SplitButtonView, ToolbarSeparatorView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui'; import markerIcon from './../theme/icons/marker.svg'; import penIcon from './../theme/icons/pen.svg'; -import eraserIcon from '@ckeditor/ckeditor5-core/theme/icons/eraser.svg'; - -import ToolbarSeparatorView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview'; -import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview'; -import { createDropdown, addToolbarToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; import './../theme/highlight.css'; @@ -101,7 +95,7 @@ export default class HighlightUI extends Plugin { _addRemoveHighlightButton() { const t = this.editor.t; - this._addButton( 'removeHighlight', t( 'Remove highlight' ), eraserIcon ); + this._addButton( 'removeHighlight', t( 'Remove highlight' ), icons.eraser ); } /** diff --git a/packages/ckeditor5-highlight/src/index.js b/packages/ckeditor5-highlight/src/index.js new file mode 100644 index 00000000000..92b38c5f8ad --- /dev/null +++ b/packages/ckeditor5-highlight/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module highlight + */ + +import Highlight from './highlight'; +import HighlightEditing from './highlightediting'; +import HighlightUI from './highlightui'; + +export default { + Highlight, + HighlightEditing, + HighlightUI +}; diff --git a/packages/ckeditor5-highlight/webpack.config.js b/packages/ckeditor5-highlight/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-highlight/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-horizontal-line/package.json b/packages/ckeditor5-horizontal-line/package.json index d4df670e6ec..26f9147fdb7 100644 --- a/packages/ckeditor5-horizontal-line/package.json +++ b/packages/ckeditor5-horizontal-line/package.json @@ -9,18 +9,24 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-cloud-services": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", + "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -38,6 +44,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-horizontal-line/src/horizontalline.js b/packages/ckeditor5-horizontal-line/src/horizontalline.js index a270f7cb12a..bb1db694b4f 100644 --- a/packages/ckeditor5-horizontal-line/src/horizontalline.js +++ b/packages/ckeditor5-horizontal-line/src/horizontalline.js @@ -7,8 +7,8 @@ * @module horizontal-line/horizontalline */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; import HorizontalLineEditing from './horizontallineediting'; import HorizontalLineUI from './horizontallineui'; diff --git a/packages/ckeditor5-horizontal-line/src/horizontallinecommand.js b/packages/ckeditor5-horizontal-line/src/horizontallinecommand.js index 93f4f9557e8..34a18f12c21 100644 --- a/packages/ckeditor5-horizontal-line/src/horizontallinecommand.js +++ b/packages/ckeditor5-horizontal-line/src/horizontallinecommand.js @@ -7,8 +7,8 @@ * @module horizontal-line/horizontallinecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import { findOptimalInsertionPosition, checkSelectionOnObject } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Command } from 'ckeditor5/src/core'; +import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget'; /** * The horizontal line command. diff --git a/packages/ckeditor5-horizontal-line/src/horizontallineediting.js b/packages/ckeditor5-horizontal-line/src/horizontallineediting.js index eddfa1f31dc..c05a84ba495 100644 --- a/packages/ckeditor5-horizontal-line/src/horizontallineediting.js +++ b/packages/ckeditor5-horizontal-line/src/horizontallineediting.js @@ -7,9 +7,10 @@ * @module horizontal-line/horizontallineediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { toWidget } from 'ckeditor5/src/widget'; + import HorizontalLineCommand from './horizontallinecommand'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; import '../theme/horizontalline.css'; diff --git a/packages/ckeditor5-horizontal-line/src/horizontallineui.js b/packages/ckeditor5-horizontal-line/src/horizontallineui.js index 46d481e6f1b..7c733fad81a 100644 --- a/packages/ckeditor5-horizontal-line/src/horizontallineui.js +++ b/packages/ckeditor5-horizontal-line/src/horizontallineui.js @@ -7,8 +7,9 @@ * @module horizontal-line/horizontallineui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; + import horizontalLineIcon from '../theme/icons/horizontalline.svg'; /** diff --git a/packages/ckeditor5-horizontal-line/src/index.js b/packages/ckeditor5-horizontal-line/src/index.js new file mode 100644 index 00000000000..6076c61a81b --- /dev/null +++ b/packages/ckeditor5-horizontal-line/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +import HorizontalLine from './horizontalline'; +import HorizontalLineEditing from './horizontallineediting'; +import HorizontalLineUI from './horizontallineui'; + +/** + * @module horizontal-line + */ + +export default { + HorizontalLine, + HorizontalLineEditing, + HorizontalLineUI +}; diff --git a/packages/ckeditor5-horizontal-line/tests/manual/horizontalline.js b/packages/ckeditor5-horizontal-line/tests/manual/horizontalline.js index 92259d239d1..4531082e46b 100644 --- a/packages/ckeditor5-horizontal-line/tests/manual/horizontalline.js +++ b/packages/ckeditor5-horizontal-line/tests/manual/horizontalline.js @@ -9,13 +9,14 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor' import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; import HorizontalLine from '../../src/horizontalline'; ClassicEditor .create( document.querySelector( '#editor' ), { cloudServices: CS_CONFIG, - plugins: [ ArticlePluginSet, ImageUpload, EasyImage, HorizontalLine ], + plugins: [ ArticlePluginSet, ImageUpload, CloudServices, EasyImage, HorizontalLine ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-horizontal-line/webpack.config.js b/packages/ckeditor5-horizontal-line/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-horizontal-line/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-html-embed/package.json b/packages/ckeditor5-html-embed/package.json index 2a968dcdf41..8c70256d26a 100644 --- a/packages/ckeditor5-html-embed/package.json +++ b/packages/ckeditor5-html-embed/package.json @@ -9,22 +9,27 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-media-embed": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", "lodash-es": "^4.17.15", - "sanitize-html": "^2.1.0" + "sanitize-html": "^2.1.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -42,6 +47,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-html-embed/src/htmlembed.js b/packages/ckeditor5-html-embed/src/htmlembed.js index 9f78aff2e79..8717407434d 100644 --- a/packages/ckeditor5-html-embed/src/htmlembed.js +++ b/packages/ckeditor5-html-embed/src/htmlembed.js @@ -7,10 +7,11 @@ * @module html-embed/htmlembed */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; + import HtmlEmbedEditing from './htmlembedediting'; import HtmlEmbedUI from './htmlembedui'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; /** * The HTML embed feature. diff --git a/packages/ckeditor5-html-embed/src/htmlembedediting.js b/packages/ckeditor5-html-embed/src/htmlembedediting.js index 75ee5895763..33abc9496cf 100644 --- a/packages/ckeditor5-html-embed/src/htmlembedediting.js +++ b/packages/ckeditor5-html-embed/src/htmlembedediting.js @@ -7,18 +7,13 @@ * @module html-embed/htmlembedediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; +import { toWidget } from 'ckeditor5/src/widget'; +import { logWarning, createElement } from 'ckeditor5/src/utils'; + import InsertHtmlEmbedCommand from './inserthtmlembedcommand'; import UpdateHtmlEmbedCommand from './updatehtmlembedcommand'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; - -import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement'; - -import pencilIcon from '@ckeditor/ckeditor5-core/theme/icons/pencil.svg'; -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; import '../theme/htmlembed.css'; @@ -366,7 +361,7 @@ function createDomButton( editor, type ) { buttonView.set( { tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w', - icon: pencilIcon, + icon: icons.pencil, tooltip: true } ); @@ -374,20 +369,20 @@ function createDomButton( editor, type ) { if ( type === 'edit' ) { buttonView.set( { - icon: pencilIcon, + icon: icons.pencil, label: t( 'Edit source' ), class: 'raw-html-embed__edit-button' } ); } else if ( type === 'save' ) { buttonView.set( { - icon: checkIcon, + icon: icons.check, label: t( 'Save changes' ), class: 'raw-html-embed__save-button' } ); buttonView.bind( 'isEnabled' ).to( command, 'isEnabled' ); } else { buttonView.set( { - icon: cancelIcon, + icon: icons.cancel, label: t( 'Cancel' ), class: 'raw-html-embed__cancel-button' } ); diff --git a/packages/ckeditor5-html-embed/src/htmlembedui.js b/packages/ckeditor5-html-embed/src/htmlembedui.js index aa31a84c20a..10d3f46b18f 100644 --- a/packages/ckeditor5-html-embed/src/htmlembedui.js +++ b/packages/ckeditor5-html-embed/src/htmlembedui.js @@ -7,8 +7,8 @@ * @module html-embed/htmlembedui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import htmlEmbedIcon from '../theme/icons/html.svg'; diff --git a/packages/ckeditor5-html-embed/src/index.js b/packages/ckeditor5-html-embed/src/index.js new file mode 100644 index 00000000000..40d242e6e02 --- /dev/null +++ b/packages/ckeditor5-html-embed/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module html-embed + */ + +import HtmlEmbed from './htmlembed'; +import HtmlEmbedEditing from './htmlembedediting'; +import HtmlEmbedUI from './htmlembedui'; + +export default { + HtmlEmbed, + HtmlEmbedEditing, + HtmlEmbedUI +}; diff --git a/packages/ckeditor5-html-embed/src/inserthtmlembedcommand.js b/packages/ckeditor5-html-embed/src/inserthtmlembedcommand.js index d2f781f2b73..b98eec2a8e4 100644 --- a/packages/ckeditor5-html-embed/src/inserthtmlembedcommand.js +++ b/packages/ckeditor5-html-embed/src/inserthtmlembedcommand.js @@ -7,8 +7,8 @@ * @module html-embed/inserthtmlembedcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import { findOptimalInsertionPosition, checkSelectionOnObject } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Command } from 'ckeditor5/src/core'; +import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget'; /** * The insert HTML embed element command. diff --git a/packages/ckeditor5-html-embed/src/updatehtmlembedcommand.js b/packages/ckeditor5-html-embed/src/updatehtmlembedcommand.js index a4a11c33365..54f2d384d43 100644 --- a/packages/ckeditor5-html-embed/src/updatehtmlembedcommand.js +++ b/packages/ckeditor5-html-embed/src/updatehtmlembedcommand.js @@ -7,7 +7,7 @@ * @module html-embed/updatehtmlembedcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * The update HTML embed value command. diff --git a/packages/ckeditor5-html-embed/webpack.config.js b/packages/ckeditor5-html-embed/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-html-embed/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-image/package.json b/packages/ckeditor5-image/package.json index 64c79128e3f..a56a2d5552d 100644 --- a/packages/ckeditor5-image/package.json +++ b/packages/ckeditor5-image/package.json @@ -9,23 +9,23 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0", - "@ckeditor/ckeditor5-upload": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { + "@ckeditor/ckeditor5-adapter-ckfinder": "^25.0.0", "@ckeditor/ckeditor5-basic-styles": "^25.0.0", - "@ckeditor/ckeditor5-cloud-services": "^25.0.0", "@ckeditor/ckeditor5-ckfinder": "^25.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", - "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-html-embed": "^25.0.0", "@ckeditor/ckeditor5-indent": "^25.0.0", @@ -33,7 +33,14 @@ "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-upload": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -51,6 +58,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-image/src/autoimage.js b/packages/ckeditor5-image/src/autoimage.js index c6e87d4956f..9b8fdee3bd6 100644 --- a/packages/ckeditor5-image/src/autoimage.js +++ b/packages/ckeditor5-image/src/autoimage.js @@ -7,12 +7,12 @@ * @module image/autoimage */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; -import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange'; -import LivePosition from '@ckeditor/ckeditor5-engine/src/model/liveposition'; -import Undo from '@ckeditor/ckeditor5-undo/src/undo'; -import global from '@ckeditor/ckeditor5-utils/src/dom/global'; +import { Plugin } from 'ckeditor5/src/core'; +import { Clipboard } from 'ckeditor5/src/clipboard'; +import { LivePosition, LiveRange } from 'ckeditor5/src/engine'; +import { Undo } from 'ckeditor5/src/undo'; +import { global } from 'ckeditor5/src/utils'; + import { insertImage } from './image/utils'; // Implements the pattern: http(s)://(www.)example.com/path/to/resource.ext?query=params&maybe=too. diff --git a/packages/ckeditor5-image/src/image.js b/packages/ckeditor5-image/src/image.js index 1eb4cdc41fb..c65a7d48838 100644 --- a/packages/ckeditor5-image/src/image.js +++ b/packages/ckeditor5-image/src/image.js @@ -7,10 +7,12 @@ * @module image/image */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ImageEditing from '../src/image/imageediting'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; + +import ImageEditing from './image/imageediting'; import ImageTextAlternative from './imagetextalternative'; +import { isImageWidget } from './image/utils'; import '../theme/image.css'; @@ -43,6 +45,16 @@ export default class Image extends Plugin { static get pluginName() { return 'Image'; } + + /** + * Checks if a given view element is an image widget. + * + * @param {module:engine/view/element~Element} viewElement + * @returns {Boolean} + */ + isImageWidget( viewElement ) { + return isImageWidget( viewElement ); + } } /** diff --git a/packages/ckeditor5-image/src/image/converters.js b/packages/ckeditor5-image/src/image/converters.js index 9c30bcba5be..a72d03c6267 100644 --- a/packages/ckeditor5-image/src/image/converters.js +++ b/packages/ckeditor5-image/src/image/converters.js @@ -7,7 +7,7 @@ * @module image/image/converters */ -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { first } from 'ckeditor5/src/utils'; import { getViewImgFromWidget } from './utils'; /** diff --git a/packages/ckeditor5-image/src/image/imageediting.js b/packages/ckeditor5-image/src/image/imageediting.js index 5511fa6b8b1..ad5372e8f02 100644 --- a/packages/ckeditor5-image/src/image/imageediting.js +++ b/packages/ckeditor5-image/src/image/imageediting.js @@ -7,7 +7,7 @@ * @module image/image/imageediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageLoadObserver from './imageloadobserver'; import { diff --git a/packages/ckeditor5-image/src/image/imageinsertcommand.js b/packages/ckeditor5-image/src/image/imageinsertcommand.js index e8bc36b8646..e2fca8c4092 100644 --- a/packages/ckeditor5-image/src/image/imageinsertcommand.js +++ b/packages/ckeditor5-image/src/image/imageinsertcommand.js @@ -3,9 +3,10 @@ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; +import { toArray } from 'ckeditor5/src/utils'; + import { insertImage, isImageAllowed } from './utils'; -import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; /** * @module image/image/imageinsertcommand diff --git a/packages/ckeditor5-image/src/image/imageloadobserver.js b/packages/ckeditor5-image/src/image/imageloadobserver.js index 16abae78d7e..fa47844b1dd 100644 --- a/packages/ckeditor5-image/src/image/imageloadobserver.js +++ b/packages/ckeditor5-image/src/image/imageloadobserver.js @@ -7,7 +7,7 @@ * @module image/image/imageloadobserver */ -import Observer from '@ckeditor/ckeditor5-engine/src/view/observer/observer'; +import { Observer } from 'ckeditor5/src/engine'; /** * Observes all new images added to the {@link module:engine/view/document~Document}, diff --git a/packages/ckeditor5-image/src/image/ui/utils.js b/packages/ckeditor5-image/src/image/ui/utils.js index 17ae2ccf442..478ef6d2d01 100644 --- a/packages/ckeditor5-image/src/image/ui/utils.js +++ b/packages/ckeditor5-image/src/image/ui/utils.js @@ -7,7 +7,7 @@ * @module image/image/ui/utils */ -import BalloonPanelView from '@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview'; +import { BalloonPanelView } from 'ckeditor5/src/ui'; import { getSelectedImageWidget } from '../utils'; /** diff --git a/packages/ckeditor5-image/src/image/utils.js b/packages/ckeditor5-image/src/image/utils.js index a1e4f79b7a9..eed10d94957 100644 --- a/packages/ckeditor5-image/src/image/utils.js +++ b/packages/ckeditor5-image/src/image/utils.js @@ -7,7 +7,7 @@ * @module image/image/utils */ -import { findOptimalInsertionPosition, checkSelectionOnObject, isWidget, toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; +import { findOptimalInsertionPosition, checkSelectionOnObject, isWidget, toWidget } from 'ckeditor5/src/widget'; /** * Converts a given {@link module:engine/view/element~Element} to an image widget: diff --git a/packages/ckeditor5-image/src/imagecaption.js b/packages/ckeditor5-image/src/imagecaption.js index 61aaa5f915d..99e87249dcf 100644 --- a/packages/ckeditor5-image/src/imagecaption.js +++ b/packages/ckeditor5-image/src/imagecaption.js @@ -7,7 +7,7 @@ * @module image/imagecaption */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageCaptionEditing from './imagecaption/imagecaptionediting'; import '../theme/imagecaption.css'; diff --git a/packages/ckeditor5-image/src/imagecaption/imagecaptionediting.js b/packages/ckeditor5-image/src/imagecaption/imagecaptionediting.js index 2760b8b7e97..648916a478f 100644 --- a/packages/ckeditor5-image/src/imagecaption/imagecaptionediting.js +++ b/packages/ckeditor5-image/src/imagecaption/imagecaptionediting.js @@ -7,7 +7,7 @@ * @module image/imagecaption/imagecaptionediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import { isImage } from '../image/utils'; import { captionElementCreator, getCaptionFromImage, matchImageCaption } from './utils'; diff --git a/packages/ckeditor5-image/src/imagecaption/utils.js b/packages/ckeditor5-image/src/imagecaption/utils.js index df8fd0bdbbf..4374830f438 100644 --- a/packages/ckeditor5-image/src/imagecaption/utils.js +++ b/packages/ckeditor5-image/src/imagecaption/utils.js @@ -7,8 +7,8 @@ * @module image/imagecaption/utils */ -import { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder'; -import { toWidgetEditable } from '@ckeditor/ckeditor5-widget/src/utils'; +import { enablePlaceholder } from 'ckeditor5/src/engine'; +import { toWidgetEditable } from 'ckeditor5/src/widget'; /** * Returns a function that creates a caption editable element for the given {@link module:engine/view/document~Document}. diff --git a/packages/ckeditor5-image/src/imageinsert.js b/packages/ckeditor5-image/src/imageinsert.js index 87fe6756d2f..c12cb22d0a3 100644 --- a/packages/ckeditor5-image/src/imageinsert.js +++ b/packages/ckeditor5-image/src/imageinsert.js @@ -7,7 +7,7 @@ * @module image/imageinsert */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageUpload from './imageupload'; import ImageInsertUI from './imageinsert/imageinsertui'; diff --git a/packages/ckeditor5-image/src/imageinsert/imageinsertui.js b/packages/ckeditor5-image/src/imageinsert/imageinsertui.js index 20471481870..c3568ad6d77 100644 --- a/packages/ckeditor5-image/src/imageinsert/imageinsertui.js +++ b/packages/ckeditor5-image/src/imageinsert/imageinsertui.js @@ -7,7 +7,7 @@ * @module image/imageinsert/imageinsertui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageInsertPanelView from './ui/imageinsertpanelview'; import { prepareIntegrations } from './utils'; diff --git a/packages/ckeditor5-image/src/imageinsert/ui/imageinsertformrowview.js b/packages/ckeditor5-image/src/imageinsert/ui/imageinsertformrowview.js index 4f59e0e51ed..94e5418dbd3 100644 --- a/packages/ckeditor5-image/src/imageinsert/ui/imageinsertformrowview.js +++ b/packages/ckeditor5-image/src/imageinsert/ui/imageinsertformrowview.js @@ -7,7 +7,7 @@ * @module image/imageinsert/ui/imageinsertformrowview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5/src/ui'; import '../../../theme/imageinsertformrowview.css'; diff --git a/packages/ckeditor5-image/src/imageinsert/ui/imageinsertpanelview.js b/packages/ckeditor5-image/src/imageinsert/ui/imageinsertpanelview.js index 92c98d9739b..850fa469292 100644 --- a/packages/ckeditor5-image/src/imageinsert/ui/imageinsertpanelview.js +++ b/packages/ckeditor5-image/src/imageinsert/ui/imageinsertpanelview.js @@ -7,23 +7,11 @@ * @module image/imageinsert/ui/imageinsertpanelview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { icons } from 'ckeditor5/src/core'; +import { ButtonView, View, SplitButtonView, ViewCollection, submitHandler, createDropdown, FocusCycler } from 'ckeditor5/src/ui'; +import { Collection, FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview'; import ImageInsertFormRowView from './imageinsertformrowview'; -import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; - -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; - -import imageIcon from '@ckeditor/ckeditor5-core/theme/icons/image.svg'; -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; import '../../../theme/imageinsert.css'; @@ -241,7 +229,7 @@ export default class ImageInsertPanelView extends View { splitButtonView.set( { label: t( 'Insert image' ), - icon: imageIcon, + icon: icons.image, tooltip: true } ); @@ -272,7 +260,7 @@ export default class ImageInsertPanelView extends View { insertButtonView.set( { label: t( 'Insert' ), - icon: checkIcon, + icon: icons.check, class: 'ck-button-save', type: 'submit', withText: true, @@ -281,7 +269,7 @@ export default class ImageInsertPanelView extends View { cancelButtonView.set( { label: t( 'Cancel' ), - icon: cancelIcon, + icon: icons.cancel, class: 'ck-button-cancel', withText: true } ); diff --git a/packages/ckeditor5-image/src/imageinsert/utils.js b/packages/ckeditor5-image/src/imageinsert/utils.js index 382773d2055..abc05d8e2ae 100644 --- a/packages/ckeditor5-image/src/imageinsert/utils.js +++ b/packages/ckeditor5-image/src/imageinsert/utils.js @@ -7,8 +7,7 @@ * @module image/imageinsert/utils */ -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; +import { LabeledFieldView, createLabeledInputText } from 'ckeditor5/src/ui'; /** * Creates integrations object that will be passed to the diff --git a/packages/ckeditor5-image/src/imageresize.js b/packages/ckeditor5-image/src/imageresize.js index c0bc2f81b5f..cf250dbc2bc 100644 --- a/packages/ckeditor5-image/src/imageresize.js +++ b/packages/ckeditor5-image/src/imageresize.js @@ -7,7 +7,7 @@ * @module image/imageresize */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageResizeButtons from './imageresize/imageresizebuttons'; import ImageResizeEditing from './imageresize/imageresizeediting'; import ImageResizeHandles from './imageresize/imageresizehandles'; diff --git a/packages/ckeditor5-image/src/imageresize/imageresizebuttons.js b/packages/ckeditor5-image/src/imageresize/imageresizebuttons.js index 8b1684f2b7a..7d8238b9d21 100644 --- a/packages/ckeditor5-image/src/imageresize/imageresizebuttons.js +++ b/packages/ckeditor5-image/src/imageresize/imageresizebuttons.js @@ -7,27 +7,17 @@ * @module image/imageresize/imageresizebuttons */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import ImageResizeEditing from './imageresizeediting'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import DropdownButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview'; - -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView, DropdownButtonView, Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; +import { CKEditorError, Collection } from 'ckeditor5/src/utils'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; - -import iconSmall from '@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg'; -import iconMedium from '@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg'; -import iconLarge from '@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg'; -import iconFull from '@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg'; +import ImageResizeEditing from './imageresizeediting'; const RESIZE_ICONS = { - small: iconSmall, - medium: iconMedium, - large: iconLarge, - original: iconFull + small: icons.objectSizeSmall, + medium: icons.objectSizeMedium, + large: icons.objectSizeLarge, + original: icons.objectSizeFull }; /** @@ -161,7 +151,7 @@ export default class ImageResizeButtons extends Plugin { dropdownButton.set( { tooltip: t( 'Resize image' ), commandValue: originalSizeOption.value, - icon: iconMedium, + icon: RESIZE_ICONS.medium, isToggleable: true, label: this._getOptionLabelValue( originalSizeOption ), withText: true, diff --git a/packages/ckeditor5-image/src/imageresize/imageresizecommand.js b/packages/ckeditor5-image/src/imageresize/imageresizecommand.js index cc6bd0455ac..4554d53ba3b 100644 --- a/packages/ckeditor5-image/src/imageresize/imageresizecommand.js +++ b/packages/ckeditor5-image/src/imageresize/imageresizecommand.js @@ -7,7 +7,7 @@ * @module image/imageresize/imageresizecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { isImage } from '../image/utils'; /** diff --git a/packages/ckeditor5-image/src/imageresize/imageresizeediting.js b/packages/ckeditor5-image/src/imageresize/imageresizeediting.js index e585574e2de..6301f5b4b68 100644 --- a/packages/ckeditor5-image/src/imageresize/imageresizeediting.js +++ b/packages/ckeditor5-image/src/imageresize/imageresizeediting.js @@ -7,7 +7,7 @@ * @module image/imageresize/imageresizeediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageResizeCommand from './imageresizecommand'; /** diff --git a/packages/ckeditor5-image/src/imageresize/imageresizehandles.js b/packages/ckeditor5-image/src/imageresize/imageresizehandles.js index 3fb9572706c..8eb8f0ccd66 100644 --- a/packages/ckeditor5-image/src/imageresize/imageresizehandles.js +++ b/packages/ckeditor5-image/src/imageresize/imageresizehandles.js @@ -7,8 +7,9 @@ * @module image/imageresize/imageresizehandles */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import WidgetResize from '@ckeditor/ckeditor5-widget/src/widgetresize'; +import { Plugin } from 'ckeditor5/src/core'; +import { WidgetResize } from 'ckeditor5/src/widget'; + import ImageLoadObserver from '../image/imageloadobserver'; /** diff --git a/packages/ckeditor5-image/src/imagestyle.js b/packages/ckeditor5-image/src/imagestyle.js index 4c5d31baa85..f3278557443 100644 --- a/packages/ckeditor5-image/src/imagestyle.js +++ b/packages/ckeditor5-image/src/imagestyle.js @@ -7,7 +7,7 @@ * @module image/imagestyle */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageStyleEditing from './imagestyle/imagestyleediting'; import ImageStyleUI from './imagestyle/imagestyleui'; @@ -75,8 +75,10 @@ export default class ImageStyle extends Plugin { * * If none of the default styles is good enough, it is possible to define independent custom styles, too: * - * import fullSizeIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg'; - * import sideIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg'; + * import { icons } from 'ckeditor5/src/core'; + * + * const fullSizeIcon = icons.objectCenter'; + * const sideIcon = icons.objectRight'; * * // ... * diff --git a/packages/ckeditor5-image/src/imagestyle/converters.js b/packages/ckeditor5-image/src/imagestyle/converters.js index 5e04ad174fb..4536cdf954f 100644 --- a/packages/ckeditor5-image/src/imagestyle/converters.js +++ b/packages/ckeditor5-image/src/imagestyle/converters.js @@ -3,7 +3,7 @@ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { first } from 'ckeditor5/src/utils'; /** * @module image/imagestyle/converters diff --git a/packages/ckeditor5-image/src/imagestyle/imagestylecommand.js b/packages/ckeditor5-image/src/imagestyle/imagestylecommand.js index e8b2a9aba30..5bb1aa477c4 100644 --- a/packages/ckeditor5-image/src/imagestyle/imagestylecommand.js +++ b/packages/ckeditor5-image/src/imagestyle/imagestylecommand.js @@ -7,7 +7,7 @@ * @module image/imagestyle/imagestylecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { isImage } from '../image/utils'; /** diff --git a/packages/ckeditor5-image/src/imagestyle/imagestyleediting.js b/packages/ckeditor5-image/src/imagestyle/imagestyleediting.js index 1f73af96172..4df322c6093 100644 --- a/packages/ckeditor5-image/src/imagestyle/imagestyleediting.js +++ b/packages/ckeditor5-image/src/imagestyle/imagestyleediting.js @@ -7,7 +7,7 @@ * @module image/imagestyle/imagestyleediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageStyleCommand from './imagestylecommand'; import { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters'; import { normalizeImageStyles } from './utils'; diff --git a/packages/ckeditor5-image/src/imagestyle/imagestyleui.js b/packages/ckeditor5-image/src/imagestyle/imagestyleui.js index 436e4ad0033..83da078d988 100644 --- a/packages/ckeditor5-image/src/imagestyle/imagestyleui.js +++ b/packages/ckeditor5-image/src/imagestyle/imagestyleui.js @@ -7,8 +7,8 @@ * @module image/imagestyle/imagestyleui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import { normalizeImageStyles } from './utils'; diff --git a/packages/ckeditor5-image/src/imagestyle/utils.js b/packages/ckeditor5-image/src/imagestyle/utils.js index 42fd8c458a8..8a5c997d737 100644 --- a/packages/ckeditor5-image/src/imagestyle/utils.js +++ b/packages/ckeditor5-image/src/imagestyle/utils.js @@ -7,11 +7,8 @@ * @module image/imagestyle/utils */ -import fullWidthIcon from '@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg'; -import leftIcon from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg'; -import centerIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg'; -import rightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg'; -import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { logWarning } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; /** * Default image styles provided by the plugin that can be referred in the @@ -35,7 +32,7 @@ const defaultStyles = { full: { name: 'full', title: 'Full size image', - icon: fullWidthIcon, + icon: icons.objectFullWidth, isDefault: true }, @@ -43,7 +40,7 @@ const defaultStyles = { side: { name: 'side', title: 'Side image', - icon: rightIcon, + icon: icons.objectRight, className: 'image-style-side' }, @@ -51,7 +48,7 @@ const defaultStyles = { alignLeft: { name: 'alignLeft', title: 'Left aligned image', - icon: leftIcon, + icon: icons.objectLeft, className: 'image-style-align-left' }, @@ -59,7 +56,7 @@ const defaultStyles = { alignCenter: { name: 'alignCenter', title: 'Centered image', - icon: centerIcon, + icon: icons.objectCenter, className: 'image-style-align-center' }, @@ -67,7 +64,7 @@ const defaultStyles = { alignRight: { name: 'alignRight', title: 'Right aligned image', - icon: rightIcon, + icon: icons.objectRight, className: 'image-style-align-right' } }; @@ -81,10 +78,10 @@ const defaultStyles = { * @member {Object.} */ const defaultIcons = { - full: fullWidthIcon, - left: leftIcon, - right: rightIcon, - center: centerIcon + full: icons.objectFullWidth, + left: icons.objectLeft, + right: icons.objectRight, + center: icons.objectCenter }; /** diff --git a/packages/ckeditor5-image/src/imagetextalternative.js b/packages/ckeditor5-image/src/imagetextalternative.js index 841d5690038..79d86ca9d68 100644 --- a/packages/ckeditor5-image/src/imagetextalternative.js +++ b/packages/ckeditor5-image/src/imagetextalternative.js @@ -7,7 +7,7 @@ * @module image/imagetextalternative */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting'; import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui'; diff --git a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js index cc84652ae4f..d828e04c7fb 100644 --- a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js +++ b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js @@ -7,7 +7,7 @@ * @module image/imagetextalternative/imagetextalternativecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { isImage } from '../image/utils'; /** diff --git a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js index a6c86a77b26..907b1c5e925 100644 --- a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js +++ b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js @@ -8,7 +8,7 @@ */ import ImageTextAlternativeCommand from './imagetextalternativecommand'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * The image text alternative editing plugin. diff --git a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js index ae2b4159306..11469cf122a 100644 --- a/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js +++ b/packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js @@ -7,12 +7,10 @@ * @module image/imagetextalternative/imagetextalternativeui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { ButtonView, ContextualBalloon, clickOutsideHandler } from 'ckeditor5/src/ui'; + import TextAlternativeFormView from './ui/textalternativeformview'; -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; -import textAlternativeIcon from '@ckeditor/ckeditor5-core/theme/icons/low-vision.svg'; import { repositionContextualBalloon, getBalloonPositionData } from '../image/ui/utils'; import { getSelectedImageWidget } from '../image/utils'; @@ -72,7 +70,7 @@ export default class ImageTextAlternativeUI extends Plugin { view.set( { label: t( 'Change image text alternative' ), - icon: textAlternativeIcon, + icon: icons.lowVision, tooltip: true } ); diff --git a/packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js b/packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js index ee8febb899b..d0713d65881 100644 --- a/packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js +++ b/packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js @@ -7,23 +7,23 @@ * @module image/imagetextalternative/ui/textalternativeformview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; +import { + ButtonView, + FocusCycler, + LabeledFieldView, + View, + ViewCollection, + createLabeledInputText, + injectCssTransitionDisabler, + submitHandler +} from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; - -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler'; - -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; - -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; import '../../../theme/textalternativeform.css'; + +// See: #8833. +// eslint-disable-next-line ckeditor5-rules/ckeditor-imports import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css'; /** @@ -68,7 +68,7 @@ export default class TextAlternativeFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} #saveButtonView */ - this.saveButtonView = this._createButton( t( 'Save' ), checkIcon, 'ck-button-save' ); + this.saveButtonView = this._createButton( t( 'Save' ), icons.check, 'ck-button-save' ); this.saveButtonView.type = 'submit'; /** @@ -76,7 +76,7 @@ export default class TextAlternativeFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} #cancelButtonView */ - this.cancelButtonView = this._createButton( t( 'Cancel' ), cancelIcon, 'ck-button-cancel', 'cancel' ); + this.cancelButtonView = this._createButton( t( 'Cancel' ), icons.cancel, 'ck-button-cancel', 'cancel' ); /** * A collection of views which can be focused in the form. diff --git a/packages/ckeditor5-image/src/imagetoolbar.js b/packages/ckeditor5-image/src/imagetoolbar.js index 73ea6a8eba4..3e88ee06b8e 100644 --- a/packages/ckeditor5-image/src/imagetoolbar.js +++ b/packages/ckeditor5-image/src/imagetoolbar.js @@ -7,9 +7,10 @@ * @module image/imagetoolbar */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { WidgetToolbarRepository } from 'ckeditor5/src/widget'; + import { getSelectedImageWidget } from './image/utils'; -import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolbarrepository'; /** * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected). diff --git a/packages/ckeditor5-image/src/imageupload.js b/packages/ckeditor5-image/src/imageupload.js index 8426e9a81f5..b0ade60f141 100644 --- a/packages/ckeditor5-image/src/imageupload.js +++ b/packages/ckeditor5-image/src/imageupload.js @@ -7,7 +7,7 @@ * @module image/imageupload */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ImageUploadUI from './imageupload/imageuploadui'; import ImageUploadProgress from './imageupload/imageuploadprogress'; import ImageUploadEditing from './imageupload/imageuploadediting'; diff --git a/packages/ckeditor5-image/src/imageupload/imageuploadcommand.js b/packages/ckeditor5-image/src/imageupload/imageuploadcommand.js index eeae2d9b6c8..8ccdae82c2e 100644 --- a/packages/ckeditor5-image/src/imageupload/imageuploadcommand.js +++ b/packages/ckeditor5-image/src/imageupload/imageuploadcommand.js @@ -3,10 +3,11 @@ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ -import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { FileRepository } from 'ckeditor5/src/upload'; +import { Command } from 'ckeditor5/src/core'; +import { toArray } from 'ckeditor5/src/utils'; + import { insertImage, isImageAllowed } from '../image/utils'; -import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; /** * @module image/imageupload/imageuploadcommand diff --git a/packages/ckeditor5-image/src/imageupload/imageuploadediting.js b/packages/ckeditor5-image/src/imageupload/imageuploadediting.js index bfdc0b60052..12bd27c7dd4 100644 --- a/packages/ckeditor5-image/src/imageupload/imageuploadediting.js +++ b/packages/ckeditor5-image/src/imageupload/imageuploadediting.js @@ -7,12 +7,14 @@ * @module image/imageupload/imageuploadediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; -import Notification from '@ckeditor/ckeditor5-ui/src/notification/notification'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; -import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; -import env from '@ckeditor/ckeditor5-utils/src/env'; +import { Plugin } from 'ckeditor5/src/core'; + +import { UpcastWriter } from 'ckeditor5/src/engine'; + +import { Notification } from 'ckeditor5/src/ui'; +import { Clipboard } from 'ckeditor5/src/clipboard'; +import { FileRepository } from 'ckeditor5/src/upload'; +import { env } from 'ckeditor5/src/utils'; import ImageUploadCommand from '../../src/imageupload/imageuploadcommand'; import { fetchLocalImage, isLocalImage } from '../../src/imageupload/utils'; diff --git a/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js b/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js index fd1ed3b1173..3d9494bea2d 100644 --- a/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js +++ b/packages/ckeditor5-image/src/imageupload/imageuploadprogress.js @@ -9,11 +9,12 @@ /* globals setTimeout */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import FileRepository from '@ckeditor/ckeditor5-upload/src/filerepository'; -import uploadingPlaceholder from '../../theme/icons/image_placeholder.svg'; +import { Plugin } from 'ckeditor5/src/core'; +import { FileRepository } from 'ckeditor5/src/upload'; import { getViewImgFromWidget } from '../image/utils'; +import uploadingPlaceholder from '../../theme/icons/image_placeholder.svg'; + import '../../theme/imageuploadprogress.css'; import '../../theme/imageuploadicon.css'; import '../../theme/imageuploadloader.css'; diff --git a/packages/ckeditor5-image/src/imageupload/imageuploadui.js b/packages/ckeditor5-image/src/imageupload/imageuploadui.js index 1cd2fe51e24..4b3312cb4de 100644 --- a/packages/ckeditor5-image/src/imageupload/imageuploadui.js +++ b/packages/ckeditor5-image/src/imageupload/imageuploadui.js @@ -7,12 +7,10 @@ * @module image/imageupload/imageuploadui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import FileDialogButtonView from '@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview'; +import { Plugin, icons } from 'ckeditor5/src/core'; +import { FileDialogButtonView } from 'ckeditor5/src/upload'; import { createImageTypeRegExp } from './utils'; -import imageIcon from '@ckeditor/ckeditor5-core/theme/icons/image.svg'; - /** * The image upload button plugin. * @@ -51,7 +49,7 @@ export default class ImageUploadUI extends Plugin { view.buttonView.set( { label: t( 'Insert image' ), - icon: imageIcon, + icon: icons.image, tooltip: true } ); diff --git a/packages/ckeditor5-image/src/imageupload/utils.js b/packages/ckeditor5-image/src/imageupload/utils.js index 2028cd805b1..a01ea08322f 100644 --- a/packages/ckeditor5-image/src/imageupload/utils.js +++ b/packages/ckeditor5-image/src/imageupload/utils.js @@ -9,7 +9,7 @@ /* global fetch, File */ -import global from '@ckeditor/ckeditor5-utils/src/dom/global'; +import { global } from 'ckeditor5/src/utils'; /** * Creates a regular expression used to test for image files. diff --git a/packages/ckeditor5-image/src/index.js b/packages/ckeditor5-image/src/index.js new file mode 100644 index 00000000000..92b9951607c --- /dev/null +++ b/packages/ckeditor5-image/src/index.js @@ -0,0 +1,30 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module image + */ + +import AutoImage from './autoimage'; +import Image from './image'; +import ImageCaption from './imagecaption'; +import ImageInsert from './imageinsert'; +import ImageResize from './imageresize'; +import ImageStyle from './imagestyle'; +import ImageTextAlternative from './imagetextalternative'; +import ImageToolbar from './imagetoolbar'; +import ImageUpload from './imageupload'; + +export default { + AutoImage, + Image, + ImageCaption, + ImageInsert, + ImageResize, + ImageStyle, + ImageTextAlternative, + ImageToolbar, + ImageUpload +}; diff --git a/packages/ckeditor5-image/tests/image.js b/packages/ckeditor5-image/tests/image.js index 7b3da2b98b9..95317801235 100644 --- a/packages/ckeditor5-image/tests/image.js +++ b/packages/ckeditor5-image/tests/image.js @@ -122,20 +122,32 @@ describe( 'Image', () => { expect( getViewData( view ) ).to.equal( '
' + - 'alt text' + - '
' + + 'alt text' + + '
' + '
' + '[
' + - 'alt text' + - '
' + + 'alt text' + + '
' + '
]' ); } ); } ); + + describe( 'isImageWidget()', () => { + it( 'should expose isImageWidget() utility', () => { + expect( editor.plugins.get( 'Image' ) ).to.respondTo( 'isImageWidget' ); + } ); + + it( 'should return true for elements marked with toImageWidget()', () => { + setModelData( model, '[alt text]' ); + const element = viewDocument.getRoot().getChild( 0 ); + expect( editor.plugins.get( 'Image' ).isImageWidget( element ) ).to.be.true; + } ); + } ); } ); diff --git a/packages/ckeditor5-image/tests/imageinsert/imageinsertui.js b/packages/ckeditor5-image/tests/imageinsert/imageinsertui.js index fe9aad9f801..a048a33cd2e 100644 --- a/packages/ckeditor5-image/tests/imageinsert/imageinsertui.js +++ b/packages/ckeditor5-image/tests/imageinsert/imageinsertui.js @@ -25,6 +25,8 @@ import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfie import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; import { UploadAdapterMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mocks'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; +import Link from '@ckeditor/ckeditor5-link/src/link'; describe( 'ImageInsertUI', () => { let editor, editorElement, fileRepository, dropdown; @@ -298,9 +300,11 @@ describe( 'ImageInsertUI', () => { const editor = await ClassicEditor .create( editorElement, { plugins: [ + Link, + Image, + CKFinderUploadAdapter, CKFinder, Paragraph, - Image, ImageInsert, ImageInsertUI, FileRepository, diff --git a/packages/ckeditor5-image/tests/imageinsert/utils.js b/packages/ckeditor5-image/tests/imageinsert/utils.js index ab71b0d84e5..214a5fff8c8 100644 --- a/packages/ckeditor5-image/tests/imageinsert/utils.js +++ b/packages/ckeditor5-image/tests/imageinsert/utils.js @@ -14,6 +14,7 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; import Link from '@ckeditor/ckeditor5-link/src/link'; import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder'; import { prepareIntegrations, createLabeledInputView } from '../../src/imageinsert/utils'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; describe( 'Upload utils', () => { describe( 'prepareIntegrations()', () => { @@ -24,10 +25,12 @@ describe( 'Upload utils', () => { const editor = await ClassicEditor .create( editorElement, { plugins: [ - CKFinder, Paragraph, + Link, Image, - ImageUploadUI + ImageUploadUI, + CKFinderUploadAdapter, + CKFinder ], image: { insert: { diff --git a/packages/ckeditor5-image/tests/imageresize/imageresizehandles.js b/packages/ckeditor5-image/tests/imageresize/imageresizehandles.js index b56efcb67a7..01551a2e615 100644 --- a/packages/ckeditor5-image/tests/imageresize/imageresizehandles.js +++ b/packages/ckeditor5-image/tests/imageresize/imageresizehandles.js @@ -7,33 +7,29 @@ // ClassicTestEditor can't be used, as it doesn't handle the focus, which is needed to test resizer visual cues. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; - -import Image from '../../src/image'; -import ImageStyle from '../../src/imagestyle'; -import ImageToolbar from '../../src/imagetoolbar'; -import ImageResizeEditing from '../../src/imageresize/imageresizeediting'; -import ImageResizeHandles from '../../src/imageresize/imageresizehandles'; -import ImageTextAlternative from '../../src/imagetextalternative'; - +import HtmlEmbedEditing from '@ckeditor/ckeditor5-html-embed/src/htmlembedediting'; import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -import Undo from '@ckeditor/ckeditor5-undo/src/undo'; +import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; import Table from '@ckeditor/ckeditor5-table/src/table'; -import HtmlEmbedEditing from '@ckeditor/ckeditor5-html-embed/src/htmlembedediting'; +import Undo from '@ckeditor/ckeditor5-undo/src/undo'; import LinkImageEditing from '@ckeditor/ckeditor5-link/src/linkimageediting'; - -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; +import Widget from '@ckeditor/ckeditor5-widget/src/widget'; import { setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; - import { focusEditor, resizerMouseSimulator, getWidgetDomParts, getHandleCenterPoint } from '@ckeditor/ckeditor5-widget/tests/widgetresize/_utils/utils'; - -import WidgetResize from '@ckeditor/ckeditor5-widget/src/widgetresize'; import { IMAGE_SRC_FIXTURE, waitForAllImagesLoaded } from './_utils/utils'; +import Image from '../../src/image'; +import ImageToolbar from '../../src/imagetoolbar'; +import ImageResizeEditing from '../../src/imageresize/imageresizeediting'; +import ImageResizeHandles from '../../src/imageresize/imageresizehandles'; +import ImageTextAlternative from '../../src/imagetextalternative'; +import ImageStyle from '../../src/imagestyle'; + describe( 'ImageResizeHandles', () => { let widget, editor, view, viewDocument, editorElement; @@ -59,7 +55,7 @@ describe( 'ImageResizeHandles', () => { plugins: [ Image, ImageResizeEditing, ImageResizeHandles ] } ); - const attachToSpy = sinon.spy( localEditor.plugins.get( WidgetResize ), 'attachTo' ); + const attachToSpy = sinon.spy( localEditor.plugins.get( 'WidgetResize' ), 'attachTo' ); await setModelAndWaitForImages( localEditor, `[]` ); @@ -92,6 +88,8 @@ describe( 'ImageResizeHandles', () => { it( 'disables the resizer if the command is disabled', async () => { await setModelAndWaitForImages( editor, `foo[]` ); + // Enforce selection on an image. See: https://github.com/ckeditor/ckeditor5/issues/8617. + editor.model.change( writer => writer.setSelection( editor.model.document.getRoot().getChild( 1 ), 'on' ) ); const resizer = getSelectedImageResizer( editor ); @@ -111,17 +109,13 @@ describe( 'ImageResizeHandles', () => { } ); it( 'the resizer is disabled from the beginning when the command is disabled when the image is inserted', async () => { - setData( editor.model, 'foo[]' ); - editor.commands.get( 'imageResize' ).on( 'set:isEnabled', evt => { evt.return = false; evt.stop(); }, { priority: 'highest' } ); editor.commands.get( 'imageResize' ).refresh(); - editor.model.change( writer => { - editor.model.insertContent( writer.createElement( 'image', { src: IMAGE_SRC_FIXTURE } ) ); - } ); + setData( editor.model, `[]` ); await waitForAllImagesLoaded( editor ); @@ -181,6 +175,8 @@ describe( 'ImageResizeHandles', () => { editor = await createEditor(); await setModelAndWaitForImages( editor, `foo[]` ); + // Enforce selection on an image. See: https://github.com/ckeditor/ckeditor5/issues/8617. + editor.model.change( writer => writer.setSelection( editor.model.document.getRoot().getChild( 1 ), 'on' ) ); widget = viewDocument.getRoot().getChild( 1 ); } ); @@ -399,6 +395,9 @@ describe( 'ImageResizeHandles', () => { await setModelAndWaitForImages( editor, `foo[]` ); + // Enforce selection on an image. See: https://github.com/ckeditor/ckeditor5/issues/8617. + editor.model.change( writer => writer.setSelection( editor.model.document.getRoot().getChild( 1 ), 'on' ) ); + widget = viewDocument.getRoot().getChild( 1 ); widgetToolbarRepository = editor.plugins.get( 'WidgetToolbarRepository' ); @@ -458,7 +457,7 @@ describe( 'ImageResizeHandles', () => { } } ); - const attachToSpy = sinon.spy( editor.plugins.get( WidgetResize ), 'attachTo' ); + const attachToSpy = sinon.spy( editor.plugins.get( 'WidgetResize' ), 'attachTo' ); setData( editor.model, '[]' ); @@ -504,7 +503,7 @@ describe( 'ImageResizeHandles', () => { function createEditor( config ) { return ClassicEditor.create( editorElement, config || { - plugins: [ Image, ImageStyle, Paragraph, Undo, Table, ImageResizeEditing, ImageResizeHandles ], + plugins: [ Widget, Image, ImageStyle, Paragraph, Undo, Table, ImageResizeEditing, ImageResizeHandles ], image: { resizeUnit: 'px' } diff --git a/packages/ckeditor5-image/tests/manual/imageinsertviaurl.js b/packages/ckeditor5-image/tests/manual/imageinsertviaurl.js index f42def2aee8..1dcce5873a6 100644 --- a/packages/ckeditor5-image/tests/manual/imageinsertviaurl.js +++ b/packages/ckeditor5-image/tests/manual/imageinsertviaurl.js @@ -7,13 +7,14 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; +import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter'; import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder'; import ImageInsert from '../../src/imageinsert'; import AutoImage from '../../src/autoimage'; ClassicEditor .create( document.querySelector( '#editor' ), { - plugins: [ ArticlePluginSet, ImageInsert, AutoImage, CKFinder ], + plugins: [ ArticlePluginSet, ImageInsert, AutoImage, CKFinderUploadAdapter, CKFinder ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-image/tests/manual/imageresize.js b/packages/ckeditor5-image/tests/manual/imageresize.js index 8ee8cf2ce5b..2b69f319832 100644 --- a/packages/ckeditor5-image/tests/manual/imageresize.js +++ b/packages/ckeditor5-image/tests/manual/imageresize.js @@ -7,10 +7,12 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; -import ImageResize from '../../src/imageresize'; import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; +import ImageResize from '../../src/imageresize'; +import ImageUpload from '../../src/imageupload'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -18,8 +20,10 @@ const commonConfig = { plugins: [ ArticlePluginSet, ImageResize, + ImageUpload, Indent, IndentBlock, + CloudServices, EasyImage ], toolbar: [ 'heading', '|', 'bold', 'italic', 'link', diff --git a/packages/ckeditor5-image/tests/manual/imageresizebuttons.js b/packages/ckeditor5-image/tests/manual/imageresizebuttons.js index 769c7307775..3f1562b9d3d 100644 --- a/packages/ckeditor5-image/tests/manual/imageresizebuttons.js +++ b/packages/ckeditor5-image/tests/manual/imageresizebuttons.js @@ -10,7 +10,9 @@ import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articleplugi import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; +import ImageUpload from '../../src/imageupload'; import ImageResizeEditing from '../../src/imageresize/imageresizeediting'; import ImageResizeButtons from '../../src/imageresize/imageresizebuttons'; @@ -21,6 +23,8 @@ const commonConfig = { ArticlePluginSet, Indent, IndentBlock, + ImageUpload, + CloudServices, EasyImage, ImageResizeEditing, ImageResizeButtons diff --git a/packages/ckeditor5-image/tests/manual/imageresizepx.js b/packages/ckeditor5-image/tests/manual/imageresizepx.js index 50270a0e178..697265b556e 100644 --- a/packages/ckeditor5-image/tests/manual/imageresizepx.js +++ b/packages/ckeditor5-image/tests/manual/imageresizepx.js @@ -7,19 +7,24 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; -import ImageResize from '../../src/imageresize'; import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; +import ImageResize from '../../src/imageresize'; +import ImageUpload from '../../src/imageupload'; + const commonConfig = { plugins: [ ArticlePluginSet, + ImageUpload, ImageResize, Indent, IndentBlock, + CloudServices, EasyImage ], toolbar: [ 'heading', '|', 'bold', 'italic', 'link', diff --git a/packages/ckeditor5-image/webpack.config.js b/packages/ckeditor5-image/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-image/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-indent/package.json b/packages/ckeditor5-indent/package.json index b6b3bbd5579..34b09fb0226 100644 --- a/packages/ckeditor5-indent/package.json +++ b/packages/ckeditor5-indent/package.json @@ -9,16 +9,21 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -36,6 +41,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-indent/src/indent.js b/packages/ckeditor5-indent/src/indent.js index e96e59826e0..c05c7313d63 100644 --- a/packages/ckeditor5-indent/src/indent.js +++ b/packages/ckeditor5-indent/src/indent.js @@ -7,7 +7,7 @@ * @module indent/indent */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import IndentEditing from './indentediting'; import IndentUI from './indentui'; diff --git a/packages/ckeditor5-indent/src/indentblock.js b/packages/ckeditor5-indent/src/indentblock.js index 4190206621e..66e827deae0 100644 --- a/packages/ckeditor5-indent/src/indentblock.js +++ b/packages/ckeditor5-indent/src/indentblock.js @@ -7,12 +7,12 @@ * @module indent/indentblock */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { addMarginRules } from 'ckeditor5/src/engine'; import IndentBlockCommand from './indentblockcommand'; import IndentUsingOffset from './indentcommandbehavior/indentusingoffset'; import IndentUsingClasses from './indentcommandbehavior/indentusingclasses'; -import { addMarginRules } from '@ckeditor/ckeditor5-engine/src/view/styles/margin'; const DEFAULT_ELEMENTS = [ 'paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6' ]; diff --git a/packages/ckeditor5-indent/src/indentblockcommand.js b/packages/ckeditor5-indent/src/indentblockcommand.js index 28fa9975317..1130f2fc17c 100644 --- a/packages/ckeditor5-indent/src/indentblockcommand.js +++ b/packages/ckeditor5-indent/src/indentblockcommand.js @@ -7,8 +7,8 @@ * @module indent/indentblockcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The indent block command. diff --git a/packages/ckeditor5-indent/src/indentediting.js b/packages/ckeditor5-indent/src/indentediting.js index 0750d0f1360..c7a58d83fad 100644 --- a/packages/ckeditor5-indent/src/indentediting.js +++ b/packages/ckeditor5-indent/src/indentediting.js @@ -7,8 +7,7 @@ * @module indent/indentediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import MultiCommand from '@ckeditor/ckeditor5-core/src/multicommand'; +import { Plugin, MultiCommand } from 'ckeditor5/src/core'; /** * The indent editing feature. diff --git a/packages/ckeditor5-indent/src/indentui.js b/packages/ckeditor5-indent/src/indentui.js index d56fb3ab131..d332b52ce79 100644 --- a/packages/ckeditor5-indent/src/indentui.js +++ b/packages/ckeditor5-indent/src/indentui.js @@ -6,8 +6,8 @@ /** * @module indent/indentui */ -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { ButtonView } from 'ckeditor5/src/ui'; +import { Plugin } from 'ckeditor5/src/core'; import indentIcon from '../theme/icons/indent.svg'; import outdentIcon from '../theme/icons/outdent.svg'; diff --git a/packages/ckeditor5-indent/src/index.js b/packages/ckeditor5-indent/src/index.js new file mode 100644 index 00000000000..b23fd6155fc --- /dev/null +++ b/packages/ckeditor5-indent/src/index.js @@ -0,0 +1,20 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module indent + */ + +import Indent from './indent'; +import IndentEditing from './indentediting'; +import IndentUI from './indentui'; +import IndentBlock from './indentblock'; + +export default { + Indent, + IndentEditing, + IndentUI, + IndentBlock +}; diff --git a/packages/ckeditor5-indent/webpack.config.js b/packages/ckeditor5-indent/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-indent/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-link/package.json b/packages/ckeditor5-link/package.json index 791efcf15fe..ae38dffbd9e 100644 --- a/packages/ckeditor5-link/package.json +++ b/packages/ckeditor5-link/package.json @@ -9,25 +9,30 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-image": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", "@ckeditor/ckeditor5-code-block": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", + "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-theme-lark": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -45,6 +50,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-link/src/autolink.js b/packages/ckeditor5-link/src/autolink.js index 1f8c1691fc9..1a7cbedc605 100644 --- a/packages/ckeditor5-link/src/autolink.js +++ b/packages/ckeditor5-link/src/autolink.js @@ -7,9 +7,9 @@ * @module link/autolink */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import TextWatcher from '@ckeditor/ckeditor5-typing/src/textwatcher'; -import getLastTextLine from '@ckeditor/ckeditor5-typing/src/utils/getlasttextline'; +import { Plugin } from 'ckeditor5/src/core'; +import { TextWatcher, getLastTextLine } from 'ckeditor5/src/typing'; + import { addLinkProtocolIfApplicable } from './utils'; const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5). diff --git a/packages/ckeditor5-link/src/index.js b/packages/ckeditor5-link/src/index.js new file mode 100644 index 00000000000..daafb5d1736 --- /dev/null +++ b/packages/ckeditor5-link/src/index.js @@ -0,0 +1,26 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module link + */ + +import Link from './link'; +import LinkEditing from './linkediting'; +import LinkUI from './linkui'; +import LinkImage from './linkimage'; +import LinkImageEditing from './linkimageediting'; +import LinkImageUI from './linkimageui'; +import AutoLink from './autolink'; + +export default { + Link, + LinkEditing, + LinkUI, + LinkImage, + LinkImageEditing, + LinkImageUI, + AutoLink +}; diff --git a/packages/ckeditor5-link/src/link.js b/packages/ckeditor5-link/src/link.js index 12f1c11adfb..7d5f1708310 100644 --- a/packages/ckeditor5-link/src/link.js +++ b/packages/ckeditor5-link/src/link.js @@ -7,7 +7,7 @@ * @module link/link */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import LinkEditing from './linkediting'; import LinkUI from './linkui'; import AutoLink from './autolink'; diff --git a/packages/ckeditor5-link/src/linkcommand.js b/packages/ckeditor5-link/src/linkcommand.js index 3c03f11bad7..7bcaaf68384 100644 --- a/packages/ckeditor5-link/src/linkcommand.js +++ b/packages/ckeditor5-link/src/linkcommand.js @@ -7,11 +7,10 @@ * @module link/linkcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import findAttributeRange from '@ckeditor/ckeditor5-typing/src/utils/findattributerange'; -import toMap from '@ckeditor/ckeditor5-utils/src/tomap'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { findAttributeRange } from 'ckeditor5/src/typing'; +import { Collection, toMap, first } from 'ckeditor5/src/utils'; + import AutomaticDecorators from './utils/automaticdecorators'; import { isImageAllowed } from './utils'; diff --git a/packages/ckeditor5-link/src/linkediting.js b/packages/ckeditor5-link/src/linkediting.js index 3517987911c..cf24b118235 100644 --- a/packages/ckeditor5-link/src/linkediting.js +++ b/packages/ckeditor5-link/src/linkediting.js @@ -7,17 +7,15 @@ * @module link/linkediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import MouseObserver from '@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver'; -import TwoStepCaretMovement from '@ckeditor/ckeditor5-typing/src/twostepcaretmovement'; -import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight'; -import Input from '@ckeditor/ckeditor5-typing/src/input'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; +import { Plugin } from 'ckeditor5/src/core'; +import { MouseObserver } from 'ckeditor5/src/engine'; +import { Input, TwoStepCaretMovement, inlineHighlight, findAttributeRange } from 'ckeditor5/src/typing'; +import { Clipboard } from 'ckeditor5/src/clipboard'; +import { keyCodes } from 'ckeditor5/src/utils'; + import LinkCommand from './linkcommand'; import UnlinkCommand from './unlinkcommand'; import ManualDecorator from './utils/manualdecorator'; -import findAttributeRange from '@ckeditor/ckeditor5-typing/src/utils/findattributerange'; -import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard'; import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators } from './utils'; import '../theme/link.css'; diff --git a/packages/ckeditor5-link/src/linkimage.js b/packages/ckeditor5-link/src/linkimage.js index 8df9bcb2b7d..1c14a2fb9a3 100644 --- a/packages/ckeditor5-link/src/linkimage.js +++ b/packages/ckeditor5-link/src/linkimage.js @@ -7,7 +7,7 @@ * @module link/linkimage */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import LinkImageEditing from './linkimageediting'; import LinkImageUI from './linkimageui'; diff --git a/packages/ckeditor5-link/src/linkimageediting.js b/packages/ckeditor5-link/src/linkimageediting.js index 112dfffa24e..40a45c514c8 100644 --- a/packages/ckeditor5-link/src/linkimageediting.js +++ b/packages/ckeditor5-link/src/linkimageediting.js @@ -7,10 +7,10 @@ * @module link/linkimageediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ImageEditing from '@ckeditor/ckeditor5-image/src/image/imageediting'; -import Matcher from '@ckeditor/ckeditor5-engine/src/view/matcher'; -import toMap from '@ckeditor/ckeditor5-utils/src/tomap'; +import { Plugin } from 'ckeditor5/src/core'; +import { Matcher } from 'ckeditor5/src/engine'; +import { toMap } from 'ckeditor5/src/utils'; + import LinkEditing from './linkediting'; import linkIcon from '../theme/icons/link.svg'; @@ -28,7 +28,7 @@ export default class LinkImageEditing extends Plugin { * @inheritDoc */ static get requires() { - return [ ImageEditing, LinkEditing ]; + return [ 'ImageEditing', LinkEditing ]; } /** diff --git a/packages/ckeditor5-link/src/linkimageui.js b/packages/ckeditor5-link/src/linkimageui.js index e779ae7f4b6..1188d7604b4 100644 --- a/packages/ckeditor5-link/src/linkimageui.js +++ b/packages/ckeditor5-link/src/linkimageui.js @@ -7,12 +7,12 @@ * @module link/linkimageui */ -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Image from '@ckeditor/ckeditor5-image/src/image'; +import { ButtonView } from 'ckeditor5/src/ui'; +import { Plugin } from 'ckeditor5/src/core'; + import LinkUI from './linkui'; import LinkEditing from './linkediting'; -import { isImageWidget } from '@ckeditor/ckeditor5-image/src/image/utils'; + import { LINK_KEYSTROKE } from './utils'; import linkIcon from '../theme/icons/link.svg'; @@ -30,7 +30,7 @@ export default class LinkImageUI extends Plugin { * @inheritDoc */ static get requires() { - return [ Image, LinkEditing, LinkUI ]; + return [ LinkEditing, LinkUI, 'Image' ]; } /** @@ -48,7 +48,7 @@ export default class LinkImageUI extends Plugin { const viewDocument = editor.editing.view.document; this.listenTo( viewDocument, 'click', ( evt, data ) => { - const hasLink = isImageLinked( viewDocument.selection.getSelectedElement() ); + const hasLink = isImageLinked( viewDocument.selection.getSelectedElement(), editor.plugins.get( 'Image' ) ); if ( hasLink ) { data.preventDefault(); @@ -91,7 +91,7 @@ export default class LinkImageUI extends Plugin { // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already. this.listenTo( button, 'execute', () => { - const hasLink = isImageLinked( editor.editing.view.document.selection.getSelectedElement() ); + const hasLink = isImageLinked( editor.editing.view.document.selection.getSelectedElement(), editor.plugins.get( 'Image' ) ); if ( hasLink ) { plugin._addActionsView(); @@ -109,8 +109,8 @@ export default class LinkImageUI extends Plugin { // // @param {module:engine/model/element~Element} element // @returns {Boolean} -function isImageLinked( element ) { - const isImage = element && isImageWidget( element ); +function isImageLinked( element, image ) { + const isImage = element && image.isImageWidget( element ); if ( !isImage ) { return false; diff --git a/packages/ckeditor5-link/src/linkui.js b/packages/ckeditor5-link/src/linkui.js index 5b827deadd6..576dcec69a8 100644 --- a/packages/ckeditor5-link/src/linkui.js +++ b/packages/ckeditor5-link/src/linkui.js @@ -7,17 +7,13 @@ * @module link/linkui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver'; -import { addLinkProtocolIfApplicable, isLinkElement, LINK_KEYSTROKE } from './utils'; - -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; +import { Plugin } from 'ckeditor5/src/core'; +import { ClickObserver } from 'ckeditor5/src/engine'; +import { ButtonView, ContextualBalloon, clickOutsideHandler } from 'ckeditor5/src/ui'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; - -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; import LinkFormView from './ui/linkformview'; import LinkActionsView from './ui/linkactionsview'; +import { addLinkProtocolIfApplicable, isLinkElement, LINK_KEYSTROKE } from './utils'; import linkIcon from '../theme/icons/link.svg'; diff --git a/packages/ckeditor5-link/src/ui/linkactionsview.js b/packages/ckeditor5-link/src/ui/linkactionsview.js index 698ca88f21f..f6b01fe0dd4 100644 --- a/packages/ckeditor5-link/src/ui/linkactionsview.js +++ b/packages/ckeditor5-link/src/ui/linkactionsview.js @@ -7,21 +7,18 @@ * @module link/ui/linkactionsview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; - -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; - -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; +import { ButtonView, View, ViewCollection, FocusCycler } from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; import { ensureSafeUrl } from '../utils'; -import unlinkIcon from '../../theme/icons/unlink.svg'; -import pencilIcon from '@ckeditor/ckeditor5-core/theme/icons/pencil.svg'; -import '../../theme/linkactions.css'; +// See: #8833. +// eslint-disable-next-line ckeditor5-rules/ckeditor-imports import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css'; +import '../../theme/linkactions.css'; + +import unlinkIcon from '../../theme/icons/unlink.svg'; /** * The link actions view class. This view displays the link preview, allows @@ -73,7 +70,7 @@ export default class LinkActionsView extends View { * * @member {module:ui/button/buttonview~ButtonView} */ - this.editButtonView = this._createButton( t( 'Edit link' ), pencilIcon, 'edit' ); + this.editButtonView = this._createButton( t( 'Edit link' ), icons.pencil, 'edit' ); /** * The value of the "href" attribute of the link to use in the {@link #previewButtonView}. diff --git a/packages/ckeditor5-link/src/ui/linkformview.js b/packages/ckeditor5-link/src/ui/linkformview.js index 23a2d1ca440..df24b7bc578 100644 --- a/packages/ckeditor5-link/src/ui/linkformview.js +++ b/packages/ckeditor5-link/src/ui/linkformview.js @@ -7,25 +7,24 @@ * @module link/ui/linkformview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; - -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import SwitchButtonView from '@ckeditor/ckeditor5-ui/src/button/switchbuttonview'; - -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler'; - -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; - -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; -import '../../theme/linkform.css'; +import { + ButtonView, + FocusCycler, + LabeledFieldView, + SwitchButtonView, + View, + ViewCollection, + createLabeledInputText, + injectCssTransitionDisabler, + submitHandler +} from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; + +// See: #8833. +// eslint-disable-next-line ckeditor5-rules/ckeditor-imports import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css'; +import '../../theme/linkform.css'; /** * The link form view controller class. @@ -77,7 +76,7 @@ export default class LinkFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} */ - this.saveButtonView = this._createButton( t( 'Save' ), checkIcon, 'ck-button-save' ); + this.saveButtonView = this._createButton( t( 'Save' ), icons.check, 'ck-button-save' ); this.saveButtonView.type = 'submit'; /** @@ -85,7 +84,7 @@ export default class LinkFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} */ - this.cancelButtonView = this._createButton( t( 'Cancel' ), cancelIcon, 'ck-button-cancel', 'cancel' ); + this.cancelButtonView = this._createButton( t( 'Cancel' ), icons.cancel, 'ck-button-cancel', 'cancel' ); /** * A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView}, diff --git a/packages/ckeditor5-link/src/unlinkcommand.js b/packages/ckeditor5-link/src/unlinkcommand.js index 82f7034c33b..6478b89d06a 100644 --- a/packages/ckeditor5-link/src/unlinkcommand.js +++ b/packages/ckeditor5-link/src/unlinkcommand.js @@ -7,9 +7,10 @@ * @module link/unlinkcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import findAttributeRange from '@ckeditor/ckeditor5-typing/src/utils/findattributerange'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { findAttributeRange } from 'ckeditor5/src/typing'; +import { first } from 'ckeditor5/src/utils'; + import { isImageAllowed } from './utils'; /** diff --git a/packages/ckeditor5-link/src/utils/automaticdecorators.js b/packages/ckeditor5-link/src/utils/automaticdecorators.js index 005f0d6ba6e..0d26bbb4fe8 100644 --- a/packages/ckeditor5-link/src/utils/automaticdecorators.js +++ b/packages/ckeditor5-link/src/utils/automaticdecorators.js @@ -7,7 +7,7 @@ * @module link/utils */ -import toMap from '@ckeditor/ckeditor5-utils/src/tomap'; +import { toMap } from 'ckeditor5/src/utils'; /** * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides diff --git a/packages/ckeditor5-link/src/utils/manualdecorator.js b/packages/ckeditor5-link/src/utils/manualdecorator.js index 262a523e973..f1e1573eb61 100644 --- a/packages/ckeditor5-link/src/utils/manualdecorator.js +++ b/packages/ckeditor5-link/src/utils/manualdecorator.js @@ -7,8 +7,7 @@ * @module link/utils */ -import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; -import mix from '@ckeditor/ckeditor5-utils/src/mix'; +import { ObservableMixin, mix } from 'ckeditor5/src/utils'; /** * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value} diff --git a/packages/ckeditor5-link/tests/linkimageediting.js b/packages/ckeditor5-link/tests/linkimageediting.js index f881ad8066b..48f98c8ae08 100644 --- a/packages/ckeditor5-link/tests/linkimageediting.js +++ b/packages/ckeditor5-link/tests/linkimageediting.js @@ -5,11 +5,13 @@ import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor'; import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -import LinkImageEditing from '../src/linkimageediting'; import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml'; import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view'; import ImageCaptionEditing from '@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting'; +import ImageEditing from '@ckeditor/ckeditor5-image/src/image/imageediting'; + +import LinkImageEditing from '../src/linkimageediting'; describe( 'LinkImageEditing', () => { let editor, model, view; @@ -17,7 +19,7 @@ describe( 'LinkImageEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ Paragraph, LinkImageEditing ] + plugins: [ Paragraph, ImageEditing, LinkImageEditing ] } ) .then( newEditor => { editor = newEditor; @@ -38,6 +40,10 @@ describe( 'LinkImageEditing', () => { expect( editor.plugins.get( LinkImageEditing ) ).to.be.instanceOf( LinkImageEditing ); } ); + it( 'should require ImageEditing by name', () => { + expect( LinkImageEditing.requires ).to.include( 'ImageEditing' ); + } ); + it( 'should set proper schema rules', () => { expect( model.schema.checkAttribute( [ '$root', 'image' ], 'linkHref' ) ).to.be.true; } ); @@ -245,7 +251,7 @@ describe( 'LinkImageEditing', () => { it( 'should convert a link and the caption element', () => { return VirtualTestEditor .create( { - plugins: [ Paragraph, LinkImageEditing, ImageCaptionEditing ] + plugins: [ Paragraph, ImageEditing, LinkImageEditing, ImageCaptionEditing ] } ) .then( editor => { editor.setData( @@ -327,7 +333,7 @@ describe( 'LinkImageEditing', () => { it( 'should convert a link and the caption element', () => { return VirtualTestEditor .create( { - plugins: [ Paragraph, LinkImageEditing, ImageCaptionEditing ] + plugins: [ Paragraph, ImageEditing, LinkImageEditing, ImageCaptionEditing ] } ) .then( editor => { setModelData( editor.model, @@ -396,7 +402,7 @@ describe( 'LinkImageEditing', () => { beforeEach( async () => { editor = await VirtualTestEditor.create( { - plugins: [ Paragraph, LinkImageEditing ], + plugins: [ Paragraph, ImageEditing, LinkImageEditing ], link: { addTargetToExternalLinks: false } @@ -441,7 +447,7 @@ describe( 'LinkImageEditing', () => { beforeEach( async () => { editor = await VirtualTestEditor.create( { - plugins: [ Paragraph, LinkImageEditing ], + plugins: [ Paragraph, ImageEditing, LinkImageEditing ], link: { addTargetToExternalLinks: true } @@ -517,7 +523,7 @@ describe( 'LinkImageEditing', () => { beforeEach( async () => { editor = await VirtualTestEditor.create( { - plugins: [ Paragraph, LinkImageEditing ], + plugins: [ Paragraph, ImageEditing, LinkImageEditing ], link: { addTargetToExternalLinks: false, decorators: { @@ -592,7 +598,7 @@ describe( 'LinkImageEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ Paragraph, LinkImageEditing ], + plugins: [ Paragraph, ImageEditing, LinkImageEditing ], link: { decorators: { isExternal: { @@ -751,7 +757,7 @@ describe( 'LinkImageEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ Paragraph, LinkImageEditing ], + plugins: [ Paragraph, ImageEditing, LinkImageEditing ], link: { decorators: { isExternal: { diff --git a/packages/ckeditor5-link/tests/linkimageui.js b/packages/ckeditor5-link/tests/linkimageui.js index 08f06bb9777..8c71321217e 100644 --- a/packages/ckeditor5-link/tests/linkimageui.js +++ b/packages/ckeditor5-link/tests/linkimageui.js @@ -14,6 +14,7 @@ import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils'; import LinkImage from '../src/linkimage'; import LinkImageUI from '../src/linkimageui'; +import Image from '@ckeditor/ckeditor5-image/src/image'; describe( 'LinkImageUI', () => { let editor, viewDocument, editorElement; @@ -27,7 +28,7 @@ describe( 'LinkImageUI', () => { return ClassicTestEditor .create( editorElement, { - plugins: [ LinkImageUI, LinkImage, Paragraph ] + plugins: [ Image, LinkImageUI, LinkImage, Paragraph ] } ) .then( newEditor => { editor = newEditor; @@ -48,6 +49,10 @@ describe( 'LinkImageUI', () => { expect( LinkImageUI.pluginName ).to.equal( 'LinkImageUI' ); } ); + it( 'should require Image by name', () => { + expect( LinkImageUI.requires ).to.include( 'Image' ); + } ); + describe( 'init()', () => { it( 'should listen to the click event on the images', () => { const listenToSpy = sinon.stub( plugin, 'listenTo' ); diff --git a/packages/ckeditor5-link/webpack.config.js b/packages/ckeditor5-link/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-link/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-list/package.json b/packages/ckeditor5-list/package.json index 39c9091eb4e..f62ccf2d123 100644 --- a/packages/ckeditor5-list/package.json +++ b/packages/ckeditor5-list/package.json @@ -9,29 +9,35 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-essentials": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", + "@ckeditor/ckeditor5-essentials": "^25.0.0", "@ckeditor/ckeditor5-font": "^25.0.0", "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-highlight": "^25.0.0", "@ckeditor/ckeditor5-indent": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-remove-format": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -49,6 +55,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-list/src/converters.js b/packages/ckeditor5-list/src/converters.js index 5c1c219e518..4722f5553fa 100644 --- a/packages/ckeditor5-list/src/converters.js +++ b/packages/ckeditor5-list/src/converters.js @@ -7,6 +7,8 @@ * @module list/converters */ +import { TreeWalker } from 'ckeditor5/src/engine'; + import { generateLiInUl, injectViewList, @@ -14,7 +16,6 @@ import { getSiblingListItem, positionAfterUiElements } from './utils'; -import TreeWalker from '@ckeditor/ckeditor5-engine/src/model/treewalker'; /** * A model-to-view converter for the `listItem` model element insertion. diff --git a/packages/ckeditor5-list/src/indentcommand.js b/packages/ckeditor5-list/src/indentcommand.js index 73495f6d7b8..60eef5172a5 100644 --- a/packages/ckeditor5-list/src/indentcommand.js +++ b/packages/ckeditor5-list/src/indentcommand.js @@ -7,8 +7,8 @@ * @module list/indentcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The list indent command. It is used by the {@link module:list/list~List list feature}. diff --git a/packages/ckeditor5-list/src/index.js b/packages/ckeditor5-list/src/index.js new file mode 100644 index 00000000000..1e8dbbca071 --- /dev/null +++ b/packages/ckeditor5-list/src/index.js @@ -0,0 +1,30 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module list + */ + +import List from './list'; +import ListEditing from './listediting'; +import ListUI from './listui'; +import ListStyle from './liststyle'; +import ListStyleEditing from './liststyleediting'; +import ListStyleUI from './liststyleui'; +import TodoList from './todolist'; +import TodoListEditing from './todolistediting'; +import TodoListUI from './todolistui'; + +export default { + List, + ListEditing, + ListUI, + ListStyle, + ListStyleEditing, + ListStyleUI, + TodoList, + TodoListEditing, + TodoListUI +}; diff --git a/packages/ckeditor5-list/src/list.js b/packages/ckeditor5-list/src/list.js index 0ee453b7ff6..b4a5e46e091 100644 --- a/packages/ckeditor5-list/src/list.js +++ b/packages/ckeditor5-list/src/list.js @@ -10,7 +10,7 @@ import ListEditing from './listediting'; import ListUI from './listui'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * The list feature. diff --git a/packages/ckeditor5-list/src/listcommand.js b/packages/ckeditor5-list/src/listcommand.js index dfeb47912a0..3db04c9e1fe 100644 --- a/packages/ckeditor5-list/src/listcommand.js +++ b/packages/ckeditor5-list/src/listcommand.js @@ -7,8 +7,8 @@ * @module list/listcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The list command. It is used by the {@link module:list/list~List list feature}. diff --git a/packages/ckeditor5-list/src/listediting.js b/packages/ckeditor5-list/src/listediting.js index e5fa5ec915f..1a9f8e1b2dc 100644 --- a/packages/ckeditor5-list/src/listediting.js +++ b/packages/ckeditor5-list/src/listediting.js @@ -10,9 +10,8 @@ import ListCommand from './listcommand'; import IndentCommand from './indentcommand'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; -import priorities from '@ckeditor/ckeditor5-utils/src/priorities'; +import { Plugin } from 'ckeditor5/src/core'; +import { priorities } from 'ckeditor5/src/utils'; import { cleanList, @@ -46,13 +45,6 @@ export default class ListEditing extends Plugin { return 'ListEditing'; } - /** - * @inheritDoc - */ - static get requires() { - return [ Paragraph ]; - } - /** * @inheritDoc */ diff --git a/packages/ckeditor5-list/src/liststyle.js b/packages/ckeditor5-list/src/liststyle.js index eee5f163ecf..796332fe47c 100644 --- a/packages/ckeditor5-list/src/liststyle.js +++ b/packages/ckeditor5-list/src/liststyle.js @@ -7,7 +7,7 @@ * @module list/liststyle */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ListStyleEditing from './liststyleediting'; import ListStyleUI from './liststyleui'; diff --git a/packages/ckeditor5-list/src/liststylecommand.js b/packages/ckeditor5-list/src/liststylecommand.js index 9a35f36de81..a2ce7c7e91b 100644 --- a/packages/ckeditor5-list/src/liststylecommand.js +++ b/packages/ckeditor5-list/src/liststylecommand.js @@ -7,7 +7,7 @@ * @module list/liststylecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getSiblingNodes } from './utils'; /** diff --git a/packages/ckeditor5-list/src/liststyleediting.js b/packages/ckeditor5-list/src/liststyleediting.js index 5921cdaf15a..d067b0b8051 100644 --- a/packages/ckeditor5-list/src/liststyleediting.js +++ b/packages/ckeditor5-list/src/liststyleediting.js @@ -7,7 +7,7 @@ * @module list/liststyleediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ListEditing from './listediting'; import ListStyleCommand from './liststylecommand'; import { getSiblingListItem, getSiblingNodes } from './utils'; diff --git a/packages/ckeditor5-list/src/liststyleui.js b/packages/ckeditor5-list/src/liststyleui.js index c8149296778..981dfcedadf 100644 --- a/packages/ckeditor5-list/src/liststyleui.js +++ b/packages/ckeditor5-list/src/liststyleui.js @@ -7,13 +7,8 @@ * @module list/liststyleui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview'; -import { - createDropdown, - addToolbarToDropdown -} from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView, SplitButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui'; import bulletedListIcon from '../theme/icons/bulletedlist.svg'; import numberedListIcon from '../theme/icons/numberedlist.svg'; diff --git a/packages/ckeditor5-list/src/listui.js b/packages/ckeditor5-list/src/listui.js index adf7000fbbc..e7e4e7f27a8 100644 --- a/packages/ckeditor5-list/src/listui.js +++ b/packages/ckeditor5-list/src/listui.js @@ -12,7 +12,7 @@ import { createUIComponent } from './utils'; import numberedListIcon from '../theme/icons/numberedlist.svg'; import bulletedListIcon from '../theme/icons/bulletedlist.svg'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that diff --git a/packages/ckeditor5-list/src/todolist.js b/packages/ckeditor5-list/src/todolist.js index 99180a2cd26..c3bdb439027 100644 --- a/packages/ckeditor5-list/src/todolist.js +++ b/packages/ckeditor5-list/src/todolist.js @@ -9,7 +9,7 @@ import TodoListEditing from './todolistediting'; import TodoListUI from './todolistui'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import '../theme/todolist.css'; /** diff --git a/packages/ckeditor5-list/src/todolistcheckcommand.js b/packages/ckeditor5-list/src/todolistcheckcommand.js index cc94ace96a2..1d3b28de3e8 100644 --- a/packages/ckeditor5-list/src/todolistcheckcommand.js +++ b/packages/ckeditor5-list/src/todolistcheckcommand.js @@ -7,7 +7,7 @@ * @module list/todolistcheckedcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; const attributeKey = 'todoListChecked'; diff --git a/packages/ckeditor5-list/src/todolistconverters.js b/packages/ckeditor5-list/src/todolistconverters.js index 00dbceb5b4a..ff532b34db6 100644 --- a/packages/ckeditor5-list/src/todolistconverters.js +++ b/packages/ckeditor5-list/src/todolistconverters.js @@ -9,8 +9,9 @@ /* global document */ +import { createElement } from 'ckeditor5/src/utils'; + import { generateLiInUl, injectViewList, positionAfterUiElements, findNestedList } from './utils'; -import createElement from '@ckeditor/ckeditor5-utils/src/dom/createelement'; /** * A model-to-view converter for the `listItem` model element insertion. diff --git a/packages/ckeditor5-list/src/todolistediting.js b/packages/ckeditor5-list/src/todolistediting.js index 01b1aa99953..17816afe3d4 100644 --- a/packages/ckeditor5-list/src/todolistediting.js +++ b/packages/ckeditor5-list/src/todolistediting.js @@ -7,12 +7,12 @@ * @module list/todolistediting */ +import { Plugin } from 'ckeditor5/src/core'; +import { getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils'; + import ListCommand from './listcommand'; import ListEditing from './listediting'; import TodoListCheckCommand from './todolistcheckcommand'; - -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; - import { dataModelViewInsertion, dataViewModelCheckmarkInsertion, @@ -21,7 +21,6 @@ import { modelViewChangeType, modelViewInsertion } from './todolistconverters'; -import { getLocalizedArrowKeyCodeDirection } from '@ckeditor/ckeditor5-utils/src/keyboard'; /** * The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items. diff --git a/packages/ckeditor5-list/src/todolistui.js b/packages/ckeditor5-list/src/todolistui.js index 8771bead6ac..97690b97bca 100644 --- a/packages/ckeditor5-list/src/todolistui.js +++ b/packages/ckeditor5-list/src/todolistui.js @@ -9,7 +9,7 @@ import { createUIComponent } from './utils'; import todoListIcon from '../theme/icons/todolist.svg'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * The to-do list UI feature. It introduces the `'todoList'` button that diff --git a/packages/ckeditor5-list/src/utils.js b/packages/ckeditor5-list/src/utils.js index d2bb241d98e..7ebb6f48409 100644 --- a/packages/ckeditor5-list/src/utils.js +++ b/packages/ckeditor5-list/src/utils.js @@ -7,9 +7,8 @@ * @module list/utils */ -import { getFillerOffset } from '@ckeditor/ckeditor5-engine/src/view/containerelement'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import TreeWalker from '@ckeditor/ckeditor5-engine/src/model/treewalker'; +import { TreeWalker, getFillerOffset } from 'ckeditor5/src/engine'; +import { ButtonView } from 'ckeditor5/src/ui'; /** * Creates a list item {@link module:engine/view/containerelement~ContainerElement}. diff --git a/packages/ckeditor5-list/tests/listediting.js b/packages/ckeditor5-list/tests/listediting.js index 030e7c68009..63c59cbe193 100644 --- a/packages/ckeditor5-list/tests/listediting.js +++ b/packages/ckeditor5-list/tests/listediting.js @@ -23,6 +23,7 @@ import IndentEditing from '@ckeditor/ckeditor5-indent/src/indentediting'; import { getCode } from '@ckeditor/ckeditor5-utils/src/keyboard'; import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils'; import TableEditing from '@ckeditor/ckeditor5-table/src/tableediting'; +import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; describe( 'ListEditing', () => { let editor, model, modelDoc, modelRoot, view, viewDoc, viewRoot; @@ -30,7 +31,7 @@ describe( 'ListEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ Clipboard, BoldEditing, ListEditing, UndoEditing, BlockQuoteEditing, TableEditing ] + plugins: [ Paragraph, IndentEditing, Clipboard, BoldEditing, ListEditing, UndoEditing, BlockQuoteEditing, TableEditing ] } ) .then( newEditor => { editor = newEditor; @@ -107,7 +108,7 @@ describe( 'ListEditing', () => { it( 'should add indent list command to indent command', () => { return VirtualTestEditor .create( { - plugins: [ ListEditing, IndentEditing ] + plugins: [ Paragraph, IndentEditing, ListEditing, IndentEditing ] } ) .then( newEditor => { editor = newEditor; @@ -128,7 +129,7 @@ describe( 'ListEditing', () => { it( 'should add outdent list command to outdent command', () => { return VirtualTestEditor .create( { - plugins: [ ListEditing, IndentEditing ] + plugins: [ Paragraph, IndentEditing, ListEditing, IndentEditing ] } ) .then( newEditor => { editor = newEditor; diff --git a/packages/ckeditor5-list/tests/liststyleediting.js b/packages/ckeditor5-list/tests/liststyleediting.js index 418d9e6b410..9d7f9d90270 100644 --- a/packages/ckeditor5-list/tests/liststyleediting.js +++ b/packages/ckeditor5-list/tests/liststyleediting.js @@ -345,7 +345,7 @@ describe( 'ListStyleEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ ListStyleEditing ] + plugins: [ Paragraph, ListStyleEditing ] } ) .then( newEditor => { editor = newEditor; diff --git a/packages/ckeditor5-list/tests/todolistcheckcommand.js b/packages/ckeditor5-list/tests/todolistcheckcommand.js index 8f3faa1bdd4..c67c0ef5a10 100644 --- a/packages/ckeditor5-list/tests/todolistcheckcommand.js +++ b/packages/ckeditor5-list/tests/todolistcheckcommand.js @@ -8,6 +8,7 @@ import TodoListCheckCommand from '../src/todolistcheckcommand'; import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor'; import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; +import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; describe( 'TodoListCheckCommand', () => { let editor, model, command; @@ -15,7 +16,7 @@ describe( 'TodoListCheckCommand', () => { beforeEach( () => { return ModelTestEditor .create( { - plugins: [ TodoListEditing ] + plugins: [ Paragraph, TodoListEditing ] } ) .then( newEditor => { editor = newEditor; diff --git a/packages/ckeditor5-list/tests/todolistediting.js b/packages/ckeditor5-list/tests/todolistediting.js index d47acaf8ac1..524bf2d26d3 100644 --- a/packages/ckeditor5-list/tests/todolistediting.js +++ b/packages/ckeditor5-list/tests/todolistediting.js @@ -22,6 +22,7 @@ import { getData as getModelData, setData as setModelData } from '@ckeditor/cked import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view'; import { getCode } from '@ckeditor/ckeditor5-utils/src/keyboard'; import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils'; +import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; /* global Event, document */ @@ -31,7 +32,7 @@ describe( 'TodoListEditing', () => { beforeEach( () => { return VirtualTestEditor .create( { - plugins: [ TodoListEditing, Typing, BoldEditing, BlockQuoteEditing, LinkEditing, Enter, ShiftEnter ] + plugins: [ Paragraph, TodoListEditing, Typing, BoldEditing, BlockQuoteEditing, LinkEditing, Enter, ShiftEnter ] } ) .then( newEditor => { editor = newEditor; @@ -1022,7 +1023,7 @@ describe( 'TodoListEditing', () => { return VirtualTestEditor .create( { language: 'en', - plugins: [ TodoListEditing, Typing, BoldEditing, BlockQuoteEditing ] + plugins: [ Paragraph, TodoListEditing, Typing, BoldEditing, BlockQuoteEditing ] } ) .then( newEditor => { editor = newEditor; @@ -1065,7 +1066,7 @@ describe( 'TodoListEditing', () => { return VirtualTestEditor .create( { language: 'ar', - plugins: [ TodoListEditing, Typing, BoldEditing, BlockQuoteEditing ] + plugins: [ Paragraph, TodoListEditing, Typing, BoldEditing, BlockQuoteEditing ] } ) .then( newEditor => { editor = newEditor; @@ -1189,7 +1190,7 @@ describe( 'TodoListEditing - checkbox rendering', () => { return ClassicTestEditor .create( editorElement, { - plugins: [ TodoListEditing ] + plugins: [ Paragraph, TodoListEditing ] } ) .then( newEditor => { editor = newEditor; diff --git a/packages/ckeditor5-list/tests/utils.js b/packages/ckeditor5-list/tests/utils.js index f1e2fe28ce5..8184aaf6d78 100644 --- a/packages/ckeditor5-list/tests/utils.js +++ b/packages/ckeditor5-list/tests/utils.js @@ -12,6 +12,7 @@ import ListEditing from '../src/listediting'; import ListStyleEditing from '../src/liststyleediting'; import { createViewListItemElement, getSiblingListItem, getSiblingNodes } from '../src/utils'; +import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; describe( 'utils', () => { let writer; @@ -270,7 +271,7 @@ describe( 'utils', () => { let editor, model, document; beforeEach( () => { - return VirtualTestEditor.create( { plugins: [ ListStyleEditing ] } ) + return VirtualTestEditor.create( { plugins: [ Paragraph, ListStyleEditing ] } ) .then( newEditor => { editor = newEditor; model = editor.model; diff --git a/packages/ckeditor5-list/webpack.config.js b/packages/ckeditor5-list/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-list/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.html b/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.html index 0b34c57d458..568b602cbd1 100644 --- a/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.html +++ b/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.html @@ -9,10 +9,10 @@

Editing with Markdown output

The CKEditor 5 WYSIWYG editor lets you use this flexible yet simple markup language in the GitHub flavor. The editor-produced Markdown output supports the most important features, like links, different kinds of emphasis, inline code formatting or code blocks:

-p {
+<code class="language-css">p {
   text-align: center;
   color: red;
-}
+}</code>
 

Formatting blocks with Markdown

diff --git a/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.js b/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.js index 27a2dc5c429..5e2b89630ad 100644 --- a/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.js +++ b/packages/ckeditor5-markdown-gfm/docs/_snippets/features/markdown.js @@ -9,6 +9,8 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor' import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock'; import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'; import Code from '@ckeditor/ckeditor5-basic-styles/src/code'; @@ -20,7 +22,8 @@ import Markdown from '@ckeditor/ckeditor5-markdown-gfm/src/markdown'; ClassicEditor .create( document.querySelector( '#snippet-markdown' ), { - plugins: [ ArticlePluginSet, EasyImage, Markdown, Code, CodeBlock, TodoList, Strikethrough, HorizontalLine ], + plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices, Markdown, + Code, CodeBlock, TodoList, Strikethrough, HorizontalLine ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-markdown-gfm/package.json b/packages/ckeditor5-markdown-gfm/package.json index 971d8b99e3d..fbee88e358f 100644 --- a/packages/ckeditor5-markdown-gfm/package.json +++ b/packages/ckeditor5-markdown-gfm/package.json @@ -9,9 +9,9 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", + "ckeditor5": "^25.0.0", "marked": "1.1.1", "turndown": "^6.0.0", "turndown-plugin-gfm": "^1.0.2" @@ -19,9 +19,15 @@ "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-code-block": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", - "@ckeditor/ckeditor5-table": "^25.0.0" + "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -39,12 +45,16 @@ "files": [ "lang", "src", - "theme" + "theme", + "build" ], "depcheckIgnore": [ "collapse-whitespace", "jsdom", "void-elements", "block-elements" - ] + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.js b/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.js index b51f26726a6..7bc6f498fbb 100644 --- a/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.js +++ b/packages/ckeditor5-markdown-gfm/src/gfmdataprocessor.js @@ -7,7 +7,7 @@ * @module markdown-gfm/gfmdataprocessor */ -import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor'; +import { HtmlDataProcessor } from 'ckeditor5/src/engine'; import markdown2html from './markdown2html/markdown2html'; import html2markdown, { turndownService } from './html2markdown/html2markdown'; diff --git a/packages/ckeditor5-markdown-gfm/src/index.js b/packages/ckeditor5-markdown-gfm/src/index.js new file mode 100644 index 00000000000..1d7461ca425 --- /dev/null +++ b/packages/ckeditor5-markdown-gfm/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module markdown-gfm + */ + +import Markdown from './markdown'; + +export default { + Markdown +}; diff --git a/packages/ckeditor5-markdown-gfm/src/markdown.js b/packages/ckeditor5-markdown-gfm/src/markdown.js index 58a380c3109..ef564c0b8b7 100644 --- a/packages/ckeditor5-markdown-gfm/src/markdown.js +++ b/packages/ckeditor5-markdown-gfm/src/markdown.js @@ -7,7 +7,7 @@ * @module markdown-gfm/markdown */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import GFMDataProcessor from './gfmdataprocessor'; /** diff --git a/packages/ckeditor5-markdown-gfm/webpack.config.js b/packages/ckeditor5-markdown-gfm/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-markdown-gfm/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-media-embed/package.json b/packages/ckeditor5-media-embed/package.json index b446e887c11..9ac010aa7ac 100644 --- a/packages/ckeditor5-media-embed/package.json +++ b/packages/ckeditor5-media-embed/package.json @@ -9,24 +9,30 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-balloon": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-table": "^25.0.0" + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -44,6 +50,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-media-embed/src/automediaembed.js b/packages/ckeditor5-media-embed/src/automediaembed.js index 05d9aef4dc2..bf13dbb826b 100644 --- a/packages/ckeditor5-media-embed/src/automediaembed.js +++ b/packages/ckeditor5-media-embed/src/automediaembed.js @@ -7,13 +7,13 @@ * @module media-embed/automediaembed */ +import { Plugin } from 'ckeditor5/src/core'; +import { LiveRange, LivePosition } from 'ckeditor5/src/engine'; +import { Clipboard } from 'ckeditor5/src/clipboard'; +import { Undo } from 'ckeditor5/src/undo'; +import { global } from 'ckeditor5/src/utils'; + import MediaEmbedEditing from './mediaembedediting'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; -import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange'; -import LivePosition from '@ckeditor/ckeditor5-engine/src/model/liveposition'; -import Undo from '@ckeditor/ckeditor5-undo/src/undo'; -import global from '@ckeditor/ckeditor5-utils/src/dom/global'; import { insertMedia } from './utils'; const URL_REGEXP = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=%]+$/; diff --git a/packages/ckeditor5-media-embed/src/index.js b/packages/ckeditor5-media-embed/src/index.js new file mode 100644 index 00000000000..b25f327ead2 --- /dev/null +++ b/packages/ckeditor5-media-embed/src/index.js @@ -0,0 +1,22 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module media-embed + */ + +import MediaEmbed from './mediaembed'; +import MediaEmbedEditing from './mediaembedediting'; +import MediaEmbedUI from './mediaembedui'; +import AutoMediaEmbed from './automediaembed'; +import MediaEmbedToolbar from './mediaembedtoolbar'; + +export default { + MediaEmbed, + MediaEmbedEditing, + MediaEmbedUI, + MediaEmbedToolbar, + AutoMediaEmbed +}; diff --git a/packages/ckeditor5-media-embed/src/mediaembed.js b/packages/ckeditor5-media-embed/src/mediaembed.js index e64f665a775..89e3a2854f1 100644 --- a/packages/ckeditor5-media-embed/src/mediaembed.js +++ b/packages/ckeditor5-media-embed/src/mediaembed.js @@ -7,11 +7,12 @@ * @module media-embed/mediaembed */ +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; + import MediaEmbedEditing from './mediaembedediting'; import AutoMediaEmbed from './automediaembed'; import MediaEmbedUI from './mediaembedui'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; import '../theme/mediaembed.css'; diff --git a/packages/ckeditor5-media-embed/src/mediaembedcommand.js b/packages/ckeditor5-media-embed/src/mediaembedcommand.js index b5371946647..1d1dddce793 100644 --- a/packages/ckeditor5-media-embed/src/mediaembedcommand.js +++ b/packages/ckeditor5-media-embed/src/mediaembedcommand.js @@ -7,8 +7,8 @@ * @module media-embed/mediaembedcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import { findOptimalInsertionPosition, checkSelectionOnObject } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Command } from 'ckeditor5/src/core'; +import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget'; import { getSelectedMediaModelWidget, insertMedia } from './utils'; /** diff --git a/packages/ckeditor5-media-embed/src/mediaembedediting.js b/packages/ckeditor5-media-embed/src/mediaembedediting.js index 5d4c82c79fc..7cdcd100081 100644 --- a/packages/ckeditor5-media-embed/src/mediaembedediting.js +++ b/packages/ckeditor5-media-embed/src/mediaembedediting.js @@ -7,7 +7,7 @@ * @module media-embed/mediaembedediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import { modelToViewUrlAttributeConverter } from './converters'; import MediaEmbedCommand from './mediaembedcommand'; diff --git a/packages/ckeditor5-media-embed/src/mediaembedtoolbar.js b/packages/ckeditor5-media-embed/src/mediaembedtoolbar.js index 55b66b9a69f..7f6b4fbb6be 100644 --- a/packages/ckeditor5-media-embed/src/mediaembedtoolbar.js +++ b/packages/ckeditor5-media-embed/src/mediaembedtoolbar.js @@ -7,8 +7,9 @@ * @module media-embed/mediaembedtoolbar */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolbarrepository'; +import { Plugin } from 'ckeditor5/src/core'; +import { WidgetToolbarRepository } from 'ckeditor5/src/widget'; + import { getSelectedMediaViewWidget } from './utils'; /** diff --git a/packages/ckeditor5-media-embed/src/mediaembedui.js b/packages/ckeditor5-media-embed/src/mediaembedui.js index ca9d18b5e7b..53c9110e7d6 100644 --- a/packages/ckeditor5-media-embed/src/mediaembedui.js +++ b/packages/ckeditor5-media-embed/src/mediaembedui.js @@ -7,8 +7,9 @@ * @module media-embed/mediaembedui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; +import { Plugin } from 'ckeditor5/src/core'; +import { createDropdown } from 'ckeditor5/src/ui'; + import MediaFormView from './ui/mediaformview'; import MediaEmbedEditing from './mediaembedediting'; import mediaIcon from '../theme/icons/media.svg'; diff --git a/packages/ckeditor5-media-embed/src/mediaregistry.js b/packages/ckeditor5-media-embed/src/mediaregistry.js index 5a0cfd60b0c..8fd3fbfbbb5 100644 --- a/packages/ckeditor5-media-embed/src/mediaregistry.js +++ b/packages/ckeditor5-media-embed/src/mediaregistry.js @@ -7,12 +7,10 @@ * @module media-embed/mediaregistry */ +import { TooltipView, IconView, Template } from 'ckeditor5/src/ui'; +import { logWarning, toArray } from 'ckeditor5/src/utils'; + import mediaPlaceholderIcon from '../theme/icons/media-placeholder.svg'; -import TooltipView from '@ckeditor/ckeditor5-ui/src/tooltip/tooltipview'; -import IconView from '@ckeditor/ckeditor5-ui/src/icon/iconview'; -import Template from '@ckeditor/ckeditor5-ui/src/template'; -import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; const mediaPlaceholderIconViewBox = '0 0 64 42'; diff --git a/packages/ckeditor5-media-embed/src/ui/mediaformview.js b/packages/ckeditor5-media-embed/src/ui/mediaformview.js index 72c480a19f4..56313a492db 100644 --- a/packages/ckeditor5-media-embed/src/ui/mediaformview.js +++ b/packages/ckeditor5-media-embed/src/ui/mediaformview.js @@ -7,24 +7,23 @@ * @module media-embed/ui/mediaformview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; - -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; - -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; - -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; -import injectCssTransitionDisabler from '@ckeditor/ckeditor5-ui/src/bindings/injectcsstransitiondisabler'; - -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; -import '../../theme/mediaform.css'; +import { + ButtonView, + FocusCycler, + LabeledFieldView, + View, + ViewCollection, + createLabeledInputText, + injectCssTransitionDisabler, + submitHandler +} from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; + +// See: #8833. +// eslint-disable-next-line ckeditor5-rules/ckeditor-imports import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css'; +import '../../theme/mediaform.css'; /** * The media form view controller class. @@ -79,7 +78,7 @@ export default class MediaFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} */ - this.saveButtonView = this._createButton( t( 'Save' ), checkIcon, 'ck-button-save' ); + this.saveButtonView = this._createButton( t( 'Save' ), icons.check, 'ck-button-save' ); this.saveButtonView.type = 'submit'; this.saveButtonView.bind( 'isEnabled' ).to( this, 'mediaURLInputValue', value => !!value ); @@ -88,7 +87,7 @@ export default class MediaFormView extends View { * * @member {module:ui/button/buttonview~ButtonView} */ - this.cancelButtonView = this._createButton( t( 'Cancel' ), cancelIcon, 'ck-button-cancel', 'cancel' ); + this.cancelButtonView = this._createButton( t( 'Cancel' ), icons.cancel, 'ck-button-cancel', 'cancel' ); /** * A collection of views that can be focused in the form. diff --git a/packages/ckeditor5-media-embed/src/utils.js b/packages/ckeditor5-media-embed/src/utils.js index 181ba60c299..f2b20b76c06 100644 --- a/packages/ckeditor5-media-embed/src/utils.js +++ b/packages/ckeditor5-media-embed/src/utils.js @@ -7,7 +7,7 @@ * @module media-embed/utils */ -import { isWidget, toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; +import { isWidget, toWidget } from 'ckeditor5/src/widget'; /** * Converts a given {@link module:engine/view/element~Element} to a media embed widget: diff --git a/packages/ckeditor5-media-embed/webpack.config.js b/packages/ckeditor5-media-embed/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-media-embed/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-mention/package.json b/packages/ckeditor5-mention/package.json index c223d0914a1..e48c1308f2c 100644 --- a/packages/ckeditor5-mention/package.json +++ b/packages/ckeditor5-mention/package.json @@ -9,26 +9,32 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-font": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", "@ckeditor/ckeditor5-widget": "^25.0.0", - "lodash": "^4.17.15" + "lodash": "^4.17.15", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -46,6 +52,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-mention/src/index.js b/packages/ckeditor5-mention/src/index.js new file mode 100644 index 00000000000..3d16fcabfc6 --- /dev/null +++ b/packages/ckeditor5-mention/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module mention + */ + +import Mention from './mention'; +import MentionEditing from './mentionediting'; +import MentionUI from './mentionui'; + +export default { + Mention, + MentionEditing, + MentionUI +}; diff --git a/packages/ckeditor5-mention/src/mention.js b/packages/ckeditor5-mention/src/mention.js index 79cdd54f2e6..cc8fb3c8f67 100644 --- a/packages/ckeditor5-mention/src/mention.js +++ b/packages/ckeditor5-mention/src/mention.js @@ -7,7 +7,7 @@ * @module mention/mention */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import MentionEditing, { _toMentionAttribute } from './mentionediting'; import MentionUI from './mentionui'; diff --git a/packages/ckeditor5-mention/src/mentioncommand.js b/packages/ckeditor5-mention/src/mentioncommand.js index dc81bafe183..51de5840f41 100644 --- a/packages/ckeditor5-mention/src/mentioncommand.js +++ b/packages/ckeditor5-mention/src/mentioncommand.js @@ -7,9 +7,9 @@ * @module mention/mentioncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import toMap from '@ckeditor/ckeditor5-utils/src/tomap'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { Command } from 'ckeditor5/src/core'; +import { CKEditorError, toMap } from 'ckeditor5/src/utils'; + import { _addMentionAttributes } from './mentionediting'; /** diff --git a/packages/ckeditor5-mention/src/mentionediting.js b/packages/ckeditor5-mention/src/mentionediting.js index b099c26ff71..51087a537ae 100644 --- a/packages/ckeditor5-mention/src/mentionediting.js +++ b/packages/ckeditor5-mention/src/mentionediting.js @@ -7,8 +7,8 @@ * @module mention/mentionediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import uid from '@ckeditor/ckeditor5-utils/src/uid'; +import { Plugin } from 'ckeditor5/src/core'; +import { uid } from 'ckeditor5/src/utils'; import MentionCommand from './mentioncommand'; diff --git a/packages/ckeditor5-mention/src/mentionui.js b/packages/ckeditor5-mention/src/mentionui.js index a6aeadfb6c5..e26f1231206 100644 --- a/packages/ckeditor5-mention/src/mentionui.js +++ b/packages/ckeditor5-mention/src/mentionui.js @@ -7,18 +7,12 @@ * @module mention/mentionui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard'; -import env from '@ckeditor/ckeditor5-utils/src/env'; -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; -import CKEditorError, { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; -import { debounce } from 'lodash-es'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView, ContextualBalloon, clickOutsideHandler } from 'ckeditor5/src/ui'; +import { Collection, keyCodes, env, Rect, CKEditorError, logWarning } from 'ckeditor5/src/utils'; +import { TextWatcher } from 'ckeditor5/src/typing'; -import TextWatcher from '@ckeditor/ckeditor5-typing/src/textwatcher'; +import { debounce } from 'lodash-es'; import MentionsView from './ui/mentionsview'; import DomWrapperView from './ui/domwrapperview'; diff --git a/packages/ckeditor5-mention/src/ui/domwrapperview.js b/packages/ckeditor5-mention/src/ui/domwrapperview.js index 2841cafa080..1fc08b7b27e 100644 --- a/packages/ckeditor5-mention/src/ui/domwrapperview.js +++ b/packages/ckeditor5-mention/src/ui/domwrapperview.js @@ -7,7 +7,7 @@ * @module mention/ui/domwrapperview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5/src/ui'; /** * This class wraps DOM element as a CKEditor5 UI View. diff --git a/packages/ckeditor5-mention/src/ui/mentionlistitemview.js b/packages/ckeditor5-mention/src/ui/mentionlistitemview.js index 671c07ded69..90489220249 100644 --- a/packages/ckeditor5-mention/src/ui/mentionlistitemview.js +++ b/packages/ckeditor5-mention/src/ui/mentionlistitemview.js @@ -7,7 +7,7 @@ * @module mention/ui/mentionlistitemview */ -import ListItemView from '@ckeditor/ckeditor5-ui/src/list/listitemview'; +import { ListItemView } from 'ckeditor5/src/ui'; export default class MentionListItemView extends ListItemView { highlight() { diff --git a/packages/ckeditor5-mention/src/ui/mentionsview.js b/packages/ckeditor5-mention/src/ui/mentionsview.js index 3698a7521f7..a6fa089fe6c 100644 --- a/packages/ckeditor5-mention/src/ui/mentionsview.js +++ b/packages/ckeditor5-mention/src/ui/mentionsview.js @@ -7,8 +7,8 @@ * @module mention/ui/mentionsview */ -import ListView from '@ckeditor/ckeditor5-ui/src/list/listview'; -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; +import { ListView } from 'ckeditor5/src/ui'; +import { Rect } from 'ckeditor5/src/utils'; import '../../theme/mentionui.css'; diff --git a/packages/ckeditor5-mention/webpack.config.js b/packages/ckeditor5-mention/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-mention/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-page-break/package.json b/packages/ckeditor5-page-break/package.json index e4e89524f56..939d6de3669 100644 --- a/packages/ckeditor5-page-break/package.json +++ b/packages/ckeditor5-page-break/package.json @@ -9,18 +9,24 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-cloud-services": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", + "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -38,6 +44,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-page-break/src/index.js b/packages/ckeditor5-page-break/src/index.js new file mode 100644 index 00000000000..01611bde4b0 --- /dev/null +++ b/packages/ckeditor5-page-break/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module page-break + */ + +import PageBreak from './pagebreak'; +import PageBreakEditing from './pagebreakediting'; +import PageBreakUI from './pagebreakui'; + +export default { + PageBreak, + PageBreakEditing, + PageBreakUI +}; diff --git a/packages/ckeditor5-page-break/src/pagebreak.js b/packages/ckeditor5-page-break/src/pagebreak.js index 4c52fb13baa..ea05910a5c4 100644 --- a/packages/ckeditor5-page-break/src/pagebreak.js +++ b/packages/ckeditor5-page-break/src/pagebreak.js @@ -7,8 +7,8 @@ * @module page-break/pagebreak */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; import PageBreakEditing from './pagebreakediting'; import PageBreakUI from './pagebreakui'; diff --git a/packages/ckeditor5-page-break/src/pagebreakcommand.js b/packages/ckeditor5-page-break/src/pagebreakcommand.js index f6a8d453e08..842b98b3f8e 100644 --- a/packages/ckeditor5-page-break/src/pagebreakcommand.js +++ b/packages/ckeditor5-page-break/src/pagebreakcommand.js @@ -7,8 +7,8 @@ * @module page-break/pagebreakcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import { findOptimalInsertionPosition, checkSelectionOnObject } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Command } from 'ckeditor5/src/core'; +import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget'; /** * The page break command. diff --git a/packages/ckeditor5-page-break/src/pagebreakediting.js b/packages/ckeditor5-page-break/src/pagebreakediting.js index 0295450c848..8ef4315b550 100644 --- a/packages/ckeditor5-page-break/src/pagebreakediting.js +++ b/packages/ckeditor5-page-break/src/pagebreakediting.js @@ -7,9 +7,10 @@ * @module page-break/pagebreakediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { toWidget } from 'ckeditor5/src/widget'; + import PageBreakCommand from './pagebreakcommand'; -import { toWidget } from '@ckeditor/ckeditor5-widget/src/utils'; import '../theme/pagebreak.css'; diff --git a/packages/ckeditor5-page-break/src/pagebreakui.js b/packages/ckeditor5-page-break/src/pagebreakui.js index 2a7ae12165b..91098337a36 100644 --- a/packages/ckeditor5-page-break/src/pagebreakui.js +++ b/packages/ckeditor5-page-break/src/pagebreakui.js @@ -7,8 +7,9 @@ * @module page-break/pagebreakui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; + import pageBreakIcon from '../theme/icons/pagebreak.svg'; /** diff --git a/packages/ckeditor5-page-break/tests/manual/pagebreak.js b/packages/ckeditor5-page-break/tests/manual/pagebreak.js index bb5924e801a..7deb1719411 100644 --- a/packages/ckeditor5-page-break/tests/manual/pagebreak.js +++ b/packages/ckeditor5-page-break/tests/manual/pagebreak.js @@ -11,11 +11,12 @@ import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; import PageBreak from '../../src/pagebreak'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; ClassicEditor .create( document.querySelector( '#editor' ), { cloudServices: CS_CONFIG, - plugins: [ ArticlePluginSet, ImageUpload, EasyImage, PageBreak ], + plugins: [ ArticlePluginSet, ImageUpload, CloudServices, EasyImage, PageBreak ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-page-break/webpack.config.js b/packages/ckeditor5-page-break/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-page-break/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-paragraph/package.json b/packages/ckeditor5-paragraph/package.json index 2254580f33c..104bc615894 100644 --- a/packages/ckeditor5-paragraph/package.json +++ b/packages/ckeditor5-paragraph/package.json @@ -7,8 +7,10 @@ "ckeditor5", "ckeditor 5", "ckeditor5-feature", - "ckeditor5-plugin" + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", diff --git a/packages/ckeditor5-paragraph/src/index.js b/packages/ckeditor5-paragraph/src/index.js new file mode 100644 index 00000000000..ebca84c5f33 --- /dev/null +++ b/packages/ckeditor5-paragraph/src/index.js @@ -0,0 +1,11 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module paragraph + */ + +export { default as Paragraph } from './paragraph'; +export { default as ParagraphButtonUI } from './paragraphbuttonui'; diff --git a/packages/ckeditor5-paste-from-office/package.json b/packages/ckeditor5-paste-from-office/package.json index 4400e96cc73..655b62ae9c1 100644 --- a/packages/ckeditor5-paste-from-office/package.json +++ b/packages/ckeditor5-paste-from-office/package.json @@ -9,15 +9,18 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-clipboard": "^25.0.0", - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", + "@ckeditor/ckeditor5-clipboard": "^25.0.0", "@ckeditor/ckeditor5-cloud-services": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-easy-image": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", "@ckeditor/ckeditor5-font": "^25.0.0", @@ -25,10 +28,13 @@ "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-page-break": "^25.0.0", + "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -46,6 +52,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-paste-from-office/src/filters/image.js b/packages/ckeditor5-paste-from-office/src/filters/image.js index 7d65144247a..5c9289c30f3 100644 --- a/packages/ckeditor5-paste-from-office/src/filters/image.js +++ b/packages/ckeditor5-paste-from-office/src/filters/image.js @@ -9,8 +9,7 @@ /* globals btoa */ -import ViewMatcher from '@ckeditor/ckeditor5-engine/src/view/matcher'; -import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; +import { Matcher, UpcastWriter } from 'ckeditor5/src/engine'; /** * Replaces source attribute of all `` elements representing regular @@ -60,7 +59,7 @@ export function _convertHexToBase64( hexString ) { function findAllShapesIds( documentFragment, writer ) { const range = writer.createRangeIn( documentFragment ); - const shapeElementsMatcher = new ViewMatcher( { + const shapeElementsMatcher = new Matcher( { name: /v:(.+)/ } ); @@ -87,7 +86,7 @@ function findAllShapesIds( documentFragment, writer ) { function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, writer ) { const range = writer.createRangeIn( documentFragment ); - const imageElementsMatcher = new ViewMatcher( { + const imageElementsMatcher = new Matcher( { name: 'img' } ); @@ -119,7 +118,7 @@ function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, wr function removeAllShapeElements( documentFragment, writer ) { const range = writer.createRangeIn( documentFragment ); - const shapeElementsMatcher = new ViewMatcher( { + const shapeElementsMatcher = new Matcher( { name: /v:(.+)/ } ); @@ -146,7 +145,7 @@ function removeAllShapeElements( documentFragment, writer ) { function findAllImageElementsWithLocalSource( documentFragment, writer ) { const range = writer.createRangeIn( documentFragment ); - const imageElementsMatcher = new ViewMatcher( { + const imageElementsMatcher = new Matcher( { name: 'img' } ); diff --git a/packages/ckeditor5-paste-from-office/src/filters/list.js b/packages/ckeditor5-paste-from-office/src/filters/list.js index f665c984fbc..62293fd2242 100644 --- a/packages/ckeditor5-paste-from-office/src/filters/list.js +++ b/packages/ckeditor5-paste-from-office/src/filters/list.js @@ -7,8 +7,7 @@ * @module paste-from-office/filters/list */ -import Matcher from '@ckeditor/ckeditor5-engine/src/view/matcher'; -import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; +import { Matcher, UpcastWriter } from 'ckeditor5/src/engine'; /** * Transforms Word specific list-like elements to the semantic HTML lists. diff --git a/packages/ckeditor5-paste-from-office/src/filters/parse.js b/packages/ckeditor5-paste-from-office/src/filters/parse.js index 7162ba1ff3c..5e6ff8a05d2 100644 --- a/packages/ckeditor5-paste-from-office/src/filters/parse.js +++ b/packages/ckeditor5-paste-from-office/src/filters/parse.js @@ -9,8 +9,7 @@ /* globals DOMParser */ -import DomConverter from '@ckeditor/ckeditor5-engine/src/view/domconverter'; -import ViewDocument from '@ckeditor/ckeditor5-engine/src/view/document'; +import { DomConverter, ViewDocument } from 'ckeditor5/src/engine'; import { normalizeSpacing, normalizeSpacerunSpans } from './space'; diff --git a/packages/ckeditor5-paste-from-office/src/index.js b/packages/ckeditor5-paste-from-office/src/index.js new file mode 100644 index 00000000000..2b8bb42291d --- /dev/null +++ b/packages/ckeditor5-paste-from-office/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module paste-from-office + */ + +import PasteFromOffice from './pastefromoffice'; + +export default { + PasteFromOffice +}; diff --git a/packages/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js b/packages/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js index 22b5b723640..2ae827e3107 100644 --- a/packages/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js +++ b/packages/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js @@ -7,9 +7,10 @@ * @module paste-from-office/normalizers/googledocsnormalizer */ +import { UpcastWriter } from 'ckeditor5/src/engine'; + import removeBoldWrapper from '../filters/removeboldwrapper'; import { unwrapParagraphInListItem } from '../filters/list'; -import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i; diff --git a/packages/ckeditor5-paste-from-office/src/pastefromoffice.js b/packages/ckeditor5-paste-from-office/src/pastefromoffice.js index d576127856c..2a0c98997af 100644 --- a/packages/ckeditor5-paste-from-office/src/pastefromoffice.js +++ b/packages/ckeditor5-paste-from-office/src/pastefromoffice.js @@ -7,11 +7,11 @@ * @module paste-from-office/pastefromoffice */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { Clipboard } from 'ckeditor5/src/clipboard'; import GoogleDocsNormalizer from './normalizers/googledocsnormalizer'; import MSWordNormalizer from './normalizers/mswordnormalizer'; -import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; /** * The Paste from Office plugin. diff --git a/packages/ckeditor5-paste-from-office/tests/manual/integration.js b/packages/ckeditor5-paste-from-office/tests/manual/integration.js index cf8032f5025..65c99b24a9e 100644 --- a/packages/ckeditor5-paste-from-office/tests/manual/integration.js +++ b/packages/ckeditor5-paste-from-office/tests/manual/integration.js @@ -18,6 +18,8 @@ import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolo import PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak'; import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties'; import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import PasteFromOffice from '../../src/pastefromoffice'; @@ -32,7 +34,7 @@ const dataDiv = document.querySelector( '#data' ); ClassicEditor .create( document.querySelector( '#editor' ), { plugins: [ ArticlePluginSet, Strikethrough, Underline, Table, TableToolbar, PageBreak, - TableProperties, TableCellProperties, EasyImage, PasteFromOffice, FontColor, FontBackgroundColor ], + TableProperties, TableCellProperties, ImageUpload, CloudServices, EasyImage, PasteFromOffice, FontColor, FontBackgroundColor ], toolbar: [ 'heading', '|', 'bold', 'italic', 'strikethrough', 'underline', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'insertTable', 'pageBreak', 'undo', 'redo' ], table: { diff --git a/packages/ckeditor5-paste-from-office/webpack.config.js b/packages/ckeditor5-paste-from-office/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-paste-from-office/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-remove-format/package.json b/packages/ckeditor5-remove-format/package.json index e8f2fade57c..89f7a5e8449 100644 --- a/packages/ckeditor5-remove-format/package.json +++ b/packages/ckeditor5-remove-format/package.json @@ -9,14 +9,15 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", @@ -24,8 +25,12 @@ "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -43,6 +48,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-remove-format/src/index.js b/packages/ckeditor5-remove-format/src/index.js new file mode 100644 index 00000000000..b339b3ef5e5 --- /dev/null +++ b/packages/ckeditor5-remove-format/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module remove-format + */ + +import RemoveFormat from './removeformat'; +import RemoveFormatEditing from './removeformatediting'; +import RemoveFormatUI from './removeformatui'; + +export default { + RemoveFormat, + RemoveFormatEditing, + RemoveFormatUI +}; diff --git a/packages/ckeditor5-remove-format/src/removeformat.js b/packages/ckeditor5-remove-format/src/removeformat.js index ab3b4f2acbd..5ad31ff2aef 100644 --- a/packages/ckeditor5-remove-format/src/removeformat.js +++ b/packages/ckeditor5-remove-format/src/removeformat.js @@ -7,7 +7,7 @@ * @module remove-format/removeformat */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import RemoveFormatUI from './removeformatui'; import RemoveFormatEditing from './removeformatediting'; diff --git a/packages/ckeditor5-remove-format/src/removeformatcommand.js b/packages/ckeditor5-remove-format/src/removeformatcommand.js index 4db733bf823..aa9fceac12d 100644 --- a/packages/ckeditor5-remove-format/src/removeformatcommand.js +++ b/packages/ckeditor5-remove-format/src/removeformatcommand.js @@ -7,8 +7,8 @@ * @module remove-format/removeformatcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Command } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; /** * The remove format command. diff --git a/packages/ckeditor5-remove-format/src/removeformatediting.js b/packages/ckeditor5-remove-format/src/removeformatediting.js index 48daf022b46..32a2f78a20e 100644 --- a/packages/ckeditor5-remove-format/src/removeformatediting.js +++ b/packages/ckeditor5-remove-format/src/removeformatediting.js @@ -7,7 +7,7 @@ * @module remove-format/removeformatediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import RemoveFormatCommand from './removeformatcommand'; diff --git a/packages/ckeditor5-remove-format/src/removeformatui.js b/packages/ckeditor5-remove-format/src/removeformatui.js index f2c18f1f1e5..57bcb70226f 100644 --- a/packages/ckeditor5-remove-format/src/removeformatui.js +++ b/packages/ckeditor5-remove-format/src/removeformatui.js @@ -7,8 +7,9 @@ * @module remove-format/removeformatui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; + import removeFormatIcon from '../theme/icons/remove-format.svg'; const REMOVE_FORMAT = 'removeFormat'; diff --git a/packages/ckeditor5-remove-format/webpack.config.js b/packages/ckeditor5-remove-format/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-remove-format/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-restricted-editing/package.json b/packages/ckeditor5-restricted-editing/package.json index 68f76e1029a..ddce817ce3f 100644 --- a/packages/ckeditor5-restricted-editing/package.json +++ b/packages/ckeditor5-restricted-editing/package.json @@ -8,22 +8,28 @@ "ckeditor 5", "ckeditor5-lib" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-undo": "^25.0.0" + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-undo": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -41,6 +47,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-restricted-editing/src/index.js b/packages/ckeditor5-restricted-editing/src/index.js new file mode 100644 index 00000000000..42cef17de73 --- /dev/null +++ b/packages/ckeditor5-restricted-editing/src/index.js @@ -0,0 +1,24 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module restricted-editing + */ + +import RestrictedEditingMode from './restrictededitingmode'; +import RestrictedEditingModeEditing from './restrictededitingmodeediting'; +import RestrictedEditingModeUI from './restrictededitingmodeui'; +import StandardEditingMode from './standardeditingmode'; +import StandardEditingModeEditing from './standardeditingmodeediting'; +import StandardEditingModeUI from './standardeditingmodeui'; + +export default { + RestrictedEditingMode, + RestrictedEditingModeEditing, + RestrictedEditingModeUI, + StandardEditingMode, + StandardEditingModeEditing, + StandardEditingModeUI +}; diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingexceptioncommand.js b/packages/ckeditor5-restricted-editing/src/restrictededitingexceptioncommand.js index b51ebce83ec..c7a5c609cb6 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingexceptioncommand.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingexceptioncommand.js @@ -7,7 +7,7 @@ * @module restricted-editing/restrictededitingexceptioncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * @extends module:core/command~Command diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingmode.js b/packages/ckeditor5-restricted-editing/src/restrictededitingmode.js index b28ba594b3b..55cee426229 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingmode.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingmode.js @@ -7,7 +7,8 @@ * @module restricted-editing/restrictededitingmode */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import RestrictedEditingModeEditing from './restrictededitingmodeediting'; import RestrictedEditingModeUI from './restrictededitingmodeui'; diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingmode/converters.js b/packages/ckeditor5-restricted-editing/src/restrictededitingmode/converters.js index 13cdb68cc4d..2bec4273289 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingmode/converters.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingmode/converters.js @@ -7,7 +7,8 @@ * @module restricted-editing/restrictededitingmode/converters */ -import Matcher from '@ckeditor/ckeditor5-engine/src/view/matcher'; +import { Matcher } from 'ckeditor5/src/engine'; + import { getMarkerAtPosition } from './utils'; const HIGHLIGHT_CLASS = 'restricted-editing-exception_selected'; diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js b/packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js index 67701ded4f4..45643326be0 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingmodeediting.js @@ -7,7 +7,8 @@ * @module restricted-editing/restrictededitingmodeediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import RestrictedEditingNavigationCommand from './restrictededitingmodenavigationcommand'; import { extendMarkerOnTypingPostFixer, diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingmodenavigationcommand.js b/packages/ckeditor5-restricted-editing/src/restrictededitingmodenavigationcommand.js index bc74adc460f..51e0fce112f 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingmodenavigationcommand.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingmodenavigationcommand.js @@ -7,7 +7,7 @@ * @module restricted-editing/restrictededitingmodenavigationcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * The command that allows navigation across the exceptions in the edited document. diff --git a/packages/ckeditor5-restricted-editing/src/restrictededitingmodeui.js b/packages/ckeditor5-restricted-editing/src/restrictededitingmodeui.js index b03d680dd9f..8ee62252e3f 100644 --- a/packages/ckeditor5-restricted-editing/src/restrictededitingmodeui.js +++ b/packages/ckeditor5-restricted-editing/src/restrictededitingmodeui.js @@ -7,11 +7,11 @@ * @module restricted-editing/restrictededitingmodeui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; +import { Plugin } from 'ckeditor5/src/core'; +import { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; +import { Collection } from 'ckeditor5/src/utils'; + import lockIcon from '../theme/icons/contentlock.svg'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; /** * The restricted editing mode UI feature. diff --git a/packages/ckeditor5-restricted-editing/src/standardeditingmode.js b/packages/ckeditor5-restricted-editing/src/standardeditingmode.js index 2bcd8a755db..ff8f820c450 100644 --- a/packages/ckeditor5-restricted-editing/src/standardeditingmode.js +++ b/packages/ckeditor5-restricted-editing/src/standardeditingmode.js @@ -7,7 +7,7 @@ * @module restricted-editing/standardeditingmode */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import StandardEditingModeEditing from './standardeditingmodeediting'; import StandardEditingModeUI from './standardeditingmodeui'; diff --git a/packages/ckeditor5-restricted-editing/src/standardeditingmodeediting.js b/packages/ckeditor5-restricted-editing/src/standardeditingmodeediting.js index 7c298593e63..3c1e2cf0b69 100644 --- a/packages/ckeditor5-restricted-editing/src/standardeditingmodeediting.js +++ b/packages/ckeditor5-restricted-editing/src/standardeditingmodeediting.js @@ -7,7 +7,8 @@ * @module restricted-editing/standardeditingmodeediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; + import RestrictedEditingExceptionCommand from './restrictededitingexceptioncommand'; /** diff --git a/packages/ckeditor5-restricted-editing/src/standardeditingmodeui.js b/packages/ckeditor5-restricted-editing/src/standardeditingmodeui.js index b1868c96f03..e3c50cf79bc 100644 --- a/packages/ckeditor5-restricted-editing/src/standardeditingmodeui.js +++ b/packages/ckeditor5-restricted-editing/src/standardeditingmodeui.js @@ -7,8 +7,8 @@ * @module restricted-editing/standardeditingmodeui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; import unlockIcon from '../theme/icons/contentunlock.svg'; diff --git a/packages/ckeditor5-restricted-editing/webpack.config.js b/packages/ckeditor5-restricted-editing/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-restricted-editing/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-select-all/package.json b/packages/ckeditor5-select-all/package.json index 3b5475595d3..6036a5c20b1 100644 --- a/packages/ckeditor5-select-all/package.json +++ b/packages/ckeditor5-select-all/package.json @@ -6,12 +6,15 @@ "ckeditor", "ckeditor5", "ckeditor 5", - "ckeditor5-lib" + "ckeditor5-feature", + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", diff --git a/packages/ckeditor5-select-all/src/index.js b/packages/ckeditor5-select-all/src/index.js new file mode 100644 index 00000000000..01c173179d2 --- /dev/null +++ b/packages/ckeditor5-select-all/src/index.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module select-all + */ + +export { default as SelectAll } from './selectall'; diff --git a/packages/ckeditor5-special-characters/package.json b/packages/ckeditor5-special-characters/package.json index 522233aad3c..b5dc3f2e3bb 100644 --- a/packages/ckeditor5-special-characters/package.json +++ b/packages/ckeditor5-special-characters/package.json @@ -9,17 +9,23 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "ckeditor5": "^25.0.0" }, "devDependencies": { + "@ckeditor/ckeditor5-cloud-services": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", + "@ckeditor/ckeditor5-easy-image": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", - "@ckeditor/ckeditor5-easy-image": "^25.0.0", - "@ckeditor/ckeditor5-cloud-services": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -37,6 +43,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-special-characters/src/index.js b/packages/ckeditor5-special-characters/src/index.js new file mode 100644 index 00000000000..4dec45eed6f --- /dev/null +++ b/packages/ckeditor5-special-characters/src/index.js @@ -0,0 +1,26 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module special-characters + */ + +import SpecialCharacters from './specialcharacters'; +import SpecialCharactersArrows from './specialcharactersarrows'; +import SpecialCharactersText from './specialcharacterstext'; +import SpecialCharactersMathematical from './specialcharactersmathematical'; +import SpecialCharactersLatin from './specialcharacterslatin'; +import SpecialCharactersEssentials from './specialcharactersessentials'; +import SpecialCharactersCurrency from './specialcharacterscurrency'; + +export default { + SpecialCharacters, + SpecialCharactersArrows, + SpecialCharactersText, + SpecialCharactersMathematical, + SpecialCharactersLatin, + SpecialCharactersEssentials, + SpecialCharactersCurrency +}; diff --git a/packages/ckeditor5-special-characters/src/specialcharacters.js b/packages/ckeditor5-special-characters/src/specialcharacters.js index 835faa4fc61..3c795c36c4b 100644 --- a/packages/ckeditor5-special-characters/src/specialcharacters.js +++ b/packages/ckeditor5-special-characters/src/specialcharacters.js @@ -7,10 +7,10 @@ * @module special-characters/specialcharacters */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import Typing from '@ckeditor/ckeditor5-typing/src/typing'; -import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +import { Plugin } from 'ckeditor5/src/core'; +import { Typing } from 'ckeditor5/src/typing'; +import { createDropdown } from 'ckeditor5/src/ui'; +import { CKEditorError } from 'ckeditor5/src/utils'; import SpecialCharactersNavigationView from './ui/specialcharactersnavigationview'; import CharacterGridView from './ui/charactergridview'; import CharacterInfoView from './ui/characterinfoview'; diff --git a/packages/ckeditor5-special-characters/src/specialcharactersarrows.js b/packages/ckeditor5-special-characters/src/specialcharactersarrows.js index 49b7eb78f28..92e4deed5de 100644 --- a/packages/ckeditor5-special-characters/src/specialcharactersarrows.js +++ b/packages/ckeditor5-special-characters/src/specialcharactersarrows.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharactersarrows */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * A plugin that provides special characters for the "Arrows" category. diff --git a/packages/ckeditor5-special-characters/src/specialcharacterscurrency.js b/packages/ckeditor5-special-characters/src/specialcharacterscurrency.js index 32b3da77011..e375adc3d5d 100644 --- a/packages/ckeditor5-special-characters/src/specialcharacterscurrency.js +++ b/packages/ckeditor5-special-characters/src/specialcharacterscurrency.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharacterscurrency */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * A plugin that provides special characters for the "Currency" category. diff --git a/packages/ckeditor5-special-characters/src/specialcharactersessentials.js b/packages/ckeditor5-special-characters/src/specialcharactersessentials.js index dbacb4cb15b..2f6e76e934f 100644 --- a/packages/ckeditor5-special-characters/src/specialcharactersessentials.js +++ b/packages/ckeditor5-special-characters/src/specialcharactersessentials.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharactersessentials */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import SpecialCharactersCurrency from './specialcharacterscurrency'; import SpecialCharactersMathematical from './specialcharactersmathematical'; diff --git a/packages/ckeditor5-special-characters/src/specialcharacterslatin.js b/packages/ckeditor5-special-characters/src/specialcharacterslatin.js index 3dec624b567..ecc8b5f4d32 100644 --- a/packages/ckeditor5-special-characters/src/specialcharacterslatin.js +++ b/packages/ckeditor5-special-characters/src/specialcharacterslatin.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharacterslatin */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * A plugin that provides special characters for the "Latin" category. diff --git a/packages/ckeditor5-special-characters/src/specialcharactersmathematical.js b/packages/ckeditor5-special-characters/src/specialcharactersmathematical.js index a663b80185a..d6d67d25275 100644 --- a/packages/ckeditor5-special-characters/src/specialcharactersmathematical.js +++ b/packages/ckeditor5-special-characters/src/specialcharactersmathematical.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharactersmathematical */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * A plugin that provides special characters for the "Mathematical" category. diff --git a/packages/ckeditor5-special-characters/src/specialcharacterstext.js b/packages/ckeditor5-special-characters/src/specialcharacterstext.js index 62ab9ca88bc..4592eb5e390 100644 --- a/packages/ckeditor5-special-characters/src/specialcharacterstext.js +++ b/packages/ckeditor5-special-characters/src/specialcharacterstext.js @@ -7,7 +7,7 @@ * @module special-characters/specialcharacterstext */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; /** * A plugin that provides special characters for the "Text" category. diff --git a/packages/ckeditor5-special-characters/src/ui/charactergridview.js b/packages/ckeditor5-special-characters/src/ui/charactergridview.js index 5d2fcbafe4e..6c5f85ad2aa 100644 --- a/packages/ckeditor5-special-characters/src/ui/charactergridview.js +++ b/packages/ckeditor5-special-characters/src/ui/charactergridview.js @@ -7,8 +7,7 @@ * @module special-characters/ui/charactergridview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { View, ButtonView } from 'ckeditor5/src/ui'; import '../../theme/charactergrid.css'; diff --git a/packages/ckeditor5-special-characters/src/ui/characterinfoview.js b/packages/ckeditor5-special-characters/src/ui/characterinfoview.js index eaff425b2ff..3407b653d99 100644 --- a/packages/ckeditor5-special-characters/src/ui/characterinfoview.js +++ b/packages/ckeditor5-special-characters/src/ui/characterinfoview.js @@ -7,7 +7,7 @@ * @module special-characters/ui/characterinfoview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5/src/ui'; import '../../theme/characterinfo.css'; diff --git a/packages/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js b/packages/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js index dd142b7f4cc..325c2d8e5d3 100644 --- a/packages/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js +++ b/packages/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js @@ -7,14 +7,8 @@ * @module special-characters/ui/specialcharactersnavigationview */ -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import { - createDropdown, - addListToDropdown -} from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; - -import FormHeaderView from '@ckeditor/ckeditor5-ui/src/formheader/formheaderview'; +import { Collection } from 'ckeditor5/src/utils'; +import { Model, FormHeaderView, createDropdown, addListToDropdown } from 'ckeditor5/src/ui'; /** * A class representing the navigation part of the special characters UI. It is responsible diff --git a/packages/ckeditor5-special-characters/tests/manual/specialcharacters.js b/packages/ckeditor5-special-characters/tests/manual/specialcharacters.js index dc10ddd958b..157ba6edb36 100644 --- a/packages/ckeditor5-special-characters/tests/manual/specialcharacters.js +++ b/packages/ckeditor5-special-characters/tests/manual/specialcharacters.js @@ -9,14 +9,17 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor' import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; + import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; + import SpecialCharacters from '../../src/specialcharacters'; import SpecialCharactersEssentials from '../../src/specialcharactersessentials'; ClassicEditor .create( document.querySelector( '#editor' ), { cloudServices: CS_CONFIG, - plugins: [ ArticlePluginSet, ImageUpload, EasyImage, SpecialCharacters, SpecialCharactersEssentials ], + plugins: [ ArticlePluginSet, ImageUpload, CloudServices, EasyImage, SpecialCharacters, SpecialCharactersEssentials ], toolbar: [ 'heading', '|', diff --git a/packages/ckeditor5-special-characters/webpack.config.js b/packages/ckeditor5-special-characters/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-special-characters/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-table/package.json b/packages/ckeditor5-table/package.json index ebe293fd2e4..b1486760579 100644 --- a/packages/ckeditor5-table/package.json +++ b/packages/ckeditor5-table/package.json @@ -9,28 +9,34 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-widget": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-alignment": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", "@ckeditor/ckeditor5-clipboard": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", + "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-horizontal-line": "^25.0.0", "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-indent": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-media-embed": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", - "json-diff": "^0.5.4" + "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-widget": "^25.0.0", + "json-diff": "^0.5.4", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -48,6 +54,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-table/src/commands/insertcolumncommand.js b/packages/ckeditor5-table/src/commands/insertcolumncommand.js index 4f9ca4d87df..b33cc8106d1 100644 --- a/packages/ckeditor5-table/src/commands/insertcolumncommand.js +++ b/packages/ckeditor5-table/src/commands/insertcolumncommand.js @@ -7,7 +7,7 @@ * @module table/commands/insertcolumncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection'; /** diff --git a/packages/ckeditor5-table/src/commands/insertrowcommand.js b/packages/ckeditor5-table/src/commands/insertrowcommand.js index 4bb8f178078..14f95699e62 100644 --- a/packages/ckeditor5-table/src/commands/insertrowcommand.js +++ b/packages/ckeditor5-table/src/commands/insertrowcommand.js @@ -7,7 +7,7 @@ * @module table/commands/insertrowcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection'; /** diff --git a/packages/ckeditor5-table/src/commands/inserttablecommand.js b/packages/ckeditor5-table/src/commands/inserttablecommand.js index a787677b8cf..64b1c533650 100644 --- a/packages/ckeditor5-table/src/commands/inserttablecommand.js +++ b/packages/ckeditor5-table/src/commands/inserttablecommand.js @@ -7,8 +7,8 @@ * @module table/commands/inserttablecommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; -import { findOptimalInsertionPosition, checkSelectionOnObject } from '@ckeditor/ckeditor5-widget/src/utils'; +import { Command } from 'ckeditor5/src/core'; +import { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget'; /** * The insert table command. diff --git a/packages/ckeditor5-table/src/commands/mergecellcommand.js b/packages/ckeditor5-table/src/commands/mergecellcommand.js index 5f354c01908..bc4b83a50d0 100644 --- a/packages/ckeditor5-table/src/commands/mergecellcommand.js +++ b/packages/ckeditor5-table/src/commands/mergecellcommand.js @@ -7,7 +7,7 @@ * @module table/commands/mergecellcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import TableWalker from '../tablewalker'; import { getTableCellsContainingSelection } from '../utils/selection'; import { isHeadingColumnCell } from '../utils/common'; diff --git a/packages/ckeditor5-table/src/commands/mergecellscommand.js b/packages/ckeditor5-table/src/commands/mergecellscommand.js index 45abca47942..b5ace31a808 100644 --- a/packages/ckeditor5-table/src/commands/mergecellscommand.js +++ b/packages/ckeditor5-table/src/commands/mergecellscommand.js @@ -7,7 +7,7 @@ * @module table/commands/mergecellscommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import TableUtils from '../tableutils'; import { getSelectedTableCells, isSelectionRectangular } from '../utils/selection'; import { updateNumericAttribute } from '../utils/common'; diff --git a/packages/ckeditor5-table/src/commands/removecolumncommand.js b/packages/ckeditor5-table/src/commands/removecolumncommand.js index 92dde9f9f55..2a1291d0f8a 100644 --- a/packages/ckeditor5-table/src/commands/removecolumncommand.js +++ b/packages/ckeditor5-table/src/commands/removecolumncommand.js @@ -7,7 +7,7 @@ * @module table/commands/removecolumncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import TableWalker from '../tablewalker'; import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection'; diff --git a/packages/ckeditor5-table/src/commands/removerowcommand.js b/packages/ckeditor5-table/src/commands/removerowcommand.js index 27a13ac9d17..68332ee03d6 100644 --- a/packages/ckeditor5-table/src/commands/removerowcommand.js +++ b/packages/ckeditor5-table/src/commands/removerowcommand.js @@ -7,7 +7,7 @@ * @module table/commands/removerowcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection'; diff --git a/packages/ckeditor5-table/src/commands/selectcolumncommand.js b/packages/ckeditor5-table/src/commands/selectcolumncommand.js index 2f57e66373b..927a43698d2 100644 --- a/packages/ckeditor5-table/src/commands/selectcolumncommand.js +++ b/packages/ckeditor5-table/src/commands/selectcolumncommand.js @@ -7,7 +7,7 @@ * @module table/commands/selectcolumncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import TableWalker from '../tablewalker'; import { getSelectionAffectedTableCells } from '../utils/selection'; diff --git a/packages/ckeditor5-table/src/commands/selectrowcommand.js b/packages/ckeditor5-table/src/commands/selectrowcommand.js index dcf7784bb05..e1c785e4dbd 100644 --- a/packages/ckeditor5-table/src/commands/selectrowcommand.js +++ b/packages/ckeditor5-table/src/commands/selectrowcommand.js @@ -7,7 +7,7 @@ * @module table/commands/selectrowcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection'; diff --git a/packages/ckeditor5-table/src/commands/setheadercolumncommand.js b/packages/ckeditor5-table/src/commands/setheadercolumncommand.js index 0ec051b17a0..a47ad6b60cc 100644 --- a/packages/ckeditor5-table/src/commands/setheadercolumncommand.js +++ b/packages/ckeditor5-table/src/commands/setheadercolumncommand.js @@ -7,7 +7,7 @@ * @module table/commands/setheadercolumncommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { isHeadingColumnCell, diff --git a/packages/ckeditor5-table/src/commands/setheaderrowcommand.js b/packages/ckeditor5-table/src/commands/setheaderrowcommand.js index bcb6408d73f..88ce2562766 100644 --- a/packages/ckeditor5-table/src/commands/setheaderrowcommand.js +++ b/packages/ckeditor5-table/src/commands/setheaderrowcommand.js @@ -7,7 +7,7 @@ * @module table/commands/setheaderrowcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { updateNumericAttribute } from '../utils/common'; import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection'; diff --git a/packages/ckeditor5-table/src/commands/splitcellcommand.js b/packages/ckeditor5-table/src/commands/splitcellcommand.js index e7338886534..b13deb974b0 100644 --- a/packages/ckeditor5-table/src/commands/splitcellcommand.js +++ b/packages/ckeditor5-table/src/commands/splitcellcommand.js @@ -7,7 +7,7 @@ * @module table/commands/splitcellcommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getSelectionAffectedTableCells } from '../utils/selection'; /** diff --git a/packages/ckeditor5-table/src/converters/downcast.js b/packages/ckeditor5-table/src/converters/downcast.js index 0c46285f0be..83aa086a86f 100644 --- a/packages/ckeditor5-table/src/converters/downcast.js +++ b/packages/ckeditor5-table/src/converters/downcast.js @@ -8,8 +8,8 @@ */ import TableWalker from './../tablewalker'; -import { setHighlightHandling, toWidget, toWidgetEditable } from '@ckeditor/ckeditor5-widget/src/utils'; -import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; +import { setHighlightHandling, toWidget, toWidgetEditable } from 'ckeditor5/src/widget'; +import { toArray } from 'ckeditor5/src/utils'; /** * Model table element to view table element conversion helper. diff --git a/packages/ckeditor5-table/src/index.js b/packages/ckeditor5-table/src/index.js new file mode 100644 index 00000000000..8c263f17a18 --- /dev/null +++ b/packages/ckeditor5-table/src/index.js @@ -0,0 +1,30 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module table + */ + +import Table from './table'; +import TableToolbar from './tabletoolbar'; +import TableCellProperties from './tablecellproperties'; +import TableProperties from './tableproperties'; +import TableClipboard from './tableclipboard'; +import TableMouse from './tablemouse'; +import TableKeyboard from './tablekeyboard'; +import TableSelection from './tableselection'; +import TableUtils from './tableutils'; + +export default { + Table, + TableToolbar, + TableCellProperties, + TableProperties, + TableMouse, + TableClipboard, + TableKeyboard, + TableSelection, + TableUtils +}; diff --git a/packages/ckeditor5-table/src/table.js b/packages/ckeditor5-table/src/table.js index 651c021f6d8..b0740e76440 100644 --- a/packages/ckeditor5-table/src/table.js +++ b/packages/ckeditor5-table/src/table.js @@ -7,7 +7,8 @@ * @module table/table */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; +import { Widget } from 'ckeditor5/src/widget'; import TableEditing from './tableediting'; import TableUI from './tableui'; @@ -15,7 +16,6 @@ import TableSelection from './tableselection'; import TableClipboard from './tableclipboard'; import TableKeyboard from './tablekeyboard'; import TableMouse from './tablemouse'; -import Widget from '@ckeditor/ckeditor5-widget/src/widget'; import '../theme/table.css'; diff --git a/packages/ckeditor5-table/src/tablecellproperties.js b/packages/ckeditor5-table/src/tablecellproperties.js index fdb69aec612..daffcb7d022 100644 --- a/packages/ckeditor5-table/src/tablecellproperties.js +++ b/packages/ckeditor5-table/src/tablecellproperties.js @@ -7,7 +7,7 @@ * @module table/tablecellproperties */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui'; import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting'; diff --git a/packages/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js b/packages/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js index 42397a89b05..c2eacfef415 100644 --- a/packages/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js +++ b/packages/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js @@ -7,7 +7,7 @@ * @module table/tablecellproperties/commands/tablecellpropertycommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; import { getSelectionAffectedTableCells } from '../../utils/selection'; /** diff --git a/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js b/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js index 936b0981d8e..9944dacf349 100644 --- a/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js +++ b/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js @@ -7,10 +7,8 @@ * @module table/tablecellproperties/tablecellpropertiesediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { addBorderRules } from '@ckeditor/ckeditor5-engine/src/view/styles/border'; -import { addPaddingRules } from '@ckeditor/ckeditor5-engine/src/view/styles/padding'; -import { addBackgroundRules } from '@ckeditor/ckeditor5-engine/src/view/styles/background'; +import { Plugin } from 'ckeditor5/src/core'; +import { addBorderRules, addPaddingRules, addBackgroundRules } from 'ckeditor5/src/engine'; import { downcastAttributeToStyle, upcastStyleToAttribute, upcastBorderStyles } from './../converters/tableproperties'; import TableEditing from './../tableediting'; diff --git a/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js b/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js index c4d5d1c8f8d..691f3e123a3 100644 --- a/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js +++ b/packages/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js @@ -7,12 +7,10 @@ * @module table/tablecellproperties/tablecellpropertiesui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView, clickOutsideHandler, ContextualBalloon, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui'; + import TableCellPropertiesView from './ui/tablecellpropertiesview'; -import tableCellProperties from './../../theme/icons/table-cell-properties.svg'; import { colorFieldValidator, getLocalizedColorErrorText, @@ -21,14 +19,12 @@ import { lengthFieldValidator, lineWidthFieldValidator } from '../utils/ui/table-properties'; -import { - getLocalizedColorOptions, - normalizeColorOptions -} from '@ckeditor/ckeditor5-ui/src/colorgrid/utils'; import { debounce } from 'lodash-es'; import { getTableWidgetAncestor } from '../utils/ui/widget'; import { getBalloonCellPositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon'; +import tableCellProperties from './../../theme/icons/table-cell-properties.svg'; + const ERROR_TEXT_TIMEOUT = 500; // Map of view properties and related commands. diff --git a/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js b/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js index c19c1d347af..6369a71f91c 100644 --- a/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js +++ b/packages/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js @@ -7,20 +7,23 @@ * @module table/tablecellproperties/ui/tablecellpropertiesview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; - -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; - -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledDropdown, createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import LabelView from '@ckeditor/ckeditor5-ui/src/label/labelview'; -import { addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { + LabeledFieldView, + createLabeledDropdown, + createLabeledInputText, + LabelView, + addListToDropdown, + ToolbarView, + ButtonView, + FocusCycler, + View, + ViewCollection, + FormHeaderView, + submitHandler +} from 'ckeditor5/src/ui'; +import { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; + import { fillToolbar, getBorderStyleDefinitions, @@ -29,30 +32,18 @@ import { } from '../../utils/ui/table-properties'; import FormRowView from '../../ui/formrowview'; -import FormHeaderView from '@ckeditor/ckeditor5-ui/src/formheader/formheaderview'; - -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; -import alignLeftIcon from '@ckeditor/ckeditor5-core/theme/icons/align-left.svg'; -import alignRightIcon from '@ckeditor/ckeditor5-core/theme/icons/align-right.svg'; -import alignCenterIcon from '@ckeditor/ckeditor5-core/theme/icons/align-center.svg'; -import alignJustifyIcon from '@ckeditor/ckeditor5-core/theme/icons/align-justify.svg'; -import alignTopIcon from '@ckeditor/ckeditor5-core/theme/icons/align-top.svg'; -import alignMiddleIcon from '@ckeditor/ckeditor5-core/theme/icons/align-middle.svg'; -import alignBottomIcon from '@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg'; - import '../../../theme/form.css'; import '../../../theme/tableform.css'; import '../../../theme/tablecellproperties.css'; const ALIGNMENT_ICONS = { - left: alignLeftIcon, - center: alignCenterIcon, - right: alignRightIcon, - justify: alignJustifyIcon, - top: alignTopIcon, - middle: alignMiddleIcon, - bottom: alignBottomIcon + left: icons.alignLeft, + center: icons.alignCenter, + right: icons.alignRight, + justify: icons.alignJustify, + top: icons.alignTop, + middle: icons.alignMiddle, + bottom: icons.alignBottom }; /** @@ -768,7 +759,7 @@ export default class TableCellPropertiesView extends View { saveButtonView.set( { label: t( 'Save' ), - icon: checkIcon, + icon: icons.check, class: 'ck-button-save', type: 'submit', withText: true @@ -780,7 +771,7 @@ export default class TableCellPropertiesView extends View { cancelButtonView.set( { label: t( 'Cancel' ), - icon: cancelIcon, + icon: icons.cancel, class: 'ck-button-cancel', type: 'cancel', withText: true diff --git a/packages/ckeditor5-table/src/tableclipboard.js b/packages/ckeditor5-table/src/tableclipboard.js index 1658bb8073b..787333abc06 100644 --- a/packages/ckeditor5-table/src/tableclipboard.js +++ b/packages/ckeditor5-table/src/tableclipboard.js @@ -7,7 +7,7 @@ * @module table/tableclipboard */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import TableSelection from './tableselection'; import TableWalker from './tablewalker'; diff --git a/packages/ckeditor5-table/src/tableediting.js b/packages/ckeditor5-table/src/tableediting.js index e7ce11fdabb..671ccb9b724 100644 --- a/packages/ckeditor5-table/src/tableediting.js +++ b/packages/ckeditor5-table/src/tableediting.js @@ -7,7 +7,7 @@ * @module table/tableediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import upcastTable, { skipEmptyTableRow } from './converters/upcasttable'; import { diff --git a/packages/ckeditor5-table/src/tablekeyboard.js b/packages/ckeditor5-table/src/tablekeyboard.js index 48c3005f704..a8ec575e4dd 100644 --- a/packages/ckeditor5-table/src/tablekeyboard.js +++ b/packages/ckeditor5-table/src/tablekeyboard.js @@ -10,12 +10,8 @@ import TableSelection from './tableselection'; import TableWalker from './tablewalker'; -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import priorities from '@ckeditor/ckeditor5-utils/src/priorities'; -import { - isArrowKeyCode, - getLocalizedArrowKeyCodeDirection -} from '@ckeditor/ckeditor5-utils/src/keyboard'; +import { Plugin } from 'ckeditor5/src/core'; +import { priorities, isArrowKeyCode, getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils'; import { getSelectedTableCells, getTableCellsContainingSelection } from './utils/selection'; /** diff --git a/packages/ckeditor5-table/src/tablemouse.js b/packages/ckeditor5-table/src/tablemouse.js index 7510a4a4414..bf8667521dd 100644 --- a/packages/ckeditor5-table/src/tablemouse.js +++ b/packages/ckeditor5-table/src/tablemouse.js @@ -7,7 +7,7 @@ * @module table/tablemouse */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import TableSelection from './tableselection'; import MouseEventsObserver from './tablemouse/mouseeventsobserver'; diff --git a/packages/ckeditor5-table/src/tablemouse/mouseeventsobserver.js b/packages/ckeditor5-table/src/tablemouse/mouseeventsobserver.js index 6c341e77fa8..11fb48a8f73 100644 --- a/packages/ckeditor5-table/src/tablemouse/mouseeventsobserver.js +++ b/packages/ckeditor5-table/src/tablemouse/mouseeventsobserver.js @@ -7,7 +7,7 @@ * @module table/tableselection/mouseeventsobserver */ -import DomEventObserver from '@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver'; +import { DomEventObserver } from 'ckeditor5/src/engine'; /** * The mouse selection event observer. diff --git a/packages/ckeditor5-table/src/tableproperties.js b/packages/ckeditor5-table/src/tableproperties.js index 062f003444b..25d23f8ffac 100644 --- a/packages/ckeditor5-table/src/tableproperties.js +++ b/packages/ckeditor5-table/src/tableproperties.js @@ -7,7 +7,7 @@ * @module table/tableproperties */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import TablePropertiesEditing from './tableproperties/tablepropertiesediting'; import TablePropertiesUI from './tableproperties/tablepropertiesui'; diff --git a/packages/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js b/packages/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js index 7ad3623dd6c..bd4094488ca 100644 --- a/packages/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js +++ b/packages/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js @@ -7,7 +7,7 @@ * @module table/tableproperties/commands/tablepropertycommand */ -import Command from '@ckeditor/ckeditor5-core/src/command'; +import { Command } from 'ckeditor5/src/core'; /** * The table cell attribute command. diff --git a/packages/ckeditor5-table/src/tableproperties/tablepropertiesediting.js b/packages/ckeditor5-table/src/tableproperties/tablepropertiesediting.js index b3e316a5362..c0648cff5bd 100644 --- a/packages/ckeditor5-table/src/tableproperties/tablepropertiesediting.js +++ b/packages/ckeditor5-table/src/tableproperties/tablepropertiesediting.js @@ -7,9 +7,8 @@ * @module table/tableproperties/tablepropertiesediting */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { addBorderRules } from '@ckeditor/ckeditor5-engine/src/view/styles/border'; -import { addBackgroundRules } from '@ckeditor/ckeditor5-engine/src/view/styles/background'; +import { Plugin } from 'ckeditor5/src/core'; +import { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine'; import TableEditing from '../tableediting'; import { diff --git a/packages/ckeditor5-table/src/tableproperties/tablepropertiesui.js b/packages/ckeditor5-table/src/tableproperties/tablepropertiesui.js index f5eb293a352..17a5c5b60b5 100644 --- a/packages/ckeditor5-table/src/tableproperties/tablepropertiesui.js +++ b/packages/ckeditor5-table/src/tableproperties/tablepropertiesui.js @@ -7,10 +7,11 @@ * @module table/tableproperties/tablepropertiesui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler'; -import ContextualBalloon from '@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon'; +import { Plugin } from 'ckeditor5/src/core'; +import { ButtonView, ContextualBalloon, clickOutsideHandler, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui'; + +import { debounce } from 'lodash-es'; + import TablePropertiesView from './ui/tablepropertiesview'; import tableProperties from './../../theme/icons/table-properties.svg'; import { @@ -21,11 +22,6 @@ import { lineWidthFieldValidator, defaultColors } from '../utils/ui/table-properties'; -import { - getLocalizedColorOptions, - normalizeColorOptions -} from '@ckeditor/ckeditor5-ui/src/colorgrid/utils'; -import { debounce } from 'lodash-es'; import { getTableWidgetAncestor } from '../utils/ui/widget'; import { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon'; diff --git a/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js b/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js index 2a53d7949a6..9be63e16c81 100644 --- a/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js +++ b/packages/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js @@ -7,20 +7,23 @@ * @module table/tableproperties/ui/tablepropertiesview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection'; -import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler'; - -import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler'; -import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; -import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler'; - -import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview'; -import { createLabeledDropdown, createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils'; -import LabelView from '@ckeditor/ckeditor5-ui/src/label/labelview'; -import { addListToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import ToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/toolbarview'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; +import { + ButtonView, + FocusCycler, + FormHeaderView, + LabelView, + LabeledFieldView, + ToolbarView, + View, + ViewCollection, + addListToDropdown, + createLabeledDropdown, + createLabeledInputText, + submitHandler +} from 'ckeditor5/src/ui'; +import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils'; +import { icons } from 'ckeditor5/src/core'; + import { fillToolbar, getBorderStyleDefinitions, @@ -29,22 +32,14 @@ import { } from '../../utils/ui/table-properties'; import FormRowView from '../../ui/formrowview'; -import FormHeaderView from '@ckeditor/ckeditor5-ui/src/formheader/formheaderview'; - -import checkIcon from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import cancelIcon from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; -import objectLeftIcon from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg'; -import objectRightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg'; -import objectCenterIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg'; - import '../../../theme/form.css'; import '../../../theme/tableform.css'; import '../../../theme/tableproperties.css'; const ALIGNMENT_ICONS = { - left: objectLeftIcon, - center: objectCenterIcon, - right: objectRightIcon + left: icons.objectLeft, + center: icons.objectCenter, + right: icons.objectRight }; /** @@ -666,7 +661,7 @@ export default class TablePropertiesView extends View { saveButtonView.set( { label: t( 'Save' ), - icon: checkIcon, + icon: icons.check, class: 'ck-button-save', type: 'submit', withText: true @@ -678,7 +673,7 @@ export default class TablePropertiesView extends View { cancelButtonView.set( { label: t( 'Cancel' ), - icon: cancelIcon, + icon: icons.cancel, class: 'ck-button-cancel', type: 'cancel', withText: true diff --git a/packages/ckeditor5-table/src/tableselection.js b/packages/ckeditor5-table/src/tableselection.js index cc3e30734ec..c2d4312426d 100644 --- a/packages/ckeditor5-table/src/tableselection.js +++ b/packages/ckeditor5-table/src/tableselection.js @@ -7,8 +7,8 @@ * @module table/tableselection */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import first from '@ckeditor/ckeditor5-utils/src/first'; +import { Plugin } from 'ckeditor5/src/core'; +import { first } from 'ckeditor5/src/utils'; import TableWalker from './tablewalker'; import TableUtils from './tableutils'; diff --git a/packages/ckeditor5-table/src/tabletoolbar.js b/packages/ckeditor5-table/src/tabletoolbar.js index 089731b2a45..615689b0b78 100644 --- a/packages/ckeditor5-table/src/tabletoolbar.js +++ b/packages/ckeditor5-table/src/tabletoolbar.js @@ -7,8 +7,8 @@ * @module table/tabletoolbar */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolbarrepository'; +import { Plugin } from 'ckeditor5/src/core'; +import { WidgetToolbarRepository } from 'ckeditor5/src/widget'; import { getSelectedTableWidget, getTableWidgetAncestor } from './utils/ui/widget'; /** diff --git a/packages/ckeditor5-table/src/tableui.js b/packages/ckeditor5-table/src/tableui.js index 59971ab8b7e..c97a1b70fa0 100644 --- a/packages/ckeditor5-table/src/tableui.js +++ b/packages/ckeditor5-table/src/tableui.js @@ -7,11 +7,9 @@ * @module table/tableui */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { addListToDropdown, createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import SplitButtonView from '@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; +import { Plugin } from 'ckeditor5/src/core'; +import { addListToDropdown, createDropdown, Model, SplitButtonView } from 'ckeditor5/src/ui'; +import { Collection } from 'ckeditor5/src/utils'; import InsertTableView from './ui/inserttableview'; diff --git a/packages/ckeditor5-table/src/tableutils.js b/packages/ckeditor5-table/src/tableutils.js index 5c0ad9c8529..23b7ea9d8ca 100644 --- a/packages/ckeditor5-table/src/tableutils.js +++ b/packages/ckeditor5-table/src/tableutils.js @@ -7,7 +7,7 @@ * @module table/tableutils */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import TableWalker from './tablewalker'; import { createEmptyTableCell, updateNumericAttribute } from './utils/common'; diff --git a/packages/ckeditor5-table/src/tablewalker.js b/packages/ckeditor5-table/src/tablewalker.js index d55a66023f0..335c29f417a 100644 --- a/packages/ckeditor5-table/src/tablewalker.js +++ b/packages/ckeditor5-table/src/tablewalker.js @@ -7,7 +7,7 @@ * @module table/tablewalker */ -// @if CK_DEBUG // import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; +// @if CK_DEBUG // import { CKEditorError } from 'ckeditor5/src/utils'; /** * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields diff --git a/packages/ckeditor5-table/src/ui/colorinputview.js b/packages/ckeditor5-table/src/ui/colorinputview.js index f2e11324323..44ed8eed2c5 100644 --- a/packages/ckeditor5-table/src/ui/colorinputview.js +++ b/packages/ckeditor5-table/src/ui/colorinputview.js @@ -7,12 +7,9 @@ * @module table/ui/colorinputview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; -import InputTextView from '@ckeditor/ckeditor5-ui/src/inputtext/inputtextview'; -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import { createDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils'; -import ColorGrid from '@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview'; -import removeButtonIcon from '@ckeditor/ckeditor5-core/theme/icons/eraser.svg'; +import { View, InputTextView, ButtonView, createDropdown, ColorGridView } from 'ckeditor5/src/ui'; +import { icons } from 'ckeditor5/src/core'; + import '../../theme/colorinput.css'; /** @@ -269,7 +266,7 @@ export default class ColorInputView extends View { removeColorButton.class = 'ck-input-color__remove-color'; removeColorButton.withText = true; - removeColorButton.icon = removeButtonIcon; + removeColorButton.icon = icons.eraser; removeColorButton.label = t( 'Remove color' ); removeColorButton.on( 'execute', () => { this.value = ''; @@ -286,7 +283,7 @@ export default class ColorInputView extends View { * @private */ _createColorGrid( locale ) { - const colorGrid = new ColorGrid( locale, { + const colorGrid = new ColorGridView( locale, { colorDefinitions: this.options.colorDefinitions, columns: this.options.columns } ); diff --git a/packages/ckeditor5-table/src/ui/formrowview.js b/packages/ckeditor5-table/src/ui/formrowview.js index bbf636ef58c..5d38c087172 100644 --- a/packages/ckeditor5-table/src/ui/formrowview.js +++ b/packages/ckeditor5-table/src/ui/formrowview.js @@ -7,7 +7,7 @@ * @module table/ui/formrowview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5/src/ui'; import '../../theme/formrow.css'; diff --git a/packages/ckeditor5-table/src/ui/inserttableview.js b/packages/ckeditor5-table/src/ui/inserttableview.js index c014b72be75..efa7e6ad933 100644 --- a/packages/ckeditor5-table/src/ui/inserttableview.js +++ b/packages/ckeditor5-table/src/ui/inserttableview.js @@ -7,7 +7,7 @@ * @module table/ui/inserttableview */ -import View from '@ckeditor/ckeditor5-ui/src/view'; +import { View } from 'ckeditor5/src/ui'; import './../../theme/inserttable.css'; diff --git a/packages/ckeditor5-table/src/utils/ui/contextualballoon.js b/packages/ckeditor5-table/src/utils/ui/contextualballoon.js index 5661690bff0..7b81d367624 100644 --- a/packages/ckeditor5-table/src/utils/ui/contextualballoon.js +++ b/packages/ckeditor5-table/src/utils/ui/contextualballoon.js @@ -7,10 +7,11 @@ * @module table/utils/ui/contextualballoon */ -import { centeredBalloonPositionForLongWidgets } from '@ckeditor/ckeditor5-widget/src/utils'; -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; +import { centeredBalloonPositionForLongWidgets } from 'ckeditor5/src/widget'; +import { Rect } from 'ckeditor5/src/utils'; +import { BalloonPanelView } from 'ckeditor5/src/ui'; + import { getTableWidgetAncestor } from './widget'; -import BalloonPanelView from '@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview'; const DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions; diff --git a/packages/ckeditor5-table/src/utils/ui/table-properties.js b/packages/ckeditor5-table/src/utils/ui/table-properties.js index 101d2fbcbf3..0ce2a3b59db 100644 --- a/packages/ckeditor5-table/src/utils/ui/table-properties.js +++ b/packages/ckeditor5-table/src/utils/ui/table-properties.js @@ -7,11 +7,11 @@ * @module table/utils/ui/table-properties */ -import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview'; -import Collection from '@ckeditor/ckeditor5-utils/src/collection'; -import Model from '@ckeditor/ckeditor5-ui/src/model'; +import { ButtonView, Model } from 'ckeditor5/src/ui'; +import { Collection } from 'ckeditor5/src/utils'; +import { isColor, isLength, isPercentage } from 'ckeditor5/src/engine'; + import ColorInputView from '../../ui/colorinputview'; -import { isColor, isLength, isPercentage } from '@ckeditor/ckeditor5-engine/src/view/styles/utils'; const isEmpty = val => val === ''; diff --git a/packages/ckeditor5-table/src/utils/ui/widget.js b/packages/ckeditor5-table/src/utils/ui/widget.js index 93ca58a7bbe..af553db5498 100644 --- a/packages/ckeditor5-table/src/utils/ui/widget.js +++ b/packages/ckeditor5-table/src/utils/ui/widget.js @@ -7,7 +7,7 @@ * @module table/utils/ui/widget */ -import { isWidget } from '@ckeditor/ckeditor5-widget/src/utils'; +import { isWidget } from 'ckeditor5/src/widget'; /** * Returns a table widget editing view element if one is selected. diff --git a/packages/ckeditor5-table/webpack.config.js b/packages/ckeditor5-table/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-table/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-theme-lark/docs/_snippets/examples/theme-lark.js b/packages/ckeditor5-theme-lark/docs/_snippets/examples/theme-lark.js index f89ff4a5644..8228a7e3b5b 100644 --- a/packages/ckeditor5-theme-lark/docs/_snippets/examples/theme-lark.js +++ b/packages/ckeditor5-theme-lark/docs/_snippets/examples/theme-lark.js @@ -8,12 +8,14 @@ import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor'; import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset'; import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; import './custom.css'; ClassicEditor .create( document.querySelector( '#snippet-classic-editor' ), { - plugins: [ ArticlePluginSet, EasyImage ], + plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices ], toolbar: { items: [ 'heading', diff --git a/packages/ckeditor5-theme-lark/package.json b/packages/ckeditor5-theme-lark/package.json index b813523c93d..6d4d9b3b35a 100644 --- a/packages/ckeditor5-theme-lark/package.json +++ b/packages/ckeditor5-theme-lark/package.json @@ -32,7 +32,8 @@ "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-undo": "^25.0.0", "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-table": "^25.0.0" + "@ckeditor/ckeditor5-table": "^25.0.0", + "ckeditor5": "^25.0.0" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-theme-lark/tests/manual/iconset.js b/packages/ckeditor5-theme-lark/tests/manual/iconset.js index c1778e44591..44ed3a6e6d8 100644 --- a/packages/ckeditor5-theme-lark/tests/manual/iconset.js +++ b/packages/ckeditor5-theme-lark/tests/manual/iconset.js @@ -21,30 +21,7 @@ import browseFiles from '@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.s import codeBlock from '@ckeditor/ckeditor5-code-block/theme/icons/codeblock.svg'; -import cancel from '@ckeditor/ckeditor5-core/theme/icons/cancel.svg'; -import check from '@ckeditor/ckeditor5-core/theme/icons/check.svg'; -import eraser from '@ckeditor/ckeditor5-core/theme/icons/eraser.svg'; -import lowVision from '@ckeditor/ckeditor5-core/theme/icons/low-vision.svg'; -import image from '@ckeditor/ckeditor5-core/theme/icons/image.svg'; -import alignBottom from '@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg'; -import alignMiddle from '@ckeditor/ckeditor5-core/theme/icons/align-middle.svg'; -import alignTop from '@ckeditor/ckeditor5-core/theme/icons/align-top.svg'; -import alignLeft from '@ckeditor/ckeditor5-core/theme/icons/align-left.svg'; -import alignCenter from '@ckeditor/ckeditor5-core/theme/icons/align-center.svg'; -import alignRight from '@ckeditor/ckeditor5-core/theme/icons/align-right.svg'; -import alignJustify from '@ckeditor/ckeditor5-core/theme/icons/align-justify.svg'; -import objectLeft from '@ckeditor/ckeditor5-core/theme/icons/object-left.svg'; -import objectCenter from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg'; -import objectRight from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg'; -import objectFullWidth from '@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg'; -import objectSizeFull from '@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg'; -import objectSizeLarge from '@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg'; -import objectSizeSmall from '@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg'; -import objectSizeMedium from '@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg'; -import pencil from '@ckeditor/ckeditor5-core/theme/icons/pencil.svg'; -import pilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg'; -import quote from '@ckeditor/ckeditor5-core/theme/icons/quote.svg'; -import threeVerticalDots from '@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg'; +import { icons as coreIcons } from 'ckeditor5/src/core'; import fontFamily from '@ckeditor/ckeditor5-font/theme/icons/font-family.svg'; import fontSize from '@ckeditor/ckeditor5-font/theme/icons/font-size.svg'; @@ -114,10 +91,7 @@ const icons = { codeBlock, // core - alignTop, alignBottom, alignMiddle, alignLeft, alignCenter, alignRight, - alignJustify, cancel, check, eraser, image, lowVision, objectCenter, - objectFullWidth, objectLeft, objectRight, objectSizeFull, objectSizeLarge, - objectSizeSmall, objectSizeMedium, pencil, pilcrow, quote, threeVerticalDots, + ...coreIcons, // font fontFamily, fontSize, fontColor, fontBackground, diff --git a/packages/ckeditor5-typing/package.json b/packages/ckeditor5-typing/package.json index 15dc51c0564..8515a9d13ce 100644 --- a/packages/ckeditor5-typing/package.json +++ b/packages/ckeditor5-typing/package.json @@ -7,8 +7,10 @@ "ckeditor5", "ckeditor 5", "ckeditor5-feature", - "ckeditor5-plugin" + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", diff --git a/packages/ckeditor5-typing/src/index.js b/packages/ckeditor5-typing/src/index.js new file mode 100644 index 00000000000..8e5b629dc66 --- /dev/null +++ b/packages/ckeditor5-typing/src/index.js @@ -0,0 +1,21 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module typing + */ + +export { default as Typing } from './typing'; +export { default as Input } from './input'; +export { default as Delete } from './delete'; + +export { default as TextWatcher } from './textwatcher'; +export { default as TwoStepCaretMovement } from './twostepcaretmovement'; + +export { default as inlineHighlight } from './utils/inlinehighlight'; +export { default as findAttributeRange } from './utils/findattributerange'; +export { default as getLastTextLine } from './utils/getlasttextline'; + +export * from './utils/injectunsafekeystrokeshandling'; diff --git a/packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js b/packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js index 88c4b343714..66b0569d5b8 100644 --- a/packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js +++ b/packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js @@ -40,6 +40,9 @@ import HeadingEditing from '@ckeditor/ckeditor5-heading/src/headingediting'; // The easy image integration. import EasyImage from '@ckeditor/ckeditor5-easy-image/src/easyimage'; +import Image from '@ckeditor/ckeditor5-image/src/image'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; // Extending the Editor class, which brings base editor API. @@ -299,7 +302,7 @@ class BootstrapEditorUI extends EditorUI { BootstrapEditor .create( $( '#editor' ).get( 0 ), { plugins: [ - Clipboard, Enter, Typing, Paragraph, EasyImage, + Clipboard, Enter, Typing, Paragraph, EasyImage, Image, ImageUpload, CloudServices, BoldEditing, ItalicEditing, UnderlineEditing, HeadingEditing, UndoEditing ], cloudServices: CS_CONFIG diff --git a/packages/ckeditor5-ui/package.json b/packages/ckeditor5-ui/package.json index 2bb83c4ab6e..7eaa471d9ff 100644 --- a/packages/ckeditor5-ui/package.json +++ b/packages/ckeditor5-ui/package.json @@ -6,16 +6,19 @@ "ckeditor", "ckeditor5", "ckeditor 5", - "ckeditor5-lib" + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-editor-balloon": "^25.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", diff --git a/packages/ckeditor5-ui/src/index.js b/packages/ckeditor5-ui/src/index.js new file mode 100644 index 00000000000..234ee2d8f67 --- /dev/null +++ b/packages/ckeditor5-ui/src/index.js @@ -0,0 +1,62 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ui + */ + +export { default as clickOutsideHandler } from './bindings/clickoutsidehandler'; +export { default as injectCssTransitionDisabler } from './bindings/injectcsstransitiondisabler'; +export { default as submitHandler } from './bindings/submithandler'; + +export { default as BodyCollection } from './editorui/bodycollection'; + +export { default as ButtonView } from './button/buttonview'; +export { default as SwitchButtonView } from './button/switchbuttonview'; + +export * from './colorgrid/utils'; +export { default as ColorGridView } from './colorgrid/colorgridview'; +export { default as ColorTileView } from './colorgrid/colortileview'; + +export { default as DropdownButtonView } from './dropdown/button/dropdownbuttonview'; +export { default as SplitButtonView } from './dropdown/button/splitbuttonview'; +export * from './dropdown/utils'; + +export { default as EditorUIView } from './editorui/editoruiview'; +export { default as BoxedEditorUIView } from './editorui/boxed/boxededitoruiview'; +export { default as InlineEditableUIView } from './editableui/inline/inlineeditableuiview'; + +export { default as FormHeaderView } from './formheader/formheaderview'; +export { default as FocusCycler } from './focuscycler'; + +export { default as IconView } from './icon/iconview'; +export { default as InputTextView } from './inputtext/inputtextview'; + +export { default as LabelView } from './label/labelview'; +export { default as LabeledFieldView } from './labeledfield/labeledfieldview'; +export * from './labeledfield/utils'; + +export { default as ListItemView } from './list/listitemview'; +export { default as ListView } from './list/listview'; + +export { default as Notification } from './notification/notification'; + +export { default as Model } from './model'; +export { default as BalloonPanelView } from './panel/balloon/balloonpanelview'; +export { default as ContextualBalloon } from './panel/balloon/contextualballoon'; +export { default as StickyPanelView } from './panel/sticky/stickypanelview'; + +export { default as TooltipView } from './tooltip/tooltipview'; +export { default as Template } from './template'; + +export { default as ToolbarView } from './toolbar/toolbarview'; +export { default as ToolbarSeparatorView } from './toolbar/toolbarseparatorview'; +export { default as enableToolbarKeyboardFocus } from './toolbar/enabletoolbarkeyboardfocus'; +export { default as normalizeToolbarConfig } from './toolbar/normalizetoolbarconfig'; +export { default as BalloonToolbar } from './toolbar/balloon/balloontoolbar'; +export { default as BlockToolbar } from './toolbar/block/blocktoolbar'; + +export { default as View } from './view'; +export { default as ViewCollection } from './viewcollection'; diff --git a/packages/ckeditor5-ui/src/notification/notification.js b/packages/ckeditor5-ui/src/notification/notification.js index 44318ca02d7..16a8532ebe2 100644 --- a/packages/ckeditor5-ui/src/notification/notification.js +++ b/packages/ckeditor5-ui/src/notification/notification.js @@ -9,7 +9,7 @@ /* globals window */ -import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin'; +import { ContextPlugin } from 'ckeditor5/src/core'; /** * The Notification plugin. diff --git a/packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js b/packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js index b3b509d6d9b..38a6b575d9c 100644 --- a/packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js +++ b/packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js @@ -7,7 +7,7 @@ * @module ui/panel/balloon/contextualballoon */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import BalloonPanelView from './balloonpanelview'; import View from '../../view'; import ButtonView from '../../button/buttonview'; diff --git a/packages/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js b/packages/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js index 430f74e43e3..4aa85766e49 100644 --- a/packages/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js +++ b/packages/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js @@ -7,7 +7,7 @@ * @module ui/toolbar/balloon/balloontoolbar */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin } from 'ckeditor5/src/core'; import ContextualBalloon from '../../panel/balloon/contextualballoon'; import ToolbarView from '../toolbarview'; import BalloonPanelView from '../../panel/balloon/balloonpanelview.js'; diff --git a/packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js b/packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js index 2dc10efa163..cf502067c1b 100644 --- a/packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js +++ b/packages/ckeditor5-ui/src/toolbar/block/blocktoolbar.js @@ -9,7 +9,7 @@ /* global window */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; +import { Plugin, icons } from 'ckeditor5/src/core'; import BlockButtonView from './blockbuttonview'; import BalloonPanelView from '../../panel/balloon/balloonpanelview'; @@ -24,7 +24,6 @@ import normalizeToolbarConfig from '../normalizetoolbarconfig'; import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver'; import toUnit from '@ckeditor/ckeditor5-utils/src/dom/tounit'; -import iconPilcrow from '@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg'; const toPx = toUnit( 'px' ); @@ -274,7 +273,7 @@ export default class BlockToolbar extends Plugin { buttonView.set( { label: t( 'Edit block' ), - icon: iconPilcrow, + icon: icons.pilcrow, withText: false } ); diff --git a/packages/ckeditor5-ui/src/toolbar/toolbarview.js b/packages/ckeditor5-ui/src/toolbar/toolbarview.js index 6ac0f5d48db..25fa45f5086 100644 --- a/packages/ckeditor5-ui/src/toolbar/toolbarview.js +++ b/packages/ckeditor5-ui/src/toolbar/toolbarview.js @@ -19,8 +19,8 @@ import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; import global from '@ckeditor/ckeditor5-utils/src/dom/global'; import { createDropdown, addToolbarToDropdown } from '../dropdown/utils'; import { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; -import verticalDotsIcon from '@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg'; import normalizeToolbarConfig from './normalizetoolbarconfig'; +import { icons } from 'ckeditor5/src/core'; import '../../theme/components/toolbar/toolbar.css'; @@ -932,7 +932,7 @@ class DynamicGrouping { label: t( 'Show more items' ), tooltip: true, tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw', - icon: verticalDotsIcon + icon: icons.threeVerticalDots } ); // 1:1 pass–through binding. diff --git a/packages/ckeditor5-undo/package.json b/packages/ckeditor5-undo/package.json index 9e125c1efd4..87f7dc86752 100644 --- a/packages/ckeditor5-undo/package.json +++ b/packages/ckeditor5-undo/package.json @@ -7,8 +7,10 @@ "ckeditor5", "ckeditor 5", "ckeditor5-feature", - "ckeditor5-plugin" + "ckeditor5-plugin", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", @@ -22,8 +24,8 @@ "@ckeditor/ckeditor5-heading": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-typing": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "@ckeditor/ckeditor5-table": "^25.0.0" + "@ckeditor/ckeditor5-table": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-undo/src/index.js b/packages/ckeditor5-undo/src/index.js new file mode 100644 index 00000000000..5a738365426 --- /dev/null +++ b/packages/ckeditor5-undo/src/index.js @@ -0,0 +1,12 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module undo + */ + +export { default as Undo } from './undo'; +export { default as UndoEditing } from './undoediting'; +export { default as UndoUi } from './undoui'; diff --git a/packages/ckeditor5-upload/package.json b/packages/ckeditor5-upload/package.json index 9bfad4ae45d..4c027146a72 100644 --- a/packages/ckeditor5-upload/package.json +++ b/packages/ckeditor5-upload/package.json @@ -6,12 +6,14 @@ "ckeditor", "ckeditor5", "ckeditor 5", - "ckeditor5-lib" + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0" + "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-ui": "^25.0.0" }, "engines": { "node": ">=12.0.0", diff --git a/packages/ckeditor5-upload/src/index.js b/packages/ckeditor5-upload/src/index.js new file mode 100644 index 00000000000..ec0b3a6ae7a --- /dev/null +++ b/packages/ckeditor5-upload/src/index.js @@ -0,0 +1,11 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module upload + */ + +export { default as FileRepository } from './filerepository'; +export { default as FileDialogButtonView } from './ui/filedialogbuttonview'; diff --git a/packages/ckeditor5-utils/package.json b/packages/ckeditor5-utils/package.json index 3084a1abd23..c98ade92167 100644 --- a/packages/ckeditor5-utils/package.json +++ b/packages/ckeditor5-utils/package.json @@ -6,8 +6,10 @@ "ckeditor", "ckeditor5", "ckeditor 5", - "ckeditor5-lib" + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "lodash-es": "^4.17.15" }, diff --git a/packages/ckeditor5-utils/src/index.js b/packages/ckeditor5-utils/src/index.js new file mode 100644 index 00000000000..13b48fccb05 --- /dev/null +++ b/packages/ckeditor5-utils/src/index.js @@ -0,0 +1,42 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module utils + */ + +export { default as env } from './env'; +export { default as diff } from './diff'; + +export { default as mix } from './mix'; +export { default as EmitterMixin } from './emittermixin'; +export { default as ObservableMixin } from './observablemixin'; + +export { default as CKEditorError, logError, logWarning } from './ckeditorerror'; + +export { default as ElementReplacer } from './elementreplacer'; + +export { default as createElement } from './dom/createelement'; +export { default as DomEmitterMixin } from './dom/emittermixin'; +export { default as global } from './dom/global'; +export { default as getDataFromElement } from './dom/getdatafromelement'; +export { default as Rect } from './dom/rect'; +export { default as ResizeObserver } from './dom/resizeobserver'; +export { default as setDataInElement } from './dom/setdatainelement'; +export { default as toUnit } from './dom/tounit'; + +export * from './keyboard'; +export { default as Locale } from './locale'; +export { default as Collection } from './collection'; +export { default as first } from './first'; +export { default as FocusTracker } from './focustracker'; +export { default as KeystrokeHandler } from './keystrokehandler'; +export { default as toArray } from './toarray'; +export { default as toMap } from './tomap'; +export { default as priorities } from './priorities'; + +export { default as uid } from './uid'; + +export { default as version } from './version'; diff --git a/packages/ckeditor5-utils/src/version.js b/packages/ckeditor5-utils/src/version.js index 4c294fe9770..9e8370ef66c 100644 --- a/packages/ckeditor5-utils/src/version.js +++ b/packages/ckeditor5-utils/src/version.js @@ -13,6 +13,8 @@ import CKEditorError from './ckeditorerror'; const version = '25.0.0'; +export default version; + /* istanbul ignore next */ const windowOrGlobal = typeof window === 'object' ? window : global; diff --git a/packages/ckeditor5-watchdog/package.json b/packages/ckeditor5-watchdog/package.json index 383d727ace7..9f819484239 100644 --- a/packages/ckeditor5-watchdog/package.json +++ b/packages/ckeditor5-watchdog/package.json @@ -8,14 +8,20 @@ "ckeditor 5", "ckeditor5-lib" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-utils": "^25.0.0", + "ckeditor5": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", - "@ckeditor/ckeditor5-paragraph": "^25.0.0" + "@ckeditor/ckeditor5-paragraph": "^25.0.0", + "@ckeditor/ckeditor5-theme-lark": "24.0.0", + "@ckeditor/ckeditor5-utils": "24.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -33,6 +39,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-watchdog/src/contextwatchdog.js b/packages/ckeditor5-watchdog/src/contextwatchdog.js index 2eaf9a2d959..2a246bda3e1 100644 --- a/packages/ckeditor5-watchdog/src/contextwatchdog.js +++ b/packages/ckeditor5-watchdog/src/contextwatchdog.js @@ -9,11 +9,11 @@ /* globals console */ +import { toArray } from 'ckeditor5/src/utils'; import Watchdog from './watchdog'; import EditorWatchdog from './editorwatchdog'; import areConnectedThroughProperties from './utils/areconnectedthroughproperties'; import getSubNodes from './utils/getsubnodes'; -import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; /** * A watchdog for the {@link module:core/context~Context} class. diff --git a/packages/ckeditor5-watchdog/src/index.js b/packages/ckeditor5-watchdog/src/index.js new file mode 100644 index 00000000000..8786efb444d --- /dev/null +++ b/packages/ckeditor5-watchdog/src/index.js @@ -0,0 +1,18 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module watchdog + */ + +import ContextWatchdog from './contextwatchdog'; +import EditorWatchdog from './editorwatchdog'; +import Watchdog from './watchdog'; + +export default { + ContextWatchdog, + EditorWatchdog, + Watchdog +}; diff --git a/packages/ckeditor5-watchdog/webpack.config.js b/packages/ckeditor5-watchdog/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-watchdog/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/packages/ckeditor5-widget/package.json b/packages/ckeditor5-widget/package.json index 6b725a88655..6620075027f 100644 --- a/packages/ckeditor5-widget/package.json +++ b/packages/ckeditor5-widget/package.json @@ -6,14 +6,16 @@ "ckeditor", "ckeditor5", "ckeditor 5", - "ckeditor5-lib" + "ckeditor5-lib", + "ckeditor5-dll" ], + "main": "src/index.js", "dependencies": { "@ckeditor/ckeditor5-core": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", - "@ckeditor/ckeditor5-typing": "^25.0.0", "@ckeditor/ckeditor5-ui": "^25.0.0", "@ckeditor/ckeditor5-utils": "^25.0.0", + "@ckeditor/ckeditor5-typing": "^25.0.0", "lodash-es": "^4.17.15" }, "devDependencies": { diff --git a/packages/ckeditor5-widget/src/index.js b/packages/ckeditor5-widget/src/index.js new file mode 100644 index 00000000000..4c3f526757a --- /dev/null +++ b/packages/ckeditor5-widget/src/index.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +export { default as Widget } from './widget'; +export { default as WidgetToolbarRepository } from './widgettoolbarrepository'; +export { default as WidgetResize } from './widgetresize'; +export { default as WidgetTypeAround } from './widgettypearound/widgettypearound'; +export * from './utils'; diff --git a/packages/ckeditor5-widget/src/utils.js b/packages/ckeditor5-widget/src/utils.js index 8b3c120a70f..cfea60e989f 100644 --- a/packages/ckeditor5-widget/src/utils.js +++ b/packages/ckeditor5-widget/src/utils.js @@ -7,17 +7,19 @@ * @module widget/utils */ -import HighlightStack from './highlightstack'; -import IconView from '@ckeditor/ckeditor5-ui/src/icon/iconview'; -import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; import BalloonPanelView from '@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview'; + import global from '@ckeditor/ckeditor5-utils/src/dom/global'; +import Rect from '@ckeditor/ckeditor5-utils/src/dom/rect'; import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; import toArray from '@ckeditor/ckeditor5-utils/src/toarray'; -import dragHandleIcon from '../theme/icons/drag-handle.svg'; +import HighlightStack from './highlightstack'; import { getTypeAroundFakeCaretPosition } from './widgettypearound/utils'; +import IconView from '@ckeditor/ckeditor5-ui/src/icon/iconview'; +import dragHandleIcon from '../theme/icons/drag-handle.svg'; + /** * CSS class added to each widget element. * diff --git a/packages/ckeditor5-word-count/package.json b/packages/ckeditor5-word-count/package.json index d087fe12375..e3eb8a4abf5 100644 --- a/packages/ckeditor5-word-count/package.json +++ b/packages/ckeditor5-word-count/package.json @@ -9,23 +9,28 @@ "ckeditor5-feature", "ckeditor5-plugin" ], + "main": "src/index.js", "dependencies": { - "@ckeditor/ckeditor5-core": "^25.0.0", - "@ckeditor/ckeditor5-ui": "^25.0.0", - "@ckeditor/ckeditor5-utils": "^25.0.0", - "lodash-es": "^4.17.15" + "lodash-es": "^4.17.15", + "ckeditor5": "^25.0.0" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "^25.0.0", "@ckeditor/ckeditor5-block-quote": "^25.0.0", + "@ckeditor/ckeditor5-core": "^25.0.0", + "@ckeditor/ckeditor5-dev-utils": "^24.0.0", "@ckeditor/ckeditor5-editor-classic": "^25.0.0", "@ckeditor/ckeditor5-engine": "^25.0.0", "@ckeditor/ckeditor5-enter": "^25.0.0", + "@ckeditor/ckeditor5-image": "^25.0.0", "@ckeditor/ckeditor5-link": "^25.0.0", "@ckeditor/ckeditor5-list": "^25.0.0", "@ckeditor/ckeditor5-paragraph": "^25.0.0", "@ckeditor/ckeditor5-table": "^25.0.0", - "@ckeditor/ckeditor5-image": "^25.0.0" + "@ckeditor/ckeditor5-theme-lark": "^25.0.0", + "@ckeditor/ckeditor5-utils": "^25.0.0", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.11" }, "engines": { "node": ">=12.0.0", @@ -43,6 +48,10 @@ "files": [ "lang", "src", - "theme" - ] + "theme", + "build" + ], + "scripts": { + "build:dll": "webpack" + } } diff --git a/packages/ckeditor5-word-count/src/index.js b/packages/ckeditor5-word-count/src/index.js new file mode 100644 index 00000000000..a2c5bf2a5c4 --- /dev/null +++ b/packages/ckeditor5-word-count/src/index.js @@ -0,0 +1,14 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module word-count + */ + +import WordCount from './wordcount'; + +export default { + WordCount +}; diff --git a/packages/ckeditor5-word-count/src/wordcount.js b/packages/ckeditor5-word-count/src/wordcount.js index 3ffa447a5d7..04153f2c3d9 100644 --- a/packages/ckeditor5-word-count/src/wordcount.js +++ b/packages/ckeditor5-word-count/src/wordcount.js @@ -7,12 +7,11 @@ * @module word-count/wordcount */ -import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; -import { modelElementToPlainText } from './utils'; +import { Plugin } from 'ckeditor5/src/core'; +import { View, Template } from 'ckeditor5/src/ui'; +import { env } from 'ckeditor5/src/utils'; import { throttle, isElement } from 'lodash-es'; -import View from '@ckeditor/ckeditor5-ui/src/view'; -import Template from '@ckeditor/ckeditor5-ui/src/template'; -import env from '@ckeditor/ckeditor5-utils/src/env'; +import { modelElementToPlainText } from './utils'; /** * The word count plugin. diff --git a/packages/ckeditor5-word-count/webpack.config.js b/packages/ckeditor5-word-count/webpack.config.js new file mode 100644 index 00000000000..fcaa78a2eed --- /dev/null +++ b/packages/ckeditor5-word-count/webpack.config.js @@ -0,0 +1,17 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +'use strict'; + +/* eslint-env node */ + +const { builds } = require( '@ckeditor/ckeditor5-dev-utils' ); + +module.exports = builds.getDllPluginWebpackConfig( { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ), + packagePath: __dirname, + manifestPath: require.resolve( 'ckeditor5/build/ckeditor5-dll.manifest.json' ), + isDevelopmentMode: process.argv.includes( '--dev' ) +} ); diff --git a/sample/README.md b/sample/README.md new file mode 100644 index 00000000000..8c80b133402 --- /dev/null +++ b/sample/README.md @@ -0,0 +1,26 @@ +# DLL sample + +The sample requires building: + +1. Base DLL using `yarn run build:dll`. +2. The DLL consumer plugin `yarn run build:dll-sample`. +3. *External* classic editor DLL builds from `packages/ckeditor5`. +4. All DLL enabled plugins. + +You can run whole project DLL build running in the top-level directory: + +```shell +yarn run build:dll +``` + +and then only in this directory: + +```shell +yarn run build:dll-sample +``` + +Notes: + +* The order of steps 2 & 3 is not important. +* If the interface of DLL is not changed (only the version update) the steps 2 & 3 _should be_ optional. In other words if the exports stays the same the DLL consumers do not need to be rebuilt. +* Steps 1 & 2 can be run together as `yarn run build`. diff --git a/sample/index.html b/sample/index.html new file mode 100644 index 00000000000..5f38d1e157f --- /dev/null +++ b/sample/index.html @@ -0,0 +1,224 @@ + + + + + DLL sample + + + + +
+
+

Classic Editor

+ +
+

Pastry powder dragée sweet donut jelly-o carrot cake. Icing jelly cotton candy. Tart dessert carrot cake dragée tootsie roll gummi bears cake. Tiramisu cookie jelly jelly beans bear claw brownie cookie cake biscuit. Carrot cake lollipop chocolate liquorice tart oat cake. Cupcake sesame snaps liquorice icing pie cake wafer dragée. Chocolate carrot cake brownie chocolate tootsie roll. Wafer chocolate pie cake gingerbread. Pudding jelly-o jelly-o danish. Donut lollipop jelly beans danish pie candy. Dessert tiramisu jelly. Pastry candy canes marzipan dragée candy. Apple pie cake jelly beans ice cream liquorice fruitcake.

+ + Autumn fields +
+
+
+

Inline Editor

+ +
+

Pastry powder dragée sweet donut jelly-o carrot cake. Icing jelly cotton candy. Tart dessert carrot cake dragée tootsie roll gummi bears cake. Tiramisu cookie jelly jelly beans bear claw brownie cookie cake biscuit. Carrot cake lollipop chocolate liquorice tart oat cake. Cupcake sesame snaps liquorice icing pie cake wafer dragée. Chocolate carrot cake brownie chocolate tootsie roll. Wafer chocolate pie cake gingerbread. Pudding jelly-o jelly-o danish. Donut lollipop jelly beans danish pie candy. Dessert tiramisu jelly. Pastry candy canes marzipan dragée candy. Apple pie cake jelly beans ice cream liquorice fruitcake.

+ + Autumn fields +
+
+
+

Balloon Editor

+ +
+

Pastry powder dragée sweet donut jelly-o carrot cake. Icing jelly cotton candy. Tart dessert carrot cake dragée tootsie roll gummi bears cake. Tiramisu cookie jelly jelly beans bear claw brownie cookie cake biscuit. Carrot cake lollipop chocolate liquorice tart oat cake. Cupcake sesame snaps liquorice icing pie cake wafer dragée. Chocolate carrot cake brownie chocolate tootsie roll. Wafer chocolate pie cake gingerbread. Pudding jelly-o jelly-o danish. Donut lollipop jelly beans danish pie candy. Dessert tiramisu jelly. Pastry candy canes marzipan dragée candy. Apple pie cake jelly beans ice cream liquorice fruitcake.

+ + Autumn fields +
+
+
+

Decoupled Document Editor

+ +

The toolbar

+
+ +

The editable

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/plugin/src/dllconsumerplugin.js b/sample/plugin/src/dllconsumerplugin.js new file mode 100644 index 00000000000..f6ec16a0cd6 --- /dev/null +++ b/sample/plugin/src/dllconsumerplugin.js @@ -0,0 +1,45 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +import { Plugin, Command } from 'ckeditor5/src/core'; +import { ButtonView } from 'ckeditor5/src/ui'; + +class ACommand extends Command { + execute() { + const model = this.editor.model; + + model.change( writer => { + model.insertContent( writer.createText( 'The cake is a lie!' ) ); + } ); + } +} + +class DLLConsumerPlugin extends Plugin { + constructor( editor ) { + super( editor ); + + editor.commands.add( 'a-command', new ACommand( editor ) ); + + editor.ui.componentFactory.add( 'a-button', locale => { + const button = new ButtonView( locale ); + + const command = editor.commands.get( 'a-command' ); + + button.set( { + withText: true, + icon: false, + label: 'Click me!' + } ); + + button.bind( 'isEnabled' ).to( command ); + + button.on( 'execute', () => editor.execute( 'a-command' ) ); + + return button; + } ); + } +} + +export default DLLConsumerPlugin; diff --git a/sample/plugin/webpack.config.js b/sample/plugin/webpack.config.js new file mode 100644 index 00000000000..758b00b56d2 --- /dev/null +++ b/sample/plugin/webpack.config.js @@ -0,0 +1,34 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/* eslint-env node */ + +const path = require( 'path' ); +const webpack = require( 'webpack' ); + +module.exports = { + mode: 'development', + optimization: { + minimize: false, + moduleIds: 'named' + }, + entry: { + path: path.resolve( __dirname, 'src/dllconsumerplugin.js' ) + }, + output: { + path: path.resolve( __dirname, '../../build' ), + filename: 'dll-consumer-plugin.js', + library: 'DLLConsumerPlugin', + libraryTarget: 'umd', + libraryExport: 'default' + }, + plugins: [ + new webpack.DllReferencePlugin( { + manifest: require( '../../build/ckeditor5-dll.manifest.json' ), + scope: 'ckeditor5/src', + name: 'CKEditor5.dll' + } ) + ] +}; diff --git a/sample/sample.jpg b/sample/sample.jpg new file mode 100644 index 00000000000..b77d07e7bff Binary files /dev/null and b/sample/sample.jpg differ diff --git a/scripts/dll/build-dlls.js b/scripts/dll/build-dlls.js new file mode 100755 index 00000000000..32a09972eac --- /dev/null +++ b/scripts/dll/build-dlls.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/* eslint-env node */ + +const childProcess = require( 'child_process' ); +const path = require( 'path' ); +const chalk = require( 'chalk' ); + +const ROOT_DIRECTORY = path.resolve( __dirname, '..', '..' ); +const IS_DEVELOPMENT_MODE = process.argv.includes( '--dev' ); + +if ( IS_DEVELOPMENT_MODE ) { + console.log( '🛠️️ ' + chalk.yellow( 'Development mode is active.' ) ); +} else { + console.log( '⚠️ ' + chalk.magenta( 'Production mode is active.' ) ); +} + +// -------------------------------------------------------- +// -------------------------------------- Main package DLL. + +console.log( '\n📍 ' + chalk.cyan.underline( 'Building DLL for the main package...\n' ) ); + +const webpackArguments = [ '--config=./scripts/dll/webpack.config.dll.js' ]; + +if ( IS_DEVELOPMENT_MODE ) { + webpackArguments.push( '--dev' ); +} + +childProcess.spawnSync( 'webpack', webpackArguments, { + encoding: 'utf8', + shell: true, + cwd: ROOT_DIRECTORY, + stdio: 'inherit', + stderr: 'inherit' +} ); + +// -------------------------------------------------------- +// ------------------------------ ckeditor5-* packages DLL. + +console.log( '\n📍 ' + chalk.underline( 'Building DLLs for ckeditor5-* packages...\n' ) ); + +const nodeArguments = [ './scripts/dll/build-packages-dlls.js' ]; + +if ( IS_DEVELOPMENT_MODE ) { + nodeArguments.push( '--dev' ); +} + +childProcess.spawnSync( 'node', nodeArguments, { + encoding: 'utf8', + shell: true, + cwd: ROOT_DIRECTORY, + stdio: 'inherit', + stderr: 'inherit' +} ); diff --git a/scripts/dll/build-packages-dlls.js b/scripts/dll/build-packages-dlls.js new file mode 100644 index 00000000000..d3fbda0af51 --- /dev/null +++ b/scripts/dll/build-packages-dlls.js @@ -0,0 +1,56 @@ +#!/usr/bin/env node + +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/* eslint-env node */ + +const childProcess = require( 'child_process' ); +const path = require( 'path' ); + +const ROOT_DIRECTORY = path.resolve( __dirname, '..', '..' ); +const IS_DEVELOPMENT_MODE = process.argv.includes( '--dev' ); + +const notBaseDLL = name => name !== 'ckeditor5-dll'; +const hasDLLBuild = name => { + const scripts = require( path.join( process.cwd(), 'packages', name, 'package.json' ) ).scripts; + + return scripts && scripts[ 'build:dll' ]; +}; + +const buildDll = fullPackageName => { + console.log( `Running "${ fullPackageName }" build...` ); + + const yarnArguments = [ 'run', 'build:dll' ]; + + if ( IS_DEVELOPMENT_MODE ) { + yarnArguments.push( '--dev' ); + } + + const subprocess = childProcess.spawnSync( 'yarn', yarnArguments, { + encoding: 'utf8', + shell: true, + cwd: path.join( ROOT_DIRECTORY, 'packages', fullPackageName ) + } ); + + if ( subprocess.status !== 0 ) { + console.log( subprocess.stdout ); + console.log( `💥 DLL ${ fullPackageName } build failed 💥` ); + } +}; + +const packages = childProcess.execSync( 'ls -1 packages', { + encoding: 'utf8', + cwd: ROOT_DIRECTORY +} ).toString().trim().split( '\n' ); + +console.log( '----------------------' ); +console.log( 'Running full DLL build' ); +console.log( '----------------------' ); + +packages + .filter( notBaseDLL ) + .filter( hasDLLBuild ) + .forEach( buildDll ); diff --git a/scripts/dll/dll-loader.js b/scripts/dll/dll-loader.js new file mode 100644 index 00000000000..212f9d139a0 --- /dev/null +++ b/scripts/dll/dll-loader.js @@ -0,0 +1,49 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ + +/* eslint-env node */ + +/** + * This loader attaches exported modules to the global (`window`) scope. + * + * It touches the "main" (`package/src/index.js`) files that re-export the public API. + * + * Files that will be modified (re-exports): + * - packages/ckeditor5-enter/src/index.js + * - packages/ckeditor5-ui/src/index.js + * - packages/ckeditor5-core/src/index.js + * - etc. + * + * Files that will not be touched: + * - packages/ckeditor5-ui/src/focuscycler.js + * - packages/ckeditor5-enter/src/shiftenter.js + * - etc. + * + * The loader assumes that `window.CKEditor5.dll()` is a webpack require function. + * + * @param {String} source + * @param {*} map + */ +module.exports = function dllLoader( source, map ) { + // Touch only the ckeditor5-* files... + if ( this.resourcePath.match( /ckeditor5?-/ ) ) { + // ...that re-export the public API. + if ( this.resourcePath.match( /index.js$/ ) ) { + const scope = this.resourcePath.match( /ckeditor5?-([^/\\]+)/ )[ 1 ]; + const windowScope = scope.replace( /-([a-z])/g, ( match, p1 ) => p1.toUpperCase() ); + + const attachModuleToGlobalScope = [ + // Define the global scope. + 'window.CKEditor5 = window.CKEditor5 || {};', + // Load modules into the global scope using webpack loader. + `window.CKEditor5.${ windowScope } = window.CKEditor5.dll( './src/${ scope }.js' );` + ].join( '' ); + + source += attachModuleToGlobalScope; + } + } + + this.callback( null, source, map ); +}; diff --git a/scripts/dll/webpack.config.dll.js b/scripts/dll/webpack.config.dll.js new file mode 100644 index 00000000000..194c7fd9e0c --- /dev/null +++ b/scripts/dll/webpack.config.dll.js @@ -0,0 +1,122 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/* eslint-env node */ + +const path = require( 'path' ); +const webpack = require( 'webpack' ); +const TerserPlugin = require( 'terser-webpack-plugin' ); +const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); + +const ROOT_DIRECTORY = path.resolve( __dirname, '..', '..' ); +const IS_DEVELOPMENT_MODE = process.argv.includes( '--dev' ); + +if ( ROOT_DIRECTORY !== process.cwd() ) { + throw new Error( 'This script should be called from the package root directory.' ); +} + +const webpackConfig = { + mode: IS_DEVELOPMENT_MODE ? 'development' : 'production', + performance: { hints: false }, + entry: [ + // The base of the CKEditor 5 framework, in order of appearance: + './src/utils.js', + './src/core.js', + './src/engine.js', + './src/ui.js', + + // The base packages of the CKEditor 5 Cloud Services: + './src/cloud-services-core.js', + + // The Essentials plugin contents: + './src/clipboard.js', + './src/enter.js', + './src/paragraph.js', + './src/select-all.js', + './src/typing.js', + './src/undo.js', + + // Other, common packages: + './src/upload.js', + './src/widget.js' + ], + optimization: { + minimize: false, + moduleIds: 'named' + }, + output: { + path: path.join( ROOT_DIRECTORY, 'build' ), + filename: 'ckeditor5-dll.js', + library: [ 'CKEditor5', 'dll' ], + libraryTarget: 'umd' + }, + plugins: [ + new webpack.BannerPlugin( { + banner: bundler.getLicenseBanner(), + raw: true + } ), + new webpack.DllPlugin( { + name: 'CKEditor5.dll', + context: 'src', + path: path.join( ROOT_DIRECTORY, 'build', 'ckeditor5-dll.manifest.json' ), + format: true, + entryOnly: true + } ) + ], + module: { + rules: [ + { + test: /\.svg$/, + use: [ 'raw-loader' ] + }, + { + test: /\.css$/, + use: [ + { + loader: 'style-loader', + options: { + injectType: 'singletonStyleTag', + attributes: { + 'data-cke': true + } + } + }, + { + loader: 'postcss-loader', + options: styles.getPostCssConfig( { + themeImporter: { + themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) + }, + minify: true + } ) + } + ] + }, + { + test: /\.js$/, + loader: require.resolve( './dll-loader' ) + } + ] + } +}; + +if ( !IS_DEVELOPMENT_MODE ) { + webpackConfig.optimization.minimize = true; + + webpackConfig.optimization.minimizer = [ + new TerserPlugin( { + terserOptions: { + output: { + // Preserve CKEditor 5 license comments. + comments: /^!/ + } + }, + extractComments: false + } ) + ]; +} + +module.exports = webpackConfig; + diff --git a/scripts/release/changelog.js b/scripts/release/changelog.js index f5d77a56d74..3ac7336dcc3 100644 --- a/scripts/release/changelog.js +++ b/scripts/release/changelog.js @@ -9,8 +9,16 @@ 'use strict'; +const path = require( 'path' ); +const fs = require( 'fs' ); const devEnv = require( '@ckeditor/ckeditor5-dev-env' ); +const CKEDITOR5_INTERNAL_PATH = path.resolve( __dirname, '..', '..', 'external', 'ckeditor5-internal' ); + +if ( !fs.existsSync( CKEDITOR5_INTERNAL_PATH ) ) { + throw new Error( `The script assumes that the directory "${ CKEDITOR5_INTERNAL_PATH }" exists.` ); +} + Promise.resolve() .then( () => devEnv.generateChangelogForMonoRepository( { cwd: process.cwd(), @@ -32,7 +40,14 @@ Promise.resolve() } return 'https://www.npmjs.com/package/@ckeditor/ckeditor5-' + name; - } + }, + externalRepositories: [ + { + cwd: CKEDITOR5_INTERNAL_PATH, + packages: 'packages', + skipLinks: true + } + ] } ) ) .then( () => { console.log( 'Done!' ); diff --git a/scripts/web-crawler.js b/scripts/web-crawler.js new file mode 100644 index 00000000000..b29f84b8bef --- /dev/null +++ b/scripts/web-crawler.js @@ -0,0 +1,388 @@ +#!/usr/bin/env node + +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/* eslint-env node */ + +const puppeteer = require( 'puppeteer' ); +const chalk = require( 'chalk' ); +const ora = require( 'ora' ); +const minimist = require( 'minimist' ); + +const ERROR_TYPES = { + PAGE_CRASH: { + event: 'error', + description: 'Page crash' + }, + UNCAUGHT_EXCEPTION: { + event: 'pageerror', + description: 'Uncaught exception' + }, + REQUEST_FAILURE: { + event: 'requestfailed', + description: 'Request failure' + }, + RESPONSE_FAILURE: { + event: 'response', + description: 'Response failure' + }, + CONSOLE_ERROR: { + event: 'console', + description: 'Console error' + } +}; + +const options = parseArguments( process.argv.slice( 2 ) ); + +startCrawler( options ); + +/** + * Main crawler function. Its purpose is to: + * - create Puppeteer's browser, + * - create Puppeteer's page instance from browser instance, + * - register error handlers, + * - open sequentially all links from the provided URL, + * - show error summary after all links have been visited. + * + * @param {Object} options Parsed CLI arguments. + * @param {String} options.url The URL to start crawling. + * @param {Number} options.depth Defines how many nested page levels should be examined. Infinity by default. + * @param {RegExp|null} options.exclude A regular expression pattern to exclude links. Null by default to not exclude anything. + */ +async function startCrawler( { url, depth, exclude } ) { + console.log( chalk.bold( '\n🔎 Starting the Crawler\n' ) ); + + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + + dismissDialogs( page ); + + const spinner = createSpinner(); + + spinner.start( 'Registering error handlers…' ); + + const errors = new Map(); + + registerErrorHandlers( page, getErrorHandler( errors ) ); + + spinner.succeed( `Registering error handlers… ${ chalk.bold( 'Done' ) }` ); + + spinner.start( 'Checking pages…' ); + + await openLink( page, { + host: new URL( url ).host, + link: url, + foundLinks: [ url ], + exclude, + depth, + onProgress: getProgressHandler( spinner ) + } ); + + spinner.succeed( `Checking pages… ${ chalk.bold( 'Done' ) }` ); + + browser.close(); + + logErrors( errors ); +} + +/** + * Dismisses any dialogs (alert, prompt, confirm, beforeunload) that could be displayed on page load. + * + * @param {Object} page The page instance from Puppeteer. + */ +function dismissDialogs( page ) { + page.on( 'dialog', async dialog => { + await dialog.dismiss(); + } ); +} + +/** + * Creates nice-looking CLI spinner. + */ +function createSpinner() { + return ora( { + indent: 2, + spinner: { + frames: [ '⣾', '⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽' ] + } + } ); +} + +/** + * Returns an error handler, which is called every time new error is found. + * + * @param {Map} errors All errors grouped by their type. + * @returns {Function} Error handler. + */ +function getErrorHandler( errors ) { + return error => { + if ( !errors.has( error.type ) ) { + errors.set( error.type, { + errors: {}, + total: 0 + } ); + } + + const def = errors.get( error.type ); + + def.errors[ error.message ] = def.errors[ error.message ] || { + // Store only unique pages, because given error can occur multiple times on the same page. + pages: new Set(), + total: 0 + }; + + def.errors[ error.message ].pages.add( error.page ); + def.errors[ error.message ].total++; + + def.total++; + }; +} + +/** + * Registers all error handlers on given page instance. + * + * @param {Object} page The page instance from Puppeteer. + * @param {Function} onError Called each time an error has been found. + */ +function registerErrorHandlers( page, onError ) { + page.on( ERROR_TYPES.PAGE_CRASH.event, error => onError( { + page: page.url(), + type: ERROR_TYPES.PAGE_CRASH, + message: error.message + } ) ); + + page.on( ERROR_TYPES.UNCAUGHT_EXCEPTION.event, error => onError( { + page: page.url(), + type: ERROR_TYPES.UNCAUGHT_EXCEPTION, + message: error.message + } ) ); + + page.on( ERROR_TYPES.REQUEST_FAILURE.event, request => onError( { + page: page.url(), + type: ERROR_TYPES.REQUEST_FAILURE, + message: `${ request.failure().errorText } for ${ request.url() }` + } ) ); + + page.on( ERROR_TYPES.RESPONSE_FAILURE.event, response => { + if ( response.status() > 399 ) { + onError( { + page: page.url(), + type: ERROR_TYPES.RESPONSE_FAILURE, + message: `HTTP code ${ response.status() } (${ response.statusText() }) for ${ response.url() }` + } ); + } + } ); + + page.on( ERROR_TYPES.CONSOLE_ERROR.event, message => { + const ignoredMessages = [ + // The resource loading failure is already covered by the `response` or `requestfailed` events. + 'Failed to load resource: the server responded with a status of' + ]; + + if ( ignoredMessages.some( ignoredMessage => message.text().startsWith( ignoredMessage ) ) ) { + return; + } + + if ( message.type() === 'error' ) { + onError( { + page: page.url(), + type: ERROR_TYPES.CONSOLE_ERROR, + message: message.text() + } ); + } + } ); +} + +/** + * Returns a progress handler, which is called every time just before opening a new link. + * + * @param {Object} spinner Spinner instance + * @returns {Function} Progress handler. + */ +function getProgressHandler( spinner ) { + let current = 0; + + return ( { total } ) => { + const progress = Math.round( current / total * 100 ); + + spinner.text = `Checking pages… ${ chalk.bold( `${ progress }% (${ current } of ${ total })` ) }`; + + current++; + }; +} + +/** + * Searches and opens all found links in the document body from requested URL, recursively. Only links from the same + * host are collected and opened sequentially. Only the main URL part consisting of a protocol, a host, a port and + * a path is collected, without a hash and search parts. Duplicated links, which were already collected and enqueued, + * are skipped to avoid loops. Explicitly excluded links are also skipped. + * + * @param {Object} page The page instance from Puppeteer. + * @param {Object} data All data needed for crawling the links. + * @param {String} data.host The host from the initial page URL. + * @param {String} data.link The link to crawl. + * @param {Array.} data.foundLinks An array of links, which have been already discovered. + * @param {RegExp|null} data.exclude A regular expression pattern to exclude links. Null by default to not exclude anything. + * @param {Number} data.depth Defines how many nested page levels should be examined. Infinity by default. + * @param {Function} data.onProgress Callback called every time just before opening a new link. + */ +async function openLink( page, { host, link, foundLinks, exclude, depth, onProgress } ) { + // Inform progress handler about current number of total discovered links. + onProgress( { + total: foundLinks.length + } ); + + try { + // Consider navigation to be finished when there are no network connections for at least 500 ms. + await page.goto( link, { waitUntil: 'networkidle0' } ); + } catch ( err ) { + // Page opening failure is already covered by the `requestfailed` event. + return; + } + + // Skip crawling deeper, if the bottom has been reached. + if ( depth === 0 ) { + return; + } + + // Callback function executed in the page context to return an unique list of links. + const evaluatePage = anchors => [ ...new Set( anchors + .filter( anchor => /http(s)?:/.test( anchor.protocol ) ) + .map( anchor => `${ anchor.origin }${ anchor.pathname }` ) ) + ]; + + // Collect unique links from the page body. + const links = ( await page.$$eval( 'body a[href]', evaluatePage ) ) + .filter( link => { + // Skip external link. + if ( new URL( link ).host !== host ) { + return false; + } + + // Skip already discovered link. + if ( foundLinks.includes( link ) ) { + return false; + } + + // Skip explicitly excluded link. + if ( exclude && exclude.test( link ) ) { + return false; + } + + return true; + } ); + + // Remember new links to avoid loops in subsequent pages. + links.forEach( link => foundLinks.push( link ) ); + + // Visit all new links sequentially. + for ( const link of links ) { + await openLink( page, { + host, + link, + foundLinks, + exclude, + depth: depth - 1, + onProgress + } ); + } +} + +/** + * Analyzes collected errors and logs them in the console. + * + * @param {Map} errors All found errors grouped by their type. + */ +function logErrors( errors ) { + if ( !errors.size ) { + console.log( chalk.green.bold( '\n✨ No errors have been found.' ) ); + return; + } + + console.log( chalk.red.bold( '\n🔥 The following errors have been found:' ) ); + + for ( const [ errorType, errorCollection ] of errors ) { + const numberOfErrors = Object.keys( errorCollection.errors ).length; + const numberOfErrorOccurrences = errorCollection.total; + const separator = chalk.gray( ' ➜ ' ); + const errorName = chalk.bgRed.white.bold( ` ${ errorType.description.toUpperCase() } ` ); + const errorSummary = chalk.red( + `${ chalk.bold( numberOfErrors ) } error(s), occurred ${ chalk.bold( numberOfErrorOccurrences ) } time(s) in total` + ); + + console.group( `\n${ errorName } ${ separator } ${ errorSummary }` ); + + Object.entries( errorCollection.errors ).forEach( ( [ message, error ] ) => { + console.group( `\n❌ ${ message }` ); + + console.log( chalk.red( `\n…occurred ${ chalk.bold( error.total ) } time(s) on the following page(s):` ) ); + + error.pages.forEach( page => console.log( chalk.gray( `➥ ${ page }` ) ) ); + + console.groupEnd(); + } ); + + console.groupEnd(); + } +} + +/** + * Parses CLI arguments and prepares configuration for the crawler. + * + * @param {Array.} args CLI arguments and options. + * @returns {Object} options + * @returns {String} options.url The URL to start crawling. + * @returns {Number} options.depth Defines how many nested page levels should be examined. Infinity by default. + * @returns {RegExp|null} options.exclude A regular expression pattern to exclude links. Null by default to not exclude anything. + */ +function parseArguments( args ) { + const config = { + string: [ + 'url', + 'depth', + 'exclude' + ], + + boolean: [ + 'docs', + 'manual' + ], + + alias: { + u: 'url', + d: 'depth', + e: 'exclude' + } + }; + + const parsedOptions = minimist( args, config ); + + if ( parsedOptions.docs && parsedOptions.manual ) { + throw new Error( 'Mutually exclusive --docs and --manual arguments.' ); + } + + const defaultOptionsForDocs = minimist( '-u http://fake.ckeditor.com:8080/ckeditor5/ -e /api/,/assets/'.split( ' ' ), config ); + const defaultOptionsForManual = minimist( '-u http://localhost:8125/ -d 1'.split( ' ' ), config ); + const options = {}; + + if ( parsedOptions.docs ) { + Object.assign( options, defaultOptionsForDocs, parsedOptions ); + } + + if ( parsedOptions.manual ) { + Object.assign( options, defaultOptionsForManual, parsedOptions ); + } + + if ( !options.url ) { + throw new Error( 'Missing required --url argument.' ); + } + + return { + url: options.url, + depth: options.depth ? Number( options.depth ) : Infinity, + exclude: options.exclude ? new RegExp( options.exclude.replace( ',', '|' ) ) : null + }; +} diff --git a/src/clipboard.js b/src/clipboard.js new file mode 100644 index 00000000000..53b3cfe9a34 --- /dev/null +++ b/src/clipboard.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/clipboard + */ + +export * from '@ckeditor/ckeditor5-clipboard'; diff --git a/src/cloud-services-core.js b/src/cloud-services-core.js new file mode 100644 index 00000000000..929fc599400 --- /dev/null +++ b/src/cloud-services-core.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/cloud-services-core + */ + +export * from '@ckeditor/ckeditor-cloud-services-core'; diff --git a/src/core.js b/src/core.js new file mode 100644 index 00000000000..063085e8a21 --- /dev/null +++ b/src/core.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/core + */ + +export * from '@ckeditor/ckeditor5-core'; diff --git a/src/engine.js b/src/engine.js new file mode 100644 index 00000000000..42f5d9065bb --- /dev/null +++ b/src/engine.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/engine + */ + +export * from '@ckeditor/ckeditor5-engine'; diff --git a/src/enter.js b/src/enter.js new file mode 100644 index 00000000000..4c21c595b5a --- /dev/null +++ b/src/enter.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/enter + */ + +export * from '@ckeditor/ckeditor5-enter'; diff --git a/src/paragraph.js b/src/paragraph.js new file mode 100644 index 00000000000..6049218239f --- /dev/null +++ b/src/paragraph.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/paragraph + */ + +export * from '@ckeditor/ckeditor5-paragraph'; diff --git a/src/select-all.js b/src/select-all.js new file mode 100644 index 00000000000..cd9ca317c89 --- /dev/null +++ b/src/select-all.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/select-all + */ + +export * from '@ckeditor/ckeditor5-select-all'; diff --git a/src/typing.js b/src/typing.js new file mode 100644 index 00000000000..9b4c6b551d9 --- /dev/null +++ b/src/typing.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/typing + */ + +export * from '@ckeditor/ckeditor5-typing'; diff --git a/src/ui.js b/src/ui.js new file mode 100644 index 00000000000..efdaf66edad --- /dev/null +++ b/src/ui.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/ui + */ + +export * from '@ckeditor/ckeditor5-ui'; diff --git a/src/undo.js b/src/undo.js new file mode 100644 index 00000000000..7bebc0f7318 --- /dev/null +++ b/src/undo.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/undo + */ + +export * from '@ckeditor/ckeditor5-undo'; diff --git a/src/upload.js b/src/upload.js new file mode 100644 index 00000000000..74288e8a7a8 --- /dev/null +++ b/src/upload.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/upload + */ + +export * from '@ckeditor/ckeditor5-upload'; diff --git a/src/utils.js b/src/utils.js new file mode 100644 index 00000000000..1fe3782990a --- /dev/null +++ b/src/utils.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/utils + */ + +export * from '@ckeditor/ckeditor5-utils'; diff --git a/src/widget.js b/src/widget.js new file mode 100644 index 00000000000..156c1de78ee --- /dev/null +++ b/src/widget.js @@ -0,0 +1,10 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ckeditor5/widget + */ + +export * from '@ckeditor/ckeditor5-widget'; diff --git a/tests/dll.js b/tests/dll.js new file mode 100644 index 00000000000..c593b5fe404 --- /dev/null +++ b/tests/dll.js @@ -0,0 +1,52 @@ +/** + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +import * as clipboardBase from '@ckeditor/ckeditor5-clipboard'; +import * as clipboardDLL from '../src/clipboard'; +import * as coreBase from '@ckeditor/ckeditor5-core'; +import * as coreDLL from '../src/core'; +import * as engineBase from '@ckeditor/ckeditor5-engine'; +import * as engineDLL from '../src/engine'; +import * as enterBase from '@ckeditor/ckeditor5-enter'; +import * as enterDLL from '../src/enter'; +import * as paragraphBase from '@ckeditor/ckeditor5-paragraph'; +import * as paragraphDLL from '../src/paragraph'; +import * as selectallBase from '@ckeditor/ckeditor5-select-all'; +import * as selectallDLL from '../src/select-all'; +import * as typingBase from '@ckeditor/ckeditor5-typing'; +import * as typingDLL from '../src/typing'; +import * as uiBase from '@ckeditor/ckeditor5-ui'; +import * as uiDLL from '../src/ui'; +import * as undoBase from '@ckeditor/ckeditor5-undo'; +import * as undoDLL from '../src/undo'; +import * as uploadBase from '@ckeditor/ckeditor5-upload'; +import * as uploadDLL from '../src/upload'; +import * as utilsBase from '@ckeditor/ckeditor5-utils'; +import * as utilsDLL from '../src/utils'; +import * as widgetBase from '@ckeditor/ckeditor5-widget'; +import * as widgetDLL from '../src/widget'; + +describe( 'CKEditor DLL', () => { + testEqualExports( 'clipboard', clipboardBase, clipboardDLL ); + testEqualExports( 'core', coreBase, coreDLL ); + testEqualExports( 'engine', engineBase, engineDLL ); + testEqualExports( 'enter', enterBase, enterDLL ); + testEqualExports( 'paragraph', paragraphBase, paragraphDLL ); + testEqualExports( 'selectall', selectallBase, selectallDLL ); + testEqualExports( 'typing', typingBase, typingDLL ); + testEqualExports( 'ui', uiBase, uiDLL ); + testEqualExports( 'undo', undoBase, undoDLL ); + testEqualExports( 'upload', uploadBase, uploadDLL ); + testEqualExports( 'utils', utilsBase, utilsDLL ); + testEqualExports( 'widget', widgetBase, widgetDLL ); + + function testEqualExports( testedLib, base, dll ) { + it( 'should load everything from ' + testedLib, () => { + for ( const exportName of Object.keys( base ) ) { + expect( base[ exportName ], exportName ).to.equal( dll[ exportName ] ); + } + } ); + } +} ); diff --git a/tests/manual/all-features.js b/tests/manual/all-features.js index 1fddee32916..60e6dc327a4 100644 --- a/tests/manual/all-features.js +++ b/tests/manual/all-features.js @@ -39,6 +39,8 @@ import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformatio import TodoList from '@ckeditor/ckeditor5-list/src/todolist'; import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline'; import WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -52,7 +54,8 @@ ClassicEditor AutoLink, Mention, TextTransformation, Alignment, IndentBlock, PasteFromOffice, PageBreak, HorizontalLine, - SpecialCharacters, SpecialCharactersEssentials, WordCount + SpecialCharacters, SpecialCharactersEssentials, WordCount, + ImageUpload, CloudServices ], toolbar: [ 'heading', diff --git a/tests/manual/mathtype.js b/tests/manual/mathtype.js index 1c59825906f..9794e4eb45e 100644 --- a/tests/manual/mathtype.js +++ b/tests/manual/mathtype.js @@ -20,6 +20,9 @@ import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import Mention from '@ckeditor/ckeditor5-mention/src/mention'; import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; + import MathType from '@wiris/mathtype-ckeditor5'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -35,6 +38,8 @@ ClassicEditor Code, Subscript, Superscript, + ImageUpload, + CloudServices, EasyImage, Font, Highlight, diff --git a/tests/manual/memory/memory.js b/tests/manual/memory/memory.js index 7c04ade513c..9888249f5f5 100644 --- a/tests/manual/memory/memory.js +++ b/tests/manual/memory/memory.js @@ -32,6 +32,8 @@ import Mention from '@ckeditor/ckeditor5-mention/src/mention'; import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat'; import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'; import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -49,7 +51,7 @@ function initEditor() { TableProperties, TableCellProperties, SpecialCharacters, SpecialCharactersEssentials, Code, Underline, Strikethrough, Superscript, Subscript, Highlight, FontColor, FontBackgroundColor, FontFamily, FontSize, - IndentBlock, WordCount, EasyImage, + IndentBlock, WordCount, ImageUpload, CloudServices, EasyImage, TodoList, PageBreak, HorizontalLine, Mention, RemoveFormat, TextTransformation ], toolbar: [ diff --git a/tests/manual/wproofreader.js b/tests/manual/wproofreader.js index 0819a178b35..04ddab3f390 100644 --- a/tests/manual/wproofreader.js +++ b/tests/manual/wproofreader.js @@ -20,6 +20,8 @@ import Indent from '@ckeditor/ckeditor5-indent/src/indent'; import Mention from '@ckeditor/ckeditor5-mention/src/mention'; import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat'; +import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload'; +import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices'; import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config'; @@ -34,6 +36,8 @@ ClassicEditor Code, Subscript, Superscript, + ImageUpload, + CloudServices, EasyImage, Font, Highlight,