Explorar el Código

Fixes in paste as plain text guide. Paste plain text and clipboard observer API docs corrected.

Anna Tomanek hace 5 años
padre
commit
e17f32da16

+ 2 - 2
packages/ckeditor5-clipboard/docs/_snippets/features/paste-plain-text.html

@@ -5,10 +5,10 @@
 	<p><em>Italic type is a cursive font based on a stylized form of calligraphic handwriting. Owing to the influence from calligraphy, italics normally slant slightly to the right. One manual of English usage described italics as &quot;the print equivalent of underlining&quot;; in other words, underscore in a manuscript directs a typesetter to use italic.</em></p>
 	<p><em>Italics are a way to emphasize key points in a printed text, to identify many types of creative works, to cite foreign words or phrases, or, when quoting a speaker, a way to show which words they stressed.</em></p>
 	<h3>Bold type</h3>
-	<p><strong>A bold font weight makes letters of a text thicker than the surrounding text. It adds certain blackness to the type. Bold strongly stands out from regular text, and is often used to highlight keywords important to the text content.</strong></p>
+	<p><strong>A bold font weight makes the letters thicker than the surrounding text. It adds certain blackness to the type. Bold strongly stands out from the regular text, and is often used to highlight keywords important to the text content.</strong></p>
 	<p><strong>For example, printed dictionaries often use boldface for their keywords, and the names of entries can conventionally be marked in bold.</strong></p>
 	<h3>Underlined type</h3>
-	<p><u>Professional Western typesetting usually does not employ lines under letters for emphasis within running text, because it is considered too distracting.</u></p>
+	<p><u>Professional Western typesetting usually does not employ lines under letters for emphasis within running text because it is considered too distracting.</u></p>
 
 	<p><u>Underlining is, however, often used with typewriters, in handwriting, and with some non-alphabetic scripts. It is also used for secondary emphasis, i.e. marks added by the reader and not the author.</u></p>
 </div>

+ 3 - 3
packages/ckeditor5-clipboard/docs/features/paste-plaintext.md → packages/ckeditor5-clipboard/docs/features/paste-plain-text.md

@@ -29,12 +29,12 @@ CKEditor 5 supports a wider range of paste features, including:
 ## Installation
 
 <info-box info>
-	This feature is required by the Clipboard plugin and is enabled by default in all official builds. The installation instructions are for developers interested in building their own custom rich-text editor.
+	This feature is required by the clipboard plugin and 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-clipboard`](https://www.npmjs.com/package/@ckeditor/ckeditor5-clipboard) package:
 
-```bash
+```
 npm install --save @ckeditor/ckeditor5-clipboard
 ```
 
