Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

@ckeditor/ckeditor5-core

Package Overview
Dependencies
Maintainers
1
Versions
1577
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-core - npm Package Compare versions

Comparing version
10.0.0
to
10.1.0
lang/translations/ca.po

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

+150
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
/**
* @module core/pendingactions
*/
import Plugin from './plugin';
import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
import Collection from '@ckeditor/ckeditor5-utils/src/collection';
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
/**
* The list of pending editor actions.
*
* This plugin should be used to synchronise plugins that execute long-lasting actions
* (i.e. file upload) with the editor integration. It gives the developer who integrates the editor
* an easy way to check if there are any pending actions whenever such information is needed.
* All plugins that register a pending action also provide a message about the action that is ongoing
* which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
*
* Adding and updating a pending action:
*
* const pendingActions = editor.plugins.get( 'PendingActions' );
* const action = pendingActions.add( 'Upload in progress 0%' );
*
* action.message = 'Upload in progress 10%';
*
* Removing a pending action:
*
* const pendingActions = editor.plugins.get( 'PendingActions' );
* const action = pendingActions.add( 'Unsaved changes.' );
*
* pendingActions.remove( action );
*
* Getting pending actions:
*
* const pendingActions = editor.plugins.get( 'PendingActions' );
*
* const action1 = pendingActions.add( 'Action 1' );
* const action2 = pendingActions.add( 'Action 2' );
*
* pendingActions.first // Returns action1
* Array.from( pendingActions ) // Returns [ action1, action2 ]
*
* @extends module:core/plugin~Plugin
*/
export default class PendingActions extends Plugin {
/**
* @inheritDoc
*/
static get pluginName() {
return 'PendingActions';
}
/**
* @inheritDoc
*/
init() {
/**
* Defines whether there is any registered pending action.
*
* @readonly
* @observable
* @member {Boolean} #isPending
*/
this.set( 'isPending', false );
/**
* A list of pending actions.
*
* @private
* @type {module:utils/collection~Collection}
*/
this._actions = new Collection( { idProperty: '_id' } );
this._actions.delegate( 'add', 'remove' ).to( this );
}
/**
* Adds an action to the list of pending actions.
*
* This method returns an action object with an observable message property.
* The action object can be later used in the {@link #remove} method. It also allows you to change the message.
*
* @param {String} message Action message.
* @returns {Object} Observable object that represents a pending action.
*/
add( message ) {
if ( typeof message !== 'string' ) {
/**
* The message must be a string.
*
* @error pendingactions-add-invalid-message
*/
throw new CKEditorError( 'pendingactions-add-invalid-message: The message must be a string.' );
}
const action = Object.create( ObservableMixin );
action.set( 'message', message );
this._actions.add( action );
this.isPending = true;
return action;
}
/**
* Removes an action from the list of pending actions.
*
* @param {Object} action An action object.
*/
remove( action ) {
this._actions.remove( action );
this.isPending = !!this._actions.length;
}
/**
* Returns the first action from the list.
*
* returns {Object} The pending action object.
*/
get first() {
return this._actions.get( 0 );
}
/**
* Iterable interface.
*
* @returns {Iterable.<*>}
*/
[ Symbol.iterator ]() {
return this._actions[ Symbol.iterator ]();
}
/**
* Fired when an action is added to the list.
*
* @event add
* @param {Object} action The added action.
*/
/**
* Fired when an action is removed from the list.
*
* @event remove
* @param {Object} action The removed action.
*/
}
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M15.442 3H8.481a3.48 3.48 0 0 0 0 6.961v6.962h1.74V4.74h1.74v12.183h1.74V4.74h1.741V3z"/></svg>
+11
-0
Changelog
=========
## [10.1.0](https://github.com/ckeditor/ckeditor5-core/compare/v10.0.0...v10.1.0) (2018-06-21)
### Features
* Introduced `PendingActions` plugin. Closes [#126](https://github.com/ckeditor/ckeditor5-core/issues/126). ([e1af648](https://github.com/ckeditor/ckeditor5-core/commit/e1af648))
### Other changes
* Updated translations.
## [10.0.0](https://github.com/ckeditor/ckeditor5-core/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)

@@ -5,0 +16,0 @@

+14
-14
{
"name": "@ckeditor/ckeditor5-core",
"version": "10.0.0",
"version": "10.1.0",
"description": "CKEditor 5 core editor architecture.",

@@ -28,17 +28,17 @@ "keywords": [

"dependencies": {
"@ckeditor/ckeditor5-engine": "^10.0.0",
"@ckeditor/ckeditor5-utils": "^10.0.0"
"@ckeditor/ckeditor5-engine": "^10.1.0",
"@ckeditor/ckeditor5-utils": "^10.1.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-autoformat": "^10.0.0",
"@ckeditor/ckeditor5-basic-styles": "^10.0.0",
"@ckeditor/ckeditor5-block-quote": "^10.0.0",
"@ckeditor/ckeditor5-editor-classic": "^10.0.0",
"@ckeditor/ckeditor5-essentials": "^10.0.0",
"@ckeditor/ckeditor5-heading": "^10.0.0",
"@ckeditor/ckeditor5-image": "^10.0.0",
"@ckeditor/ckeditor5-link": "^10.0.0",
"@ckeditor/ckeditor5-list": "^10.0.0",
"@ckeditor/ckeditor5-paragraph": "^10.0.0",
"@ckeditor/ckeditor5-ui": "^10.0.0",
"@ckeditor/ckeditor5-autoformat": "^10.0.1",
"@ckeditor/ckeditor5-basic-styles": "^10.0.1",
"@ckeditor/ckeditor5-block-quote": "^10.0.1",
"@ckeditor/ckeditor5-editor-classic": "^10.0.1",
"@ckeditor/ckeditor5-essentials": "^10.1.0",
"@ckeditor/ckeditor5-heading": "^10.0.1",
"@ckeditor/ckeditor5-image": "^10.1.0",
"@ckeditor/ckeditor5-link": "^10.0.2",
"@ckeditor/ckeditor5-list": "^11.0.0",
"@ckeditor/ckeditor5-paragraph": "^10.0.1",
"@ckeditor/ckeditor5-ui": "^10.1.0",
"eslint": "^4.15.0",

@@ -45,0 +45,0 @@ "eslint-config-ckeditor5": "^1.0.7",

@@ -7,3 +7,3 @@ CKEditor 5 core editor architecture

[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-core.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-core)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://www.browserstack.com/automate/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)
[![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-core/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-core?branch=master)

@@ -10,0 +10,0 @@ <br>

@@ -82,15 +82,9 @@ /**

if ( value ) {
// See a ticket about overriding observable properties
// https://github.com/ckeditor/ckeditor5-utils/issues/171.
this.on( 'change:isEnabled', forceDisable, { priority: 'lowest' } );
this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
this.isEnabled = false;
} else {
this.off( 'change:isEnabled', forceDisable );
this.off( 'set:isEnabled', forceDisable );
this.refresh();
}
} );
function forceDisable() {
this.isEnabled = false;
}
}

@@ -143,1 +137,7 @@

mix( Command, ObservableMixin );
// Helper function that forces command to be disabled.
function forceDisable( evt ) {
evt.return = false;
evt.stop();
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet