Files
speckle-server/packages/ui-components-nuxt/index.js
T
Kristaps Fabians Geikins 2b08bd5452 feat: moved various LayoutXXX components to ui-components (#1607)
* fix(ui-components): use basic anchor if external=true

* moved layout components to ui-components

* integrated new components into fe-2
2023-06-08 09:12:09 +03:00

30 lines
702 B
JavaScript

import { has, isObjectLike } from 'lodash-es'
import { defineNuxtModule, addComponent } from '@nuxt/kit'
import * as SpeckleUiComponents from '@speckle/ui-components'
const isVueComponent = (val) => {
if (!isObjectLike(val)) return false
return has(val, '__name')
}
export default defineNuxtModule({
meta: {
name: 'speckle-ui-components'
},
async setup() {
// Add all @speckle/ui-components components
for (const [key, val] of Object.entries(SpeckleUiComponents)) {
const isVue = isVueComponent(val)
if (!isVue) {
continue
}
addComponent({
name: key,
filePath: '@speckle/ui-components',
export: key
})
}
}
})