Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Document lists] Editing part - tab, shift+tab #10880

Closed
Reinmar opened this issue Nov 22, 2021 · 7 comments
Closed

[Document lists] Editing part - tab, shift+tab #10880

Reinmar opened this issue Nov 22, 2021 · 7 comments
Assignees
Labels
package:list squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@Reinmar
Copy link
Member

Reinmar commented Nov 22, 2021

Part of #2973.

Based on https://miro.com/app/board/o9J_lVbklBg=/

@Reinmar Reinmar added type:task This issue reports a chore (non-production change) and other types of "todos". package:list squad:core Issue to be handled by the Core team. labels Nov 22, 2021
@Reinmar
Copy link
Member Author

Reinmar commented Dec 8, 2021

Note: In case of most keystrokes, we listen to editor.editing.view.document, but in the case of tab and shift+tab we use  editor.keystrokes. Unfortunately, it's hard to unify this now because we'd have to change it in too many places (not only lists). Hence, let's keep using editor.keystrokes for now.

@Reinmar
Copy link
Member Author

Reinmar commented Dec 8, 2021

Consider adding an integration test for how tab/shift+tab behaves in:

<td><ul><li>x</li><li>x[]</li></ul></td><td></td>

@Reinmar
Copy link
Member Author

Reinmar commented Dec 8, 2021

Difference between previous list implementation and the new one: Now we can have a table or code block inside a list item. So far, we could only have a list inside a table cell. So, the order may now be reversed.

@Reinmar
Copy link
Member Author

Reinmar commented Dec 8, 2021

Current Tab listeners: lists, table, code block, restricted editing.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 3, 2022

Remark: There's a functional conflict between indenting lists and indenting blocks. For simplicity, we decided to give list indentation absolute precedence over indenting blocks.

We can review this later when we can see the behavior live. We're aware that indenting blocks will not be possible in some scenarios.

@Reinmar
Copy link
Member Author

Reinmar commented Jan 3, 2022

There are two places where we'll need to handle these priorities:

  • keystroke handling (problem: we don't use editing view's events here but the keystroke handler which has no support for priorities)
  • multicommand for indent

This gets more complex, so let's split the integration with indent block to a separate ticket. For now, let's focus on scenarios where only indent list is enabled.

@CatStrategist CatStrategist self-assigned this Jan 31, 2022
@Reinmar Reinmar added the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 11, 2022
niegowski added a commit that referenced this issue Feb 24, 2022
Feature (engine): Introduced `TabObserver` that allows listening to pressing down the `Tab` key in a specified context.

Feature (core): The `MultiCommand` accepts priorities for child commands.

Other (table, code-block, list): `Tab` and `Tab+Shift` keystrokes handlers now listen to `tab` events and are executed with respect to context.

Internal (list): Implemented handling of `Tab` and `Tab+Shift` keys in document lists. Closes #10880.

Internal (list): `indentList` and `outdentList` commands are now registered with priority in 'Indent' `MultiCommand` , `Tab` and `Tab+Shift` listeners now executes in `li` context in order to not interfere with other plugins' listeners . Closes #11072.
@niegowski
Copy link
Contributor

Closed in #11244.

@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Feb 24, 2022
@Reinmar Reinmar added this to the upcoming milestone Feb 25, 2022
oleq added a commit that referenced this issue Apr 4, 2022
Feature (list): Introducing the document (advanced) list feature (multiple blocks per list item). Closes #2973. Closes #10812.

Feature (list): Introducing the document (advanced) list properties feature (list styles, start index, reversed list). Closes #11065.

Feature (html-support): Adds support for document list in the `GeneralHtmlSupport` feature. Closes #11454. Closes #11359. Closes #11358.

