Webcomponent support in SweetHome3D JS

This topic has been viewed 9465 times and has 11 replies
Thread status: Active
Features you would like to see [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

I'd like to use SweetHome3D in a webcomponent. But the viewHome function requires a element id. Would it be possible, if I use a HTMLElement as a parameter instead of a string, you use the compoent you get hand over, instead of search yourself for the component.
So it could be use inside of a webcomponent?
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

One of the changes needed would be this: https://github.com/node-projects/sweeth ... d72e0af8d3
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

Can I create Pull reuests? Never used sourceforge in the last years?
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

I now also remove the "define" calls from some additional libs. Cause I use "monaco" editor in my frontend, wich is using require/define and this does not work with the libs. In these the code is only for nodejs support, but I think it is not needed there.
Best would be to switch to es6...

see commit: https://github.com/node-projects/sweeth ... 1a5cc97d57
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

One of the changes needed would be this: https://github.com/node-projects/sweeth ... d72e0af8d3
was the wrong commit, this is the correct one: https://github.com/node-projects/sweeth ... 0985781e1d
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

And another fix for activeElement inside shadowRoot: https://github.com/node-projects/sweeth ... 350031f992
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

here is a sample how it could be used: https://node-projects.github.io/web-com ... home-3d%3E
jogibear9988
Posts: 13
Joined: Thu Oct 26, 2023 5:37 pm
Country: Deutschland

Re: Webcomponent support in SweetHome3D JS

Post by jogibear9988 »

@Puybaret
what do you think about the changes? i would do them myself, if there is a way to create pull requests.
Kunda
Posts: 18
Joined: Sun Jan 08, 2017 12:21 pm

Re: Webcomponent support in SweetHome3D JS

Post by Kunda »

You can make patches and then submit them on the forum or directly to sourceforge
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest