Loheide-eu-mitarbeiterplatt.../resources/js/app.js
Friederich Loheide ea2200cb3e
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m49s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m51s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m12s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
Plugin-SDK: Oberflächen für Kunden-Plugins, Generator, Doku (0.20.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 04:57:28 +00:00

51 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import '../css/app.css';
import 'vue-sonner/style.css';
import * as Vue from 'vue';
import * as Inertia from '@inertiajs/vue3';
import * as InhausUi from './sdk/ui';
import { loadPluginPage } from './lib/pluginComponents';
const { createApp, h } = Vue;
const { createInertiaApp } = Inertia;
// Plugin-SDK: Module für die Import Map (public/sdk/*.js) – Plugins nutzen dieselben Instanzen.
window.__inhaus = { modules: { vue: Vue, '@inertiajs/vue3': Inertia, '@inhaus/ui': InhausUi } };
createInertiaApp({
title: (title, page) => {
const portalName = page.props.branding.portal_name;
return title ? `${title} – ${portalName}` : portalName;
},
resolve: (name) => {
// „news::Index“ → Seite aus einem mitgelieferten Plugin (plugins-core/news/resources/js/pages/Index.vue)
const pages = {
...import.meta.glob('./pages/**/*.vue'),
...import.meta.glob('../../plugins-core/*/resources/js/pages/**/*.vue'),
};
const [plugin, pageName] = name.includes('::') ? name.split('::') : [null, name];
const page = plugin ? pages[`../../plugins-core/${plugin}/resources/js/pages/${pageName}.vue`] : pages[`./pages/${name}.vue`];
// Separat installierte Plugins liefern ihre Seiten vorkompiliert mit (Plugin-SDK)
if (!page && plugin) {
const remote = loadPluginPage(name);
if (remote) return remote;
}
if (!page) {
throw new Error(`Seite nicht gefunden: ${name}`);
}
return page();
},
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el);
},
progress: {
color: 'var(--brand)',
},
});