node-projects / web-component-designer

A Designer for HTML Components or Pages in a WebComponent
https://node-projects.github.io/web-component-designer-demo/index.html
MIT License
136 stars 16 forks source link

Check if element is of type "custom", then stop with sub-child select… #404

Closed ifekonja closed 6 months ago

ifekonja commented 7 months ago

…ion.

jogibear9988 commented 7 months ago

Can you add a sample HTML you use your changes in?

I look how we could add this.

ifekonja commented 7 months ago

I use JavaScript "createElement('custom-eco-fb')" , not HTML and want wo void childs to be selected Same valids for "static" selector, so it cannot be selected, since it is controlled by my platform

ifekonja commented 7 months ago

But I didnt change it properly, since still NULL designItem are coming and Objects are no more selectable at all, I dont know what I did wrong

ifekonja commented 7 months ago

And shadow selection frames are remaining on the sheet (from original position)

jogibear9988 commented 7 months ago

are you trying something like this:

  <div>
      <custom-aaa><span>aaa</span><span>bbb</span></custom-aaa>
  </div>

but here your are not able to select all components inside of "custom...." It should behave like if it is a custom HTML element?

I can look how this would be possible.

But you know (if you want this) that it already works like this:

  <div>
      <custom-aaa style="position:absolute;left:0px;top:3px;">
          <template shadowrootmode="open">
              <span>aaa</span>
              <span>bbb</span>
          </template>
      </custom-aaa>
  </div>
ifekonja commented 7 months ago

It would be nice to get the events "forwarded" in bithe cases (locked and custom), so I could perform my own reactions. But I dont know how...over platform callback or over "template-class".... do you have any example of template-class, I would like to use it (in custom-menu and connected to events)

jogibear9988 commented 7 months ago

I (again) don't understand. Maybe describe your case better then I can help you. What are you trying to build? Wich events you like forwarded? I don't get it.

ifekonja commented 7 months ago

how is template linked to template-class-file? does selection stops on "custom"? (I want to block the moving of inside elements, since they are parts of whole object, and cannot be teared apart

ifekonja commented 7 months ago

I have to get "mouse move" to my handler; it is ok that it is moved, but I have to react to to those events in my platform. So I am missing some art of "extended" callback (over template?). So PointTool would send mouse events also to template-event handlers

jogibear9988 commented 7 months ago

I still don't get it. Could you not describe your complete usecase a little bit more.

ifekonja commented 7 months ago

I would like to use your "custom-elements-manifest" , connected to menu-list (PreDefinedElementsService), I dont understand if template is related to "custom-elements-manifest" ? I am missing also Event Handler definition in "custom" and "defaultContents". I dont get , how I can use it in designer , together with "template" ?

I would like to have own "custom" objects, which are not "tearable" (childs NOT separately selectable and movable), and with extra Event handlers (sending event from PointTool to custom-handler)

jogibear9988 commented 6 months ago

I close, as the issue could be resolved via declaritive shadowdom, if not we could create a extension but not like this with hardcoded values