mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
🔥 remove: delete Picture Button/Card duplicates, use @manacore/shared-ui
- Delete unused Card.svelte (21 LOC) - Migrate Button imports to @manacore/shared-ui (53 LOC) - Update CONSOLIDATION_OPPORTUNITIES.md Savings: ~74 LOC
This commit is contained in:
parent
2d16f7c9ff
commit
c4483e2c0b
7 changed files with 15 additions and 92 deletions
|
|
@ -17,7 +17,7 @@
|
|||
deselectAll,
|
||||
} from '$lib/stores/canvas';
|
||||
import { boardSettings } from '$lib/stores/boards';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { Button } from '@manacore/shared-ui';
|
||||
import Konva from 'konva';
|
||||
import {
|
||||
CaretLeft,
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
import { canvasItems, addCanvasItem } from '$lib/stores/canvas';
|
||||
import { getImages } from '$lib/api/images';
|
||||
import { addBoardItem } from '$lib/api/boardItems';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import Modal from '$lib/components/ui/Modal.svelte';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { toastStore, Modal, Button } from '@manacore/shared-ui';
|
||||
import { MagnifyingGlass, Image as ImageIcon, Check } from '@manacore/shared-icons';
|
||||
|
||||
interface Props {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { selectedItems, updateCanvasItem, removeSelectedItems } from '$lib/stores/canvas';
|
||||
import { updateBoardItem, changeBoardItemZIndex, isImageItem } from '$lib/api/boardItems';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import { Button, toastStore } from '@manacore/shared-ui';
|
||||
import {
|
||||
Image,
|
||||
CaretDoubleUp,
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
import { CircleNotch } from '@manacore/shared-icons';
|
||||
|
||||
interface Props {
|
||||
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
class?: string;
|
||||
onclick?: () => void;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let {
|
||||
variant = 'primary',
|
||||
size = 'md',
|
||||
type = 'button',
|
||||
disabled = false,
|
||||
loading = false,
|
||||
class: className = '',
|
||||
onclick,
|
||||
children,
|
||||
}: Props = $props();
|
||||
|
||||
const baseStyles =
|
||||
'inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50';
|
||||
|
||||
const variants = {
|
||||
primary: 'bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-600',
|
||||
secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300 focus-visible:ring-gray-400',
|
||||
outline: 'border border-gray-300 bg-transparent hover:bg-gray-100 focus-visible:ring-gray-400',
|
||||
ghost: 'hover:bg-gray-100 focus-visible:ring-gray-400',
|
||||
danger: 'bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-600',
|
||||
};
|
||||
|
||||
const sizes = {
|
||||
sm: 'h-9 px-3 text-sm rounded-md',
|
||||
md: 'h-10 px-4 py-2 rounded-md',
|
||||
lg: 'h-11 px-8 text-lg rounded-md',
|
||||
};
|
||||
|
||||
const buttonClass = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;
|
||||
</script>
|
||||
|
||||
<button {type} class={buttonClass} disabled={disabled || loading} {onclick}>
|
||||
{#if loading}
|
||||
<CircleNotch size={16} weight="bold" class="mr-2 animate-spin" />
|
||||
{/if}
|
||||
{@render children()}
|
||||
</button>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
interface Props {
|
||||
class?: string;
|
||||
padding?: boolean;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let { class: className = '', padding = true, children }: Props = $props();
|
||||
|
||||
const baseStyles =
|
||||
'rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-900';
|
||||
const paddingStyles = padding ? 'p-6' : '';
|
||||
const cardClass = `${baseStyles} ${paddingStyles} ${className}`;
|
||||
</script>
|
||||
|
||||
<div class={cardClass}>
|
||||
{@render children()}
|
||||
</div>
|
||||
|
|
@ -14,10 +14,7 @@
|
|||
removeBoardFromList,
|
||||
} from '$lib/stores/boards';
|
||||
import { getBoards, deleteBoard, duplicateBoard } from '$lib/api/boards';
|
||||
import { PageHeader } from '@manacore/shared-ui';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import Modal from '$lib/components/ui/Modal.svelte';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import { PageHeader, Button, Modal, toastStore } from '@manacore/shared-ui';
|
||||
import { Plus, SquaresFour, Image, Trash } from '@manacore/shared-icons';
|
||||
|
||||
let loadingMore = $state(false);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
| ~~**HOCH**~~ | ~~App Settings Stores~~ | ~~600-700 LOC~~ ✅ **323 LOC entfernt** | ~~Mittel~~ |
|
||||
| **HOCH** | Main.ts/CORS Patterns | 1.800 LOC | Mittel |
|
||||
| ~~**MITTEL**~~ | ~~TypeScript Configs~~ | ~~400 LOC~~ ✅ **~280 LOC entfernt** | ~~Niedrig~~ |
|
||||
| **MITTEL** | UI Component Cleanup | 400 LOC | Niedrig |
|
||||
| ~~**MITTEL**~~ | ~~UI Component Cleanup~~ | ~~400 LOC~~ ✅ **~74 LOC entfernt** | ~~Niedrig~~ |
|
||||
| ~~**MITTEL**~~ | ~~Vite Configs~~ | ~~300 LOC~~ ✅ **~350 LOC entfernt** | ~~Niedrig~~ |
|
||||
| ~~**MITTEL**~~ | ~~Navigation Stores~~ | ~~50 LOC~~ ✅ **~50 LOC entfernt** | ~~Niedrig~~ |
|
||||
| ~~**NIEDRIG**~~ | ~~Drizzle Configs~~ | ~~200 LOC~~ ✅ **~160 LOC entfernt** | ~~Niedrig~~ |
|
||||
|
|
@ -238,17 +238,18 @@ export const { isSidebarMode, isNavCollapsed } = createSimpleNavigationStores({
|
|||
|
||||
---
|
||||
|
||||
### 3.2 MITTEL: Sofort löschbare Duplikate (144 LOC)
|
||||
### ~~3.2 MITTEL: Sofort löschbare Duplikate~~ ✅ TEILWEISE ERLEDIGT
|
||||
|
||||
**Picture App hat lokale Kopien von shared-ui Komponenten:**
|
||||
**Picture App - Status (29.01.2026):**
|
||||
|
||||
| Datei | LOC | shared-ui Alternative |
|
||||
|-------|-----|----------------------|
|
||||
| `apps/picture/apps/web/src/lib/components/ui/Button.svelte` | 53 | `@manacore/shared-ui/Button` |
|
||||
| `apps/picture/apps/web/src/lib/components/ui/Input.svelte` | 70 | `@manacore/shared-ui/Input` |
|
||||
| `apps/picture/apps/web/src/lib/components/ui/Card.svelte` | 21 | `@manacore/shared-ui/Card` |
|
||||
| Datei | LOC | Status |
|
||||
|-------|-----|--------|
|
||||
| ~~`Button.svelte`~~ | ~~53~~ | ✅ Migriert zu `@manacore/shared-ui` |
|
||||
| ~~`Card.svelte`~~ | ~~21~~ | ✅ Gelöscht (unbenutzt) |
|
||||
| ~~`Input.svelte`~~ | ~~70~~ | ✅ Bereits vorher gelöscht |
|
||||
|
||||
**Aktion:** Lösche lokale Dateien, importiere aus shared-ui.
|
||||
**Verbleibendes:**
|
||||
- `Modal.svelte` könnte migriert werden, aber hat unterschiedliche API (`open` vs `visible`)
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -430,7 +431,7 @@ export default createDrizzleConfig({ dbName: 'chat' });
|
|||
| ~~Metrics zu shared-nestjs-metrics migrieren (6 Backends)~~ | ~~350~~ → **709** | ~~Niedrig~~ | ✅ Erledigt |
|
||||
| ~~Picture Input.svelte löschen (unbenutzt)~~ | ~~70~~ | ~~Niedrig~~ | ✅ Erledigt |
|
||||
| ~~Sleep-Duplikat entfernen~~ | ~~8~~ | ~~Minimal~~ | ✅ Erledigt |
|
||||
| Picture UI-Komponenten (Button/Card) | 74 | Niedrig | Offen |
|
||||
| ~~Picture UI-Komponenten (Button/Card)~~ | ~~74~~ → **74** | ~~Niedrig~~ | ✅ Erledigt |
|
||||
| AppSlider Wrapper evaluieren (8 Apps) | - | Niedrig | Nicht nötig (sind Lokalisierungs-Wrapper) |
|
||||
|
||||
### Phase 2: Stores & Configs (3-5 Tage, ~1.500 LOC)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue