/** * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ /** * @module list/legacylistproperties/legacylistpropertiesediting */ import { Plugin, type Editor } from 'ckeditor5/src/core.js'; import LegacyListEditing from '../legacylist/legacylistediting.js'; /** * The engine of the list properties feature. * * It sets the value for the `listItem` attribute of the {@link module:list/legacylist~LegacyList ``} 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 LegacyListPropertiesEditing extends Plugin { /** * @inheritDoc */ static get requires(): readonly [typeof LegacyListEditing]; /** * @inheritDoc */ static get pluginName(): "LegacyListPropertiesEditing"; /** * @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; }