@@ -51,7 +51,7 @@ ClassicEditor
 	.catch( ... );
 ```
 
-{@link module:clipboard/clipboard~PastePlainText `PastePlainText`} plugin will activate along with the Clipboard plugin.
+The {@link module:clipboard/clipboard~PastePlainText `PastePlainText`} plugin will activate along with the clipboard plugin.
 
 ## Support for other applications
 

+ 35 - 35
packages/ckeditor5-clipboard/src/clipboardobserver.js

@@ -24,7 +24,7 @@ import DataTransfer from './datatransfer';
  * * {@link module:engine/view/document~Document#event:cut}
  *
  * Note that this observer is not available by default (it is not added by the engine).
- * To make it available it needs to be added to {@link module:engine/view/document~Document} by
+ * To make it available, it needs to be added to {@link module:engine/view/document~Document} by
  * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. You can also load the
  * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
  *
@@ -100,111 +100,111 @@ function getDropViewRange( view, domEvent ) {
 }
 
 /**
- * Fired as a continuation of {@link #event:paste} and {@link #event:drop} events.
+ * Fired as a continuation of the {@link #event:paste} and {@link #event:drop} events.
  *
  * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}.
  *
- * Fired with a `dataTransfer` which comes from the clipboard and which content should be processed
+ * Fired with a `dataTransfer` which comes from the clipboard and whose content should be processed
  * and inserted into the editor.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:clipboard/clipboardobserver~ClipboardObserver
  * @see module:clipboard/clipboard~Clipboard
  * @event module:engine/view/document~Document#event:clipboardInput
  * @param {Object} data Event data.
- * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer Data transfer instance.
+ * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance.
  * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  * (usually – into which the content should be inserted).
  * If clipboard input was triggered by a paste operation, then these are the selection ranges. If by a drop operation,
- * then it's the drop position (which can be different than the selection at the moment of drop).
+ * then it is the drop position (which can be different than the selection at the moment of drop).
  */
 
 /**
- * Fired when user drags content over one of the editables.
+ * Fired when the user drags the content over one of the editables.
  *
  * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:engine/view/document~Document#event:clipboardInput
  * @event module:engine/view/document~Document#event:dragover
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  */
 
 /**
- * Fired when user dropped content into one of the editables.
+ * Fired when the user dropped the content into one of the editables.
  *
  * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:engine/view/document~Document#event:clipboardInput
  * @event module:engine/view/document~Document#event:drop
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
  */
 
 /**
- * Fired when user pasted content into one of the editables.
+ * Fired when the user pasted the content into one of the editables.
  *
  * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:engine/view/document~Document#event:clipboardInput
  * @event module:engine/view/document~Document#event:paste
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  */
 
 /**
- * Fired when user copied content from one of the editables.
+ * Fired when the user copied the content from one of the editables.
  *
  * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:clipboard/clipboardobserver~ClipboardObserver
  * @event module:engine/view/document~Document#event:copy
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  */
 
 /**
- * Fired when user cut content from one of the editables.
+ * Fired when the user cut the content from one of the editables.
  *
  * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  *
- * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
- * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
- * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
+ * Note that this event is not available by default. To make it available, {@link module:clipboard/clipboardobserver~ClipboardObserver}
+ * needs to be added to the {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
+ * This is done by the {@link module:clipboard/clipboard~Clipboard} feature. If it is not loaded, it must be done manually.
  *
  * @see module:clipboard/clipboardobserver~ClipboardObserver
  * @event module:engine/view/document~Document#event:cut
- * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
+ * @param {module:clipboard/clipboardobserver~ClipboardEventData} data The event data.
  */
 
 /**
  * The value of the {@link module:engine/view/document~Document#event:paste},
  * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
  *
- * In order to access clipboard data use `dataTransfer` property.
+ * In order to access the clipboard data, use the `dataTransfer` property.
  *
  * @class module:clipboard/clipboardobserver~ClipboardEventData
  * @extends module:engine/view/observer/domeventdata~DomEventData
  */
 
 /**
- * Data transfer instance.
+ * The data transfer instance.
  *
  * @readonly
  * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer

+ 1 - 1
packages/ckeditor5-clipboard/src/pasteplaintext.js

@@ -14,7 +14,7 @@ import ClipboardObserver from './clipboardobserver';
 /**
  * The plugin detects user intentions for pasting plain text.
  *
- * For example, it detects <kbd>ctrl/cmd</kbd> + <kbd>shift</kbd> + <kbd>ctrl/v</kbd> keystroke.
+ * For example, it detects <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.
  *
  * @extends module:core/plugin~Plugin
  */

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

@@ -30,18 +30,18 @@ To test how Paste from Office works, open the [sample Google Docs document](http
 
 {@snippet features/paste-from-office}
 
+## Related features
+ 
+CKEditor 5 supports a wider range of paste features, including:
+* {@link features/paste-plain-text Paste plain text} &ndash; Paste text without formatting that will inherit the style of the content it was pasted into.
+* {@link features/paste-from-word Paste from Word} &ndash; Paste content from Microsoft Word and maintain the original structure and formatting.
+
 ## 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).
 
-## Related features
- 
-CKEditor 5 supports a wider range of paste features, including:
-* {@link features/paste-plaintext Paste plain text} &ndash; Detects when a plain text is pasted and acts accordingly.
-* {@link features/paste-from-word Paste from Word} &ndash; Allows you to paste content from Microsoft Word and maintain the original structure and formatting.
-
 ## Installation
 
 <info-box info>
@@ -50,7 +50,7 @@ CKEditor 5 supports a wider range of paste features, including:
 
 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
 ```
 

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

@@ -30,18 +30,18 @@ To test how Paste from Office works, download the [sample Word document](../../a
 
 {@snippet features/paste-from-office}
 
+## Related features
+ 
+CKEditor 5 supports a wider range of paste features, including:
+* {@link features/paste-from-google-docs Paste from Google Docs} &ndash; Paste content from Google Docs, maintaining the original formatting and structure.
+* {@link features/paste-plain-text Paste plain text} &ndash; Paste text without formatting that will inherit the style of the content it was pasted into.
+
 ## Automatic content filtering
 
 With CKEditor 5 you do not need to worry about pasting messy content from Microsoft Word (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 Microsoft Word and other sources (e.g. other websites).
 
-## Related features
- 
-CKEditor 5 supports a wider range of paste features, including:
-* {@link features/paste-from-google-docs Paste from Google Docs} &ndash; Allows you to paste content from Google Docs maintaining the original formatting and structure.
-* {@link features/paste-plaintext Paste plain text} &ndash; Detects when a plain text is pasted and acts accordingly.
-
 ## Installation
 
 <info-box info>
@@ -50,7 +50,7 @@ CKEditor 5 supports a wider range of paste features, including:
 
 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
 ```