-
Notifications
You must be signed in to change notification settings - Fork 47
feat(src): pasting clause uses new uuid - I88 #89
feat(src): pasting clause uses new uuid - I88 #89
Conversation
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Yes, the clause specific logic should be in Cicero-ui not here. I think we can register multiple onPaste handlers on the underlying slate editor, they are chained by the call to next() I believe. We also need to test what happens on paste of html that contains an existing clause div. |
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.
Please move any logic specific to clauses into cicero-ui.
Not sure I understand how to go about this. This is the direction I am currently going in:
|
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Further issues should consider:
|
Issue #88
Create newuuid
for a clause that was copy/pastedHandle
html
on a copy/paste and abstract out clause paste logic toCicero-UI
Changes
On a paste event, we take theDocument
on the event and make it mutable in order to change theclauseid
to auuid
and revert everything to immutablehtml
type in the paste effectFlags
@accordproject/cicero-ui
to abstract out clause template specific logic.cicero-ui
, passing it down, and runningprops.onPaste
if it has been passed downonPaste
requiringPluginManager
andFromHTML
frommarkdown-editor
, which means they will need to be imported intocicero-ui
only for them to be passed down intomarkdown-editor
from which they came from originallyonPaste
if it exists and then carries on to the rest of the plugin process.if (transfer.type !== 'html') return undefined;
may need to be adjusted withnext()
or something similar? Unsure whatnext()
really does here.clauseid
and then augment everything back to immutable.uuid
's placed onto theclauses
are not represented in the store, and moreover the extra pasted clause does not appear at all.DOM:
![Screen Shot 2019-08-30 at 3 32 49 PM](https://user-images.githubusercontent.com/36460856/64048218-1f4c8f00-cb3f-11e9-89f1-bfbc9890c66d.png)
![Screen Shot 2019-08-30 at 3 33 08 PM](https://user-images.githubusercontent.com/36460856/64048223-22e01600-cb3f-11e9-99ab-e58394194647.png)
Store:
Related Issues