8
0
Просмотр исходного кода

Docs: move `HighlightOption` from `HighlightEditing` to `Highlight`.

Maciej Gołaszewski 8 лет назад
Родитель
Сommit
4963297509

+ 78 - 1
packages/ckeditor5-highlight/src/highlight.js

@@ -15,7 +15,10 @@ import HighlightUI from './highlightui';
 /**
 /**
  * The highlight plugin.
  * The highlight plugin.
  *
  *
- * It requires {@link module:highlight/highlightediting~HighlightEditing} and {@link module:highlight/highlightui~HighlightUI} plugins.
+ * It loads the {@link module:highlight/highlightediting~HighlightEditing} and
+ * {@link module:highlight/highlightui~HighlightUI} plugins.
+ *
+ * Read more about the feature in the {@glink api/highlight highlight package} page.
  *
  *
  * @extends module:core/plugin~Plugin
  * @extends module:core/plugin~Plugin
  */
  */
@@ -34,3 +37,77 @@ export default class Highlight extends Plugin {
 		return 'Highlight';
 		return 'Highlight';
 	}
 	}
 }
 }
+
+/**
+ * Highlight option descriptor.
+ *
+ * @typedef {Object} module:highlight/highlight~HighlightOption
+ * @property {String} title The user-readable title of the option.
+ * @property {String} model Attribute's unique value in the model.
+ * @property {String} color Color used for highlighter. Should be coherent with `class` CSS setting.
+ * @property {String} class CSS Class used on `mark` element in view. Should be coherent with `color` setting.
+ * @property {'marker'|'pen'} type The type of highlighter:
+ * - "marker" - will use #color as highlight background,
+ * - "pen" - will use #color as highlight font color.
+ */
+
+/**
+ * The configuration of the {@link module:highlight/highlight~Highlight} feature.
+ *
+ * Read more in {@link module:highlight/highlight~HighlightConfig}.
+ *
+ * @member {module:highlight/highlight~HighlightConfig} module:core/editor/editorconfig~EditorConfig#highlight
+ */
+
+/**
+ * The configuration of the {@link module:highlight/highlight~Highlight Highlight feature}.
+ *
+ *		ClassicEditor
+ *			.create( editorElement, {
+ * 				highlight:  ... // Highlight feature config.
+ *			} )
+ *			.then( ... )
+ *			.catch( ... );
+ *
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
+ *
+ * @interface HighlightConfig
+ */
+
+/**
+ * Available highlighters options.
+ *
+ * There are two types of highlighters:
+ * - 'marker' - rendered as `<mark>` element with defined background color.
+ * - 'pen' - rendered as `<mark>` element with defined foreground (font) color.
+ *
+ * **Note**: Each highlighter must have it's own CSS class defined to properly match content data.
+ * Also it is advised that color value should match the values defined in content CSS stylesheet.
+ *
+ *		ClassicEditor
+ *			.create( editorElement, {
+ *				highlight: {
+ *					options: [
+ *						{
+ *							model: 'pinkMarker',
+ *							class: 'marker-pink',
+ *							title: 'Pink Marker',
+ *							color: '#ff6fff',
+ *							type: 'marker'
+ *						},
+ *						{
+ *							model: 'redPen',
+ *							class: 'pen-red',
+ *							title: 'Red Pen',
+ *							color: '#ff2929',
+ *							type: 'pen'
+ *						},
+ *					]
+ *				}
+ *		} )
+ *		.then( ... )
+ *		.catch( ... );
+ *
+ * @member {Array.<module:highlight/highlight~HighlightOption>} module:highlight/highlight~HighlightConfig#options
+ */
+

+ 2 - 51
packages/ckeditor5-highlight/src/highlightediting.js

@@ -67,59 +67,10 @@ export default class HighlightEditing extends Plugin {
 	}
 	}
 }
 }
 
 
-/**
- * Highlight option descriptor.
- *
- * @typedef {Object} module:highlight/highlightediting~HighlightOption
- * @property {String} title The user-readable title of the option.
- * @property {String} model Attribute's unique value in the model.
- * @property {String} color Color used for highlighter. Should be coherent with `class` CSS setting.
- * @property {String} class CSS Class used on `mark` element in view. Should be coherent with `color` setting.
- * @property {'marker'|'pen'} type The type of highlighter:
- * - "marker" - will use #color as background,
- * - "pen" - will use #color as font color.
- */
-
-/**
- * The configuration of the {@link module:highlight/highlightediting~HighlightEditing Highlight feature}.
- *
- * Read more in {@link module:highlight/highlightediting~HighlightEditingConfig}.
- *
- * @member {module:highlight/highlightediting~HighlightEditingConfig} module:core/editor/editorconfig~EditorConfig#highlight
- */
-
-/**
- * The configuration of the {@link module:highlight/highlightediting~HighlightEditing Highlight feature}.
- *
- *        ClassicEditor
- *            .create( editorElement, {
- * 				highlight:  ... // Highlight feature config.
- *			} )
- *            .then( ... )
- *            .catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @interface HighlightEditingConfig
- */
-
-/**
- * Available highlighters options.
- *
- * There are two types of highlighters:
- * - 'marker' - rendered as `<mark>` element with defined background color.
- * - 'pen' - rendered as `<mark>` element with defined foreground (font) color.
- *
- * Note: Each highlighter must have it's own CSS class defined to properly match content data. Also it is advised
- * that color value should match the values defined in content CSS stylesheet.
- *
- * @member {Array.<module:heading/heading~HighlightOption>} module:heading/heading~HeadingConfig#options
- */
-
-// Converts {@link module:highlight/highlightediting~HighlightOption}
+// Converts {@link module:highlight/highlight~HighlightOption}
 // to {@link module:engine/conversion/definition-based-converters~ConverterDefinition}
 // to {@link module:engine/conversion/definition-based-converters~ConverterDefinition}
 //
 //
-// @param {module:highlight/highlightediting~HighlightOption} option
+// @param {module:highlight/highlight~HighlightOption} option
 // @returns {module:engine/conversion/definition-based-converters~ConverterDefinition}
 // @returns {module:engine/conversion/definition-based-converters~ConverterDefinition}
 function _getConverterDefinition( option ) {
 function _getConverterDefinition( option ) {
 	return {
 	return {

+ 2 - 2
packages/ckeditor5-highlight/src/highlightui.js

@@ -77,7 +77,7 @@ export default class HighlightUI extends Plugin {
 	/**
 	/**
 	 * Creates toolbar button from provided highlight option.
 	 * Creates toolbar button from provided highlight option.
 	 *
 	 *
-	 * @param {module:highlight/highlightediting~HighlightOption} option
+	 * @param {module:highlight/highlight~HighlightOption} option
 	 * @private
 	 * @private
 	 */
 	 */
 	_addHighlighterButton( option ) {
 	_addHighlighterButton( option ) {
@@ -134,7 +134,7 @@ export default class HighlightUI extends Plugin {
 	/**
 	/**
 	 * Creates split button dropdown UI from provided highlight options.
 	 * Creates split button dropdown UI from provided highlight options.
 	 *
 	 *
-	 * @param {Array.<module:highlight/highlightediting~HighlightOption>} options
+	 * @param {Array.<module:highlight/highlight~HighlightOption>} options
 	 * @private
 	 * @private
 	 */
 	 */
 	_addDropdown( options ) {
 	_addDropdown( options ) {