diff --git a/packages/shared-branding/src/index.ts b/packages/shared-branding/src/index.ts index 7bfdc345e..89f2424ef 100644 --- a/packages/shared-branding/src/index.ts +++ b/packages/shared-branding/src/index.ts @@ -38,8 +38,11 @@ export { getAvailableManaApps, APP_STATUS_LABELS, APP_SLIDER_LABELS, + APP_URLS, + getPillAppItems, type ManaApp, type AppStatus, + type PillAppItemConfig, } from './mana-apps'; // Types diff --git a/packages/shared-branding/src/mana-apps.ts b/packages/shared-branding/src/mana-apps.ts index 00bdfa1da..58f781906 100644 --- a/packages/shared-branding/src/mana-apps.ts +++ b/packages/shared-branding/src/mana-apps.ts @@ -230,3 +230,53 @@ export const APP_SLIDER_LABELS = { openApp: 'Open App', }, } as const; + +/** + * Default app URLs for local development and production + */ +export const APP_URLS: Record = { + chat: { dev: 'http://localhost:5174', prod: 'https://chat.manacore.app' }, + memoro: { dev: 'http://localhost:5175', prod: 'https://memoro.manacore.app' }, + presi: { dev: 'http://localhost:5176', prod: 'https://presi.manacore.app' }, + manadeck: { dev: 'http://localhost:5177', prod: 'https://manadeck.manacore.app' }, + maerchenzauber: { dev: 'http://localhost:5178', prod: 'https://maerchenzauber.manacore.app' }, + picture: { dev: 'http://localhost:5179', prod: 'https://picture.manacore.app' }, + zitare: { dev: 'http://localhost:5180', prod: 'https://zitare.manacore.app' }, + wisekeep: { dev: 'http://localhost:5181', prod: 'https://wisekeep.manacore.app' }, + nutriphi: { dev: 'http://localhost:5182', prod: 'https://nutriphi.manacore.app' }, +}; + +/** + * App item type for PillNavigation app switcher + */ +export interface PillAppItemConfig { + id: string; + name: string; + url: string; + icon?: string; + color?: string; + isCurrent?: boolean; +} + +/** + * Get app items for PillNavigation app switcher + * @param currentAppId - The ID of the current app to mark as active + * @param isDev - Whether to use development URLs (default: auto-detect) + * @param customUrls - Optional custom URL overrides per app + */ +export function getPillAppItems( + currentAppId?: AppIconId, + isDev?: boolean, + customUrls?: Partial> +): PillAppItemConfig[] { + const isDevMode = isDev ?? (typeof window !== 'undefined' && window.location.hostname === 'localhost'); + + return MANA_APPS.map((app) => ({ + id: app.id, + name: app.name, + url: customUrls?.[app.id] || (isDevMode ? APP_URLS[app.id].dev : APP_URLS[app.id].prod), + icon: app.icon, + color: app.color, + isCurrent: app.id === currentAppId, + })); +} diff --git a/packages/shared-ui/src/navigation/PillAppDropdown.svelte b/packages/shared-ui/src/navigation/PillAppDropdown.svelte new file mode 100644 index 000000000..798483c63 --- /dev/null +++ b/packages/shared-ui/src/navigation/PillAppDropdown.svelte @@ -0,0 +1,450 @@ + + +
+ + + + {#if isOpen} + + + + + + {/if} +
+ + diff --git a/packages/shared-ui/src/navigation/PillNavigation.svelte b/packages/shared-ui/src/navigation/PillNavigation.svelte index c5ec15ff0..86cd72d34 100644 --- a/packages/shared-ui/src/navigation/PillNavigation.svelte +++ b/packages/shared-ui/src/navigation/PillNavigation.svelte @@ -1,8 +1,9 @@