Skip to content

Commit

Permalink
Merge branch 'master' into t/19
Browse files Browse the repository at this point in the history
  • Loading branch information
johanzandstra authored Oct 9, 2019
2 parents 528acdc + a6408d8 commit ac91106
Show file tree
Hide file tree
Showing 76 changed files with 1,052 additions and 384 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @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
*/

/* eslint-env node */
Expand Down
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
sudo: required
dist: trusty
dist: xenial
addons:
chrome: stable
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: node_js
services:
- xvfb
node_js:
- '8'
cache:
yarn: true
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- export START_TIME=$( date +%s )
- npm i -g yarn
install:
- yarn add @ckeditor/ckeditor5-dev-tests
Expand All @@ -23,10 +20,12 @@ script:
- ckeditor5-dev-tests-travis
after_success:
- ckeditor5-dev-tests-save-revision
env:
global:
- secure: cV2+JsJxfc3+J3I9ICdW+VH2lm3XYtcCxb43NcHXrYEYZ4oNGgemSEL+WOp25QKm52eLxmOULzKTNW5eJbNk0EGB8Im4hvRDvMEL8uzcKM+io33nOmUdEML7i1tihlr2C0aOGI+7DOGFIm3rWGItUXcCLWyb3E1zQiOsaDmhzwdDBqDQqug3i3US4l9d39IFO/rdfoZpWhUCKdEfV/gNp6lqPN/Y7P7VPu72k+hRm+fxaQcPNOB5xN+XLWy9vbegqw730EBVJ7e+dMGXAqdJHZxNHwF+aBwHaC5BhqeFfli0nTMH1P5g30t4VVxJfvMNBpj1vQ09UAGDkUWF5L/F8ey3pym+ntkyr+dDifLCbDbybbiwjEH0flX5FSTGBiLhw5loKeTlHoaM/vfKnJoB9rVQkmIw1NVgW/zb1KtFkg/zyJn4CQgg9hKQS07HWHOHO9oDOngB3qPEpBmFcVC4CQBpnycEv3mhghM5Z/cxgQ4cifnt5jybp/ksUyFBNIc61IbRFKBJnw+WXxKTauNRrMu9FiON8g+NW5hzhCaa2r7pmlJS7GU4JWa4mJc+5jAtoYVYCCFKFiP4JmEt/AVnO6ZiuETdl7tTsu9fXF6WFBDCAZDf76xIxv3glLtuG1AaetDPxTEx14/XNIDGiCIExMvfL1aZCUmL0Zg6n3KZOc8=
- secure: PpyiVJhDey9v+VK8FFHZugfCiyr8JluPSCrrUP71DqGmaxJi4V2i3mRmowX2vznJtvnCjLAOfPCireD2CLqCQk1evohV/iOsIvdsvOqmn5wAF32SQbsYIj2FFQaK09uWW1Oxxu4VfbHjpsh4S7Gy+fEmed7nQyvBno3v5YH/Qm6vYa6BJLrSeiFyUGkuRjGeIt+cXrMFJJ3qqGh7tZFMkn0mW0KSkcdB7yauYWs2TfeJMkea6WVJ5XU0r9t5KPlSLgQuNixtaAvKN/oHMSCBAIM9okRoM1gOlErk7dgo21VZ4ThVhylil6ib3iGx84xCGYiR8MNBZ74yr7/xFbGQaaJID5ABZDYiT8VcGH1aZjWeN4yM/ZdEiXgkYaxSLNkqAbr0SSKbNyp/LrKvvcI9UKGTqbqEd86BU+K0VEfFcDj1O/0nHWFW6CkFBDAJ6JYlaV/GXoziWlmSBxfyME4rVA1FE3p04KH/T+kDwDaJ0gKctVRxQJdSYSpn89f51V+puvylZ02jq2LiJlKl8dygJRb6c/uFcQdRWCHbkUlCaTmFivCAh1x5njs5k+az6FDmmIs2ZxzbVObC+skvgtAJ4c5aTcOVJVXB4DLaMyDkXivn4E5zJj0C/LVPl/+rWWucyEiBJ0oTz1dsWCXdQiMj8TEjm6nuXkH7Hi+sfTH3EJI=
branches:
except:
- stable
after_script:
- export END_TIME=$( date +%s )
- ckeditor5-dev-tests-notify-travis-status
env:
global:
- secure: vRCJKaWSwGdlHfNQpQqrADr5BkoZ8C8DiIhzKRszvb4ZHeGpf09whNvzKKaP/57c3XfF+CW0Cfbu17Im7U7tmynLqb4nPLJycO6U7vRWYF6iaJjgQGiTLl2uGQLM+AIMPZpE9I1a1ZbL7J9+uV8anaDGmHn2Wj9rryHi++93z/kim1lSFkpD4I/6qkeBZYmhsXiM6XaqpsF6ysK59FzQReenFVZ8qoM0s+srf9PPbsysWJuN7jgKxfHDT4IdxtUG/OsXaRzMhoKRC54YV8ell+pBg2MMZBGln/dR0lKYmHV0+6MrDBQULm4OvogZtFMwn67T6u9Th9aNJoUrlaDlZPNLOls1ZAeG3W16S8mjoy6LaCea7VAUkXcLbswXMV9T546+1sQD+RmSE2ybpQXv6VUL9pOonr/hHogbeto+/D6aEqEwHpHeH9qFjqpeOVneWxor9t02KMm4WAGk3hHk//MiD9UFvqsFLybLVeF0T2UzffKqsBPfgjJgeP2+6vazZjKuBhTrNSvEYfDnV4Odfx0L6KhYQuWztfzJBD6uhTkGvBIB18u2/m8FrgUh8G6O+L3YSizfCyLv5zdDm5C7Jgh+ODDjB+35PrYuTe49zgFQoWoFYBA7qXLn3Re7GOtVPYnVJF5WpJhiD/liSjI7YMhyv1c3eIhkxmL2+k1RwCg=
48 changes: 48 additions & 0 deletions CHANGELOG.md
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.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
CKEditor 5 paste from Office feature
==================================

