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

Add Image Format to getFormatState #1656

Merged
merged 5 commits into from
Mar 22, 2023

Conversation

juliaroldi
Copy link
Contributor

Add Image Format that includes the image border and box shadow styles to Format State.

@@ -59,6 +62,11 @@ export function retrieveModelFormatState(
segments.some(segment => segment.segmentType == 'Image');

isFirst = false;

if (segment.segmentType === 'Image' && isFirstImage) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question to PM: for segments format, if the selection contains multiple different format, such as different font names, we will return undefined for that format so that user know that there are different fonts selected. Do we want to do the same for image?

/**
* Format of image, if there is table at cursor position
*/
imageFormat?: ImageFormat;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other format sub types, they are all supported by both Content model and original API. But this one is only supported by Content Model. In that case, I think we can have a sub type of FormatState in Content Model package to hold image format. So when people use original API, they will only see original formats.

What do you think?

@juliaroldi juliaroldi marked this pull request as draft March 22, 2023 16:36
@juliaroldi juliaroldi marked this pull request as ready for review March 22, 2023 17:59
@juliaroldi juliaroldi merged commit 5ff7581 into master Mar 22, 2023
@JiuqingSong JiuqingSong deleted the u/juliaroldi/image-format-content-model branch September 8, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants