@ckeditor/ckeditor5-clipboard
Advanced tools
Comparing version 27.0.0 to 27.1.0
{ | ||
"name": "@ckeditor/ckeditor5-clipboard", | ||
"version": "27.0.0", | ||
"version": "27.1.0", | ||
"description": "Clipboard integration for CKEditor 5.", | ||
@@ -15,26 +15,26 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^27.0.0", | ||
"@ckeditor/ckeditor5-engine": "^27.0.0", | ||
"@ckeditor/ckeditor5-utils": "^27.0.0", | ||
"@ckeditor/ckeditor5-widget": "^27.0.0", | ||
"@ckeditor/ckeditor5-core": "^27.1.0", | ||
"@ckeditor/ckeditor5-engine": "^27.1.0", | ||
"@ckeditor/ckeditor5-utils": "^27.1.0", | ||
"@ckeditor/ckeditor5-widget": "^27.1.0", | ||
"lodash-es": "^4.17.11" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-alignment": "^27.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^27.0.0", | ||
"@ckeditor/ckeditor5-block-quote": "^27.0.0", | ||
"@ckeditor/ckeditor5-cloud-services": "^27.0.0", | ||
"@ckeditor/ckeditor5-code-block": "^27.0.0", | ||
"@ckeditor/ckeditor5-easy-image": "^27.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^27.0.0", | ||
"@ckeditor/ckeditor5-enter": "^27.0.0", | ||
"@ckeditor/ckeditor5-horizontal-line": "^27.0.0", | ||
"@ckeditor/ckeditor5-image": "^27.0.0", | ||
"@ckeditor/ckeditor5-link": "^27.0.0", | ||
"@ckeditor/ckeditor5-page-break": "^27.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^27.0.0", | ||
"@ckeditor/ckeditor5-paste-from-office": "^27.0.0", | ||
"@ckeditor/ckeditor5-remove-format": "^27.0.0", | ||
"@ckeditor/ckeditor5-table": "^27.0.0", | ||
"@ckeditor/ckeditor5-typing": "^27.0.0" | ||
"@ckeditor/ckeditor5-alignment": "^27.1.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^27.1.0", | ||
"@ckeditor/ckeditor5-block-quote": "^27.1.0", | ||
"@ckeditor/ckeditor5-cloud-services": "^27.1.0", | ||
"@ckeditor/ckeditor5-code-block": "^27.1.0", | ||
"@ckeditor/ckeditor5-easy-image": "^27.1.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^27.1.0", | ||
"@ckeditor/ckeditor5-enter": "^27.1.0", | ||
"@ckeditor/ckeditor5-horizontal-line": "^27.1.0", | ||
"@ckeditor/ckeditor5-image": "^27.1.0", | ||
"@ckeditor/ckeditor5-link": "^27.1.0", | ||
"@ckeditor/ckeditor5-page-break": "^27.1.0", | ||
"@ckeditor/ckeditor5-paragraph": "^27.1.0", | ||
"@ckeditor/ckeditor5-paste-from-office": "^27.1.0", | ||
"@ckeditor/ckeditor5-remove-format": "^27.1.0", | ||
"@ckeditor/ckeditor5-table": "^27.1.0", | ||
"@ckeditor/ckeditor5-typing": "^27.1.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "engines": { |
@@ -19,3 +19,3 @@ /** | ||
* | ||
* Read more about the clipboard integration in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive} guide. | ||
* Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* | ||
@@ -22,0 +22,0 @@ * This is a "glue" plugin which loads the following plugins: |
@@ -114,5 +114,5 @@ /** | ||
* | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}. | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}. | ||
* | ||
* This event carries a `dataTransfer` object which comes from the clipboard and which content should be processed | ||
* This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed | ||
* and inserted into the editor. | ||
@@ -128,3 +128,3 @@ * | ||
* @event module:engine/view/document~Document#event:clipboardInput | ||
* @param {Object} data Event data. | ||
* @param {Object} data The event data. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance. | ||
@@ -135,3 +135,3 @@ * @param {'paste'|'drop'} method Whether the event was triggered by a paste or drop operation. | ||
* (usually – into which the content should be inserted). | ||
* If the clipboard input was triggered by a paste operation, then this property is not set. If by a drop operation, | ||
* If the clipboard input was triggered by a paste operation, this property is not set. If by a drop operation, | ||
* then it is the drop position (which can be different than the selection at the moment of drop). | ||
@@ -236,5 +236,5 @@ */ | ||
* | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}. | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}. | ||
* | ||
* This event carries a `dataTransfer` object which comes from the clipboard and which content should be processed | ||
* This event carries a `dataTransfer` object which comes from the clipboard and whose content should be processed | ||
* and inserted into the editor. | ||
@@ -250,3 +250,3 @@ * | ||
* @event module:engine/view/document~Document#event:dragging | ||
* @param {Object} data Event data. | ||
* @param {Object} data The event data. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance. | ||
@@ -253,0 +253,0 @@ * @param {module:engine/view/element~Element} target The tree view element representing the target. |
@@ -55,3 +55,3 @@ /** | ||
// │ view.Document │ Processes view.DocumentFragment to text/html and text/plain | ||
// │ clipboardOutput │ and stores results in data.dataTransfer. | ||
// │ clipboardOutput │ and stores the results in data.dataTransfer. | ||
// └──────────────────┘ | ||
@@ -62,31 +62,31 @@ // | ||
* The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and | ||
* passing the pasted content through the series of events in order to insert it into the editor's content. | ||
* It also handles the `cut` and `copy` events to fill the native clipboard with serialized editor's data. | ||
* passing the pasted content through a series of events in order to insert it into the editor's content. | ||
* It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data. | ||
* | ||
* # Input pipeline | ||
* | ||
* Behavior of the default handlers (all at `low` priority): | ||
* The behavior of the default handlers (all at a `low` priority): | ||
* | ||
* ## Event: `paste` or `drop` | ||
* | ||
* 1. Translates an event data, | ||
* 2. and fires {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event. | ||
* 1. Translates the event data. | ||
* 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event. | ||
* | ||
* ## Event: `view.Document#clipboardInput` | ||
* | ||
* 1. If the `data.content` event field is already set (by some listener on a higher priority) takes that content and fires the event | ||
* from the last point, | ||
* 2. or else retrieves `text/html` or `text/plain` from `data.dataTransfer`, | ||
* 3. normalizes that raw data by applying simple filters on string data, | ||
* 4. processes raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the | ||
* {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}, | ||
* 5. and fires {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation | ||
* `ClipboardPipeline#inputTransformation`} event with the view DocumentFragment in `data.content` event field. | ||
* 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event | ||
* from the last point. | ||
* 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`. | ||
* 3. Normalizes the raw data by applying simple filters on string data. | ||
* 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the | ||
* {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}. | ||
* 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation | ||
* `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field. | ||
* | ||
* ## Event: `ClipboardPipeline#inputTransformation` | ||
* | ||
* 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from `data.content` field to | ||
* {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}, | ||
* 2. and fires {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`} | ||
* event with model DocumentFragment in `data.content` event field. | ||
* 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to | ||
* {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}. | ||
* 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`} | ||
* event with the model document fragment in the `data.content` event field. | ||
* **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers | ||
@@ -102,3 +102,3 @@ * to run in the same block without post-fixers called in between (i.e., the selection post-fixer). | ||
* | ||
* Behavior of the default handlers (all at `low` priority): | ||
* The behavior of the default handlers (all at a `low` priority): | ||
* | ||
@@ -108,16 +108,16 @@ * ## Event: `copy`, `cut` or `dragstart` | ||
* 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling | ||
* {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}, | ||
* 2. converts model DocumentFragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}, | ||
* 3. and fires {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event | ||
* with view DocumentFragment in `data.content` event field. | ||
* {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}. | ||
* 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}. | ||
* 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event | ||
* with the view document fragment in the `data.content` event field. | ||
* | ||
* ## Event: `view.Document#clipboardOutput` | ||
* | ||
* 1. Processes `data.content` to html and plain text with the | ||
* {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}, | ||
* 2. updates `data.dataTransfer` data for `text/html` and `text/plain` with the processed data, | ||
* 3. and for the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`} | ||
* 1. Processes `data.content` to HTML and plain text with the | ||
* {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}. | ||
* 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data. | ||
* 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`} | ||
* on the current selection. | ||
* | ||
* Read more about the clipboard integration in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive} guide. | ||
* Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* | ||
@@ -158,3 +158,3 @@ * @extends module:core/plugin~Plugin | ||
// Pasting and dropping is disabled when editor is read-only. | ||
// Pasting and dropping is disabled when editor is in the read-only mode. | ||
// See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26. | ||
@@ -192,3 +192,3 @@ this.listenTo( viewDocument, 'clipboardInput', evt => { | ||
// If CKEditor handled the input, do not bubble the original event any further. | ||
// This helps external integrations recognize that fact and act accordingly. | ||
// This helps external integrations recognize this fact and act accordingly. | ||
// https://github.com/ckeditor/ckeditor5-upload/issues/92 | ||
@@ -209,4 +209,4 @@ if ( eventInfo.stop.called ) { | ||
// Convert the pasted content to a model document fragment. | ||
// The conversion is contextual, but in this case we need an "all allowed" context | ||
// Convert the pasted content into a model document fragment. | ||
// The conversion is contextual, but in this case an "all allowed" context is needed | ||
// and for that we use the $clipboardHolder item. | ||
@@ -261,3 +261,3 @@ const modelFragment = dataController.toModel( data.content, '$clipboardHolder' ); | ||
this.listenTo( viewDocument, 'cut', ( evt, data ) => { | ||
// Cutting is disabled when editor is read-only. | ||
// Cutting is disabled when editor is in the read-only mode. | ||
// See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26. | ||
@@ -287,8 +287,8 @@ if ( editor.isReadOnly ) { | ||
* | ||
* * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor. | ||
* * The `dataTransfer` object is available in case transformation functions need access to the raw clipboard data. | ||
* * The `content` which comes from the clipboard (it was pasted or dropped) should be processed in order to be inserted into the editor. | ||
* * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data. | ||
* * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`). | ||
* * The `targetRanges` is an array of view ranges (it is available only for `'drop'`). | ||
* * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`). | ||
* | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}. | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}. | ||
* | ||
@@ -300,9 +300,9 @@ * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead. | ||
* @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation | ||
* @param {Object} data Event data. | ||
* @param {module:engine/view/documentfragment~DocumentFragment} data.content Event data. Content to be inserted into the editor. | ||
* It can be modified by the event listeners. Read more about the clipboard pipelines in | ||
* {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive}. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer Data transfer instance. | ||
* @param {Object} data The event data. | ||
* @param {module:engine/view/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor. | ||
* It can be modified by event listeners. Read more about the clipboard pipelines in | ||
* the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance. | ||
* @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation. | ||
* @param {Array.<module:engine/view/range~Range>} data.targetRanges Target drop ranges. | ||
* @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges. | ||
*/ | ||
@@ -314,9 +314,9 @@ | ||
* * The `content` which comes from the clipboard (was pasted or dropped) should be processed in order to be inserted into the editor. | ||
* * The `dataTransfer` object is available in case transformation functions need access to the raw clipboard data. | ||
* * The `dataTransfer` object is available in case the transformation functions need access to the raw clipboard data. | ||
* * The `method` indicates the original DOM event (for example `'drop'` or `'paste'`). | ||
* * The `targetRanges` is an array of view ranges (it is available only for `'drop'`). | ||
* * The `targetRanges` property is an array of view ranges (it is available only for `'drop'`). | ||
* | ||
* Event handlers can modify the content according to the final insertion position. | ||
* | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}. | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline clipboard input pipeline}. | ||
* | ||
@@ -329,10 +329,10 @@ * **Note**: You should not stop this event if you want to change the input data. You should modify the `content` property instead. | ||
* @event module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion | ||
* @param {Object} data Event data. | ||
* @param {module:engine/model/documentfragment~DocumentFragment} data.content Event data. Content to be inserted into the editor. | ||
* Read more about the clipboard pipelines in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive}. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer Data transfer instance. | ||
* @param {Object} data The event data. | ||
* @param {module:engine/model/documentfragment~DocumentFragment} data.content The event data. The content to be inserted into the editor. | ||
* Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer The data transfer instance. | ||
* @param {'paste'|'drop'} data.method Whether the event was triggered by a paste or drop operation. | ||
* @param {Array.<module:engine/view/range~Range>} data.targetRanges Target drop ranges. | ||
* @param {module:engine/model/range~Range} data.resultRange The result of `model.insertContent()` call (inserted by the event handler | ||
* at low priority). | ||
* @param {Array.<module:engine/view/range~Range>} data.targetRanges The target drop ranges. | ||
* @param {module:engine/model/range~Range} data.resultRange The result of the `model.insertContent()` call | ||
* (inserted by the event handler at a low priority). | ||
*/ | ||
@@ -342,5 +342,5 @@ | ||
* Fired on {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} | ||
* with a copy of selected content. The content can be processed before it ends up in the clipboard. | ||
* with a copy of the selected content. The content can be processed before it ends up in the clipboard. | ||
* | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline "clipboard output pipeline"}. | ||
* It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline clipboard output pipeline}. | ||
* | ||
@@ -350,3 +350,3 @@ * @see module:clipboard/clipboardobserver~ClipboardObserver | ||
* @event module:engine/view/document~Document#event:clipboardOutput | ||
* @param {module:clipboard/clipboardpipeline~ClipboardOutputEventData} data Event data. | ||
* @param {module:clipboard/clipboardpipeline~ClipboardOutputEventData} data The event data. | ||
*/ | ||
@@ -361,3 +361,3 @@ | ||
/** | ||
* Data transfer instance. | ||
* The data transfer instance. | ||
* | ||
@@ -370,3 +370,3 @@ * @readonly | ||
* Content to be put into the clipboard. It can be modified by the event listeners. | ||
* Read more about the clipboard pipelines in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive}. | ||
* Read more about the clipboard pipelines in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* | ||
@@ -373,0 +373,0 @@ * @member {module:engine/view/documentfragment~DocumentFragment} module:clipboard/clipboardpipeline~ClipboardOutputEventData#content |
@@ -11,3 +11,3 @@ /** | ||
/** | ||
* Facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object. | ||
* A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object. | ||
*/ | ||
@@ -43,7 +43,7 @@ export default class DataTransfer { | ||
/** | ||
* Gets data from the data transfer by its mime type. | ||
* Gets the data from the data transfer by its MIME type. | ||
* | ||
* dataTransfer.getData( 'text/plain' ); | ||
* | ||
* @param {String} type The mime type. E.g. `text/html` or `text/plain`. | ||
* @param {String} type The MIME type. E.g. `text/html` or `text/plain`. | ||
* @returns {String} | ||
@@ -56,5 +56,5 @@ */ | ||
/** | ||
* Sets data in the data transfer. | ||
* Sets the data in the data transfer. | ||
* | ||
* @param {String} type The mime type. E.g. `text/html` or `text/plain`. | ||
* @param {String} type The MIME type. E.g. `text/html` or `text/plain`. | ||
* @param {String} data | ||
@@ -93,3 +93,3 @@ */ | ||
/** | ||
* Whether dragging operation was canceled. | ||
* Whether the dragging operation was canceled. | ||
* | ||
@@ -104,3 +104,3 @@ * @returns {Boolean} | ||
function getFiles( nativeDataTransfer ) { | ||
// DataTransfer.files and items are Array-like and might not have an iterable interface. | ||
// DataTransfer.files and items are array-like and might not have an iterable interface. | ||
const files = nativeDataTransfer.files ? Array.from( nativeDataTransfer.files ) : []; | ||
@@ -112,3 +112,3 @@ const items = nativeDataTransfer.items ? Array.from( nativeDataTransfer.items ) : []; | ||
} | ||
// Chrome have empty DataTransfer.files, but let get files through the items interface. | ||
// Chrome has empty DataTransfer.files, but allows getting files through the items interface. | ||
return items | ||
@@ -115,0 +115,0 @@ .filter( item => item.kind === 'file' ) |
@@ -27,6 +27,6 @@ /** | ||
// Drag and Drop events overview: | ||
// Drag and drop events overview: | ||
// | ||
// ┌──────────────────┐ | ||
// │ mousedown │ Setting the draggable attribute. | ||
// │ mousedown │ Sets the draggable attribute. | ||
// └─────────┬────────┘ | ||
@@ -37,3 +37,3 @@ // │ | ||
// │ ┌─────────V────────┐ | ||
// │ │ mouseup │ Dragging did not start so removing the draggable attribute. | ||
// │ │ mouseup │ Dragging did not start, removes the draggable attribute. | ||
// │ └──────────────────┘ | ||
@@ -46,3 +46,3 @@ // │ | ||
// ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain | ||
// │ clipboardOutput │ and stores results in data.dataTransfer. | ||
// │ clipboardOutput │ and stores the results in data.dataTransfer. | ||
// └─────────┬────────┘ | ||
@@ -74,6 +74,6 @@ // │ | ||
// │ │ ┌─────────V────────┐ | ||
// └───┐ │ drop │ ( Default handler of the clipboard pipeline ). | ||
// └───┐ │ drop │ (The default handler of the clipboard pipeline). | ||
// │ └─────────┬────────┘ | ||
// │ │ | ||
// │ ┌─────────V────────┐ Resolves final data.targetRanges. | ||
// │ ┌─────────V────────┐ Resolves the final data.targetRanges. | ||
// │ │ clipboardInput │ Aborts if dropping on dragged content. | ||
@@ -83,7 +83,7 @@ // │ └─────────┬────────┘ | ||
// │ ┌─────────V────────┐ | ||
// │ │ clipboardInput │ ( Default handler of the clipboard pipeline ). | ||
// │ │ clipboardInput │ (The default handler of the clipboard pipeline). | ||
// │ └─────────┬────────┘ | ||
// │ │ | ||
// │ ┌───────────V───────────┐ | ||
// │ │ inputTransformation │ ( Default handler of the clipboard pipeline ). | ||
// │ │ inputTransformation │ (The default handler of the clipboard pipeline). | ||
// │ └───────────┬───────────┘ | ||
@@ -96,7 +96,7 @@ // │ │ | ||
// │ ┌──────────V──────────┐ | ||
// │ │ contentInsertion │ ( Default handler of the clipboard pipeline ). | ||
// │ │ contentInsertion │ (The default handler of the clipboard pipeline). | ||
// │ └──────────┬──────────┘ | ||
// │ │ | ||
// │ ┌──────────V──────────┐ | ||
// │ │ contentInsertion │ Removes content from the original range if insertion was successful. | ||
// │ │ contentInsertion │ Removes the content from the original range if the insertion was successful. | ||
// │ └──────────┬──────────┘ | ||
@@ -107,3 +107,3 @@ // │ │ | ||
// ┌─────────V────────┐ | ||
// │ dragend │ Removes the drop marker and cleans state. | ||
// │ dragend │ Removes the drop marker and cleans the state. | ||
// └──────────────────┘ | ||
@@ -113,5 +113,5 @@ // | ||
/** | ||
* The drag and drop feature. It works on top of {@link module:clipboard/clipboardpipeline~ClipboardPipeline}. | ||
* The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}. | ||
* | ||
* Read more about the clipboard integration in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive} guide. | ||
* Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep dive guide}. | ||
* | ||
@@ -143,3 +143,3 @@ * @extends module:core/plugin~Plugin | ||
/** | ||
* The LiveRange over the original content that is being dragged. | ||
* The live range over the original content that is being dragged. | ||
* | ||
@@ -152,3 +152,3 @@ * @private | ||
/** | ||
* The UID of current dragging that is used to verify if the drop started in the same editor as dragstart. | ||
* The UID of current dragging that is used to verify if the drop started in the same editor as the drag start. | ||
* | ||
@@ -163,3 +163,3 @@ * **Note**: This is a workaround for broken 'dragend' events (they are not fired if the source text node got removed). | ||
/** | ||
* The reference to the model element that currently has a 'draggable' attribute set (it's set while dragging). | ||
* The reference to the model element that currently has a `draggable` attribute set (it is set while dragging). | ||
* | ||
@@ -172,3 +172,3 @@ * @private | ||
/** | ||
* A throttled callback updating drop marker. | ||
* A throttled callback updating the drop marker. | ||
* | ||
@@ -181,3 +181,3 @@ * @private | ||
/** | ||
* A delayed callback removing drop marker. | ||
* A delayed callback removing the drop marker. | ||
* | ||
@@ -242,3 +242,3 @@ * @private | ||
/** | ||
* Drag & drop events handling. | ||
* Drag and drop events handling. | ||
* | ||
@@ -254,3 +254,3 @@ * @private | ||
// The handler for the drag start, it's responsible for setting data transfer object. | ||
// The handler for the drag start; it is responsible for setting data transfer object. | ||
this.listenTo( viewDocument, 'dragstart', ( evt, data ) => { | ||
@@ -260,3 +260,3 @@ const selection = modelDocument.selection; | ||
// Don't drag the editable element itself. | ||
if ( data.target && data.target.is( 'rootElement' ) ) { | ||
if ( data.target && data.target.is( 'editableElement' ) ) { | ||
data.preventDefault(); | ||
@@ -271,3 +271,3 @@ | ||
// Check if this is dragstart over the widget (but not nested editable). | ||
// Check if this is dragstart over the widget (but not a nested editable). | ||
const draggableWidget = data.target ? findDraggableWidget( data.target ) : null; | ||
@@ -281,3 +281,3 @@ | ||
// If this was not a widget so we should check if we need to drag some text content. | ||
// If this was not a widget we should check if we need to drag some text content. | ||
else if ( !viewDocument.selection.isCollapsed ) { | ||
@@ -314,3 +314,3 @@ const selectedElement = viewDocument.selection.getSelectedElement(); | ||
// The handler for finalizing drag & drop. It should be triggered always after dragging completed | ||
// The handler for finalizing drag and drop. It should always be triggered after dragging completes | ||
// even if it was completed in a different application. | ||
@@ -333,3 +333,3 @@ // Note: This is not fired if source text node got removed while downcasting a marker. | ||
this.listenTo( viewDocument, 'dragleave', () => { | ||
// We don't know if the mouse left the editor or just some element in it so lets wait a few milliseconds | ||
// We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds | ||
// to check if 'dragover' is not fired. | ||
@@ -351,3 +351,3 @@ this._removeDropMarkerDelayed(); | ||
// If this is content being dragged from other editor moving out of current editor instance | ||
// If this is content being dragged from another editor, moving out of current editor instance | ||
// is not possible until 'dragend' event case will be fixed. | ||
@@ -358,3 +358,3 @@ if ( !this._draggedRange ) { | ||
// In Firefox it's already set and effectAllowed remains the same as originally set. | ||
// In Firefox it is already set and effect allowed remains the same as originally set. | ||
if ( !env.isGecko ) { | ||
@@ -385,3 +385,3 @@ if ( data.dataTransfer.effectAllowed == 'copy' ) { | ||
// Update the event targetRanges and abort dropping if dropping over itself. | ||
// Update the event target ranges and abort dropping if dropping over itself. | ||
this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => { | ||
@@ -406,4 +406,4 @@ if ( data.method != 'drop' ) { | ||
// Since we can't rely on the dragend event, we must check if the local dragRange is from the current drag & drop | ||
// or it's from some previous not cleared one. | ||
// Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop | ||
// or it is from some previous not cleared one. | ||
if ( this._draggedRange && this._draggingUid != data.dataTransfer.getData( 'application/ckeditor5-dragging-uid' ) ) { | ||
@@ -415,3 +415,3 @@ this._draggedRange.detach(); | ||
// Don't do anything if some content was dragged within the same document to the same position. | ||
// Do not do anything if some content was dragged within the same document to the same position. | ||
const isMove = getFinalDropEffect( data.dataTransfer ) == 'move'; | ||
@@ -432,3 +432,3 @@ | ||
/** | ||
* Integration with the `ClipboardPipeline` `contentInsertion` event. | ||
* Integration with the `contentInsertion` event of the clipboard pipeline. | ||
* | ||
@@ -461,3 +461,3 @@ * @private | ||
// Whether any content was inserted (insertion might fail if the schema is disallowing some elements | ||
// (for example an image caption allows only content of block but not blocks themself. | ||
// (for example an image caption allows only the content of a block but not blocks themselves. | ||
// Some integrations might not return valid range (i.e., table pasting). | ||
@@ -471,3 +471,3 @@ const isSuccess = !data.resultRange || !data.resultRange.isCollapsed; | ||
/** | ||
* Adds listeners that adds 'draggable' attribute to the elements while the mouse button is down so the dragging could start. | ||
* Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start. | ||
* | ||
@@ -481,3 +481,3 @@ * @private | ||
// Add 'draggable' attribute to the widget while pressing the selection handle. | ||
// Add the 'draggable' attribute to the widget while pressing the selection handle. | ||
// This is required for widgets to be draggable. In Chrome it will enable dragging text nodes. | ||
@@ -493,12 +493,14 @@ this.listenTo( viewDocument, 'mousedown', ( evt, data ) => { | ||
// Check if this is mousedown over the widget (but not nested editable). | ||
// Check if this is a mousedown over the widget (but not a nested editable). | ||
let draggableElement = findDraggableWidget( data.target ); | ||
// Note: There is a limitation that if there is more than a widget selected (widget and some text) | ||
// and dragging starts on widget, then only a widget is dragged. | ||
// Note: There is a limitation that if more than a widget is selected (a widget and some text) | ||
// and dragging starts on the widget, then only the widget is dragged. | ||
// If this was not a widget so we should check if we need to drag some text content. | ||
// If this was not a widget then we should check if we need to drag some text content. | ||
// In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range. | ||
// In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content). | ||
if ( env.isBlink && !draggableElement && !viewDocument.selection.isCollapsed ) { | ||
// Disabled in read-only mode because draggable="true" + contenteditable="false" results | ||
// in not firing selectionchange event ever, which makes the selection stuck in read-only mode. | ||
if ( env.isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed ) { | ||
const selectedElement = viewDocument.selection.getSelectedElement(); | ||
@@ -516,3 +518,3 @@ | ||
// Keep the reference to the model element in case view element got removed while dragging. | ||
// Keep the reference to the model element in case the view element gets removed while dragging. | ||
this._draggableElement = editor.editing.mapper.toModelElement( draggableElement ); | ||
@@ -531,3 +533,3 @@ } | ||
/** | ||
* Removes 'draggable' attribute from the element that was used for dragging. | ||
* Removes the `draggable` attribute from the element that was used for dragging. | ||
* | ||
@@ -591,3 +593,3 @@ * @private | ||
* @private | ||
* @param {module:engine/model/range~Range} targetRange The range to set marker to. | ||
* @param {module:engine/model/range~Range} targetRange The range to set the marker to. | ||
*/ | ||
@@ -614,3 +616,3 @@ _updateDropMarker( targetRange ) { | ||
/** | ||
* Remove the drop target marker. | ||
* Removes the drop target marker. | ||
* | ||
@@ -633,3 +635,3 @@ * @private | ||
/** | ||
* Deletes the dragged content from it's original range and clears dragging state. | ||
* Deletes the dragged content from its original range and clears the dragging state. | ||
* | ||
@@ -676,3 +678,3 @@ * @private | ||
// An UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement. | ||
// A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement). | ||
if ( targetViewElement.is( 'uiElement' ) ) { | ||
@@ -696,3 +698,3 @@ targetViewElement = targetViewElement.parent; | ||
// There is no target position while hovering over an empty table cell. | ||
// In Safari target position can be empty while hovering over a widget (for example, a page-break). | ||
// In Safari, target position can be empty while hovering over a widget (e.g., a page-break). | ||
// Find the drop position inside the element. | ||
@@ -712,3 +714,3 @@ if ( !targetModelPosition ) { | ||
// Try fixing selection position. | ||
// In Firefox the target position lands before widgets but in other browsers it tend to land after a widget. | ||
// In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget. | ||
range = model.schema.getNearestSelectionRange( targetModelPosition, env.isGecko ? 'forward' : 'backward' ); | ||
@@ -720,3 +722,3 @@ | ||
// There is no valid selection position inside the current limit element so find closest object ancestor. | ||
// There is no valid selection position inside the current limit element so find a closest object ancestor. | ||
// This happens if the model position lands directly in the <table> element itself (view target element was a `<td>` | ||
@@ -727,3 +729,3 @@ // so a nested editable, but view target position was directly in the `<figure>` element). | ||
// Returns fixed selection range for given position and target element if it is over the widget but not over it's nested editable. | ||
// Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable. | ||
// | ||
@@ -742,8 +744,8 @@ // @param {module:core/editor/editor~Editor} editor | ||
// Check if we are deeper over a widget (but not over nested editable). | ||
// Check if we are deeper over a widget (but not over a nested editable). | ||
if ( !targetViewElement.is( 'editableElement' ) ) { | ||
// Find closest ancestor that is either a widget or an editable element... | ||
// Find a closest ancestor that is either a widget or an editable element... | ||
const ancestor = targetViewElement.findAncestor( node => isWidget( node ) || node.is( 'editableElement' ) ); | ||
// ...and if closer was the widget then it's a drop target. | ||
// ...and if the widget was closer then it is a drop target. | ||
if ( isWidget( ancestor ) ) { | ||
@@ -771,3 +773,3 @@ return model.createRangeOn( mapper.toModelElement( ancestor ) ); | ||
// Returns fixed selection range for given position and target element if the drop would be between blocks. | ||
// Returns fixed selection range for a given position and a target element if the drop is between blocks. | ||
// | ||
@@ -844,3 +846,3 @@ // @param {module:core/editor/editor~Editor} editor | ||
// Returns the drop effect that should be a result of dragging content. | ||
// Returns the drop effect that should be a result of dragging the content. | ||
// This function is handling a quirk when checking the effect in the 'drop' DOM event. | ||
@@ -847,0 +849,0 @@ function getFinalDropEffect( dataTransfer ) { |
@@ -18,3 +18,3 @@ /** | ||
* | ||
* For example, it detects <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke. | ||
* For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke. | ||
* | ||
@@ -57,3 +57,3 @@ * @extends module:core/plugin~Plugin | ||
editor.plugins.get( ClipboardPipeline ).on( 'contentInsertion', ( evt, data ) => { | ||
// Plain text can be determined based on event flag (#7799) or auto-detection (#1006). If detected, | ||
// Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected, | ||
// preserve selection attributes on pasted items. | ||
@@ -60,0 +60,0 @@ if ( !shiftPressed && !isPlainTextFragment( data.content, model.schema ) ) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
87926
1687
0
4
- Removed@ckeditor/ckeditor5-clipboard@27.1.0(transitive)