forked from ckeditor/ckeditor5-paste-from-office
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
1,052 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,54 @@ | ||
Changelog | ||
========= | ||
|
||
## [11.1.0](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v11.0.4...v11.1.0) (2019-08-26) | ||
|
||
### Features | ||
|
||
* Prevent of bolding entire content pasted from Google Docs. Closes [#61](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/61). ([8102de3](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/8102de3)) | ||
* Provide support for pasting lists from Google Docs. Closes [#69](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/69). ([6ad2a62](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/6ad2a62)) | ||
|
||
### Other changes | ||
|
||
* The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([22edb90](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/22edb90)) | ||
|
||
|
||
## [11.0.4](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v11.0.3...v11.0.4) (2019-07-10) | ||
|
||
Internal changes only (updated dependencies, documentation, etc.). | ||
|
||
|
||
## [11.0.3](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v11.0.2...v11.0.3) (2019-07-04) | ||
|
||
Internal changes only (updated dependencies, documentation, etc.). | ||
|
||
|
||
## [11.0.2](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v11.0.1...v11.0.2) (2019-06-05) | ||
|
||
### Other changes | ||
|
||
* Loosen a dependency of a clipboard plugin in the paste from Office plugin so that it can be overridden. Closes [#56](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/56). ([561f22b](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/561f22b)) | ||
|
||
|
||
## [11.0.1](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v11.0.0...v11.0.1) (2019-04-10) | ||
|
||
Internal changes only (updated dependencies, documentation, etc.). | ||
|
||
|
||
## [11.0.0](https://github.com/ckeditor/ckeditor5-paste-from-office/compare/v10.0.0...v11.0.0) (2019-02-28) | ||
|
||
### Bug fixes | ||
|
||
* Ensured correct lists ordering for separate list items with the same `mso-list` id. Closes [#43](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/43). ([4ebc363](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/4ebc363)) | ||
* Handle "spacerun spans" with mixed whitespaces. Closes [#49](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/49). Closes [#50](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/50). ([7fb132f](https://github.com/ckeditor/ckeditor5-paste-from-office/commit/7fb132f)) | ||
|
||
Huge thanks to [Matt Kobs](https://github.com/kobsy) for this contribution! | ||
|
||
### BREAKING CHANGES | ||
|
||
* Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c)) | ||
|
||
|
||
## [10.0.0](https://github.com/ckeditor/ckeditor5-paste-from-office/tree/v10.0.0) (2018-12-05) | ||
|
||
Initial implementation of the Paste from Office feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals window */ | ||
|
||
import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor'; | ||
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'; | ||
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; | ||
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment'; | ||
import Code from '@ckeditor/ckeditor5-basic-styles/src/code'; | ||
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough'; | ||
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript'; | ||
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript'; | ||
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline'; | ||
import Font from '@ckeditor/ckeditor5-font/src/font'; | ||
import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight'; | ||
import Indent from '@ckeditor/ckeditor5-indent/src/indent'; | ||
|
||
ClassicEditor.builtinPlugins.push( Alignment ); | ||
ClassicEditor.builtinPlugins.push( PasteFromOffice ); | ||
ClassicEditor.builtinPlugins.push( | ||
Alignment, | ||
PasteFromOffice, | ||
Code, | ||
Strikethrough, | ||
Subscript, | ||
Superscript, | ||
Underline, | ||
Font, | ||
Highlight, | ||
Indent | ||
); | ||
|
||
window.ClassicEditor = ClassicEditor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1 @@ | ||
<div id="snippet-paste-from-office"> | ||
<h2 style="text-align:center;">Recognition of Achievement</h2> | ||
|
||
<p style="text-align:justify;">This letter acknowledges the invaluable input <strong>you</strong>, as a member of our <i>Innovation Team</i>, have provided in the “Implement Rich Text Editor” project. </p> | ||
|
||
<ul> | ||
<li>Paste from Office feature,</li> | ||
<li>Tracking changes feature,</li> | ||
<li>Comments feature.</li> | ||
</ul> | ||
|
||
<p style="text-align:justify;">The Management would like to hereby thank you for this great accomplishment that was delivered in a timely fashion, up to the highest company standards, and with great results:</p> | ||
|
||
<figure class="table"> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td> | ||
<p style="text-align:center;"><strong>Project Phase</strong></p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;"><strong>Deadline</strong></p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;"><strong>Status</strong></p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<p>Phase 1: Market research</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">2018-10-15</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">✓</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<p>Phase 2: Editor implementation</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">2018-10-20</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">✓</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<p>Phase 3: Rollout to Production</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">2018-10-22</p> | ||
</td> | ||
<td> | ||
<p style="text-align:center;">✓</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</figure> | ||
|
||
<p style="text-align:justify;">The project that you participated in is of utmost importance to the future success of our platform. We are very proud to share that the CKEditor implementation was a huge success and brought congratulations from both the key Stakeholders and the Customers:</p> | ||
|
||
<p style="text-align:center;"><i>This new editor has totally changed our content creation experience!</i></p> | ||
|
||
<p style="text-align:center;"><i>— John F. Smith, CEO, The New Web</i></p> | ||
|
||
<p style="text-align:justify;">This letter recognizes that much of our success is directly attributable to your efforts. You deserve to be proud of your achievement. May your future efforts be equally successful and rewarding.</p> | ||
|
||
<p style="text-align:justify;">I am sure we will be seeing and hearing a great deal more about your accomplishments in the future. Keep up the good work!</p> | ||
|
||
<p> </p> | ||
|
||
<p>Best regards,</p> | ||
|
||
<p><i>The Management</i></p> | ||
</div> | ||
<div id="snippet-paste-from-office"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
menu-title: Paste from Google Docs | ||
category: features-pasting | ||
order: 20 | ||
--- | ||
|
||
{@snippet features/build-paste-from-office-source} | ||
|
||
# Pasting content from Google Docs | ||
|
||
The Paste from Google Docs feature is provided through the {@link module:paste-from-office/pastefromoffice~PasteFromOffice} plugin. | ||
|
||
This feature allows you to paste content from Google Docs and maintain the original structure and formatting. After creating a document in Google Docs you can simply copy it to CKEditor 5 and retain basic text styling, heading levels, links, lists, tables and images. | ||
|
||
When the plugin is enabled, it automatically detects Google Docs content and transforms its structure and formatting to clean HTML which is then transformed into semantic content by the editor. | ||
|
||
<info-box info> | ||
The Paste from Office plugin only preserves content formatting and structures that are included in your CKEditor 5 build. This means that you may need to add missing features such as font color or text alignment to your build. Read more in the [Automatic content filtering](#automatic-content-filtering) section below. | ||
</info-box> | ||
|
||
<info-box info> | ||
The {@link module:paste-from-office/pastefromoffice~PasteFromOffice} plugin also allows you to paste content from Microsoft Word. See the {@link features/paste-from-word Pasting content from Microsoft Word} guide to learn more. | ||
</info-box> | ||
|
||
## Demo | ||
|
||
To test how Paste from Office works, open the [sample Google Docs document](https://docs.google.com/document/d/1a9YzJidjxRPrxY9BL4ZReNFkPAgd_ItnZoFxcjSiJ4U/edit?usp=sharing), open it, copy the content, and paste it into CKEditor 5 below. | ||
|
||
{@snippet features/paste-from-office} | ||
|
||
## Automatic content filtering | ||
|
||
With CKEditor 5 you do not need to worry about pasting messy content from Google Docs (or any other possible sources). Thanks to the CKEditor 5 {@link framework/guides/overview custom data model}, only content which is specifically handled by the loaded rich-text editor features will be preserved. | ||
|
||
This means that if you did not enable, for instance, {@link features/font font family and font size} features, this sort of formatting will be automatically stripped off when you paste content from Google Docs and other sources (e.g. other websites). | ||
|
||
## Installation | ||
|
||
<info-box info> | ||
This feature is enabled by default in all official builds. The installation instructions are for developers interested in building their own custom rich-text editor. | ||
</info-box> | ||
|
||
To add this feature to your rich-text editor, install the [`@ckeditor/ckeditor5-paste-from-office`](https://www.npmjs.com/package/@ckeditor/ckeditor5-paste-from-office) package: | ||
|
||
```bash | ||
npm install --save @ckeditor/ckeditor5-paste-from-office | ||
``` | ||
|
||
Then add the {@link module:paste-from-office/pastefromoffice~PasteFromOffice `PasteFromOffice`} plugin to your plugin list: | ||
|
||
```js | ||
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ PasteFromOffice, Bold, ... ] | ||
} ) | ||
.then( ... ) | ||
.catch( ... ); | ||
``` | ||
|
||
## Support for other applications | ||
|
||
At the current stage, the focus of the `@ckeditor/ckeditor5-paste-from-office` package is on supporting content that comes from {@link features/paste-from-word Microsoft Word} and Google Docs. However, it does not mean that pasting from other similar applications (such as Microsoft Excel) is not supported. | ||
|
||
By default, CKEditor 5 will support pasting rich-text content from these applications, however, some styles and formatting may be lost, depending on the source application. Also, other minor bugs may appear. | ||
|
||
You can find more information regarding compatibility with other applications in [this ticket](https://github.com/ckeditor/ckeditor5/issues/1184#issuecomment-409828069). | ||
|
||
If you think that support for any of the applications needs improvements, please add 👍 and comments in the following issues: | ||
|
||
* [Support pasting from Excel](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/23). | ||
* [Support pasting from Libre Office](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/35). | ||
* [Support pasting from Pages](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/36). | ||
|
||
Feel free to open a [new feature request](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/new) for other similar applications, too! | ||
|
Oops, something went wrong.