feat: Add custom Prisma language support and theme in DatabaseViewer

- Implemented a custom language registration for Prisma in Monaco Editor.
- Defined syntax highlighting tokens, including keywords, types, and annotations.
- Created a custom dark theme for Prisma with specific color rules.
- Updated the editor configuration to use the new Prisma language and theme.

style: Enhance visual design of GeminiSettings and Sidebar components

- Updated styles for GeminiSettings to include gradients and animations for a modern look.
- Improved button styles with hover effects and transitions.
- Redesigned Sidebar with gradient backgrounds, enhanced button styles, and scrollbar customization.
- Added hover effects and transitions for file items and section headers in Sidebar.
This commit is contained in:
Shni
2025-11-04 10:40:42 -06:00
parent 4cf99a6f91
commit e3ef60a9a5
5 changed files with 827 additions and 129 deletions

View File

@@ -12,9 +12,14 @@
"app": { "app": {
"windows": [ "windows": [
{ {
"title": "aeditor", "title": "Amayo Bot Editor",
"width": 800, "width": 1400,
"height": 600 "height": 900,
"minWidth": 1200,
"minHeight": 700,
"resizable": true,
"fullscreen": false,
"center": true
} }
], ],
"security": { "security": {

View File

@@ -36,6 +36,12 @@ const currentView = ref<"editor" | "command-creator" | "event-creator" | "databa
const loading = ref(false); const loading = ref(false);
const errorMsg = ref<string>(""); const errorMsg = ref<string>("");
const schemaContent = ref<string>(""); const schemaContent = ref<string>("");
const sidebarCollapsed = ref(false);
// Toggle sidebar
function toggleSidebar() {
sidebarCollapsed.value = !sidebarCollapsed.value;
}
// Deshabilitar F12 y habilitar Ctrl+Q // Deshabilitar F12 y habilitar Ctrl+Q
const handleF12 = (e: KeyboardEvent) => { const handleF12 = (e: KeyboardEvent) => {
@@ -420,6 +426,7 @@ function handlePaletteCommand(commandId: string) {
<template v-if="!showProjectSelector && !initialLoading"> <template v-if="!showProjectSelector && !initialLoading">
<Sidebar <Sidebar
v-show="!sidebarCollapsed"
:stats="stats" :stats="stats"
:commands="commands" :commands="commands"
:events="events" :events="events"
@@ -439,7 +446,7 @@ function handlePaletteCommand(commandId: string) {
@notify="showNotification" @notify="showNotification"
/> />
<div class="main-content"> <div class="main-content" :class="{ 'sidebar-collapsed': sidebarCollapsed }">
<div v-if="loading" class="loading-overlay"> <div v-if="loading" class="loading-overlay">
<div class="loading-spinner"> Cargando proyecto...</div> <div class="loading-spinner"> Cargando proyecto...</div>
</div> </div>
@@ -507,20 +514,56 @@ function handlePaletteCommand(commandId: string) {
<div class="stat-label">Eventos Totales</div> <div class="stat-label">Eventos Totales</div>
</div> </div>
</div> </div>
<div class="welcome-actions">
<button @click="showCommandCreator" class="welcome-btn primary">
Crear Comando
</button>
<button @click="showEventCreator" class="welcome-btn primary">
Crear Evento
</button>
</div>
<p class="welcome-hint"> <p class="welcome-hint">
💡 <strong>Tip:</strong> Selecciona un archivo del panel izquierdo para editarlo 💡 <strong>Tip:</strong> Selecciona un archivo del panel izquierdo para editarlo
</p> </p>
</div> </div>
</div> </div>
</div> </div>
<!-- Panel de Acciones Rápidas (Derecha) -->
<div class="quick-actions-panel">
<button @click="toggleSidebar" class="quick-btn toggle-sidebar" :title="sidebarCollapsed ? 'Mostrar Sidebar' : 'Ocultar Sidebar'">
<span class="btn-icon">{{ sidebarCollapsed ? '📂' : '📁' }}</span>
<span class="btn-label">{{ sidebarCollapsed ? 'Mostrar' : 'Ocultar' }}</span>
</button>
<div class="divider"></div>
<button @click="showCommandCreator" class="quick-btn create-command" title="Crear Comando">
<span class="btn-icon"></span>
<span class="btn-label">Crear Comando</span>
</button>
<button @click="showEventCreator" class="quick-btn create-event" title="Crear Evento">
<span class="btn-icon"></span>
<span class="btn-label">Crear Evento</span>
</button>
<div class="divider"></div>
<button @click="toggleEnvManager" class="quick-btn env" title="Variables ENV">
<span class="btn-icon">🔐</span>
<span class="btn-label">Variables ENV</span>
</button>
<button @click="toggleGeminiSettings" class="quick-btn gemini" title="Gemini IA">
<span class="btn-icon"></span>
<span class="btn-label">Gemini IA</span>
</button>
<button @click="toggleDatabase" class="quick-btn database" title="Base de Datos">
<span class="btn-icon">🗄</span>
<span class="btn-label">Base de Datos</span>
</button>
<div class="divider"></div>
<button @click="loadProjectData" class="quick-btn refresh" title="Refrescar">
<span class="btn-icon">🔄</span>
<span class="btn-label">Refrescar</span>
</button>
</div>
</template> </template>
</div> </div>
</template> </template>
@@ -531,6 +574,7 @@ function handlePaletteCommand(commandId: string) {
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
background-color: #1e1e1e; background-color: #1e1e1e;
position: relative;
} }
.main-content { .main-content {
@@ -539,6 +583,11 @@ function handlePaletteCommand(commandId: string) {
flex-direction: column; flex-direction: column;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.main-content.sidebar-collapsed {
margin-left: 0;
} }
.loading-overlay { .loading-overlay {
@@ -591,92 +640,363 @@ function handlePaletteCommand(commandId: string) {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #1e1e1e; background: linear-gradient(135deg, #1e1e1e 0%, #252526 50%, #1e1e1e 100%);
position: relative;
overflow: hidden;
}
.welcome-screen::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(78, 201, 176, 0.05) 0%, transparent 70%);
animation: pulse-gradient 8s ease-in-out infinite;
}
@keyframes pulse-gradient {
0%, 100% {
transform: scale(1) rotate(0deg);
opacity: 0.5;
}
50% {
transform: scale(1.1) rotate(180deg);
opacity: 0.8;
}
} }
.welcome-content { .welcome-content {
text-align: center; text-align: center;
max-width: 600px; max-width: 700px;
padding: 40px; padding: 50px;
position: relative;
z-index: 1;
background: linear-gradient(135deg, rgba(37, 37, 38, 0.8) 0%, rgba(30, 30, 30, 0.9) 100%);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(78, 201, 176, 0.1);
backdrop-filter: blur(10px);
} }
.welcome-content h1 { .welcome-content h1 {
color: #ffffff; background: linear-gradient(135deg, #4ec9b0 0%, #0e639c 50%, #4ec9b0 100%);
font-size: 48px; -webkit-background-clip: text;
margin: 0 0 16px 0; -webkit-text-fill-color: transparent;
font-weight: 700; background-clip: text;
font-size: 52px;
margin: 0 0 20px 0;
font-weight: 800;
letter-spacing: -1px;
animation: gradient-shift 6s ease infinite;
background-size: 200% 200%;
}
@keyframes gradient-shift {
0%, 100% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
} }
.welcome-content > p { .welcome-content > p {
color: #cccccc; color: #e0e0e0;
font-size: 18px; font-size: 18px;
margin: 0 0 40px 0; margin: 0 0 50px 0;
line-height: 1.6;
font-weight: 400;
} }
.welcome-stats { .welcome-stats {
display: flex; display: flex;
gap: 40px; gap: 50px;
justify-content: center; justify-content: center;
margin-bottom: 40px; margin-bottom: 50px;
} }
.welcome-stat { .welcome-stat {
text-align: center; text-align: center;
padding: 20px;
background: linear-gradient(135deg, rgba(78, 201, 176, 0.1) 0%, rgba(14, 99, 156, 0.1) 100%);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(78, 201, 176, 0.2);
}
.welcome-stat:hover {
transform: translateY(-4px);
box-shadow: 0 8px 20px rgba(78, 201, 176, 0.3);
border-color: rgba(78, 201, 176, 0.4);
} }
.stat-number { .stat-number {
font-size: 48px; font-size: 56px;
font-weight: 700; font-weight: 800;
color: #4ec9b0; background: linear-gradient(135deg, #4ec9b0 0%, #5fd4bf 100%);
margin-bottom: 8px; -webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
text-shadow: 0 0 20px rgba(78, 201, 176, 0.3);
} }
.stat-label { .stat-label {
font-size: 14px; font-size: 14px;
color: #cccccc; color: #cccccc;
font-weight: 500; font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
} }
.welcome-actions { .welcome-actions {
display: flex; display: flex;
gap: 16px; gap: 20px;
justify-content: center; justify-content: center;
margin-bottom: 40px; margin-bottom: 50px;
} }
.welcome-btn { .welcome-btn {
padding: 12px 24px; padding: 14px 32px;
border: none; border: none;
border-radius: 6px; border-radius: 8px;
cursor: pointer; cursor: pointer;
font-size: 15px; font-size: 16px;
font-weight: 600; font-weight: 700;
transition: all 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
position: relative;
overflow: hidden;
}
.welcome-btn::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
transform: translate(-50%, -50%);
transition: width 0.6s, height 0.6s;
}
.welcome-btn:hover::before {
width: 300px;
height: 300px;
} }
.welcome-btn.primary { .welcome-btn.primary {
background-color: #0e639c; background: linear-gradient(135deg, #0e639c 0%, #1177bb 100%);
color: #ffffff; color: #ffffff;
position: relative;
z-index: 1;
} }
.welcome-btn.primary:hover { .welcome-btn.primary:hover {
background-color: #1177bb; background: linear-gradient(135deg, #1177bb 0%, #1a8dd4 100%);
transform: translateY(-2px); transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(14, 99, 156, 0.5);
} }
.welcome-hint { .welcome-hint {
color: #858585; color: #a0a0a0;
font-size: 14px; font-size: 14px;
margin: 0; font-style: italic;
padding: 16px; padding: 16px 24px;
background-color: #252526; background: linear-gradient(90deg, transparent 0%, rgba(78, 201, 176, 0.05) 50%, transparent 100%);
border-radius: 6px; border-radius: 8px;
border-left: 3px solid #0e639c; border-left: 3px solid #4ec9b0;
margin-top: 10px;
} }
.welcome-hint strong { .welcome-hint strong {
color: #4ec9b0; color: #4ec9b0;
} }
/* ============================================
PANEL DE ACCIONES RÁPIDAS (DERECHA)
============================================ */
.quick-actions-panel {
width: 80px;
min-width: 80px;
background: linear-gradient(180deg, #2d2d30 0%, #252526 100%);
border-left: 1px solid #3e3e42;
box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
align-items: center;
padding: 12px 0;
gap: 6px;
overflow-y: auto;
overflow-x: hidden;
flex-shrink: 0;
}
.quick-actions-panel::-webkit-scrollbar {
width: 6px;
}
.quick-actions-panel::-webkit-scrollbar-track {
background: #1e1e1e;
border-radius: 3px;
}
.quick-actions-panel::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #4ec9b0 0%, #3a9b88 100%);
border-radius: 3px;
}
.quick-actions-panel::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, #5fd4bf 0%, #4ec9b0 100%);
}
.quick-btn {
width: 64px;
height: 64px;
background: linear-gradient(135deg, rgba(78, 201, 176, 0.05) 0%, rgba(14, 99, 156, 0.05) 100%);
border: 1px solid rgba(78, 201, 176, 0.1);
border-radius: 10px;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
padding: 8px;
position: relative;
flex-shrink: 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.quick-btn::before {
content: '';
position: absolute;
inset: 0;
border-radius: 10px;
padding: 1px;
background: linear-gradient(135deg, #4ec9b0, #0e639c);
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
mask-composite: exclude;
opacity: 0;
transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quick-btn:hover::before {
opacity: 1;
}
.quick-btn .btn-icon {
font-size: 26px;
line-height: 1;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quick-btn .btn-label {
font-size: 9px;
font-weight: 600;
color: #cccccc;
text-align: center;
line-height: 1.2;
max-width: 100%;
word-wrap: break-word;
transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quick-btn:hover {
background: linear-gradient(135deg, rgba(78, 201, 176, 0.15) 0%, rgba(14, 99, 156, 0.15) 100%);
transform: translateY(-2px) scale(1.05);
box-shadow: 0 4px 12px rgba(78, 201, 176, 0.3);
border-color: rgba(78, 201, 176, 0.3);
}
.quick-btn:hover .btn-icon {
transform: scale(1.1);
}
.quick-btn:hover .btn-label {
color: #ffffff;
}
.quick-btn.toggle-sidebar {
border: 2px solid rgba(255, 152, 0, 0.4);
background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
}
.quick-btn.toggle-sidebar:hover {
background: linear-gradient(135deg, rgba(255, 152, 0, 0.25) 0%, rgba(255, 152, 0, 0.15) 100%);
border-color: #ff9800;
box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}
.quick-btn.create-command {
border: 2px solid rgba(14, 99, 156, 0.3);
}
.quick-btn.create-command:hover {
background: linear-gradient(135deg, rgba(14, 99, 156, 0.2) 0%, rgba(14, 99, 156, 0.1) 100%);
border-color: #0e639c;
}
.quick-btn.create-event {
border: 2px solid rgba(78, 201, 176, 0.3);
}
.quick-btn.create-event:hover {
background: linear-gradient(135deg, rgba(78, 201, 176, 0.2) 0%, rgba(78, 201, 176, 0.1) 100%);
border-color: #4ec9b0;
}
.quick-btn.env {
border: 2px solid rgba(255, 193, 7, 0.3);
}
.quick-btn.env:hover {
background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
border-color: #ffc107;
}
.quick-btn.gemini {
border: 2px solid transparent;
background: linear-gradient(#252526, #252526) padding-box,
linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc04 50%, #ea4335 75%, #4285f4 100%) border-box;
}
.quick-btn.gemini:hover {
background: linear-gradient(135deg, rgba(66, 133, 244, 0.2) 0%, rgba(234, 67, 53, 0.2) 100%) padding-box,
linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc04 50%, #ea4335 75%, #4285f4 100%) border-box;
}
.quick-btn.database {
border: 2px solid rgba(156, 39, 176, 0.3);
}
.quick-btn.database:hover {
background: linear-gradient(135deg, rgba(156, 39, 176, 0.2) 0%, rgba(156, 39, 176, 0.1) 100%);
border-color: #9c27b0;
}
.quick-btn.refresh {
border: 2px solid rgba(96, 125, 139, 0.3);
}
.quick-btn.refresh:hover {
background: linear-gradient(135deg, rgba(96, 125, 139, 0.2) 0%, rgba(96, 125, 139, 0.1) 100%);
border-color: #607d8b;
}
.quick-actions-panel .divider {
width: 48px;
height: 1px;
background-color: #3e3e42;
margin: 8px 0;
}
</style> </style>
<style> <style>
@@ -742,6 +1062,26 @@ body {
RESPONSIVE DESIGN - Media Queries RESPONSIVE DESIGN - Media Queries
============================================ */ ============================================ */
/* Pantallas Ultra Grandes (2560px+) */
@media (min-width: 2560px) {
.quick-actions-panel {
width: 100px;
}
.quick-btn {
width: 80px;
height: 80px;
}
.quick-btn .btn-icon {
font-size: 28px;
}
.quick-btn .btn-label {
font-size: 11px;
}
}
/* Pantallas grandes (1920px+) */ /* Pantallas grandes (1920px+) */
@media (min-width: 1920px) { @media (min-width: 1920px) {
.welcome-content h1 { .welcome-content h1 {
@@ -774,10 +1114,6 @@ body {
/* Tabletas y pantallas pequeñas (768px - 1365px) */ /* Tabletas y pantallas pequeñas (768px - 1365px) */
@media (max-width: 1365px) { @media (max-width: 1365px) {
.app-container {
flex-direction: column;
}
.welcome-content h1 { .welcome-content h1 {
font-size: 40px; font-size: 40px;
} }
@@ -790,6 +1126,68 @@ body {
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
} }
}
/* Modo compacto para ventanas pequeñas (< 1200px) */
@media (max-width: 1199px) {
.quick-actions-panel {
width: 64px;
min-width: 64px;
padding: 8px 0;
}
.quick-btn {
width: 52px;
height: 52px;
}
.quick-btn .btn-icon {
font-size: 20px;
}
.quick-btn .btn-label {
font-size: 8px;
}
}
/* Móviles y ventanas muy pequeñas (< 768px) */
@media (max-width: 767px) {
.app-container {
flex-direction: column;
}
.quick-actions-panel {
width: 100%;
height: 60px;
min-width: unset;
flex-direction: row;
border-left: none;
border-top: 1px solid #3e3e42;
padding: 0 12px;
justify-content: space-around;
overflow-x: auto;
overflow-y: hidden;
}
.quick-btn {
width: 56px;
height: 56px;
min-width: 56px;
}
.quick-btn .btn-label {
font-size: 8px;
}
.quick-actions-panel .divider {
width: 1px;
height: 40px;
margin: 0;
}
.welcome-content h1 {
font-size: 32px;
}
.stat-number { .stat-number {
font-size: 40px; font-size: 40px;

View File

@@ -94,6 +94,107 @@ watch(() => props.schemaContent, (newContent) => {
parseSchema(); parseSchema();
}); });
// Registrar lenguaje Prisma personalizado
function registerPrismaLanguage() {
// Registrar el lenguaje
monaco.languages.register({ id: 'prisma' });
// Definir tokens para syntax highlighting
monaco.languages.setMonarchTokensProvider('prisma', {
keywords: [
'datasource', 'generator', 'model', 'enum', 'type',
'client', 'db', 'provider', 'url', 'shadowDatabaseUrl',
'relationMode', 'output', 'binaryTargets', 'previewFeatures'
],
typeKeywords: [
'String', 'Boolean', 'Int', 'BigInt', 'Float', 'Decimal',
'DateTime', 'Json', 'Bytes', 'Unsupported'
],
attributes: [
'@id', '@unique', '@default', '@relation', '@map', '@updatedAt',
'@db', '@@map', '@@unique', '@@index', '@@id', '@@ignore',
'@ignore', '@@schema', '@allow', '@deny'
],
operators: ['=', '?', '!', '[', ']', '(', ')', '{', '}', '@', '@@'],
symbols: /[=><!~?:&|+\-*\/\^%]+/,
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
tokenizer: {
root: [
// Identificadores y keywords
[/[a-zA-Z_]\w*/, {
cases: {
'@keywords': 'keyword',
'@typeKeywords': 'type',
'@default': 'identifier'
}
}],
// Atributos de Prisma
[/@+[a-zA-Z_]\w*/, 'annotation'],
// Espacios en blanco
{ include: '@whitespace' },
// Delimitadores y operadores
[/[{}()\[\]]/, '@brackets'],
[/@symbols/, {
cases: {
'@operators': 'operator',
'@default': ''
}
}],
// Números
[/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'],
[/0[xX][0-9a-fA-F]+/, 'number.hex'],
[/\d+/, 'number'],
// Strings
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' }],
],
string: [
[/[^\\"]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
],
whitespace: [
[/[ \t\r\n]+/, 'white'],
[/\/\*/, 'comment', '@comment'],
[/\/\/.*$/, 'comment'],
],
comment: [
[/[^\/*]+/, 'comment'],
[/\/\*/, 'comment', '@push'],
["\\*/", 'comment', '@pop'],
[/[\/*]/, 'comment']
],
},
});
// Definir tema personalizado para Prisma
monaco.editor.defineTheme('prisma-dark', {
base: 'vs-dark',
inherit: true,
rules: [
{ token: 'keyword', foreground: 'C586C0', fontStyle: 'bold' },
{ token: 'type', foreground: '4EC9B0', fontStyle: 'bold' },
{ token: 'annotation', foreground: 'DCDCAA' },
{ token: 'string', foreground: 'CE9178' },
{ token: 'number', foreground: 'B5CEA8' },
{ token: 'comment', foreground: '6A9955', fontStyle: 'italic' },
{ token: 'identifier', foreground: '9CDCFE' },
{ token: 'operator', foreground: 'D4D4D4' },
],
colors: {}
});
}
// Parsear el schema de Prisma para extraer tablas // Parsear el schema de Prisma para extraer tablas
function parseSchema() { function parseSchema() {
const modelRegex = /model\s+(\w+)\s*\{([^}]+)\}/g; const modelRegex = /model\s+(\w+)\s*\{([^}]+)\}/g;
@@ -148,17 +249,28 @@ function parseSchema() {
} }
onMounted(() => { onMounted(() => {
// Registrar lenguaje Prisma personalizado
registerPrismaLanguage();
// Crear editor Monaco para el schema // Crear editor Monaco para el schema
if (schemaEditorContainer.value) { if (schemaEditorContainer.value) {
schemaEditor = monaco.editor.create(schemaEditorContainer.value, { schemaEditor = monaco.editor.create(schemaEditorContainer.value, {
value: props.schemaContent, value: props.schemaContent,
language: 'prisma', language: 'prisma',
theme: 'vs-dark', theme: 'prisma-dark',
automaticLayout: true, automaticLayout: true,
minimap: { enabled: true }, minimap: { enabled: true },
fontSize: 13, fontSize: 14,
lineNumbers: 'on', lineNumbers: 'on',
readOnly: false, readOnly: false,
glyphMargin: false,
lineDecorationsWidth: 0,
lineNumbersMinChars: 3,
scrollBeyondLastLine: false,
renderLineHighlight: 'all',
matchBrackets: 'always',
folding: true,
foldingStrategy: 'indentation',
}); });
// Guardar con Ctrl+S // Guardar con Ctrl+S

View File

@@ -167,11 +167,60 @@ function showMessage(msg: string, type: 'success' | 'error' | 'info') {
</script> </script>
<style scoped> <style scoped>
.gemini-settings { padding: 30px; max-width: 700px; margin: 0 auto; color: #e0e0e0; background: #1e1e1e; min-height: 100vh; } .gemini-settings {
.settings-header { margin-bottom: 30px; border-bottom: 2px solid rgba(66, 133, 244, 0.3); padding-bottom: 15px; } padding: 30px;
.settings-header h3 { margin: 0 0 8px 0; font-size: 28px; color: #fff; font-weight: 600; background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc04 75%, #ea4335 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } max-width: 700px;
margin: 0 auto;
color: #e0e0e0;
background: linear-gradient(135deg, #1e1e1e 0%, #252526 50%, #1e1e1e 100%);
min-height: 100vh;
}
.settings-header {
margin-bottom: 30px;
border-bottom: 2px solid transparent;
background: linear-gradient(90deg, rgba(66, 133, 244, 0.3), rgba(52, 168, 83, 0.3)) bottom / 100% 2px no-repeat;
padding-bottom: 20px;
animation: border-glow 3s ease-in-out infinite;
}
@keyframes border-glow {
0%, 100% {
background-position: 0% 100%;
}
50% {
background-position: 100% 100%;
}
}
.settings-header h3 {
margin: 0 0 8px 0;
font-size: 32px;
color: #fff;
font-weight: 700;
background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc04 75%, #ea4335 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: -0.5px;
text-shadow: 0 2px 10px rgba(66, 133, 244, 0.3);
}
.subtitle { margin: 0 0 15px 0; color: #b0b0b0; font-size: 15px; } .subtitle { margin: 0 0 15px 0; color: #b0b0b0; font-size: 15px; }
.info-box { background: rgba(66, 133, 244, 0.1); border: 2px solid rgba(66, 133, 244, 0.3); border-radius: 8px; padding: 16px; margin-top: 15px; } .info-box {
background: linear-gradient(135deg, rgba(66, 133, 244, 0.15) 0%, rgba(52, 168, 83, 0.1) 100%);
border: 2px solid rgba(66, 133, 244, 0.4);
border-radius: 12px;
padding: 20px;
margin-top: 15px;
box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.info-box:hover {
border-color: rgba(66, 133, 244, 0.6);
box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
transform: translateY(-2px);
}
.info-box p { margin: 0 0 10px 0; color: #fff; font-size: 14px; } .info-box p { margin: 0 0 10px 0; color: #fff; font-size: 14px; }
.info-box ul { margin: 0; padding-left: 20px; list-style: none; } .info-box ul { margin: 0; padding-left: 20px; list-style: none; }
.info-box li { margin: 8px 0; color: #e0e0e0; font-size: 13px; line-height: 1.6; position: relative; padding-left: 8px; } .info-box li { margin: 8px 0; color: #e0e0e0; font-size: 13px; line-height: 1.6; position: relative; padding-left: 8px; }
@@ -206,8 +255,36 @@ function showMessage(msg: string, type: 'success' | 'error' | 'info') {
.actions { display: flex; gap: 12px; margin-top: 10px; } .actions { display: flex; gap: 12px; margin-top: 10px; }
.btn { padding: 12px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); } .btn { padding: 12px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #4285f4 0%, #34a853 100%); color: white; } .btn-primary {
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #5a9dff 0%, #46ba65 100%); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4); } background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
color: white;
position: relative;
overflow: hidden;
}
.btn-primary::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: translate(-50%, -50%);
transition: width 0.6s, height 0.6s;
}
.btn-primary:hover::before {
width: 300px;
height: 300px;
}
.btn-primary:hover:not(:disabled) {
background: linear-gradient(135deg, #5a9dff 0%, #46ba65 100%);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(66, 133, 244, 0.5);
}
.btn-test { background: #2d2d30; color: #e0e0e0; border: 2px solid #4285f4; } .btn-test { background: #2d2d30; color: #e0e0e0; border: 2px solid #4285f4; }
.btn-test:hover:not(:disabled) { background: #3e3e42; transform: translateY(-2px); } .btn-test:hover:not(:disabled) { background: #3e3e42; transform: translateY(-2px); }
.message { padding: 14px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 2px solid; animation: slideIn 0.3s ease; } .message { padding: 14px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 2px solid; animation: slideIn 0.3s ease; }

View File

@@ -26,24 +26,6 @@
<span class="path-value">{{ truncatePath(projectRoot) }}</span> <span class="path-value">{{ truncatePath(projectRoot) }}</span>
</div> </div>
<div class="actions-section">
<button @click="emit('new-command')" class="action-btn primary">
Nuevo Comando
</button>
<button @click="emit('new-event')" class="action-btn primary">
Nuevo Evento
</button>
<button @click="emit('toggle-env-manager')" class="action-btn env-manager">
🔐 Variables ENV
</button>
<button @click="emit('toggle-gemini-settings')" class="action-btn gemini">
Gemini IA
</button>
<button @click="emit('refresh')" class="action-btn secondary">
🔄 Refrescar
</button>
</div>
<div class="files-section"> <div class="files-section">
<!-- Sección de Comandos --> <!-- Sección de Comandos -->
<div class="section-group"> <div class="section-group">
@@ -229,47 +211,73 @@ function truncatePath(path: string): string {
<style scoped> <style scoped>
.sidebar { .sidebar {
width: 300px; width: 300px;
background-color: #252526; background: linear-gradient(180deg, #252526 0%, #1e1e1e 100%);
color: #cccccc; color: #cccccc;
height: 100vh; height: 100vh;
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-right: 1px solid #3e3e42; border-right: 1px solid #3e3e42;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}
.sidebar::-webkit-scrollbar {
width: 8px;
}
.sidebar::-webkit-scrollbar-track {
background: #1e1e1e;
}
.sidebar::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
background: #4e4e4e;
} }
.sidebar-header { .sidebar-header {
padding: 12px 16px; padding: 16px;
background-color: #2d2d30; background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
border-bottom: 1px solid #3e3e42; border-bottom: 1px solid #3e3e42;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
} }
.header-title h2 { .header-title h2 {
margin: 0 0 8px 0; margin: 0 0 12px 0;
font-size: 16px; font-size: 18px;
font-weight: 600; font-weight: 700;
color: #ffffff; color: #ffffff;
letter-spacing: 0.5px;
background: linear-gradient(135deg, #4ec9b0 0%, #0e639c 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
} }
.header-actions { .header-actions {
display: flex; display: flex;
gap: 6px; gap: 8px;
} }
.icon-btn { .icon-btn {
background: #3c3c3c; background: linear-gradient(135deg, #3c3c3c 0%, #2d2d30 100%);
border: 1px solid #3e3e42; border: 1px solid #3e3e42;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
padding: 8px 12px; padding: 10px 14px;
border-radius: 4px; border-radius: 6px;
transition: all 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex: 1; flex: 1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
} }
.icon-btn:hover { .icon-btn:hover {
background-color: #4e4e52; background: linear-gradient(135deg, #4e4e52 0%, #3c3c3c 100%);
transform: translateY(-1px); transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
} }
.dev-ultra-btn { .dev-ultra-btn {
@@ -277,24 +285,24 @@ function truncatePath(path: string): string {
} }
.dev-ultra-btn.active { .dev-ultra-btn.active {
background-color: #0e639c; background: linear-gradient(135deg, #0e639c 0%, #1177bb 100%);
border-color: #1177bb; border-color: #1177bb;
box-shadow: 0 0 10px rgba(14, 99, 156, 0.5); box-shadow: 0 0 15px rgba(14, 99, 156, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
animation: pulse 2s infinite; animation: pulse 2s infinite;
} }
@keyframes pulse { @keyframes pulse {
0%, 100% { 0%, 100% {
box-shadow: 0 0 10px rgba(14, 99, 156, 0.5); box-shadow: 0 0 15px rgba(14, 99, 156, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
} }
50% { 50% {
box-shadow: 0 0 20px rgba(14, 99, 156, 0.8); box-shadow: 0 0 25px rgba(14, 99, 156, 0.9), 0 6px 12px rgba(0, 0, 0, 0.4);
} }
} }
.project-path { .project-path {
padding: 8px 16px; padding: 12px 16px;
background-color: #1e1e1e; background: linear-gradient(135deg, #1e1e1e 0%, #252526 100%);
border-bottom: 1px solid #3e3e42; border-bottom: 1px solid #3e3e42;
font-size: 11px; font-size: 11px;
} }
@@ -311,8 +319,9 @@ function truncatePath(path: string): string {
.actions-section { .actions-section {
padding: 12px; padding: 12px;
background-color: #1e1e1e; background: linear-gradient(180deg, #252526 0%, #1e1e1e 100%);
border-bottom: 1px solid #3e3e42; border-bottom: 1px solid #3e3e42;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
@@ -321,42 +330,48 @@ function truncatePath(path: string): string {
.action-btn { .action-btn {
padding: 10px 14px; padding: 10px 14px;
border: none; border: none;
border-radius: 4px; border-radius: 6px;
cursor: pointer; cursor: pointer;
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 500;
transition: all 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
text-align: left; text-align: left;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
} }
.action-btn.primary { .action-btn.primary {
background-color: #0e639c; background: linear-gradient(135deg, #0e639c 0%, #1177bb 100%);
color: #ffffff; color: #ffffff;
} }
.action-btn.primary:hover { .action-btn.primary:hover {
background-color: #1177bb; background: linear-gradient(135deg, #1177bb 0%, #1a8dd4 100%);
transform: translateY(-1px); transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(14, 99, 156, 0.4);
} }
.action-btn.secondary { .action-btn.secondary {
background-color: #3c3c3c; background: linear-gradient(135deg, #3c3c3c 0%, #2d2d30 100%);
color: #cccccc; color: #cccccc;
border: 1px solid #3e3e42; border: 1px solid #3e3e42;
} }
.action-btn.secondary:hover { .action-btn.secondary:hover {
background-color: #4e4e52; background: linear-gradient(135deg, #4e4e52 0%, #3c3c3c 100%);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(60, 60, 60, 0.4);
} }
.action-btn.env-manager { .action-btn.env-manager {
background-color: #4ec9b0; background: linear-gradient(135deg, #4ec9b0 0%, #5fd4bf 100%);
color: #1e1e1e; color: #1e1e1e;
font-weight: 600;
} }
.action-btn.env-manager:hover { .action-btn.env-manager:hover {
background-color: #5fd4bf; background: linear-gradient(135deg, #5fd4bf 0%, #70dfc9 100%);
transform: translateY(-1px); transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(78, 201, 176, 0.4);
} }
.action-btn.gemini { .action-btn.gemini {
@@ -368,7 +383,7 @@ function truncatePath(path: string): string {
.action-btn.gemini:hover { .action-btn.gemini:hover {
background: linear-gradient(135deg, #5a9dff 0%, #46ba65 50%, #ffc825 75%, #f55a4e 100%); background: linear-gradient(135deg, #5a9dff 0%, #46ba65 50%, #ffc825 75%, #f55a4e 100%);
transform: translateY(-1px); transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(66, 133, 244, 0.5); box-shadow: 0 4px 12px rgba(66, 133, 244, 0.5);
} }
@@ -378,22 +393,46 @@ function truncatePath(path: string): string {
padding: 8px 0; padding: 8px 0;
} }
.files-section::-webkit-scrollbar {
width: 8px;
}
.files-section::-webkit-scrollbar-track {
background: #1e1e1e;
border-radius: 4px;
}
.files-section::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #4ec9b0 0%, #3a9b88 100%);
border-radius: 4px;
}
.files-section::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, #5fd4bf 0%, #4ec9b0 100%);
}
.section-group { .section-group {
margin-bottom: 8px; margin-bottom: 4px;
} }
.section-header { .section-header {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 10px;
padding: 10px 16px; padding: 12px 16px;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
user-select: none; user-select: none;
background: linear-gradient(90deg, transparent 0%, rgba(78, 201, 176, 0.05) 100%);
border-left: 3px solid transparent;
border-radius: 4px 0 0 4px;
} }
.section-header:hover { .section-header:hover {
background-color: #2d2d30; background: linear-gradient(90deg, rgba(78, 201, 176, 0.1) 0%, rgba(78, 201, 176, 0.15) 100%);
border-left-color: #4ec9b0;
padding-left: 13px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
} }
.section-icon { .section-icon {
@@ -409,12 +448,14 @@ function truncatePath(path: string): string {
} }
.section-count { .section-count {
background-color: #3c3c3c; background: linear-gradient(135deg, #4ec9b0 0%, #3a9b88 100%);
color: #cccccc; color: #1e1e1e;
padding: 2px 8px; padding: 3px 10px;
border-radius: 10px; border-radius: 12px;
font-size: 11px; font-size: 11px;
font-weight: 600; font-weight: 700;
box-shadow: 0 2px 4px rgba(78, 201, 176, 0.3);
letter-spacing: 0.3px;
} }
.section-content { .section-content {
@@ -428,19 +469,31 @@ function truncatePath(path: string): string {
.subsection-header { .subsection-header {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 10px;
padding: 8px 16px; padding: 10px 16px 10px 20px;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
user-select: none; user-select: none;
background: linear-gradient(90deg, transparent 0%, rgba(14, 99, 156, 0.05) 100%);
border-left: 2px solid transparent;
border-radius: 4px 0 0 4px;
} }
.subsection-header:hover { .subsection-header:hover {
background-color: #2d2d30; background: linear-gradient(90deg, rgba(14, 99, 156, 0.1) 0%, rgba(14, 99, 156, 0.15) 100%);
border-left-color: #1177bb;
padding-left: 18px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
} }
.subsection-icon { .subsection-icon {
font-size: 14px; font-size: 14px;
color: #858585;
transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.subsection-header:hover .subsection-icon {
color: #1177bb;
} }
.subsection-title { .subsection-title {
@@ -451,12 +504,13 @@ function truncatePath(path: string): string {
} }
.subsection-count { .subsection-count {
background-color: #3c3c3c; background: linear-gradient(135deg, #3c3c3c 0%, #2d2d30 100%);
color: #858585; color: #cccccc;
padding: 2px 6px; padding: 2px 8px;
border-radius: 8px; border-radius: 10px;
font-size: 10px; font-size: 10px;
font-weight: 600; font-weight: 600;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
} }
.file-list { .file-list {
@@ -466,25 +520,61 @@ function truncatePath(path: string): string {
.file-item { .file-item {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 10px;
padding: 6px 16px; padding: 8px 16px 8px 24px;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border-left: 2px solid transparent; border-left: 2px solid transparent;
border-radius: 4px 0 0 4px;
position: relative;
}
.file-item::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 0;
background: linear-gradient(90deg, rgba(78, 201, 176, 0.2) 0%, transparent 100%);
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
} }
.file-item:hover { .file-item:hover {
background-color: #2d2d30; background: linear-gradient(90deg, rgba(45, 45, 48, 0.5) 0%, rgba(30, 30, 30, 0.3) 100%);
padding-left: 22px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.file-item:hover::before {
width: 3px;
} }
.file-item.active { .file-item.active {
background-color: #3e3e42; background: linear-gradient(90deg, rgba(14, 99, 156, 0.2) 0%, rgba(14, 99, 156, 0.1) 100%);
border-left-color: #0e639c; border-left-color: #0e639c;
box-shadow: 0 2px 6px rgba(14, 99, 156, 0.3);
}
.file-item.active::before {
width: 3px;
background: linear-gradient(90deg, rgba(14, 99, 156, 0.5) 0%, transparent 100%);
} }
.file-icon { .file-icon {
font-size: 13px; font-size: 14px;
opacity: 0.8; opacity: 0.8;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.file-item:hover .file-icon {
opacity: 1;
transform: scale(1.1);
}
.file-item.active .file-icon {
color: #4ec9b0;
opacity: 1;
} }
.file-name { .file-name {
@@ -495,6 +585,17 @@ function truncatePath(path: string): string {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
flex: 1; flex: 1;
font-weight: 500;
transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.file-item:hover .file-name {
color: #ffffff;
}
.file-item.active .file-name {
color: #4ec9b0;
font-weight: 600;
} }
.file-path { .file-path {
@@ -503,6 +604,11 @@ function truncatePath(path: string): string {
font-family: 'Consolas', 'Monaco', monospace; font-family: 'Consolas', 'Monaco', monospace;
margin-left: auto; margin-left: auto;
padding-left: 8px; padding-left: 8px;
transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.file-item:hover .file-path {
color: #a0a0a0;
} }
.ultra-mode { .ultra-mode {