Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

T/4: Initial Font plugin implementation. #5

Merged
merged 101 commits into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
869ede0
Feature: Add Font & FontSize plugins stubs.
jodator Nov 29, 2017
75ee85f
Feature: Add FontSizeEditing plugins stub.
jodator Nov 29, 2017
7eb6bf7
Other: Move FontSizeEditing to font/fontsize module.
jodator Nov 29, 2017
dbbdb19
Feature: Introduce FontSizeCommand.
jodator Nov 29, 2017
817597e
Other: Initial implementation of FontSize configuration and editing p…
jodator Nov 30, 2017
bd9c78c
Other: Initial implementation of FontSize data pipeline conversion.
jodator Nov 30, 2017
345d349
Tests: Add font size manual test stub.
jodator Dec 1, 2017
9b10a3f
Other: Implement proper use of matchers and converters.
jodator Dec 1, 2017
35430c4
Other: Initial support fo ViewElementDefinition interface.
jodator Dec 5, 2017
db88e50
Other: Extract implementation of unified converters from ViewElementD…
jodator Dec 5, 2017
419c4de
Other: Unify ViewElement converters for attribute and element.
jodator Dec 11, 2017
ebda823
Other: Rename ViewElementDefinition attributes to plural names.
jodator Dec 11, 2017
284baf0
Other: Rename AttributeElement conversion helpers.
jodator Dec 12, 2017
1b26cb7
Other: Merge configuration defined converters into one file.
jodator Dec 14, 2017
8efb27d
Other: Update Font Size feature to latest changes in engine.
jodator Dec 17, 2017
152e48f
Tests: Reorder `FontSizeCommand` test.
jodator Dec 18, 2017
b8a9311
Other: Rename configurationdefinedconverters to definition-based-conv…
jodator Dec 19, 2017
174e6ee
Refactor: Use singular class and styles in ViewElementDefinition.
jodator Dec 19, 2017
58a8c85
Added: Create commands in FontSizeEditing plugin.
jodator Dec 20, 2017
62b2d9b
Tests: Add 'normal' setting to tests.
jodator Dec 21, 2017
dc170d4
Other: Bootstrap FontFamilyEditing and FontFamilyCommand.
jodator Dec 17, 2017
5f3c60c
Tests: Add more tests for `FontFamilyEditing` and `FontFamilyCommand`.
jodator Dec 18, 2017
5296f54
Added: Introduce FontFamily plugin.
jodator Dec 18, 2017
efdb954
Tests: Added Font Family feature manual tests.
jodator Dec 18, 2017
8e9ecd1
Other: Make FontFamily work with various font-family style markup.
jodator Dec 19, 2017
f59b1de
Other: Align FontFamilyEditing code to changes in ckeditor5-engine.
jodator Dec 20, 2017
b030a9a
Added: Stub FontSizeUI plugin.
jodator Dec 20, 2017
cad324c
Changed: Pass all `ConverterDefinition`s to modelAttributeToViewAttri…
jodator Dec 21, 2017
1543d0e
Changed: Use one command for font features.
jodator Dec 21, 2017
dff41a3
Changed: Refactor FontFamilyCommand to match FontSizeCommand.
jodator Dec 21, 2017
d5bdd79
Added: Bootstrap FontFamilyUI.
jodator Dec 21, 2017
f624e3b
Added: Add 'default' option to FontFamily options.
jodator Dec 21, 2017
d38ddc5
Tests: Fix current tests.
jodator Dec 21, 2017
e6f6877
Tests: Fix commands coverage.
jodator Dec 21, 2017
3c5bcf6
Tests: Add FontFamilyUI tests.
jodator Dec 22, 2017
e34994c
Tests: Add FontSizeUI tests.
jodator Dec 22, 2017
19432ed
Added: Font should require FontFamily & FontSize plugins.
jodator Dec 22, 2017
db1f260
Docs: Update FontFamily & FontSize plugin docs.
jodator Dec 22, 2017
c536ba4
Changed: Extract FontCommand.
jodator Dec 22, 2017
2bc0718
Added font size and family icons.
oleq Dec 22, 2017
581a242
Changed: Updated icons in font toolbar buttons.
jodator Dec 22, 2017
1d77a89
Changed: Use undefined as command value to pass to unset font attribute.
jodator Dec 22, 2017
af0d463
Docs: Update Font commands documentation.
jodator Dec 22, 2017
d3a2e0d
Tests: Refactor Font commands tests.
jodator Dec 22, 2017
c3ef786
Docs: Update FontFamily documentation.
jodator Dec 22, 2017
c1e94a9
Other: Update schema use to match the new API.
jodator Jan 8, 2018
beb0b8c
Other: Extract common UI and Editing parts as utils.
jodator Jan 9, 2018
e71c8e2
Other: Update copyright year.
jodator Jan 9, 2018
c77be7e
Docs: Review Font documentation.
jodator Jan 9, 2018
dab591d
Other: Fix localization support.
jodator Jan 10, 2018
f138202
Docs: Remove `uiStyle` description from `FontFamilyOption`.
jodator Jan 10, 2018
2b02313
Tests: Update manual tests description.
jodator Jan 10, 2018
40030a0
Tests: Fix FontFamilyEditing and FontSizeEditing tests.
jodator Jan 12, 2018
cab014d
Translations need to be defined on Transifex.
Reinmar Jan 12, 2018
9b83506
Fixed API docs.
Reinmar Jan 12, 2018
ff7dfc1
Changed: Make `FontCommand` work also on collapsed selection.
jodator Jan 16, 2018
8bff4c3
Other: Update .travis.yml file as in other repos.
jodator Jan 16, 2018
c157fee
Updated dependencies.
Reinmar Jan 16, 2018
202c67c
Added: Mark font family/font size in the dropdown's panel items.
jodator Jan 16, 2018
1d71287
Changed: Accept only single quotes for multi-word font family definit…
jodator Jan 17, 2018
d92c785
Updated font size and font family icons.
oleq Jan 22, 2018
0f2620d
Updated font size and family icons.
oleq Jan 23, 2018
ae89fb5
Docs: Move FontSizeConfig options documentation to FontSize.
jodator Jan 25, 2018
1534f1e
Docs: Move FontFamilyConfig options documentation to FontFamily.
jodator Jan 25, 2018
5a98b1f
Docs: Add Font Family feature guide.
jodator Jan 25, 2018
aea1a9a
Docs: Add Font Size feature guide.
jodator Jan 25, 2018
b35152b
Docs: Add font api page.
jodator Jan 25, 2018
3b9cdfc
Docs: Typo fix.
jodator Jan 26, 2018
f793fe6
Aligned code to the changes in DocumentSelection API.
jodator Jan 29, 2018
26503b3
Make font-size option configuration reflect dropdown items UI.
jodator Jan 29, 2018
f30b467
Code style: The dots are required at the end of the comment.
jodator Jan 29, 2018
32d283b
Changed: update dropdowns to match the new API.
jodator Jan 22, 2018
bc8c336
Changed: Removed `addDefaultBehavior()` from dropdown utils.
jodator Jan 23, 2018
c79974d
Changed: Removed `createSingleButtonDropdown()` from dropdown utils.
jodator Jan 23, 2018
22a6deb
Changed: update dropdowns to match the new API.
jodator Jan 24, 2018
057ea7c
Changed: Change how dropdowns with `ButtonView` and `SplitButtonView`…
jodator Jan 28, 2018
dc8a2be
Changed: Remove dafult dropdown behavior helper methods from API.
jodator Jan 28, 2018
3051e81
Changed: Move `addListViewToDropdown()` helper to ui/dropdown/utils.
jodator Jan 29, 2018
5a55304
Changed: Bind dropdown behavior to `DropdownView` instead of `Model`.
jodator Jan 29, 2018
44a2dbe
Review dropdown creation process in `FontSizeUI` and `FontFamilyUI`.
jodator Feb 1, 2018
d8f2ed4
Docs: Brought dropdown/utils methods to a common naming scheme.
jodator Feb 2, 2018
6031d40
Changed: Remove `dropdown.buttonView` bindings to `dropdown`.
jodator Feb 5, 2018
8657667
Fix: Update imports to CKEditor5 plugins.
jodator Feb 9, 2018
1e7c54d
Updated the font features' conversion to the newest API.
oleq Feb 12, 2018
ba2379e
Fix: Font size's normalizeOptions should not change the type of the m…
oleq Feb 12, 2018
5d506ec
Tests: Added separators to toolbar configs in manual tests.
oleq Feb 12, 2018
2f7b5ec
Docs: Added separators to toolbar configurations.
oleq Feb 12, 2018
1324a23
Docs: Improved font size and family feature guides.
oleq Feb 12, 2018
4a4f47d
Docs: Minor improvements in docs.
oleq Feb 12, 2018
2ccbd9c
Docs: Minor improvements in docs.
oleq Feb 12, 2018
85d1fa7
Docs: Improvements to font package docs.
oleq Feb 12, 2018
0691434
Docs: Improvements to font package docs.
oleq Feb 12, 2018
4e063c7
Docs: Improvements to font package docs.
oleq Feb 12, 2018
9f79464
Docs: Improved font package docs.
oleq Feb 13, 2018
d128512
Docs: Improved font package docs.
oleq Feb 13, 2018
5cf9a1e
Docs: Add more explanatory descriptions.
jodator Feb 14, 2018
fbad3d6
Docs: Merge font-family and font-size feature documentation into one …
jodator Feb 14, 2018
5929641
Docs: Various fixes and improvements in the documentation.
oleq Feb 15, 2018
22a1946
Changed 'normal' font size to 'default' to keep the same naming conve…
oleq Feb 15, 2018
4e5979a
Removed the fontsize style sheet. Moved customizations to Lark.
oleq Feb 15, 2018
33743e8
Minor lexical improvements.
oleq Feb 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