Feature (engine): Added a new `Model#insertObject()` method for inserting elements defined as objects by model schema (see #11198).

Feature (engine): Introduced inheritable `$container`, `$blockObject`, and `$inlineObject` element types in the model `Schema` (see #11197).

Feature (engine): Introduced `TabObserver` that allows listening to pressing down the `Tab` key in a specified context.

Feature (paragraph): Added an optional `options.attributes` parameter to the `InsertParagraph` command that allows setting attributes on a created paragraph (see #11198).

Feature (core): `MultiCommand` now allows setting a priority (order) of registered sub commands. Closes #11083.

Feature (engine): Added a new `Schema#getAttributesWithProperty()` method that retrieves attributes from a node which have given property (see #11198).

Feature (engine): Added a new `Schema#setAllowedAttributes()` method that validates whether attributes are allowed on a given element before setting them (see #11198).

Other (engine): The `Differ` change entries for `insert` and `remove` types are extended with a map of attributes that were set while inserting an element or that belonged to an element that got removed.

Other (engine): The `DowncastHelpers` are passing an additional parameter to the creator functions (the `data` that provides more context to the element creator callback).

Other (engine): The `isAllowedInsideAttributeElement` option was removed, from now on `AttributeElements` are allowed to wrap any view element.

Other (engine): The `ConversionApi` provided by the `UpcastDispatcher` was extended by an additional `keepEmptyElement()` method that marks an element that was created during splitting a model element that should not get removed on conversion even if it is empty. 

Other (html-support): Updated default schema definitions for various elements taking advantage of the `$container`, `$blockObject`, and `$inlineObject` elements in model schema (see #11197).

Other (table, code-block, list): The handling of `Tab` and `Shift+Tab` keystrokes switched to the `'tab'` view document event and now respects the event context.

Other (media-embed): Added an optional `findOptimalPosition` parameter to the `insertMedia()` helper that allows for inserting `media` model element without breaking the content (see #11198).

Fix (link): The link decorators should be converted on block images only once (should not wrap block image with an additional link).

Internal (engine): Added option for the `DomConverter` to transparently render only the content of the element in the data pipeline.

Internal (engine): Added option for the `DomConverter` to transparently render only the content of the element in the data pipeline.

Internal (engine): The `findOptimalPosition()` helper is now available in the ckeditor5-engine package for internal use (see #11198).

Internal (list): `DocumentListEditing` should extend `$container` (for `blockQuote`, etc.), `$block` (for `paragraph`, `heading2`, etc.), and `$blockObject` (for `table`, `horizontalLine`, etc.) with its attributes. Closes #11197.

Internal (list): `indentList` and `outdentList` commands are now registered with priority in 'Indent' `MultiCommand` , `Tab` and `Tab+Shift` listeners now executes in `li` context in order to not interfere with other plugins' listeners . Closes #11072.

Internal (list): Adds `DocumentListStartCommand` and `DocumentListReversedCommand`. Closes #11166.

Internal (list): Adds `DocumentListStyleCommand`. See #11166.

Internal (list): Adds post-fixer that makes sure that all items in a single list have the same start, reversed, and style properties. Closes #11167.

Internal (list): Deleting a widget which is a document list item should be possible. Closes #11346.

Internal (list): Document list items should not get split by inserting block objects (widgets). Closes #11198.

Internal (list): Implemented backspace and delete handling in and around document lists. Closes #10878.

Internal (list): Implemented handling of `Tab` and `Tab+Shift` keys in document lists. Closes #10880.

Internal (list): Implemented the `DocumentListMergeCommand`. Closes #10977.

Internal (list): Improved enter handling in document lists by allowing to split the list item when the collapsed selection is anchored in the first (but not only) empty block of a list item (see #10879, #10976).

Internal (list): Integrated the enter feature with document lists. Closes #10879. Closes #10976.

Internal (list): Reset document list properties after indent. Closes #11357.

Internal (table, page-break, horizontal-line, media-embed, html-embed, image): `table`, `pageBreak`, `horizontalLine`, `media`, `imageBlock`,`imageInline` elements are now inserted with `insertObject()` function instead of `insertContent()` (see #11198).

Internal (list): Added `DocumentListCommand` and `DocumentListIndentCommand`. Closes #10974. Closes #10975.

MINOR BREAKING CHANGE (html-support): The `$htmlSection`, `$htmlObjectBlock`, and `$htmlObjectInline` element types are no longer available for custom elements registered via `registerBlockElement()` to inherit from. Please use `$container`, `$blockObject`, and `$inlineObject` instead (see #11197).

MINOR BREAKING CHANGE (engine): The `isAllowedInsideAttributeElement` option was removed so `AttributeElements` can wrap any view element (according to positions). Make sure that you are not wrapping any `ContainerElement` by an accident by not checking the target in the converter. Those would previously get wrapped by an `AttributeElement` that immediately would be removed by the `ContainerElement` within it so there would not be any visual effect.

MINOR BREAKING CHANGE (engine): The handling of `Tab` and `Shift+Tab` keystrokes switched to the `'tab'` view document event across the project. If your integration uses `KeystrokeHandler` for `Tab` key handling, we recommend you migrate to the `'tab'` event to avoid unpredicted errors.

MINOR BREAKING CHANGE (engine): If your integration uses `Model#insertContent()` and `findOptimalInsertionRange()` to insert widgets into the content, we recommend you migrate your code to `Model#insertObject()` for best results. This is particularly relevant for compatibility with the document (advanced) lists feature (see #11198).
@CKEditorBot CKEditorBot modified the milestones: upcoming, iteration 52 Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:list squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

4 participants