Ajustes Gerais
This commit is contained in:
@@ -330,6 +330,12 @@
|
||||
</div>
|
||||
<div class="ml-auto flex flex-none items-center gap-4">
|
||||
{#if currentUser.data}
|
||||
<!-- Nome e Perfil à esquerda do avatar -->
|
||||
<div class="hidden flex-col items-end lg:flex">
|
||||
<span class="text-primary text-sm font-semibold">{currentUser.data.nome}</span>
|
||||
<span class="text-base-content/60 text-xs">{currentUser.data.role?.nome}</span>
|
||||
</div>
|
||||
|
||||
<div class="dropdown dropdown-end">
|
||||
<!-- Botão de Perfil ULTRA MODERNO -->
|
||||
<button
|
||||
@@ -343,32 +349,32 @@
|
||||
class="absolute inset-0 bg-linear-to-br from-white/0 to-white/20 opacity-0 transition-opacity duration-300 group-hover:opacity-100"
|
||||
> </div>
|
||||
|
||||
<!-- Avatar/Foto do usuário ou ícone padrão -->
|
||||
{#if avatarUrlDoUsuario()}
|
||||
<img
|
||||
src={avatarUrlDoUsuario()}
|
||||
alt={currentUser.data?.nome || 'Usuário'}
|
||||
class="relative z-10 h-full w-full object-cover"
|
||||
/>
|
||||
{:else}
|
||||
<!-- Ícone de usuário moderno (fallback) -->
|
||||
<User
|
||||
class="relative z-10 h-7 w-7 text-white transition-transform duration-300 group-hover:scale-110"
|
||||
style="filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));"
|
||||
/>
|
||||
{/if}
|
||||
<!-- Avatar/Foto do usuário ou ícone padrão -->
|
||||
{#if avatarUrlDoUsuario()}
|
||||
<img
|
||||
src={avatarUrlDoUsuario()}
|
||||
alt={currentUser.data?.nome || 'Usuário'}
|
||||
class="relative z-10 h-full w-full object-cover"
|
||||
/>
|
||||
{:else}
|
||||
<!-- Ícone de usuário moderno (fallback) -->
|
||||
<User
|
||||
class="relative z-10 h-7 w-7 text-white transition-transform duration-300 group-hover:scale-110"
|
||||
style="filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Anel de pulso sutil -->
|
||||
<div
|
||||
class="absolute inset-0 rounded-2xl"
|
||||
style="animation: pulse-ring-subtle 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;"
|
||||
></div>
|
||||
|
||||
<!-- Badge de status online -->
|
||||
<!-- Anel de pulso sutil -->
|
||||
<div
|
||||
class="bg-success absolute top-1 right-1 z-20 h-3 w-3 rounded-full border-2 border-white shadow-lg"
|
||||
style="animation: pulse-dot 2s ease-in-out infinite;"
|
||||
class="absolute inset-0 rounded-2xl"
|
||||
style="animation: pulse-ring-subtle 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;"
|
||||
></div>
|
||||
|
||||
<!-- Badge de status online -->
|
||||
<div
|
||||
class="bg-success absolute top-1 right-1 z-20 h-3 w-3 rounded-full border-2 border-white shadow-lg"
|
||||
style="animation: pulse-dot 2s ease-in-out infinite;"
|
||||
></div>
|
||||
</button>
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<ul
|
||||
@@ -387,11 +393,6 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mr-2 hidden flex-col items-end lg:flex">
|
||||
<span class="text-primary text-sm font-semibold">{currentUser.data.nome}</span>
|
||||
<span class="text-base-content/60 text-xs">{currentUser.data.role?.nome}</span>
|
||||
</div>
|
||||
|
||||
<!-- Sino de notificações no canto superior direito -->
|
||||
<div class="relative">
|
||||
<NotificationBell />
|
||||
|
||||
@@ -424,15 +424,16 @@
|
||||
|
||||
<section class="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3">
|
||||
{#each featureCards as card (card.title)}
|
||||
<article
|
||||
class={`group relative overflow-hidden rounded-2xl border ${paletteStyles[card.palette].cardBorder} bg-base-100/90 p-6 shadow-lg transition-all duration-300`}
|
||||
>
|
||||
<div
|
||||
class="from-base-200/40 absolute inset-x-6 top-0 h-24 rounded-b-full bg-linear-to-b to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100"
|
||||
></div>
|
||||
<div class="relative flex items-start gap-4">
|
||||
{#if card.href && !card.disabled}
|
||||
<a
|
||||
href={resolve(card.href)}
|
||||
class={`group relative flex cursor-pointer items-center gap-4 overflow-hidden rounded-2xl border ${paletteStyles[card.palette].cardBorder} bg-base-100/90 p-6 shadow-lg transition-all duration-300 hover:shadow-xl hover:scale-[1.02]`}
|
||||
>
|
||||
<div
|
||||
class={`flex h-14 w-14 items-center justify-center rounded-2xl ${paletteStyles[card.palette].iconBg} ${paletteStyles[card.palette].iconRing}`}
|
||||
class="from-base-200/40 absolute inset-x-6 top-0 h-24 rounded-b-full bg-linear-to-b to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100"
|
||||
></div>
|
||||
<div
|
||||
class={`relative flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl ${paletteStyles[card.palette].iconBg} ${paletteStyles[card.palette].iconRing}`}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -455,47 +456,39 @@
|
||||
<h2 class="text-base-content text-xl font-semibold">
|
||||
{card.title}
|
||||
</h2>
|
||||
<p class="text-base-content/70 mt-2 text-sm leading-relaxed">
|
||||
{card.description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if card.highlightBadges}
|
||||
<div class="mt-4 flex flex-wrap gap-2">
|
||||
{#each card.highlightBadges as badge (badge.label)}
|
||||
{#if badge.variant === 'solid'}
|
||||
<span class={`badge ${paletteStyles[card.palette].badgeSolid}`}>{badge.label}</span>
|
||||
{:else}
|
||||
<span
|
||||
class={`badge ${paletteStyles[card.palette].badgeOutline} ${paletteStyles[card.palette].iconColor}`}
|
||||
>
|
||||
{badge.label}
|
||||
</span>
|
||||
{/if}
|
||||
{/each}
|
||||
</a>
|
||||
{:else}
|
||||
<article
|
||||
class={`group relative flex cursor-not-allowed items-center gap-4 overflow-hidden rounded-2xl border ${paletteStyles[card.palette].cardBorder} bg-base-100/50 p-6 shadow-lg opacity-60`}
|
||||
>
|
||||
<div
|
||||
class={`relative flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl ${paletteStyles[card.palette].iconBg} ${paletteStyles[card.palette].iconRing}`}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
class={`h-7 w-7 ${paletteStyles[card.palette].iconColor}`}
|
||||
>
|
||||
{#each iconPaths[card.icon] as path (path.d)}
|
||||
<path
|
||||
d={path.d}
|
||||
stroke-linecap={path.strokeLinecap ?? 'round'}
|
||||
stroke-linejoin={path.strokeLinejoin ?? 'round'}
|
||||
stroke-width={path.strokeWidth ?? 2}
|
||||
/>
|
||||
{/each}
|
||||
</svg>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
{#if card.href && !card.disabled}
|
||||
<a
|
||||
class={`btn ${paletteStyles[card.palette].button} btn-sm sm:btn-md shadow-md transition-all duration-200 hover:shadow-lg`}
|
||||
href={resolve(card.href)}
|
||||
>
|
||||
{card.ctaLabel}
|
||||
</a>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class={`btn ${paletteStyles[card.palette].button} btn-sm sm:btn-md shadow-md`}
|
||||
disabled
|
||||
>
|
||||
{card.ctaLabel}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</article>
|
||||
<div class="relative flex-1">
|
||||
<h2 class="text-base-content text-xl font-semibold">
|
||||
{card.title}
|
||||
</h2>
|
||||
</div>
|
||||
</article>
|
||||
{/if}
|
||||
{/each}
|
||||
</section>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
enviadoPor: Id<'usuarios'>;
|
||||
criadoEm: number;
|
||||
enviadoEm: number | undefined;
|
||||
erroDetalhes?: string;
|
||||
destinatarioInfo: Doc<'usuarios'> | null;
|
||||
templateInfo: Doc<'templatesMensagens'> | null;
|
||||
}
|
||||
@@ -55,10 +56,11 @@
|
||||
const emailIdsArray = $derived(
|
||||
Array.from(emailIdsRastreados).map((id) => id as Id<'notificacoesEmail'>)
|
||||
);
|
||||
// Usar função para evitar execução quando array está vazio
|
||||
const emailsStatusQuery = useQuery(api.email.buscarEmailsPorIds, () =>
|
||||
// Usar $derived para calcular argumentos da query condicionalmente
|
||||
const emailsStatusArgs = $derived(
|
||||
emailIdsArray.length === 0 ? 'skip' : { emailIds: emailIdsArray }
|
||||
);
|
||||
const emailsStatusQuery = useQuery(api.email.buscarEmailsPorIds, emailsStatusArgs);
|
||||
|
||||
// Queries para agendamentos
|
||||
const agendamentosEmailQuery = useQuery(api.email.listarAgendamentosEmail, {});
|
||||
@@ -248,9 +250,21 @@
|
||||
variaveis: Record<string, string>
|
||||
): string {
|
||||
const textoComVariaveis = renderizarTemplate(template, variaveis);
|
||||
// Remove quaisquer tags HTML que possam ter sido inseridas por engano
|
||||
const textoPuro = textoComVariaveis.replace(/<[^>]*>/g, '');
|
||||
return textoPuro;
|
||||
// Remove todas as tags HTML (incluindo quebras de linha HTML)
|
||||
let textoPuro = textoComVariaveis.replace(/<[^>]*>/g, '');
|
||||
// Converte entidades HTML comuns para texto normal
|
||||
textoPuro = textoPuro
|
||||
.replace(/ /g, ' ')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/'/g, "'")
|
||||
.replace(/&[a-zA-Z0-9#]+;/g, ''); // Remove outras entidades HTML
|
||||
// Normaliza espaços múltiplos (mas preserva quebras de linha reais)
|
||||
textoPuro = textoPuro.replace(/[ \t]+/g, ' ').replace(/[ \t]*\n[ \t]*/g, '\n');
|
||||
return textoPuro.trim();
|
||||
}
|
||||
|
||||
// Função para mostrar mensagens
|
||||
@@ -726,9 +740,10 @@
|
||||
});
|
||||
|
||||
if (conversaId) {
|
||||
// Para chat, sempre remover HTML dos templates
|
||||
const mensagem =
|
||||
usarTemplate && templateSelecionado
|
||||
? renderizarTemplate(templateSelecionado.corpo, {
|
||||
? renderizarTemplateChatLocal(templateSelecionado.corpo, {
|
||||
nome: destinatario.nome,
|
||||
matricula: destinatario.matricula || ''
|
||||
})
|
||||
@@ -1999,6 +2014,7 @@
|
||||
</svg>
|
||||
<span>Para enviar emails, certifique-se de configurar o SMTP em Configurações de Email.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Novo Template -->
|
||||
|
||||
Reference in New Issue
Block a user