2b08bd5452
* fix(ui-components): use basic anchor if external=true * moved layout components to ui-components * integrated new components into fe-2
30 lines
702 B
JavaScript
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
|
|
})
|
|
}
|
|
}
|
|
})
|