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

Conversion: Allows specyfing the priority for view element #4339

Closed
pomek opened this issue Apr 18, 2018 · 3 comments · Fixed by ckeditor/ckeditor5-engine#1413
Closed

Conversion: Allows specyfing the priority for view element #4339

pomek opened this issue Apr 18, 2018 · 3 comments · Fixed by ckeditor/ckeditor5-engine#1413
Assignees
Labels
package:engine type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone

Comments

@pomek
Copy link
Member

pomek commented Apr 18, 2018

When I was working on https://github.com/ckeditor/ckeditor5-highlight/issues/17 I noticed that there is no option for specifying the priority for the view element that will be created.

It means we cannot use two-way conversion methods like elementToElement(), attributeToElement() or attributeToAttribute(). Instead of we have to care about upcast and downcast conversion manually. It means we cannot use the helpers that are using in two-way conversion.

Would be nice to have an option for that. It simplify changes the priority element. We will have a single property instead of the whole block of code (which does not care about upcastAlso option.

@pomek
Copy link
Member Author

pomek commented Apr 18, 2018

How should we call the parameter? I thought about viewPriority:

const definition = { 
  model: { },
  view: { },
  priority: 'normal', /* by default */
  viewPriority: AttributeElement.DEFAULT_PRIORITY /* by default */
}

WDYT?

@Reinmar
Copy link
Member

Reinmar commented Apr 18, 2018

Could we add it to the view: {} object? Where is it defined in downcast and upcast converters?

@pomek
Copy link
Member Author

pomek commented Apr 18, 2018

Could we add it to the view: {} object?

Yes, we can. In such case it would be called priority.

Where is it defined in downcast and upcast converters?

I guess here – https://github.com/ckeditor/ckeditor5-engine/blob/70cc0f5976e3a2e9862f6550ad18b1886df83a37/src/conversion/downcast-converters.js#L377

scofalik referenced this issue in ckeditor/ckeditor5-engine May 15, 2018
Feature: Introduce `ElementDefinition#priority` property which allows specifying the priority of created element during the downcast conversion. Closes #1408.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 18 milestone Oct 9, 2019
@mlewand mlewand added module:conversion type:feature This issue reports a feature request (an idea for a new functionality or a missing option). package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants