refactor: mover .go de tipos Go a functions/{domain}/ para compilación unificada
Los archivos .go de tipos ahora viven junto a las funciones en functions/{domain}/
(mismo paquete Go), resolviendo errores de compilación por tipos no encontrados
(Option, Pair, Result, etc.). Los .md de metadata permanecen en types/{domain}/
con file_path actualizado a functions/. Se elimina types.go duplicado de infra.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package tui
|
||||
|
||||
// BaseModel provee funcionalidad comun a todas las vistas TUI:
|
||||
// dimensiones de terminal, estilos y manejo de errores.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type BaseModel struct {
|
||||
Width int
|
||||
Height int
|
||||
Styles Styles
|
||||
Err error
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package tui
|
||||
|
||||
// ConfirmModel es un dialogo de confirmacion Si/No interactivo.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ConfirmModel struct {
|
||||
BaseModel
|
||||
prompt string
|
||||
selected bool
|
||||
done bool
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package tui
|
||||
|
||||
// FilteredListModel extiende ListModel con filtrado por texto en tiempo real.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type FilteredListModel struct {
|
||||
ListModel
|
||||
query string
|
||||
allItems []ListItem
|
||||
placeholder string
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package tui
|
||||
|
||||
// ListItem representa un item individual en una lista TUI.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ListItem struct {
|
||||
Title string
|
||||
Description string
|
||||
Value interface{}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package tui
|
||||
|
||||
// ListModel es un componente lista seleccionable con cursor, scroll y seleccion.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ListModel struct {
|
||||
items []ListItem
|
||||
cursor int
|
||||
selected map[int]struct{}
|
||||
multi bool
|
||||
styles Styles
|
||||
height int
|
||||
width int
|
||||
offset int
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package tui
|
||||
|
||||
// MultiProgressModel gestiona multiples barras de progreso simultaneas.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type MultiProgressModel struct {
|
||||
bars []ProgressModel
|
||||
styles Styles
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/bubbles/progress"
|
||||
)
|
||||
|
||||
// ProgressModel es una barra de progreso con porcentaje, ETA y tiempo transcurrido.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ProgressModel struct {
|
||||
progress progress.Model
|
||||
current float64
|
||||
total float64
|
||||
label string
|
||||
styles Styles
|
||||
showPct bool
|
||||
showETA bool
|
||||
started time.Time
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/bubbles/spinner"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
// SpinnerModel es un indicador de carga animado con mensaje personalizable.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type SpinnerModel struct {
|
||||
spinner spinner.Model
|
||||
message string
|
||||
style lipgloss.Style
|
||||
active bool
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package tui
|
||||
|
||||
import "time"
|
||||
|
||||
// SpinnerWithTimeoutModel es un spinner que se auto-detiene tras un timeout.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type SpinnerWithTimeoutModel struct {
|
||||
SpinnerModel
|
||||
timeout time.Duration
|
||||
started time.Time
|
||||
finished bool
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package tui
|
||||
|
||||
import "github.com/charmbracelet/lipgloss"
|
||||
|
||||
// Styles contiene todos los estilos lipgloss pre-configurados para una aplicacion TUI.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type Styles struct {
|
||||
Theme Theme
|
||||
Title lipgloss.Style
|
||||
Subtitle lipgloss.Style
|
||||
Header lipgloss.Style
|
||||
Label lipgloss.Style
|
||||
Text lipgloss.Style
|
||||
Muted lipgloss.Style
|
||||
Code lipgloss.Style
|
||||
Success lipgloss.Style
|
||||
Error lipgloss.Style
|
||||
Warning lipgloss.Style
|
||||
Info lipgloss.Style
|
||||
Border lipgloss.Style
|
||||
Box lipgloss.Style
|
||||
List lipgloss.Style
|
||||
ListItem lipgloss.Style
|
||||
Selected lipgloss.Style
|
||||
Unselected lipgloss.Style
|
||||
Button lipgloss.Style
|
||||
ButtonActive lipgloss.Style
|
||||
Input lipgloss.Style
|
||||
Cursor lipgloss.Style
|
||||
Container lipgloss.Style
|
||||
Section lipgloss.Style
|
||||
Divider lipgloss.Style
|
||||
StatusBar lipgloss.Style
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package tui
|
||||
|
||||
import "github.com/charmbracelet/lipgloss"
|
||||
|
||||
// Theme define una paleta de 9 colores semanticos para terminal.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type Theme struct {
|
||||
Primary lipgloss.Color
|
||||
Secondary lipgloss.Color
|
||||
Success lipgloss.Color
|
||||
Error lipgloss.Color
|
||||
Warning lipgloss.Color
|
||||
Info lipgloss.Color
|
||||
Muted lipgloss.Color
|
||||
Text lipgloss.Color
|
||||
Border lipgloss.Color
|
||||
}
|
||||
Reference in New Issue
Block a user