Expand Down
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
sudo: required
dist: trusty
addons:
firefox: "latest"
apt:
sources:
- google-chrome
- google-chrome
packages:
- google-chrome-stable
- google-chrome-stable
language: node_js
node_js:
- "6"
- '6'
cache:
- node_modules
- node_modules
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- npm install @ckeditor/ckeditor5-dev-tests
- ckeditor5-dev-tests-install-dependencies
- npm install @ckeditor/ckeditor5-dev-tests
- ckeditor5-dev-tests-install-dependencies
script:
- ckeditor5-dev-tests-travis
- ckeditor5-dev-tests-travis
after_success:
- codeclimate-test-reporter < coverage/lcov.info
- ckeditor5-dev-tests-save-revision
- ckeditor5-dev-tests-save-revision
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Software License Agreement
==========================

**CKEditor 5 Font Feature** – https://github.com/ckeditor/ckeditor5-font <br>
Copyright (c) 2003-2017, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
Copyright (c) 2003-2018, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.

Licensed under the terms of any of the following licenses at your choice:

Expand Down
Empty file.
14 changes: 14 additions & 0 deletions docs/_snippets/features/build-font-family-source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals window */

import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';

import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily';

ClassicEditor.build.plugins.push( FontFamily );

window.ClassicEditor = ClassicEditor;
17 changes: 17 additions & 0 deletions docs/_snippets/features/build-font-size-source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<style>
.text-tiny {
font-size: 0.7em;
}

