Story 6-2 — Markdown roundtrip export/import: - lib/editor/markdown-export.ts: tiptapHTMLToMarkdown, markdownToHTML, looksLikeMarkdown - lib/editor/markdown-paste-extension.ts: TipTap extension paste Markdown → blocs - note-editor-toolbar.tsx: export .md + import .md (file picker) - rich-text-editor.tsx: intégration MarkdownPasteExtension - 40 tests unitaires markdown-export.test.ts Story 6-3 — Brainstorm PPTX + Canvas: - lib/brainstorm/export-pptx.ts: génération PPTX 5 slides (pptxgenjs) - app/api/brainstorm/[sessionId]/export-pptx/route.ts: route POST protégée - brainstorm-page.tsx: bouton PPTX, auto-select session, fix emoji, fix router.replace - wave-canvas.tsx: fitTrigger recentrage, légende bas-droite Onboarding activation wizard (Story 6-1): - components/onboarding/: wizard multi-étapes, hints éditeur - app/api/onboarding/: route PATCH onboarding - prisma/migrations: champs onboarding user Locales: 15 langues mises à jour (brainstorm, markdown, onboarding keys) Sprint: 6-1 done, 6-2 review, 6-3 review Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
'use client'
|
|
|
|
import { motion } from 'motion/react'
|
|
import { Brain } from 'lucide-react'
|
|
import { Button } from '@/components/ui/button'
|
|
import { useLanguage } from '@/lib/i18n'
|
|
|
|
interface Props {
|
|
onNext: () => void
|
|
onSkip: () => void
|
|
userName?: string | null
|
|
}
|
|
|
|
export function OnboardingStepWelcome({ onNext, onSkip, userName }: Props) {
|
|
const { t } = useLanguage()
|
|
const firstName = userName?.split(' ')[0] ?? null
|
|
|
|
return (
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 16 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
exit={{ opacity: 0, y: -16 }}
|
|
className="flex flex-col items-center gap-6 text-center"
|
|
>
|
|
<motion.div
|
|
initial={{ scale: 0.7, opacity: 0 }}
|
|
animate={{ scale: 1, opacity: 1 }}
|
|
transition={{ delay: 0.1, type: 'spring', stiffness: 200 }}
|
|
className="flex h-20 w-20 items-center justify-center rounded-2xl bg-brand-accent/10 text-brand-accent"
|
|
>
|
|
<Brain className="h-10 w-10" />
|
|
</motion.div>
|
|
|
|
<div className="space-y-2">
|
|
<h2 className="text-2xl font-bold tracking-tight text-foreground">
|
|
{firstName
|
|
? t('onboarding.welcome_title_name', { name: firstName })
|
|
: t('onboarding.welcome_title')}
|
|
</h2>
|
|
<p className="text-base text-muted-foreground max-w-xs">
|
|
{t('onboarding.welcome_subtitle')}
|
|
</p>
|
|
</div>
|
|
|
|
<div className="flex flex-col gap-2 w-full max-w-xs">
|
|
<Button onClick={onNext} size="lg" className="w-full">
|
|
{t('onboarding.welcome_cta')} →
|
|
</Button>
|
|
<button
|
|
onClick={onSkip}
|
|
className="text-xs text-muted-foreground/60 hover:text-muted-foreground transition-colors py-1"
|
|
>
|
|
{t('onboarding.skip')}
|
|
</button>
|
|
</div>
|
|
</motion.div>
|
|
)
|
|
}
|