UNPKG

1.52 kBJavaScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5/**
6 * @module list/documentlistproperties/documentlistpropertiesutils
7 */
8import { Plugin } from 'ckeditor5/src/core';
9import { getAllSupportedStyleTypes, getListStyleTypeFromTypeAttribute, getListTypeFromListStyleType, getTypeAttributeFromListStyleType } from './utils/style';
10/**
11 * A set of helpers related to document lists.
12 */
13export default class DocumentListPropertiesUtils extends Plugin {
14 /**
15 * @inheritDoc
16 */
17 static get pluginName() {
18 return 'DocumentListPropertiesUtils';
19 }
20 /**
21 * Gets all the style types supported by given list type.
22 */
23 getAllSupportedStyleTypes() {
24 return getAllSupportedStyleTypes();
25 }
26 /**
27 * Checks whether the given list-style-type is supported by numbered or bulleted list.
28 */
29 getListTypeFromListStyleType(listStyleType) {
30 return getListTypeFromListStyleType(listStyleType);
31 }
32 /**
33 * Converts `type` attribute of `<ul>` or `<ol>` elements to `list-style-type` equivalent.
34 */
35 getListStyleTypeFromTypeAttribute(value) {
36 return getListStyleTypeFromTypeAttribute(value);
37 }
38 /**
39 * Converts `list-style-type` style to `type` attribute of `<ul>` or `<ol>` elements.
40 */
41 getTypeAttributeFromListStyleType(value) {
42 return getTypeAttributeFromListStyleType(value);
43 }
44}