Files
nextcloud-server-mirror/core/src/appmenu.ts
Peter Ringelmann 03cc28901e feat(core): add standalone AppMenu bootstrap
Mounts the waffle launcher from its own entry point, independent of
core-main, and exposes OC.setNavigationCounter once mounted.

Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-11-04 12:52:56 +01:00

24 lines
799 B
TypeScript

/*!
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Standalone entry for the waffle launcher (AppMenu). Mounts independently of
* core-main so the app grid lives in its own chunk.
*/
import { createApp } from 'vue'
import AppMenu from './components/AppMenu/AppMenu.vue'
import { mountInPlace } from './utils/mountInPlace.ts'
const placeholder = document.getElementById('header-start__appmenu')
// No placeholder on layouts without the app menu, e.g. public pages.
if (placeholder) {
const appMenu = mountInPlace(createApp(AppMenu), placeholder) as InstanceType<typeof AppMenu>
Object.assign(window.OC, {
setNavigationCounter(id: string, counter: number) {
appMenu.setNavigationCounter(id, counter)
},
})
}