diff --git a/adapter/vaadin.js b/adapter/vaadin.js index 96c3d5c..ebd8a23 100644 --- a/adapter/vaadin.js +++ b/adapter/vaadin.js @@ -84,6 +84,9 @@ ELEMENTS.tags.forEach((tag) => { `; file += `@Tag("${tag.name}") @NpmPackage(value = "${PACKAGE_JSON.name}", version = "${PACKAGE_JSON.version}") +@NpmPackage(value = "@public-ui/themes", version = "2.1.2") +@NpmPackage(value = "@stencil/core", version = "4.18.3") +@JsModule("./src/kolibri-init.ts") @JsModule("${PACKAGE_JSON.name}/dist/components/${tag.name}") `; file += `public class ${pascalCase(tag.name)} extends Component { diff --git a/frontend/src/kolibri-init.ts b/frontend/src/kolibri-init.ts new file mode 100644 index 0000000..172691e --- /dev/null +++ b/frontend/src/kolibri-init.ts @@ -0,0 +1,25 @@ +import { bootstrap } from '@public-ui/components'; +import { defineCustomElements } from '@public-ui/components/dist/loader'; +import { DEFAULT } from '@public-ui/themes'; +import '@public-ui/components/assets/codicons/codicon.css'; + +void (async () => { + try { + await bootstrap( + DEFAULT, + () => { + defineCustomElements(window); + }, + { + theme: { + detect: 'auto', + }, + translation: { + name: 'de', + }, + }, + ); + } catch (error) { + console.warn('Theme registration failed:', error); + } +})(); diff --git a/kolibri-vaadin.iws b/kolibri-vaadin.iws index 9f54d1c..928c8e5 100644 --- a/kolibri-vaadin.iws +++ b/kolibri-vaadin.iws @@ -4,10 +4,10 @@