TeselaGen / tg-oss

Teselagen Open Source modules
https://teselagen.github.io/tg-oss/
MIT License
40 stars 17 forks source link

Copy command in menu toolbar "Edit" menu doesn't work for multiple editors #24

Closed ryan-stackwave closed 8 months ago

ryan-stackwave commented 1 year ago

@tnrich

The implementation of the copy command for the menu toolbar assumes there is only one element with class veVectorInteractionWrapper so copying via the "Edit" menu doesn't work for the second editor on a page: https://github.com/TeselaGen/tg-oss/blob/master/packages/ove/src/commands/index.js#L362

tnrich commented 1 year ago

HI @ryan-stackwave you're right, good catch. I think we should be scoping to the unique editorName of the given editor. Any chance you'd want to add a PR for that functionality? We're not using multiple editors on the same page yet.

ryan-stackwave commented 1 year ago

Sure @tnrich, I'll see what I can do.

ryan-stackwave commented 1 year ago

@tnrich, bad news. It looks like I can't upgrade to this version of ove yet because react 18 conflicts with another library I'm using. I'll have to look at this again when I upgrade react and work around in the meantime.

tnrich commented 1 year ago

@ryan-stackwave I don't think you need to be using react 18 to use this version of ove? Are you seeing errors when trying to upgrade?

ryan-stackwave commented 8 months ago

Sorry for the delay @tnrich, got caught up in other priorities. I found the issue with using react 16 with ove and it seems to be because I'm using webpack. I was able to workaround it by specifying aliases in my webpack.js file to force all libraries to use my chosen version of react:

alias: {  
    react: path.resolve(__dirname, "./node_modules/react"),  
    "react-dom": path.resolve(__dirname, "./node_modules/react-dom"),  
    "react-redux": path.resolve(__dirname, "./node_modules/react-redux")  
}

This stackoverflow post seems to indicate that changing ove to make the react libraries peerDependencies rather than dependencies might make it more compatible with webpack but I haven't tried it yet.