/** * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ /** * @module list/listproperties/listpropertiesediting */ import { Plugin, type Editor } from 'ckeditor5/src/core'; import ListEditing from '../list/listediting'; /** * The engine of the list properties feature. * * It sets the value for the `listItem` attribute of the {@link module:list/list~List ``} element that * allows modifying the list style type. * * It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration. * Read more in {@link module:list/listconfig~ListPropertiesConfig}. */ export default class ListPropertiesEditing extends Plugin { /** * @inheritDoc */ static get requires(): readonly [typeof ListEditing]; /** * @inheritDoc */ static get pluginName(): 'ListPropertiesEditing'; /** * @inheritDoc */ constructor(editor: Editor); /** * @inheritDoc */ init(): void; /** * @inheritDoc */ afterInit(): void; /** * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether two lists will be merged into a single * one after deleting the content. * * The purpose of this action is to adjust the `listStyle`, `listReversed` and `listStart` values * for the list that was merged. * * Consider the following model's content: * * ```xml * UL List item 1 * UL List item 2 * [A paragraph.] * UL List item 1 * UL List item 2 * ``` * * After removing the paragraph element, the second list will be merged into the first one. * We want to inherit the `listStyle` attribute for the second list from the first one. * * ```xml * UL List item 1 * UL List item 2 * UL List item 1 * UL List item 2 * ``` * * See https://github.com/ckeditor/ckeditor5/issues/7879. * * @param attributeStrategies Strategies for the enabled attributes. */ private _mergeListAttributesWhileMergingLists; }