Open NilsJacobsen opened 2 weeks ago
How will apps define custom actions?
If the external inlang-message-bundle
component has no shadow root, I think it can't use slots. If slots can't be used, how can apps define custom actions?
<inlang-message-bundle
.messageBundle=${bundle}
.settings=${settings}
@change-message-bundle=${() => {}}
>
<inlang-message-bundle-action slot="bundle" />
</inlang-message-bundle>
We could access the children and check if they are a instance of a action template. Based on that we can put it into the right location of the wrapper component and then slot it. Seems doable.
The last research showed that the message bundle editor which wants to render multiple pattern editors in the shadow root doesn't work.
The rich text editors rely on the
Selection API
which needs to be supported by the browsers. This API is not standard -> bugs and different behaviour in different browsers.Proposal: Build the component in a way, that the editor can be on the light dom.
External Wrapper API (simple)
The wrapper component doesn't use the shadow root, that way we can use slots inside the wrapper that can also be on the top level dom.
Internal API (inside wrapper)
We can do manual wiring in this component. But the app devs are going to use the simple api as long as they don't want to hack some fancy stuff in it.
Naming convention
inlang-message-bunlde
| no-shadow (same api as before)inlang-message-bundle-root
inlang-message-bundle-header
inlang-message
inlang-variant
inlang-pattern-editor
| no-shadow -> slotinlang-message-bunlde-action
) -> slotinlang-variant-action
) -> slotLoom
Solving Rich Text Editor Issues in Web Components