Files
InvoiceShelf/resources/scripts/extensions/ExtensionSlot.vue
T
Darko Gjorgjijoski 0b9ae9ea00 refactor(ai): extract assistant into an official module (#749)
* feat(modules): expose host data boundaries

* feat(modules): add frontend extension surfaces

* refactor(ai): remove assistant from core

* chore(ai): prepare the module extraction

* fix(modules): load extension styles after the host bundle

* chore(modules): lock SDK 3.3.0
2026-08-05 22:10:21 +02:00

36 lines
1.0 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue'
import { extensionRegistry, extensionItems } from './runtime'
import type { RichEditorContext } from './types'
const props = defineProps<{
name: 'header-actions' | 'company-layout-overlays' | 'rich-editor-toolbar-actions'
context?: RichEditorContext
}>()
const contributions = computed(() => {
const items = {
'header-actions': extensionRegistry.headerActions.value,
'company-layout-overlays': extensionRegistry.companyLayoutOverlays.value,
'rich-editor-toolbar-actions': extensionRegistry.richEditorToolbarActions.value,
}[props.name]
return extensionItems(items)
})
function componentProps(props_: Record<string, unknown> | undefined): Record<string, unknown> {
return props.context === undefined
? (props_ ?? {})
: { ...props_, context: props.context }
}
</script>
<template>
<component
:is="contribution.component"
v-for="contribution in contributions"
:key="contribution.id"
v-bind="componentProps(contribution.props)"
/>
</template>