.text-small {
font-size: 0.85em;
}

.text-big {
font-size: 1.4em;
}

.text-huge {
font-size: 1.8em;
}
</style>
14 changes: 14 additions & 0 deletions docs/_snippets/features/build-font-size-source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals window */

import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';

import FontSize from '@ckeditor/ckeditor5-font/src/fontsize';

ClassicEditor.build.plugins.push( FontSize );

window.ClassicEditor = ClassicEditor;
13 changes: 13 additions & 0 deletions docs/_snippets/features/custom-font-family-options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<link href="https://fonts.googleapis.com/css?family=Ubuntu|Ubuntu+Mono" rel="stylesheet">

<div id="snippet-custom-font-family-options">
<h2>Font Family feature sample.</h2>

<p>
<span style="font-family: Ubuntu, Arial, sans-serif;">This text has "Ubuntu, Arial, Helvetica, sans-serif" font family set.</span>
</p>

<p>
<span style="font-family: 'Ubuntu Mono', 'Courier New', Courier, monospace;">This text has "Ubuntu Mono, Courier New, Courier, monospace" font family set.</span>
</p>
</div>
28 changes: 28 additions & 0 deletions docs/_snippets/features/custom-font-family-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */
ClassicEditor
.create( document.querySelector( '#snippet-custom-font-family-options' ), {
toolbar: {
items: [
'headings', '|', 'bulletedList', 'numberedList', 'fontFamily', 'undo', 'redo'
],
viewportTopOffset: 60
},
fontFamily: {
options: [
'default',
'Ubuntu, Arial, sans-serif',
'Ubuntu Mono, Courier New, Courier, monospace'
]
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
9 changes: 9 additions & 0 deletions docs/_snippets/features/custom-font-size-named-options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="snippet-custom-font-size-named-options">
<h2>Font Size named options sample.</h2>

<p>
This is a mixed text with different sizes of text:
<span class="text-small">small</span> and
<span class="text-big">big</span>
</p>
</div>
28 changes: 28 additions & 0 deletions docs/_snippets/features/custom-font-size-named-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */
ClassicEditor
.create( document.querySelector( '#snippet-custom-font-size-named-options' ), {
toolbar: {
items: [
'headings', '|', 'bulletedList', 'numberedList', 'fontSize', 'undo', 'redo'
],
viewportTopOffset: 60
},
fontSize: {
options: [
'small',
'normal',
'big'
]
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
11 changes: 11 additions & 0 deletions docs/_snippets/features/custom-font-size-numeric-options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="snippet-custom-font-size-numeric-options">
<h2>Font Size feature numeric options sample.</h2>

<p><span style="font-size: 9px">9px</span></p>
<p><span style="font-size: 11px">11px</span></p>
<p><span style="font-size: 13px">13px</span></p>
<p>Normal</p>
<p><span style="font-size: 17px">17px</span></p>
<p><span style="font-size: 19px">19px</span></p>
<p><span style="font-size: 21px">21px</span></p>
</div>
32 changes: 32 additions & 0 deletions docs/_snippets/features/custom-font-size-numeric-options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */
ClassicEditor
.create( document.querySelector( '#snippet-custom-font-size-numeric-options' ), {
toolbar: {
items: [
'headings', '|', 'bulletedList', 'numberedList', 'fontSize', 'undo', 'redo'
],
viewportTopOffset: 60
},
fontSize: {
options: [
9,
11,
13,
'normal',
17,
19,
21
]
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
31 changes: 31 additions & 0 deletions docs/_snippets/features/font-family.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div id="snippet-font-family">
<h2>Font Family feature sample.</h2>

<p>
<span style="font-family: Arial, Helvetica, sans-serif;">This text has "Arial, Helvetica, sans-serif" family set.</span>
</p>

<p>
<span style="font-family: 'Courier New', Courier, monospace;">This text has "Courier New, Courier, monospace" family set.</span>
</p>

<p>
<span style="font-family: Georgia, serif;">This text has "Georgia, serif" family set.</span>
</p>

<p>
<span style="font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;">This text has "Lucida Sans Unicode, Lucida Grande, sans-serif" font family set.</span>
</p>

<p>
<span style="font-family: Tahoma, Geneva, sans-serif;">This text has "Tahoma, Geneva, sans-serif" font family set.</span>
</p>

<p>
<span style="font-family: 'Trebuchet MS', Helvetica, sans-serif;">This text has "Trebuchet MS, Helvetica, sans-serif" font family set.</span>
</p>

<p>
<span style="font-family: Verdana, Geneva, sans-serif;">This text has "Verdana, Geneva, sans-serif" font family set.</span>
</p>
</div>
22 changes: 22 additions & 0 deletions docs/_snippets/features/font-family.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */

ClassicEditor
.create( document.querySelector( '#snippet-font-family' ), {
toolbar: {
items: [
'headings', '|', 'bulletedList', 'numberedList', 'fontFamily', 'undo', 'redo'
],
viewportTopOffset: 60
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
11 changes: 11 additions & 0 deletions docs/_snippets/features/font-size.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="snippet-font-size">
<h2>Font Size feature sample.</h2>

<p>
This is a mixed text with different sizes of text:
<span class="text-tiny">tiny</span>,
<span class="text-small">small</span>,
<span class="text-big">big</span> and
<span class="text-huge">huge</span>.
</p>
</div>
22 changes: 22 additions & 0 deletions docs/_snippets/features/font-size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */

ClassicEditor
.create( document.querySelector( '#snippet-font-size' ), {
toolbar: {
items: [
'headings', 'bulletedList', 'numberedList', 'fontSize', 'undo', 'redo'
],
viewportTopOffset: 60
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
31 changes: 31 additions & 0 deletions docs/api/font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
category: api-reference
---

# CKEditor 5 font feature

[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-font.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-font)

This package implements the font family and font size features for CKEditor 5.

## Documentation

See the {@link features/font-family Font family feature} and {@link features/font-size Font size feature} guides
with corresponding {@link module:font/fontfamily~FontFamily} and {@link module:font/fontsize~FontSize} plugin documentation.

## Installation

```bash
npm install --save @ckeditor/ckeditor5-font
```

## Contribute

The source code of this package is available on GitHub in https://github.com/ckeditor/ckeditor5-font.

## External links

* [`@ckeditor/ckeditor5-font` on npm](https://www.npmjs.com/package/@ckeditor/ckeditor5-font)
* [`ckeditor/ckeditor5-font` on GitHub](https://github.com/ckeditor/ckeditor5-font)
* [Issue tracker](https://github.com/ckeditor/ckeditor5-font/issues)
* [Changelog](https://github.com/ckeditor/ckeditor5-font/blob/master/CHANGELOG.md)
Loading