-
Notifications
You must be signed in to change notification settings - Fork 418
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
Two-Step Pasting #390
Two-Step Pasting #390
Conversation
791ecb0
to
c9a4d7d
Compare
c9a4d7d
to
60c64d2
Compare
52b3c78
to
8c20819
Compare
263ec00
to
e924d4a
Compare
Ready to be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about the rationale behind some of these changes next week. I'd like to understand stuff before giving my 👍.
lib/util/CopyPasteUtil.js
Outdated
export function getParents(elements) { | ||
|
||
// find elements that are not children of any other elements | ||
return filter(elements, function(element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation is super slow as it will run elements.length * elements.length
times.
Does it have to be fast? If yes, let's look into 🚤 it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that might be an issue, let's look into it. 💪
8a5e27e
to
66abc83
Compare
f21b39a
to
cdb06fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some things I noticed
|
||
// helpers ////////// | ||
|
||
export function createMoveEvent(x, y) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff, maybe we can use it to improve the situation in the dirty HoverFixSpec
. 👍
cdb06fc
to
6f7cfb3
Compare
9d470de
to
9b4bd6e
Compare
* create#start can be called with a single element or multiple elements * create will assign x and y to shapes * create will center elements around cursor * create preview moved to CreatePreview * PreviewSupport#addDragger add optional third argument gfx * Modeling#createElements added BREAKING CHANGES * Create: hints are not passed to CreateShapeHandler anymore * Create#start: third argument is context, if you want to specify source do { hints: { source: myElement } }
a884d44
to
1e9b722
Compare
* CopyPaste#paste starts create by default * add createElementsBehavior hint to prevent behavior on creating elements BREAKING CHANGES * CopyPaste: <elements.copied>, <element.copy>, <elements.copy>, <element.paste>, <elements.paste> removed, <copyPaste.canCopyElements>, <copyPaste.copyElement>, <copyPaste.elementsCopied>, <copyPaste.pasteElement>, <copyPaste.pasteElements> added * Modeling#pasteElements removed in favor of Modeling#createElements * MouseTracking removed in favor of Mouse
1e9b722
to
fb938bf
Compare
|
||
|
||
/** | ||
* Adds the ability to create new shapes via drag and drop. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is gone now, will we restore it some day, maybe? 👓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code is not self-explanatory enough, yes. 🙉
fb938bf
to
1ef5b34
Compare
Required by bpmn-io/bpmn-js#1137
Related to camunda/camunda-modeler#1421