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

fix(ui-markdown-editor): handle cut image operation - #294 #298

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

Cronus1007
Copy link
Contributor

@Cronus1007 Cronus1007 commented Mar 12, 2021

Closes #294

The Cut operation that can't be performed upon the images is regulated.

Steps to see the Change

  • Click an image
  • Press Ctrl+X
  • Image disapperas
  • Normal cut functionality

Screenshots or Video

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to master from fork:branchname
  • Manual accessibility test performed
    • Keyboard-only access, including forms
    • Contrast at least WCAG Level A
    • Appropriate labels, alt text, and instructions

@Cronus1007 Cronus1007 changed the title feat(ui-markdown-editor): cut image operation fix(ui-markdown-editor): cut image operation Mar 12, 2021
@@ -130,10 +129,15 @@ export const MarkdownEditor = (props) => {
const CICERO_MARK_DOM = slateTransformer.toCiceroMark(SLATE_DOM);
const HTML_DOM = htmlTransformer.toHtml(CICERO_MARK_DOM);
const MARKDOWN_TEXT = ciceroMarkTransformer.toMarkdown(CICERO_MARK_DOM);
const [imageNode] = Editor.nodes(editor, { match: n => n.type === 'image' });
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

@irmerk @DianaLease @dselman Is this the best way to detect if the operation applies to an 'image'?

Copy link
Contributor Author

@Cronus1007 Cronus1007 Mar 12, 2021

Choose a reason for hiding this comment

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

@irmerk @DianaLease @dselman Also tell me the best way to detect textnode.

Copy link
Member

Choose a reason for hiding this comment

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

We have precedent here for detecting an image, see L175 under handleDrop in this file.

I'd look for other inspiration on a text node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@irmerk Sure.

Copy link
Sponsor Member

@mttrbrts mttrbrts left a comment

Choose a reason for hiding this comment

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

Good spot @Cronus1007. I'm happy with the change, but will need a review from one of the maintainers with deeper knowledge of Slate to confirm.

@irmerk irmerk changed the title fix(ui-markdown-editor): cut image operation fix(ui-markdown-editor): handle cut image operation - #294 Mar 15, 2021
Copy link
Member

@irmerk irmerk left a comment

Choose a reason for hiding this comment

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

This looks good to me. Can you rebase to get rid of 1c6ee38?

Signed-off-by: Cronus1007 <lit2019058@iiitl.ac.in>
@irmerk irmerk merged commit 9678eda into accordproject:master Mar 15, 2021
@Cronus1007 Cronus1007 deleted the issue-294 branch March 15, 2021 15:54
Cronus1007 added a commit to Cronus1007/web-components that referenced this pull request Mar 15, 2021
fix(ui-markdown-editor): handle cut image operation - accordproject#294 (accordproject#298)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to Cut an image
4 participants