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 Canvas Component Dragging API #6184

Merged
merged 15 commits into from
Oct 3, 2024
Merged

Add Canvas Component Dragging API #6184

merged 15 commits into from
Oct 3, 2024

Conversation

mohamedsalem401
Copy link
Member

@mohamedsalem401 mohamedsalem401 commented Oct 2, 2024

  • For dragging symbols
  const onDragStart = () => {
    Canvas.startSort([{
      symbolModel: symbol,
      content: () => Components.addSymbol(symbol),
      definition: {
        type: symbol.get('type'),
        draggable: symbol.attributes.draggable,
        droppable: symbol.attributes.droppable,
      },
    }]);
 };
  
  const onDragEnd = () => {
    Canvas.endSort();
  };
  • Also add a property to blocks that determines if a block can be moved inside a given component when the content is a function.

@mohamedsalem401 mohamedsalem401 requested a review from artf October 2, 2024 18:40
Copy link
Member

@artf artf left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@artf artf left a comment

Choose a reason for hiding this comment

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

🔝

@artf artf merged commit d94f2c1 into dev Oct 3, 2024
3 checks passed
@mohamedsalem401 mohamedsalem401 deleted the add-canvas-sorter-api branch October 3, 2024 14:06
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