chore(vue3): migrate custom component registration

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
Maksim Sukharev 2025-06-23 09:57:14 +02:00
parent 7b5ff7795e
commit 2437bc9415

View file

@ -3,19 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import wrap from '@vue/web-component-wrapper'
import Vue from 'vue'
import { defineCustomElement } from 'vue'
import FlowPostToConversation from './views/FlowPostToConversation.vue'
const FlowPostToConversationComponent = wrap(Vue, FlowPostToConversation)
const FlowPostToConversationComponent = defineCustomElement(FlowPostToConversation, {
shadowRoot: false,
})
const customElementId = 'oca-spreed-flow_post_to_conversation'
window.customElements.define(customElementId, FlowPostToConversationComponent)
// In Vue 2, wrap doesn't support disabling shadow :(
// Disable with a hack
Object.defineProperty(FlowPostToConversationComponent.prototype, 'attachShadow', { value() { return this } })
Object.defineProperty(FlowPostToConversationComponent.prototype, 'shadowRoot', { get() { return this } })
window.OCA.WorkflowEngine.registerOperator({
id: 'OCA\\Talk\\Flow\\Operation',
color: '#0082c9',