[![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-paste-from-office.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-paste-from-office)
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-paste-from-office.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-paste-from-office)
[![BrowserStack Status](https://automate.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://automate.browserstack.com/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-paste-from-office/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-paste-from-office?branch=master)
<br>
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-paste-from-office/status.svg)](https://david-dm.org/ckeditor/ckeditor5-paste-from-office)
Expand All @@ -20,4 +18,4 @@ See the [`@ckeditor/ckeditor5-paste-from-office` package](https://docs.ckeditor.

## License

Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file.
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
26 changes: 22 additions & 4 deletions docs/_snippets/features/build-paste-from-office-source.js
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;
81 changes: 1 addition & 80 deletions docs/_snippets/features/paste-from-office.html
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>,&nbsp;have provided in the “Implement Rich Text Editor” project.&nbsp;</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>&nbsp;</p>

<p>Best regards,</p>

<p><i>The Management</i></p>
</div>
<div id="snippet-paste-from-office"></div>
3 changes: 2 additions & 1 deletion docs/_snippets/features/paste-from-office.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @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 ClassicEditor, console, window, document */
Expand All @@ -9,6 +9,7 @@ import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud

ClassicEditor
.create( document.querySelector( '#snippet-paste-from-office' ), {
placeholder: 'Paste the content here to test the feature.',
cloudServices: CS_CONFIG
} )
.then( editor => {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/paste-from-office.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ The source code of this package is available on GitHub in https://github.com/cke

* [`@ckeditor/ckeditor5-paste-from-office` on npm](https://www.npmjs.com/package/@ckeditor/ckeditor5-paste-from-office)
* [`ckeditor/ckeditor5-paste-from-office` on GitHub](https://github.com/ckeditor/ckeditor5-paste-from-office)
* [Issue tracker](https://github.com/ckeditor/ckeditor5-paste-from-office/issues)
* [Issue tracker](https://github.com/ckeditor/ckeditor5/issues)
* [Changelog](https://github.com/ckeditor/ckeditor5-paste-from-office/blob/master/CHANGELOG.md)
77 changes: 77 additions & 0 deletions docs/features/paste-from-google-docs.md
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!

Loading

0 comments on commit ac91106

Please sign in to comment.