Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ckeditor/ckeditor5-font

Package Overview
Dependencies
Maintainers
1
Versions
700
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-font - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0-beta.2

lang/translations/ar.po

11

CHANGELOG.md
Changelog
=========
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-font/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
### Other changes
* Aligned `ElementDefinition` usage to the changes in the engine. See [ckeditor/ckeditor5#742](https://github.com/ckeditor/ckeditor5/issues/742). ([5705b42](https://github.com/ckeditor/ckeditor5-font/commit/5705b42))
### BREAKING CHANGES
* In the custom format of the font size configuration the `view.style`, `view.class` and `view.attribute` properties are now called `view.styles`, `view.classes` and `view.attributes`.
## 1.0.0-beta.1 (2018-03-15)

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

20

package.json
{
"name": "@ckeditor/ckeditor5-font",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "Font feature for CKEditor 5.",

@@ -10,15 +10,15 @@ "keywords": [

"dependencies": {
"@ckeditor/ckeditor5-core": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-engine": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-ui": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-utils": "^1.0.0-beta.1"
"@ckeditor/ckeditor5-core": "^1.0.0-beta.2",
"@ckeditor/ckeditor5-engine": "^1.0.0-beta.2",
"@ckeditor/ckeditor5-ui": "^1.0.0-beta.2",
"@ckeditor/ckeditor5-utils": "^1.0.0-beta.2"
},
"devDependencies": {
"@ckeditor/ckeditor5-cloudservices": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-editor-classic": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-paragraph": "^1.0.0-beta.1",
"@ckeditor/ckeditor5-cloud-services": "^1.0.0-beta.2",
"@ckeditor/ckeditor5-editor-classic": "^1.0.0-beta.2",
"@ckeditor/ckeditor5-paragraph": "^1.0.0-beta.2",
"eslint": "^4.15.0",
"eslint-config-ckeditor5": "^1.0.7",
"husky": "^0.14.3",
"lint-staged": "^6.0.0"
"lint-staged": "^7.0.0"
},

@@ -31,3 +31,3 @@ "engines": {

"license": "(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)",
"homepage": "https://ckeditor5.github.io",
"homepage": "https://ckeditor.com",
"bugs": "https://github.com/ckeditor/ckeditor5-font/issues",

@@ -34,0 +34,0 @@ "repository": {

@@ -12,7 +12,7 @@ CKEditor 5 font feature

This package implements font size support for CKEditor 5.
This package implements font size and font family support for CKEditor 5.
## Documentation
See the [`@ckeditor/ckeditor5-font` package](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/api/font.html) page in [CKEditor 5 documentation](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/).
See the [`@ckeditor/ckeditor5-font` package](https://docs.ckeditor.com/ckeditor5/latest/api/font.html) page in [CKEditor 5 documentation](https://docs.ckeditor.com/ckeditor5/latest/).

@@ -19,0 +19,0 @@ ## License

@@ -20,3 +20,3 @@ /**

*
* Read more about the feature in the {@glink api/font font package} page.
* For a detailed overview, check the {@glink features/font font feature} documentation.
*

@@ -23,0 +23,0 @@ * @extends module:core/plugin~Plugin

@@ -22,3 +22,3 @@ /**

* @param {module:core/editor/editor~Editor} editor Editor instance.
* @param {String} attributeKey Name of an model attribute on which this command operates.
* @param {String} attributeKey The name of a model attribute on which this command operates.
*/

@@ -62,3 +62,3 @@ constructor( editor, attributeKey ) {

* @param {Object} [options] Options for the executed command.
* @param {String} [options.value] a value to apply.
* @param {String} [options.value] The value to apply.
* @fires execute

@@ -65,0 +65,0 @@ */

@@ -20,2 +20,4 @@ /**

*
* For a detailed overview, check the {@glink features/font font feature} documentation.
*
* @extends module:core/plugin~Plugin

@@ -40,3 +42,3 @@ */

/**
* Font family option descriptor.
* The font family option descriptor.
*

@@ -46,6 +48,6 @@ * @typedef {Object} module:font/fontfamily~FontFamilyOption

* @property {String} title The user-readable title of the option.
* @property {String} model Attribute's unique value in the model.
* @property {String} model The attribute's unique value in the model.
* @property {module:engine/view/elementdefinition~ElementDefinition} view View element configuration.
* @property {Array.<module:engine/view/elementdefinition~ElementDefinition>} [upcastAlso] An array with all matched elements that
* view to model conversion should also accept.
* the view-to-model conversion should also accept.
*/

@@ -55,3 +57,3 @@

* The configuration of the font family feature.
* Introduced by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
* It is introduced by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
*

@@ -65,7 +67,7 @@ * Read more in {@link module:font/fontfamily~FontFamilyConfig}.

* The configuration of the font family feature.
* The option is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
* This option is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} feature.
*
* ClassicEditor
* .create( {
* fontFamily: ... // Font family feature config.
* fontFamily: ... // Font family feature configuration.
* } )

@@ -97,4 +99,4 @@ * .then( ... )

*
* which configures 8 font family options. Each option consist of one or more comma–separated font-family names. The first font name is
* used as a dropdown item description in the UI.
* which configures 8 font family options. Each option consists of one or more comma–separated font family names. The first font name is
* used as the dropdown item description in the UI.
*

@@ -114,5 +116,5 @@ * **Note:** The family names that consist of spaces should not have quotes (as opposed to the CSS standard). The necessary quotes

*
* Executing `fontFamily` command without any value will remove `fontFamily` attribute from the current selection.
* Executing the `fontFamily` command without any value will remove the `fontFamily` attribute from the current selection.
*
* @member {Array.<String|module:font/fontfamily~FontFamilyOption>} module:font/fontfamily~FontFamilyConfig#options
*/

@@ -13,3 +13,3 @@ /**

/**
* The font family command. It is used by the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
* The font family command. It is used by {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}
* to apply the font family.

@@ -16,0 +16,0 @@ *

@@ -23,3 +23,3 @@ /**

* the `fontFamily` attribute in the {@link module:engine/model/model~Model model} which renders
* in the {@link module:engine/view/view view} as an inline span (`<span style="font-family: Arial">`),
* in the {@link module:engine/view/view view} as an inline `<span>` element (`<span style="font-family: Arial">`),
* depending on the {@link module:font/fontfamily~FontFamilyConfig configuration}.

@@ -26,0 +26,0 @@ *

@@ -65,8 +65,8 @@ /**

/**
* Returns options as defined in `config.fontFamily.options` but processed to consider
* Returns options as defined in `config.fontFamily.options` but processed to account for
* editor localization, i.e. to display {@link module:font/fontfamily~FontFamilyOption}
* in the correct language.
*
* Note: The reason behind this method is that there's no way to use {@link module:utils/locale~Locale#t}
* when the user config is defined because the editor does not exist yet.
* Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
* when the user configuration is defined because the editor does not exist yet.
*

@@ -111,4 +111,4 @@ * @private

// Try to set a dropdown list item style.
if ( option.view && option.view.style ) {
itemModel.set( 'style', `font-family: ${ option.view.style[ 'font-family' ] }` );
if ( option.view && option.view.styles ) {
itemModel.set( 'style', `font-family: ${ option.view.styles[ 'font-family' ] }` );
}

@@ -115,0 +115,0 @@

@@ -11,6 +11,6 @@ /**

/**
* Normalizes the {@link module:font/fontfamily~FontFamilyConfig#options config options}
* Normalizes the {@link module:font/fontfamily~FontFamilyConfig#options configuration options}
* to the {@link module:font/fontfamily~FontFamilyOption} format.
*
* @param {Array.<String|Object>} configuredOptions An array of options taken from configuration.
* @param {Array.<String|Object>} configuredOptions An array of options taken from the configuration.
* @returns {Array.<module:font/fontfamily~FontFamilyOption>}

@@ -73,3 +73,3 @@ */

name: 'span',
style: {
styles: {
'font-family': cssFontNames

@@ -76,0 +76,0 @@ }

@@ -20,2 +20,4 @@ /**

*
* For a detailed overview, check the {@glink features/font font feature} documentation.
*
* @extends module:core/plugin~Plugin

@@ -40,3 +42,3 @@ */

/**
* Font size option descriptor.
* The font size option descriptor.
*

@@ -46,6 +48,6 @@ * @typedef {Object} module:font/fontsize~FontSizeOption

* @property {String} title The user-readable title of the option.
* @property {String} model Attribute's unique value in the model.
* @property {String} model The attribute's unique value in the model.
* @property {module:engine/view/elementdefinition~ElementDefinition} view View element configuration.
* @property {Array.<module:engine/view/elementdefinition~ElementDefinition>} [upcastAlso] An array with all matched elements that
* view to model conversion should also accept.
* the view-to-model conversion should also accept.
*/

@@ -55,3 +57,3 @@

* The configuration of the font size feature.
* Introduced by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
* It is introduced by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
*

@@ -65,7 +67,7 @@ * Read more in {@link module:font/fontsize~FontSizeConfig}.

* The configuration of the font size feature.
* The option is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
* This option is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} feature.
*
* ClassicEditor
* .create( {
* fontSize: ... // Font size feature config.
* fontSize: ... // Font size feature configuration.
* } )

@@ -96,6 +98,6 @@ * .then( ... )

*
* It defines 4 sizes: **tiny**, **small**, **big**, and **huge**. These values will be rendered as `span` elements in view.
* It defines 4 sizes: **tiny**, **small**, **big**, and **huge**. These values will be rendered as `<span>` elements in the view.
* The **default** defines a text without the `fontSize` attribute.
*
* Each `span` has the `class` attribute set to the corresponding size name. For instance, this is what the **small** size looks
* Each `<span>` has the the `class` attribute set to the corresponding size name. For instance, this is what the **small** size looks
* like in the view:

@@ -105,3 +107,3 @@ *

*
* As an alternative, the font size might be defined using the numerical values (either as a `Number` or as a `String`):
* As an alternative, the font size might be defined using numerical values (either as a `Number` or as a `String`):
*

@@ -113,9 +115,9 @@ * const fontSizeConfig = {

* Font size can be applied using the command API. To do that, use the `fontSize` command and pass the desired font size as a `value`.
* For example, the below code will apply the `fontSize` attribute with the **tiny** value to the current selection:
* For example, the following code will apply the `fontSize` attribute with the **tiny** value to the current selection:
*
* editor.execute( 'fontSize', { value: 'tiny' } );
*
* Executing `fontSize` command without value will remove `fontSize` attribute from the current selection.
* Executing the `fontSize` command without value will remove the `fontSize` attribute from the current selection.
*
* @member {Array.<String|Number|module:font/fontsize~FontSizeOption>} module:font/fontsize~FontSizeConfig#options
*/

@@ -13,3 +13,3 @@ /**

/**
* The font size command. It is used by the {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
* The font size command. It is used by {@link module:font/fontsize/fontsizeediting~FontSizeEditing}
* to apply the font size.

@@ -16,0 +16,0 @@ *

@@ -21,3 +21,3 @@ /**

/**
* The font family UI plugin. It introduces the `'fontSize'` dropdown.
* The font size UI plugin. It introduces the `'fontSize'` dropdown.
*

@@ -71,8 +71,8 @@ * @extends module:core/plugin~Plugin

/**
* Returns options as defined in `config.fontSize.options` but processed to consider
* Returns options as defined in `config.fontSize.options` but processed to account for
* editor localization, i.e. to display {@link module:font/fontsize~FontSizeOption}
* in the correct language.
*
* Note: The reason behind this method is that there's no way to use {@link module:utils/locale~Locale#t}
* when the user config is defined because the editor does not exist yet.
* Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
* when the user configuration is defined because the editor does not exist yet.
*

@@ -124,8 +124,8 @@ * @private

if ( option.view && option.view.style ) {
itemModel.set( 'style', `font-size:${ option.view.style[ 'font-size' ] }` );
if ( option.view && option.view.styles ) {
itemModel.set( 'style', `font-size:${ option.view.styles[ 'font-size' ] }` );
}
if ( option.view && option.view.class ) {
itemModel.set( 'class', `${ itemModel.class } ${ option.view.class }` );
if ( option.view && option.view.classes ) {
itemModel.set( 'class', `${ itemModel.class } ${ option.view.classes }` );
}

@@ -132,0 +132,0 @@

@@ -11,6 +11,6 @@ /**

/**
* Normalizes and translates the {@link module:font/fontsize~FontSizeConfig#options config options}
* Normalizes and translates the {@link module:font/fontsize~FontSizeConfig#options configuration options}
* to the {@link module:font/fontsize~FontSizeOption} format.
*
* @param {Array.<String|Number|Object>} configuredOptions An array of options taken from configuration.
* @param {Array.<String|Number|Object>} configuredOptions An array of options taken from the configuration.
* @returns {Array.<module:font/fontsize~FontSizeOption>}

@@ -33,3 +33,3 @@ */

name: 'span',
class: 'text-tiny'
classes: 'text-tiny'
}

@@ -42,3 +42,3 @@ },

name: 'span',
class: 'text-small'
classes: 'text-small'
}

@@ -51,3 +51,3 @@ },

name: 'span',
class: 'text-big'
classes: 'text-big'
}

@@ -60,3 +60,3 @@ },

name: 'span',
class: 'text-huge'
classes: 'text-huge'
}

@@ -114,3 +114,3 @@ }

name: 'span',
style: {
styles: {
'font-size': `${ size }px`

@@ -117,0 +117,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc