Browse Source

Remove unused normalization tests from Google Docs lists fixtures.

Maciej Gołaszewski 6 years ago
parent
commit
f96abc02bf

+ 12 - 0
packages/ckeditor5-paste-from-office/CHANGELOG.md

@@ -1,6 +1,18 @@
 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.).

+ 1 - 80
packages/ckeditor5-paste-from-office/docs/_snippets/features/paste-from-office.html

@@ -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>

+ 1 - 0
packages/ckeditor5-paste-from-office/docs/_snippets/features/paste-from-office.js

@@ -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 => {

+ 76 - 0
packages/ckeditor5-paste-from-office/docs/features/paste-from-google-docs.md

@@ -0,0 +1,76 @@
+---
+menu-title: Paste from Google Docs
+category: features-pasting
+---
+
+{@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!
+

+ 11 - 8
packages/ckeditor5-paste-from-office/docs/features/paste-from-word.md

@@ -1,6 +1,6 @@
 ---
 menu-title: Paste from Word
-category: features
+category: features-pasting
 ---
 
 {@snippet features/build-paste-from-office-source}
@@ -9,7 +9,7 @@ category: features
 
 The Paste from Word feature is provided through the {@link module:paste-from-office/pastefromoffice~PasteFromOffice} plugin.
 
-This feature allows you to paste content from Microsoft Word and maintain the original structure and formatting. After creating a document in Microsoft Word you can simply copy it to CKEditor and retain basic text styling, heading levels, links, lists, tables and images.
+This feature allows you to paste content from Microsoft Word and maintain the original structure and formatting. After creating a document in Microsoft Word 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 Word content and transforms its structure and formatting to clean HTML which is then transformed into semantic content by the editor.
 
@@ -17,9 +17,13 @@ When the plugin is enabled, it automatically detects Word content and transforms
 	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 Google Docs. See the {@link features/paste-from-google-docs Pasting content from Google Docs} guide to learn more.
+</info-box>
+
 ## Demo
 
-To test how Paste from Office works, download the [sample Word document](../assets/CKEditor5.PFO.Sample.Recognition_of_Achievement.docx), open it in Microsoft Word, copy the content and paste it into CKEditor 5 below.
+To test how Paste from Office works, download the [sample Word document](../../assets/CKEditor5.PFO.Sample.Recognition_of_Achievement.docx), open it in Microsoft Word, copy the content, and paste it into CKEditor 5 below.
 
 {@snippet features/paste-from-office}
 
@@ -54,19 +58,18 @@ ClassicEditor
 	.catch( ... );
 ```
 
-## Support for other office applications
+## 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 Microsoft Word. However, it does not mean that pasting from other office applications (such as Microsoft Excel or Google Docs) is not supported.
+At the current stage, the focus of the `@ckeditor/ckeditor5-paste-from-office` package is on supporting content that comes from Microsoft Word and {@link features/paste-from-google-docs 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 office applications needs improvements, please add 👍 and comments in the following issues:
+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 Google Docs](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/20).
 * [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 office applications, too!
+Feel free to open a [new feature request](https://github.com/ckeditor/ckeditor5-paste-from-office/issues/new) for other similar applications, too!

+ 17 - 17
packages/ckeditor5-paste-from-office/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-paste-from-office",
-  "version": "11.0.4",
+  "version": "11.1.0",
   "description": "Paste from Office feature for CKEditor 5.",
   "keywords": [
     "ckeditor",
@@ -10,23 +10,23 @@
     "ckeditor5-plugin"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-clipboard": "^12.0.1",
-    "@ckeditor/ckeditor5-core": "^12.2.1",
-    "@ckeditor/ckeditor5-engine": "^13.2.1"
+    "@ckeditor/ckeditor5-clipboard": "^12.0.2",
+    "@ckeditor/ckeditor5-core": "^12.3.0",
+    "@ckeditor/ckeditor5-engine": "^14.0.0"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-basic-styles": "^11.1.3",
-    "@ckeditor/ckeditor5-cloud-services": "^11.0.4",
-    "@ckeditor/ckeditor5-easy-image": "^11.0.4",
-    "@ckeditor/ckeditor5-editor-classic": "^12.1.3",
-    "@ckeditor/ckeditor5-enter": "^11.0.4",
-    "@ckeditor/ckeditor5-heading": "^11.0.4",
-    "@ckeditor/ckeditor5-image": "^13.1.2",
-    "@ckeditor/ckeditor5-link": "^11.1.1",
-    "@ckeditor/ckeditor5-list": "^12.0.4",
-    "@ckeditor/ckeditor5-paragraph": "^11.0.4",
-    "@ckeditor/ckeditor5-table": "^13.0.2",
-    "@ckeditor/ckeditor5-utils": "^13.0.1",
+    "@ckeditor/ckeditor5-basic-styles": "^11.1.4",
+    "@ckeditor/ckeditor5-cloud-services": "^11.0.5",
+    "@ckeditor/ckeditor5-easy-image": "^11.0.5",
+    "@ckeditor/ckeditor5-editor-classic": "^12.1.4",
+    "@ckeditor/ckeditor5-enter": "^11.1.0",
+    "@ckeditor/ckeditor5-heading": "^11.0.5",
+    "@ckeditor/ckeditor5-image": "^14.0.0",
+    "@ckeditor/ckeditor5-link": "^11.1.2",
+    "@ckeditor/ckeditor5-list": "^12.1.0",
+    "@ckeditor/ckeditor5-paragraph": "^11.0.5",
+    "@ckeditor/ckeditor5-table": "^14.0.0",
+    "@ckeditor/ckeditor5-utils": "^14.0.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^2.0.0",
     "husky": "^1.3.1",
@@ -39,7 +39,7 @@
   "author": "CKSource (http://cksource.com/)",
   "license": "GPL-2.0-or-later",
   "homepage": "https://ckeditor.com/ckeditor-5",
-  "bugs": "https://github.com/ckeditor/ckeditor5-paste-from-office/issues",
+  "bugs": "https://github.com/ckeditor/ckeditor5/issues",
   "repository": {
     "type": "git",
     "url": "https://github.com/ckeditor/ckeditor5-paste-from-office.git"

+ 0 - 10
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/index.js

@@ -4,19 +4,15 @@
  */
 
 import nestedOrderedList from './nested-ordered-lists/input.html';
-import nestedOrderedListNormalized from './nested-ordered-lists/normalized.html';
 import nestedOrderedListModel from './nested-ordered-lists/model.html';
 
 import mixedList from './mixed-list/input.html';
-import mixedListNormalized from './mixed-list/normalized.html';
 import mixedListModel from './mixed-list/model.html';
 
 import repeatedlyNestedList from './repeatedly-nested-list/input.html';
-import repeatedlyNestedListNormalized from './repeatedly-nested-list/normalized.html';
 import repeatedlyNestedListModel from './repeatedly-nested-list/model.html';
 
 import partiallySelected from './partially-selected/input.html';
-import partiallySelectedNormalized from './partially-selected/normalized.html';
 import partiallySelectedModel from './partially-selected/model.html';
 
 export const fixtures = {
@@ -26,12 +22,6 @@ export const fixtures = {
 		repeatedlyNestedList,
 		partiallySelected
 	},
-	normalized: {
-		nestedOrderedList: nestedOrderedListNormalized,
-		mixedList: mixedListNormalized,
-		repeatedlyNestedList: repeatedlyNestedListNormalized,
-		partiallySelected: partiallySelectedNormalized
-	},
 	model: {
 		nestedOrderedList: nestedOrderedListModel,
 		mixedList: mixedListModel,

File diff suppressed because it is too large
+ 0 - 1
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/mixed-list/normalized.html


File diff suppressed because it is too large
+ 0 - 1
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/nested-ordered-lists/normalized.html


File diff suppressed because it is too large
+ 0 - 1
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/partially-selected/normalized.html


File diff suppressed because it is too large
+ 0 - 1
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/repeatedly-nested-list/normalized.html


+ 0 - 0
packages/ckeditor5-paste-from-office/tests/_data/paste-from-google-docs/lists/repeatedly-nested-list/repeatedly-nested-list.html