mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
🔧 fix(mac-mini): update health checks and disable missing services
- Disable api-gateway and skilltree-web (no working images/Dockerfiles) - Fix mana-search Dockerfile healthcheck port and endpoint - Update health-check.sh to skip disabled services - Fix search service health endpoint (/api/v1/health) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
177e4eea88
commit
d5e18c9c27
14 changed files with 3702 additions and 10 deletions
|
|
@ -0,0 +1,635 @@
|
|||
<script lang="ts">
|
||||
import { setContext, onMount } from 'svelte';
|
||||
import { unifiedBarStore } from '$lib/stores/unified-bar.svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { quintOut } from 'svelte/easing';
|
||||
import { fly, slide } from 'svelte/transition';
|
||||
|
||||
// Components
|
||||
// import QuickInputBar from '@manacore/shared-ui/components/QuickInputBar.svelte';
|
||||
import DateStrip from './DateStrip.svelte';
|
||||
import TagStrip from './TagStrip.svelte';
|
||||
import CalendarToolbar from './CalendarToolbar.svelte';
|
||||
import DateStripFab from './DateStripFab.svelte';
|
||||
|
||||
// Props
|
||||
interface Props {
|
||||
// QuickInputBar props
|
||||
onSearch?: (query: string) => void;
|
||||
onSelect?: (result: any) => void;
|
||||
onSearchChange?: (query: string) => void;
|
||||
onCreate?: (data: any) => void;
|
||||
onParseCreate?: (data: any) => void;
|
||||
placeholder?: string;
|
||||
emptyText?: string;
|
||||
searchingText?: string;
|
||||
createText?: string;
|
||||
appIcon?: string;
|
||||
bottomOffset?: string;
|
||||
hasFabRight?: boolean;
|
||||
hasFabLeft?: boolean;
|
||||
defaultOptions?: any[];
|
||||
|
||||
// DateStrip props
|
||||
selectedDate?: Date;
|
||||
onDateSelect?: (date: Date) => void;
|
||||
|
||||
// Responsive
|
||||
isMobile?: boolean;
|
||||
|
||||
// Calendar toolbar visibility
|
||||
showCalendarToolbar?: boolean;
|
||||
onToolbarCollapsedChange?: (collapsed: boolean) => void;
|
||||
}
|
||||
|
||||
let {
|
||||
// QuickInputBar props
|
||||
onSearch = () => {},
|
||||
onSelect = () => {},
|
||||
onSearchChange = () => {},
|
||||
onCreate = () => {},
|
||||
onParseCreate = () => {},
|
||||
placeholder = 'Neuer Termin oder suchen...',
|
||||
emptyText = 'Keine Termine gefunden',
|
||||
searchingText = 'Suche...',
|
||||
createText = 'Erstellen',
|
||||
appIcon = 'calendar',
|
||||
bottomOffset = '70px',
|
||||
hasFabRight = false,
|
||||
hasFabLeft = false,
|
||||
defaultOptions = [],
|
||||
|
||||
// DateStrip props
|
||||
onDateSelect = () => {},
|
||||
|
||||
// Responsive
|
||||
isMobile = false,
|
||||
|
||||
// Calendar toolbar
|
||||
showCalendarToolbar = false,
|
||||
onToolbarCollapsedChange = () => {},
|
||||
}: Props = $props();
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
// Local state for transitions
|
||||
let isTransitioning = $state(false);
|
||||
let previousMode = $state(unifiedBarStore.mode);
|
||||
|
||||
// Computed values
|
||||
let layerZIndices = $derived({
|
||||
input: 80,
|
||||
date: 85,
|
||||
tag: 90,
|
||||
toolbar: 95,
|
||||
overlay: 110,
|
||||
});
|
||||
|
||||
let activeLayers = $derived(() => {
|
||||
const layers = [];
|
||||
if (unifiedBarStore.showQuickInput) layers.push('input');
|
||||
if (unifiedBarStore.showDateStrip) layers.push('date');
|
||||
if (unifiedBarStore.showTagStrip) layers.push('tag');
|
||||
if (unifiedBarStore.showCalendarToolbar) layers.push('toolbar');
|
||||
return layers;
|
||||
});
|
||||
|
||||
// Simplified bottom offsets (using fixed values for now)
|
||||
let layerBottomOffsets = $derived({
|
||||
input: '0px',
|
||||
date: '70px',
|
||||
tag: '140px',
|
||||
toolbar: '280px',
|
||||
});
|
||||
|
||||
// Handle mode transitions
|
||||
$effect(() => {
|
||||
const currentMode = unifiedBarStore.mode;
|
||||
if (currentMode !== previousMode) {
|
||||
isTransitioning = true;
|
||||
setTimeout(() => {
|
||||
isTransitioning = false;
|
||||
}, unifiedBarStore.settings.barAnimationDuration);
|
||||
previousMode = currentMode;
|
||||
}
|
||||
});
|
||||
|
||||
// Overlay menu handlers
|
||||
function handleOverlayToggle() {
|
||||
unifiedBarStore.toggleOverlay();
|
||||
dispatch('overlayToggle', { isOpen: unifiedBarStore.isOverlayOpen });
|
||||
}
|
||||
|
||||
function handleOverlayAction(action: string) {
|
||||
dispatch('overlayAction', { action });
|
||||
|
||||
// Handle common actions
|
||||
switch (action) {
|
||||
case 'toggle-date-strip':
|
||||
unifiedBarStore.toggleDateStrip();
|
||||
break;
|
||||
case 'toggle-tag-strip':
|
||||
unifiedBarStore.toggleTagStrip();
|
||||
break;
|
||||
case 'toggle-toolbar':
|
||||
unifiedBarStore.toggleCalendarToolbar();
|
||||
break;
|
||||
case 'collapse-all':
|
||||
unifiedBarStore.collapseAll();
|
||||
break;
|
||||
}
|
||||
|
||||
// Close overlay after action
|
||||
unifiedBarStore.set('overlayMenuOpen', false);
|
||||
}
|
||||
|
||||
// Layer activation
|
||||
function handleLayerClick(layer: string) {
|
||||
unifiedBarStore.setActiveLayer(layer as any);
|
||||
if (unifiedBarStore.mode === 'collapsed') {
|
||||
unifiedBarStore.setMode('expanded');
|
||||
}
|
||||
}
|
||||
|
||||
// Context for child components
|
||||
onMount(() => {
|
||||
setContext('unifiedBarStore', unifiedBarStore);
|
||||
setContext('isMobile', isMobile);
|
||||
});
|
||||
|
||||
// Transition configurations
|
||||
const slideConfig = {
|
||||
duration: unifiedBarStore.settings.barAnimationDuration,
|
||||
easing: quintOut,
|
||||
y: 20,
|
||||
};
|
||||
|
||||
const flyConfig = {
|
||||
duration: unifiedBarStore.settings.barAnimationDuration,
|
||||
easing: quintOut,
|
||||
opacity: 0.8,
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- UnifiedBar Container -->
|
||||
<div
|
||||
class="unified-bar-container"
|
||||
class:transitioning={isTransitioning}
|
||||
style="--animation-duration: {unifiedBarStore.settings.barAnimationDuration}ms;"
|
||||
>
|
||||
<!-- Layer 3: CalendarToolbar -->
|
||||
{#if unifiedBarStore.showCalendarToolbar}
|
||||
<div
|
||||
class="unified-bar-layer toolbar-layer"
|
||||
style="z-index: {layerZIndices.toolbar}; bottom: {layerBottomOffsets.toolbar};"
|
||||
class:active={unifiedBarStore.activeLayer === 'toolbar'}
|
||||
transition:fly={{ ...flyConfig, y: 100 }}
|
||||
role="toolbar"
|
||||
aria-label="Calendar toolbar"
|
||||
onclick={() => handleLayerClick('toolbar')}
|
||||
>
|
||||
<!-- CalendarToolbar placeholder -->
|
||||
<div class="toolbar-placeholder">CalendarToolbar Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 2: TagStrip -->
|
||||
{#if unifiedBarStore.showTagStrip}
|
||||
<div
|
||||
class="unified-bar-layer tag-strip-layer"
|
||||
style="z-index: {layerZIndices.tag}; bottom: {layerBottomOffsets.tag};"
|
||||
class:active={unifiedBarStore.activeLayer === 'tag'}
|
||||
transition:fly={{ ...flyConfig, y: 50 }}
|
||||
role="toolbar"
|
||||
aria-label="Tag filter bar"
|
||||
onclick={() => handleLayerClick('tag')}
|
||||
>
|
||||
<!-- TagStrip placeholder -->
|
||||
<div class="tag-strip-placeholder">TagStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 1: DateStrip -->
|
||||
{#if unifiedBarStore.showDateStrip}
|
||||
<div
|
||||
class="unified-bar-layer date-strip-layer"
|
||||
style="z-index: {layerZIndices.date}; bottom: {layerBottomOffsets.date};"
|
||||
class:active={unifiedBarStore.activeLayer === 'date'}
|
||||
transition:fly={{ ...flyConfig, y: 30 }}
|
||||
role="toolbar"
|
||||
aria-label="Date strip"
|
||||
onclick={() => handleLayerClick('date')}
|
||||
>
|
||||
<!-- DateStrip placeholder -->
|
||||
<div class="date-strip-placeholder">DateStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 1: DateStrip -->
|
||||
{#if unifiedBarStore.showDateStrip && !unifiedBarStore.legacyDateStripCollapsed}
|
||||
<div
|
||||
class="unified-bar-layer date-strip-layer"
|
||||
style="z-index: {layerZIndices.date}; bottom: 70px;"
|
||||
class:active={unifiedBarStore.activeLayer === 'date'}
|
||||
transition:fly={{ ...flyConfig, y: 30 }}
|
||||
role="toolbar"
|
||||
aria-label="Date strip"
|
||||
onclick={() => handleLayerClick('date')}
|
||||
>
|
||||
<!-- DateStrip placeholder -->
|
||||
<div class="date-strip-placeholder">DateStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 2: TagStrip -->
|
||||
{#if unifiedBarStore.showTagStrip}
|
||||
<div
|
||||
class="unified-bar-layer tag-strip-layer"
|
||||
style="z-index: {layerZIndices.tag}; bottom: {layerBottomOffsets.tag};"
|
||||
class:active={unifiedBarStore.activeLayer === 'tag'}
|
||||
transition:fly={{ ...flyConfig, y: 50 }}
|
||||
role="toolbar"
|
||||
aria-label="Tag filter bar"
|
||||
onclick={() => handleLayerClick('tag')}
|
||||
>
|
||||
<!-- TagStrip placeholder -->
|
||||
<div class="tag-strip-placeholder">TagStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 1: DateStrip -->
|
||||
{#if unifiedBarStore.showDateStrip}
|
||||
<div
|
||||
class="unified-bar-layer date-strip-layer"
|
||||
style="z-index: {layerZIndices.date}; bottom: {layerBottomOffsets.date};"
|
||||
class:active={unifiedBarStore.activeLayer === 'date'}
|
||||
transition:fly={{ ...flyConfig, y: 30 }}
|
||||
role="toolbar"
|
||||
aria-label="Date strip"
|
||||
onclick={() => handleLayerClick('date')}
|
||||
>
|
||||
<!-- DateStrip placeholder -->
|
||||
<div class="date-strip-placeholder">DateStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 1: DateStrip -->
|
||||
{#if unifiedBarStore.showDateStrip}
|
||||
<div
|
||||
class="unified-bar-layer date-strip-layer"
|
||||
style="z-index: {layerZIndices.date}; bottom: {layerBottomOffsets.date};"
|
||||
class:active={unifiedBarStore.activeLayer === 'date'}
|
||||
transition:fly={{ ...flyConfig, y: 30 }}
|
||||
role="toolbar"
|
||||
aria-label="Date strip"
|
||||
onclick={() => handleLayerClick('date')}
|
||||
>
|
||||
<!-- DateStrip placeholder -->
|
||||
<div class="date-strip-placeholder">DateStrip Component</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Layer 0: QuickInputBar -->
|
||||
{#if unifiedBarStore.showQuickInput}
|
||||
<div
|
||||
class="unified-bar-layer input-layer"
|
||||
style="z-index: {layerZIndices.input}; bottom: {layerBottomOffsets.input};"
|
||||
class:active={unifiedBarStore.activeLayer === 'input'}
|
||||
transition:slide={slideConfig}
|
||||
role="toolbar"
|
||||
aria-label="Quick input"
|
||||
onclick={() => handleLayerClick('input')}
|
||||
>
|
||||
<div class="input-bar-wrapper">
|
||||
<div class="input-bar-row">
|
||||
<!-- QuickInputBar placeholder - will be implemented with actual component -->
|
||||
<div class="quick-input-placeholder">
|
||||
QuickInputBar Component
|
||||
<button onmousedown={handleOverlayToggle}>
|
||||
{unifiedBarStore.isOverlayOpen ? 'X' : 'Menu'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Overlay Menu -->
|
||||
{#if unifiedBarStore.isOverlayOpen}
|
||||
<div
|
||||
class="unified-bar-overlay"
|
||||
style="z-index: {layerZIndices.overlay};"
|
||||
transition:fly={{ ...flyConfig, y: 100 }}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="Menu"
|
||||
>
|
||||
<div class="overlay-backdrop" onclick={handleOverlayToggle} />
|
||||
<div class="overlay-content">
|
||||
<div class="overlay-header">
|
||||
<h3>Menü</h3>
|
||||
<button class="close-btn" onmousedown={handleOverlayToggle}>
|
||||
<span class="icon-x"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="overlay-actions">
|
||||
<!-- Layer Toggles -->
|
||||
<div class="action-group">
|
||||
<h4>Ansichten</h4>
|
||||
<button
|
||||
class="action-btn"
|
||||
class:active={unifiedBarStore.showDateStrip}
|
||||
onmousedown={() => handleOverlayAction('toggle-date-strip')}
|
||||
>
|
||||
<span class="icon-calendar"></span>
|
||||
Datum-Leiste
|
||||
<span class="status">{unifiedBarStore.showDateStrip ? '✓' : ''}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="action-btn"
|
||||
class:active={unifiedBarStore.showTagStrip}
|
||||
onmousedown={() => handleOverlayAction('toggle-tag-strip')}
|
||||
>
|
||||
<span class="icon-tag"></span>
|
||||
Tag-Filter
|
||||
<span class="status">{unifiedBarStore.showTagStrip ? '✓' : ''}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="action-btn"
|
||||
class:active={unifiedBarStore.showCalendarToolbar}
|
||||
onmousedown={() => handleOverlayAction('toggle-toolbar')}
|
||||
>
|
||||
<span class="icon-toolbox"></span>
|
||||
Kalender-Toolbar
|
||||
<span class="status">{unifiedBarStore.showCalendarToolbar ? '✓' : ''}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="action-group">
|
||||
<h4>Schnellaktionen</h4>
|
||||
<button class="action-btn" onmousedown={() => handleOverlayAction('collapse-all')}>
|
||||
<span class="icon-minimize"></span>
|
||||
Alle einklappen
|
||||
</button>
|
||||
|
||||
<button class="action-btn" onmousedown={() => handleOverlayAction('new-event')}>
|
||||
<span class="icon-plus"></span>
|
||||
Neuer Termin
|
||||
</button>
|
||||
|
||||
<button class="action-btn" onmousedown={() => handleOverlayAction('today')}>
|
||||
<span class="icon-navigation"></span>
|
||||
Heute
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.unified-bar-container {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.unified-bar-container.transitioning {
|
||||
transition: all var(--animation-duration) ease;
|
||||
}
|
||||
|
||||
.unified-bar-layer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
pointer-events: auto;
|
||||
background: color-mix(in srgb, var(--color-surface) 95%, transparent);
|
||||
backdrop-filter: blur(20px);
|
||||
border: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
|
||||
transition: all var(--animation-duration) ease;
|
||||
}
|
||||
|
||||
.unified-bar-layer.active {
|
||||
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
|
||||
z-index: calc(var(--z-index) + 5) !important;
|
||||
}
|
||||
|
||||
.unified-bar-layer:hover {
|
||||
background: color-mix(in srgb, var(--color-surface) 98%, transparent);
|
||||
}
|
||||
|
||||
.input-layer {
|
||||
background: color-mix(in srgb, var(--color-surface) 90%, transparent);
|
||||
border-top: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.input-bar-wrapper {
|
||||
position: relative;
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
}
|
||||
|
||||
.input-bar-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
/* Overlay Styles */
|
||||
.unified-bar-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
pointer-events: auto;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.overlay-backdrop {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.overlay-content {
|
||||
position: relative;
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-bottom: none;
|
||||
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
|
||||
padding: var(--spacing-lg);
|
||||
max-width: 100%;
|
||||
width: 500px;
|
||||
max-height: 70vh;
|
||||
overflow-y: auto;
|
||||
box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.overlay-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--spacing-lg);
|
||||
padding-bottom: var(--spacing-md);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.overlay-header h3 {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
padding: var(--spacing-xs);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--color-muted-foreground);
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.close-btn:hover {
|
||||
background: var(--color-muted);
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
|
||||
.overlay-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.action-group h4 {
|
||||
margin: 0 0 var(--spacing-md) 0;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-muted-foreground);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
width: 100%;
|
||||
padding: var(--spacing-md);
|
||||
background: var(--color-background);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-base);
|
||||
font-size: 0.875rem;
|
||||
color: var(--color-foreground);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.action-btn:hover {
|
||||
background: var(--color-muted);
|
||||
border-color: var(--color-primary);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.action-btn.active {
|
||||
background: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
||||
border-color: var(--color-primary);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.action-btn .status {
|
||||
margin-left: auto;
|
||||
font-weight: 600;
|
||||
color: var(--color-success);
|
||||
}
|
||||
|
||||
/* Icons (placeholder - replace with actual icon component) */
|
||||
.icon-x::before {
|
||||
content: '×';
|
||||
}
|
||||
.icon-calendar::before {
|
||||
content: '📅';
|
||||
}
|
||||
.icon-tag::before {
|
||||
content: '🏷️';
|
||||
}
|
||||
.icon-toolbox::before {
|
||||
content: '🔧';
|
||||
}
|
||||
.icon-minimize::before {
|
||||
content: '⬇️';
|
||||
}
|
||||
.icon-plus::before {
|
||||
content: '+';
|
||||
}
|
||||
.icon-navigation::before {
|
||||
content: '🧭';
|
||||
}
|
||||
|
||||
/* Placeholder styles */
|
||||
.quick-input-placeholder,
|
||||
.tag-strip-placeholder,
|
||||
.date-strip-placeholder,
|
||||
.toolbar-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--spacing-lg);
|
||||
background: var(--color-background);
|
||||
border: 2px dashed var(--color-border);
|
||||
border-radius: var(--radius-md);
|
||||
color: var(--color-muted-foreground);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.quick-input-placeholder button {
|
||||
margin-left: var(--spacing-sm);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
background: var(--color-primary);
|
||||
color: var(--color-primary-foreground);
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.overlay-content {
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
padding: var(--spacing-lg);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.quick-input-placeholder,
|
||||
.tag-strip-placeholder,
|
||||
.date-strip-placeholder,
|
||||
.toolbar-placeholder {
|
||||
min-height: 50px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,422 @@
|
|||
<script lang="ts">
|
||||
import {
|
||||
unifiedBarStore,
|
||||
type UnifiedBarLayer,
|
||||
type UnifiedBarMode,
|
||||
} from '$lib/stores/unified-bar.svelte';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { slide } from 'svelte/transition';
|
||||
|
||||
interface Props {
|
||||
onModeChange?: (mode: UnifiedBarMode) => void;
|
||||
onLayerChange?: (layer: UnifiedBarLayer) => void;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
let { onModeChange = () => {}, onLayerChange = () => {}, disabled = false }: Props = $props();
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
// Current state
|
||||
let currentMode = $derived(unifiedBarStore.mode);
|
||||
let activeLayer = $derived(unifiedBarStore.activeLayer);
|
||||
|
||||
// Handle mode switching
|
||||
function switchToMode(mode: UnifiedBarMode) {
|
||||
unifiedBarStore.setMode(mode);
|
||||
onModeChange(mode);
|
||||
dispatch('modeChange', { mode, previousMode: currentMode });
|
||||
}
|
||||
|
||||
// Handle layer activation
|
||||
function activateLayer(layer: UnifiedBarLayer) {
|
||||
unifiedBarStore.expandToLayer(layer);
|
||||
onLayerChange(layer);
|
||||
dispatch('layerChange', { layer, previousLayer: activeLayer });
|
||||
}
|
||||
|
||||
// Quick actions
|
||||
function handleQuickAction(action: string) {
|
||||
dispatch('quickAction', { action });
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Unified Bar Controls -->
|
||||
<div class="unified-bar-controls" class:disabled>
|
||||
<!-- Mode Selector -->
|
||||
<div class="mode-selector">
|
||||
<button
|
||||
class="mode-btn"
|
||||
class:active={currentMode === 'collapsed'}
|
||||
onmousedown={() => switchToMode('collapsed')}
|
||||
title="Zusammengeklappt"
|
||||
>
|
||||
<span class="icon-minimize-2"></span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="mode-btn"
|
||||
class:active={currentMode === 'expanded'}
|
||||
onmousedown={() => switchToMode('expanded')}
|
||||
title="Erweitert"
|
||||
>
|
||||
<span class="icon-maximize-2"></span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="mode-btn"
|
||||
class:active={currentMode === 'overlay'}
|
||||
onmousedown={() => unifiedBarStore.toggleOverlay()}
|
||||
title="Menü"
|
||||
>
|
||||
<span class="icon-menu"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Layer Controls (only visible in expanded mode) -->
|
||||
{#if currentMode === 'expanded'}
|
||||
<div class="layer-controls" transition:slide={{ duration: 200 }}>
|
||||
<div class="layer-btn-group">
|
||||
<button
|
||||
class="layer-btn"
|
||||
class:active={activeLayer === 'input' || unifiedBarStore.showQuickInput}
|
||||
onmousedown={() => activateLayer('input')}
|
||||
title="Schnelleingabe"
|
||||
>
|
||||
<span class="icon-edit"></span>
|
||||
<span class="label">Eingabe</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="layer-btn"
|
||||
class:active={activeLayer === 'date' || unifiedBarStore.showDateStrip}
|
||||
onmousedown={() => activateLayer('date')}
|
||||
title="Datum-Leiste"
|
||||
>
|
||||
<span class="icon-calendar"></span>
|
||||
<span class="label">Datum</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="layer-btn"
|
||||
class:active={activeLayer === 'tag' || unifiedBarStore.showTagStrip}
|
||||
onmousedown={() => activateLayer('tag')}
|
||||
title="Tag-Filter"
|
||||
>
|
||||
<span class="icon-tag"></span>
|
||||
<span class="label">Tags</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="layer-btn"
|
||||
class:active={activeLayer === 'toolbar' || unifiedBarStore.showCalendarToolbar}
|
||||
onmousedown={() => activateLayer('toolbar')}
|
||||
title="Kalender-Toolbar"
|
||||
>
|
||||
<span class="icon-settings"></span>
|
||||
<span class="label">Tools</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="quick-actions">
|
||||
<button
|
||||
class="quick-action-btn"
|
||||
onmousedown={() => handleQuickAction('new-event')}
|
||||
title="Neuer Termin"
|
||||
>
|
||||
<span class="icon-plus"></span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="quick-action-btn"
|
||||
onmousedown={() => handleQuickAction('today')}
|
||||
title="Heute"
|
||||
>
|
||||
<span class="icon-navigation"></span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="quick-action-btn"
|
||||
onmousedown={() => unifiedBarStore.collapseAll()}
|
||||
title="Alle einklappen"
|
||||
>
|
||||
<span class="icon-chevron-down"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Status Indicator -->
|
||||
<div class="status-indicator">
|
||||
<div class="status-dots">
|
||||
<div class="status-dot" class:active={unifiedBarStore.showQuickInput} title="Eingabe"></div>
|
||||
<div
|
||||
class="status-dot"
|
||||
class:active={unifiedBarStore.showDateStrip}
|
||||
title="Datum-Leiste"
|
||||
></div>
|
||||
<div class="status-dot" class:active={unifiedBarStore.showTagStrip} title="Tag-Filter"></div>
|
||||
<div
|
||||
class="status-dot"
|
||||
class:active={unifiedBarStore.showCalendarToolbar}
|
||||
title="Kalender-Toolbar"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
<span class="mode-text">
|
||||
{#if currentMode === 'collapsed'}
|
||||
Zusammengklappt
|
||||
{:else if currentMode === 'expanded'}
|
||||
Erweitert
|
||||
{:else if currentMode === 'overlay'}
|
||||
Menü offen
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.unified-bar-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.unified-bar-controls.disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Mode Selector */
|
||||
.mode-selector {
|
||||
display: flex;
|
||||
gap: var(--spacing-xs);
|
||||
background: var(--color-background);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.mode-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
color: var(--color-muted-foreground);
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.mode-btn:hover {
|
||||
background: var(--color-muted);
|
||||
color: var(--color-foreground);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.mode-btn.active {
|
||||
background: var(--color-primary);
|
||||
color: var(--color-primary-foreground);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Layer Controls */
|
||||
.layer-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
padding: 0 var(--spacing-md);
|
||||
}
|
||||
|
||||
.layer-btn-group {
|
||||
display: flex;
|
||||
gap: var(--spacing-xs);
|
||||
background: var(--color-background);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.layer-btn {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
color: var(--color-muted-foreground);
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.layer-btn:hover {
|
||||
background: var(--color-muted);
|
||||
color: var(--color-foreground);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.layer-btn.active {
|
||||
background: color-mix(in srgb, var(--color-primary) 20%, transparent);
|
||||
color: var(--color-primary);
|
||||
border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
|
||||
}
|
||||
|
||||
.layer-btn .label {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.layer-btn .icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Quick Actions */
|
||||
.quick-actions {
|
||||
display: flex;
|
||||
gap: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.quick-action-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: var(--color-background);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
color: var(--color-muted-foreground);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.quick-action-btn:hover {
|
||||
background: var(--color-muted);
|
||||
border-color: var(--color-primary);
|
||||
color: var(--color-primary);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Status Indicator */
|
||||
.status-indicator {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.status-dots {
|
||||
display: flex;
|
||||
gap: var(--spacing-xs);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-border);
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.status-dot.active {
|
||||
background: var(--color-success);
|
||||
box-shadow: 0 0 8px color-mix(in srgb, var(--color-success) 50%, transparent);
|
||||
}
|
||||
|
||||
.status-dot:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
.mode-text {
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-muted-foreground);
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Icons (placeholder - replace with actual icon components) */
|
||||
.icon-minimize-2::before {
|
||||
content: '⬇️';
|
||||
}
|
||||
.icon-maximize-2::before {
|
||||
content: '⬆️';
|
||||
}
|
||||
.icon-menu::before {
|
||||
content: '☰';
|
||||
}
|
||||
.icon-edit::before {
|
||||
content: '✏️';
|
||||
}
|
||||
.icon-calendar::before {
|
||||
content: '📅';
|
||||
}
|
||||
.icon-tag::before {
|
||||
content: '🏷️';
|
||||
}
|
||||
.icon-settings::before {
|
||||
content: '⚙️';
|
||||
}
|
||||
.icon-plus::before {
|
||||
content: '+';
|
||||
}
|
||||
.icon-navigation::before {
|
||||
content: '🧭';
|
||||
}
|
||||
.icon-chevron-down::before {
|
||||
content: '⬇️';
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.unified-bar-controls {
|
||||
flex-wrap: wrap;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.layer-controls {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
padding: var(--spacing-sm) 0;
|
||||
}
|
||||
|
||||
.layer-btn {
|
||||
min-width: 50px;
|
||||
padding: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.layer-btn .label {
|
||||
font-size: 0.5rem;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mode-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.status-dots {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
266
apps/calendar/apps/web/src/lib/stores/unified-bar.svelte.ts
Normal file
266
apps/calendar/apps/web/src/lib/stores/unified-bar.svelte.ts
Normal file
|
|
@ -0,0 +1,266 @@
|
|||
/**
|
||||
* UnifiedBar Store - Manages the new unified bottom bar system
|
||||
* Replaces multiple individual bars with a layered, cohesive interface
|
||||
*/
|
||||
|
||||
import type { CalendarViewType } from '@calendar/shared';
|
||||
import { createAppSettingsStore } from '@manacore/shared-stores';
|
||||
import { userSettings } from './user-settings.svelte';
|
||||
|
||||
// UnifiedBar modes and layers
|
||||
export type UnifiedBarMode = 'collapsed' | 'expanded' | 'overlay';
|
||||
export type UnifiedBarLayer = 'input' | 'date' | 'tag' | 'toolbar' | 'settings';
|
||||
|
||||
// Store interface
|
||||
export interface UnifiedBarSettings extends Record<string, unknown> {
|
||||
// UnifiedBar mode control
|
||||
unifiedBarMode: UnifiedBarMode;
|
||||
unifiedBarActiveLayer: UnifiedBarLayer;
|
||||
|
||||
// Legacy compatibility (keep existing settings working)
|
||||
dateStripCollapsed: boolean;
|
||||
tagStripCollapsed: boolean;
|
||||
calendarToolbarCollapsed: boolean;
|
||||
|
||||
// New UnifiedBar-specific settings
|
||||
showQuickInput: boolean;
|
||||
showDateStrip: boolean;
|
||||
showTagStrip: boolean;
|
||||
showCalendarToolbar: boolean;
|
||||
overlayMenuOpen: boolean;
|
||||
|
||||
// Animation and interaction preferences
|
||||
barAnimationDuration: number;
|
||||
enableHapticFeedback: boolean;
|
||||
autoCollapseBars: boolean;
|
||||
|
||||
// Quick access toggles
|
||||
quickAccessActions: string[];
|
||||
}
|
||||
|
||||
const DEFAULT_SETTINGS: UnifiedBarSettings = {
|
||||
// Default to collapsed mode with only input bar visible
|
||||
unifiedBarMode: 'collapsed',
|
||||
unifiedBarActiveLayer: 'input',
|
||||
|
||||
// Legacy compatibility
|
||||
dateStripCollapsed: false,
|
||||
tagStripCollapsed: true,
|
||||
calendarToolbarCollapsed: true,
|
||||
|
||||
// New settings
|
||||
showQuickInput: true,
|
||||
showDateStrip: true,
|
||||
showTagStrip: false,
|
||||
showCalendarToolbar: false,
|
||||
overlayMenuOpen: false,
|
||||
|
||||
// Interaction preferences
|
||||
barAnimationDuration: 300,
|
||||
enableHapticFeedback: true,
|
||||
autoCollapseBars: false,
|
||||
|
||||
// Quick actions
|
||||
quickAccessActions: ['new-event', 'search', 'today', 'calendar-toggle'],
|
||||
};
|
||||
|
||||
// Cloud sync state
|
||||
let cloudSyncEnabled = $state(false);
|
||||
let initialSyncDone = $state(false);
|
||||
|
||||
// Sync to cloud callback
|
||||
async function syncToCloud(settings: UnifiedBarSettings) {
|
||||
if (!cloudSyncEnabled || typeof window === 'undefined') return;
|
||||
try {
|
||||
await userSettings.updateDeviceAppSettings(settings as unknown as Record<string, unknown>);
|
||||
} catch (e) {
|
||||
console.error('Failed to sync unified bar settings to cloud:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// Create base store
|
||||
const baseStore = createAppSettingsStore<UnifiedBarSettings>(
|
||||
'unified-bar-settings',
|
||||
DEFAULT_SETTINGS,
|
||||
{
|
||||
onSettingsChange: syncToCloud,
|
||||
}
|
||||
);
|
||||
|
||||
// Load settings from cloud
|
||||
function loadFromCloud(): Partial<UnifiedBarSettings> | null {
|
||||
if (!userSettings.loaded) return null;
|
||||
const cloudSettings = userSettings.currentDeviceAppSettings;
|
||||
if (cloudSettings && Object.keys(cloudSettings).length > 0) {
|
||||
return cloudSettings as unknown as Partial<UnifiedBarSettings>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export const unifiedBarStore = {
|
||||
// Base store methods
|
||||
get settings() {
|
||||
return baseStore.settings;
|
||||
},
|
||||
initialize: baseStore.initialize,
|
||||
set: baseStore.set,
|
||||
update: baseStore.update,
|
||||
reset: baseStore.reset,
|
||||
getDefaults: baseStore.getDefaults,
|
||||
|
||||
// Mode management
|
||||
get mode() {
|
||||
return baseStore.settings.unifiedBarMode;
|
||||
},
|
||||
|
||||
get activeLayer() {
|
||||
return baseStore.settings.unifiedBarActiveLayer;
|
||||
},
|
||||
|
||||
get isOverlayOpen() {
|
||||
return baseStore.settings.overlayMenuOpen;
|
||||
},
|
||||
|
||||
// Layer visibility helpers
|
||||
get showQuickInput() {
|
||||
return baseStore.settings.showQuickInput;
|
||||
},
|
||||
|
||||
get showDateStrip() {
|
||||
return baseStore.settings.showDateStrip && !baseStore.settings.dateStripCollapsed;
|
||||
},
|
||||
|
||||
get showTagStrip() {
|
||||
return baseStore.settings.showTagStrip && !baseStore.settings.tagStripCollapsed;
|
||||
},
|
||||
|
||||
get showCalendarToolbar() {
|
||||
return baseStore.settings.showCalendarToolbar && !baseStore.settings.calendarToolbarCollapsed;
|
||||
},
|
||||
|
||||
// Mode switching
|
||||
setMode(mode: UnifiedBarMode) {
|
||||
baseStore.set('unifiedBarMode', mode);
|
||||
},
|
||||
|
||||
toggleOverlay() {
|
||||
const isOpen = baseStore.settings.overlayMenuOpen;
|
||||
baseStore.set('overlayMenuOpen', !isOpen);
|
||||
if (!isOpen) {
|
||||
baseStore.set('unifiedBarMode', 'overlay');
|
||||
} else {
|
||||
baseStore.set('unifiedBarMode', 'collapsed');
|
||||
}
|
||||
},
|
||||
|
||||
setActiveLayer(layer: UnifiedBarLayer) {
|
||||
baseStore.set('unifiedBarActiveLayer', layer);
|
||||
},
|
||||
|
||||
// Layer toggles
|
||||
toggleQuickInput() {
|
||||
baseStore.set('showQuickInput', !baseStore.settings.showQuickInput);
|
||||
},
|
||||
|
||||
toggleDateStrip() {
|
||||
const newValue = !baseStore.settings.showDateStrip;
|
||||
baseStore.set('showDateStrip', newValue);
|
||||
baseStore.set('dateStripCollapsed', !newValue);
|
||||
},
|
||||
|
||||
toggleTagStrip() {
|
||||
const newValue = !baseStore.settings.showTagStrip;
|
||||
baseStore.set('showTagStrip', newValue);
|
||||
baseStore.set('tagStripCollapsed', !newValue);
|
||||
},
|
||||
|
||||
toggleCalendarToolbar() {
|
||||
const newValue = !baseStore.settings.showCalendarToolbar;
|
||||
baseStore.set('showCalendarToolbar', newValue);
|
||||
baseStore.set('calendarToolbarCollapsed', !newValue);
|
||||
},
|
||||
|
||||
// Quick actions
|
||||
expandToLayer(layer: UnifiedBarLayer) {
|
||||
baseStore.set('unifiedBarMode', 'expanded');
|
||||
baseStore.set('unifiedBarActiveLayer', layer);
|
||||
|
||||
// Auto-show the layer if hidden
|
||||
switch (layer) {
|
||||
case 'date':
|
||||
if (!baseStore.settings.showDateStrip) {
|
||||
baseStore.set('showDateStrip', true);
|
||||
baseStore.set('dateStripCollapsed', false);
|
||||
}
|
||||
break;
|
||||
case 'tag':
|
||||
if (!baseStore.settings.showTagStrip) {
|
||||
baseStore.set('showTagStrip', true);
|
||||
baseStore.set('tagStripCollapsed', false);
|
||||
}
|
||||
break;
|
||||
case 'toolbar':
|
||||
if (!baseStore.settings.showCalendarToolbar) {
|
||||
baseStore.set('showCalendarToolbar', true);
|
||||
baseStore.set('calendarToolbarCollapsed', false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
collapseAll() {
|
||||
baseStore.set('unifiedBarMode', 'collapsed');
|
||||
baseStore.set('unifiedBarActiveLayer', 'input');
|
||||
if (baseStore.settings.autoCollapseBars) {
|
||||
baseStore.set('showDateStrip', false);
|
||||
baseStore.set('showTagStrip', false);
|
||||
baseStore.set('showCalendarToolbar', false);
|
||||
}
|
||||
},
|
||||
|
||||
// Cloud sync methods
|
||||
enableCloudSync() {
|
||||
cloudSyncEnabled = true;
|
||||
if (!initialSyncDone) {
|
||||
const cloudSettings = loadFromCloud();
|
||||
if (cloudSettings && Object.keys(cloudSettings).length > 0) {
|
||||
baseStore.update(cloudSettings);
|
||||
} else {
|
||||
syncToCloud(baseStore.settings);
|
||||
}
|
||||
initialSyncDone = true;
|
||||
}
|
||||
},
|
||||
|
||||
disableCloudSync() {
|
||||
cloudSyncEnabled = false;
|
||||
},
|
||||
|
||||
// Legacy compatibility helpers (for gradual migration)
|
||||
get legacyDateStripCollapsed() {
|
||||
return baseStore.settings.dateStripCollapsed;
|
||||
},
|
||||
|
||||
get legacyTagStripCollapsed() {
|
||||
return baseStore.settings.tagStripCollapsed;
|
||||
},
|
||||
|
||||
// Sync from legacy settings (migration helper)
|
||||
syncFromLegacySettings(legacy: { dateStripCollapsed?: boolean; tagStripCollapsed?: boolean }) {
|
||||
const updates: Partial<UnifiedBarSettings> = {};
|
||||
|
||||
if (legacy.dateStripCollapsed !== undefined) {
|
||||
updates.dateStripCollapsed = legacy.dateStripCollapsed;
|
||||
updates.showDateStrip = !legacy.dateStripCollapsed;
|
||||
}
|
||||
|
||||
if (legacy.tagStripCollapsed !== undefined) {
|
||||
updates.tagStripCollapsed = legacy.tagStripCollapsed;
|
||||
updates.showTagStrip = !legacy.tagStripCollapsed;
|
||||
}
|
||||
|
||||
if (Object.keys(updates).length > 0) {
|
||||
baseStore.update(updates);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,328 @@
|
|||
<script lang="ts">
|
||||
import UnifiedBar from '$lib/components/calendar/UnifiedBar.svelte';
|
||||
import UnifiedBarControls from '$lib/components/calendar/UnifiedBarControls.svelte';
|
||||
import { unifiedBarStore } from '$lib/stores/unified-bar.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// Demo handlers
|
||||
function handleSearch(query: string) {
|
||||
console.log('Search:', query);
|
||||
}
|
||||
|
||||
function handleSelect(result: any) {
|
||||
console.log('Select:', result);
|
||||
}
|
||||
|
||||
function handleSearchChange(query: string) {
|
||||
console.log('Search change:', query);
|
||||
}
|
||||
|
||||
function handleCreate(data: any) {
|
||||
console.log('Create:', data);
|
||||
}
|
||||
|
||||
function handleParseCreate(data: any) {
|
||||
console.log('Parse create:', data);
|
||||
}
|
||||
|
||||
function handleDateSelect(date: Date) {
|
||||
console.log('Date select:', date);
|
||||
}
|
||||
|
||||
function handleOverlayToggle(event: CustomEvent) {
|
||||
console.log('Overlay toggle:', event.detail);
|
||||
}
|
||||
|
||||
function handleOverlayAction(event: CustomEvent) {
|
||||
console.log('Overlay action:', event.detail);
|
||||
}
|
||||
|
||||
function handleModeChange(mode: string) {
|
||||
console.log('Mode change:', mode);
|
||||
}
|
||||
|
||||
function handleLayerChange(layer: string) {
|
||||
console.log('Layer change:', layer);
|
||||
}
|
||||
|
||||
function handleQuickAction(event: CustomEvent) {
|
||||
console.log('Quick action:', event.detail);
|
||||
}
|
||||
|
||||
function handleToolbarCollapsedChange(collapsed: boolean) {
|
||||
console.log('Toolbar collapsed:', collapsed);
|
||||
}
|
||||
|
||||
// Initialize store on mount
|
||||
onMount(() => {
|
||||
unifiedBarStore.enableCloudSync();
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>UnifiedBar Demo - Calendar</title>
|
||||
</svelte:head>
|
||||
|
||||
<main class="demo-container">
|
||||
<header class="demo-header">
|
||||
<h1>UnifiedBar Demo</h1>
|
||||
<p>Demonstration der neuen unified bottom bar Architektur</p>
|
||||
</header>
|
||||
|
||||
<!-- Controls for testing -->
|
||||
<section class="controls-section">
|
||||
<h2>UnifiedBar Controls</h2>
|
||||
<UnifiedBarControls onModeChange={handleModeChange} onLayerChange={handleLayerChange} />
|
||||
</section>
|
||||
|
||||
<!-- Main content area -->
|
||||
<section class="content-section">
|
||||
<div class="content-placeholder">
|
||||
<h2>Kalender Inhalt</h2>
|
||||
<p>Dies ist der Hauptinhaltbereich, in dem die Kalender-Ansichten angezeigt werden.</p>
|
||||
|
||||
<div class="info-cards">
|
||||
<div class="info-card">
|
||||
<h3>Aktueller Modus</h3>
|
||||
<p><strong>{unifiedBarStore.mode}</strong></p>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<h3>Aktiver Layer</h3>
|
||||
<p><strong>{unifiedBarStore.activeLayer}</strong></p>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<h3>Sichtbare Layers</h3>
|
||||
<ul>
|
||||
{#if unifiedBarStore.showQuickInput}<li>✓ QuickInput</li>{/if}
|
||||
{#if unifiedBarStore.showDateStrip}<li>✓ DateStrip</li>{/if}
|
||||
{#if unifiedBarStore.showTagStrip}<li>✓ TagStrip</li>{/if}
|
||||
{#if unifiedBarStore.showCalendarToolbar}<li>✓ CalendarToolbar</li>{/if}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-card">
|
||||
<h3>Overlay Status</h3>
|
||||
<p><strong>{unifiedBarStore.isOverlayOpen ? 'Offen' : 'Geschlossen'}</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-actions">
|
||||
<button onmousedown={() => unifiedBarStore.setMode('collapsed')}> Zusammengklappt </button>
|
||||
<button onmousedown={() => unifiedBarStore.setMode('expanded')}> Erweitert </button>
|
||||
<button onmousedown={() => unifiedBarStore.toggleOverlay()}> Overlay Toggle </button>
|
||||
<button onmousedown={() => unifiedBarStore.expandToLayer('date')}> zum Datum-Layer </button>
|
||||
<button onmousedown={() => unifiedBarStore.collapseAll()}> Alle einklappen </button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- UnifiedBar at the bottom -->
|
||||
<UnifiedBar
|
||||
onSearch={handleSearch}
|
||||
onSelect={handleSelect}
|
||||
onSearchChange={handleSearchChange}
|
||||
onCreate={handleCreate}
|
||||
onParseCreate={handleParseCreate}
|
||||
onDateSelect={handleDateSelect}
|
||||
onToolbarCollapsedChange={handleToolbarCollapsedChange}
|
||||
placeholder="Neuer Termin oder suchen..."
|
||||
emptyText="Keine Termine gefunden"
|
||||
searchingText="Suche..."
|
||||
createText="Erstellen"
|
||||
appIcon="calendar"
|
||||
isMobile={false}
|
||||
showCalendarToolbar={true}
|
||||
/>
|
||||
|
||||
<!-- Footer with info -->
|
||||
<footer class="demo-footer">
|
||||
<p>UnifiedBar Demo - Calendar App</p>
|
||||
<p>Scrollen Sie, um zu sehen wie die Bars fixiert bleiben</p>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.demo-container {
|
||||
min-height: 100vh;
|
||||
padding-bottom: 400px; /* Space for UnifiedBar */
|
||||
background: var(--color-background);
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
|
||||
.demo-header {
|
||||
padding: var(--spacing-xl) var(--spacing-lg);
|
||||
text-align: center;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.demo-header h1 {
|
||||
margin: 0 0 var(--spacing-sm) 0;
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.demo-header p {
|
||||
margin: 0;
|
||||
color: var(--color-muted-foreground);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.controls-section {
|
||||
padding: var(--spacing-lg);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
background: color-mix(in srgb, var(--color-surface) 50%, transparent);
|
||||
}
|
||||
|
||||
.controls-section h2 {
|
||||
margin: 0 0 var(--spacing-md) 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.content-section {
|
||||
padding: var(--spacing-lg);
|
||||
}
|
||||
|
||||
.content-placeholder {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.content-placeholder h2 {
|
||||
margin: 0 0 var(--spacing-lg) 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.content-placeholder p {
|
||||
margin: 0 0 var(--spacing-xl) 0;
|
||||
color: var(--color-muted-foreground);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.info-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: var(--spacing-lg);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.info-card {
|
||||
background: var(--color-surface);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-lg);
|
||||
transition: all var(--transition-base);
|
||||
}
|
||||
|
||||
.info-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.info-card h3 {
|
||||
margin: 0 0 var(--spacing-sm) 0;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-muted-foreground);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.info-card p {
|
||||
margin: 0;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
|
||||
.info-card ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.info-card li {
|
||||
padding: var(--spacing-xs) 0;
|
||||
color: var(--color-success);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.demo-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--spacing-md);
|
||||
margin-top: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.demo-actions button {
|
||||
padding: var(--spacing-md) var(--spacing-lg);
|
||||
background: var(--color-primary);
|
||||
color: var(--color-primary-foreground);
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
font-weight: 500;
|
||||
transition: all var(--transition-base);
|
||||
}
|
||||
|
||||
.demo-actions button:hover {
|
||||
filter: brightness(0.9);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.demo-footer {
|
||||
position: fixed;
|
||||
bottom: 350px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
padding: var(--spacing-md);
|
||||
background: color-mix(in srgb, var(--color-surface) 80%, transparent);
|
||||
border-top: 1px solid var(--color-border);
|
||||
color: var(--color-muted-foreground);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.demo-footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Responsive Design */
|
||||
@media (max-width: 768px) {
|
||||
.demo-container {
|
||||
padding-bottom: 500px;
|
||||
}
|
||||
|
||||
.demo-header {
|
||||
padding: var(--spacing-lg) var(--spacing-md);
|
||||
}
|
||||
|
||||
.demo-header h1 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.controls-section,
|
||||
.content-section {
|
||||
padding: var(--spacing-md);
|
||||
}
|
||||
|
||||
.info-cards {
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.demo-actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.demo-footer {
|
||||
bottom: 450px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue