Add SVG assets and TypeScript configuration
- Created a new SVG for the Open Graph image (og-image.svg) with a gradient background and text elements. - Added Vercel logo SVG (vercel.svg) for deployment branding. - Introduced a window icon SVG (window.svg) for UI representation. - Initialized TypeScript configuration file (tsconfig.json) with strict settings and module resolution for a React project.
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
.next
|
||||||
|
.git
|
||||||
|
*.md
|
||||||
|
.env*.local
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.*
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/versions
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# env files (can opt-in for committing if needed)
|
||||||
|
.env*
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
# BlocNote
|
||||||
|
|
||||||
|
Bloc-notes Markdown en ligne, rapide et sans inscription.
|
||||||
|
|
||||||
|
## Site public
|
||||||
|
|
||||||
|
- Production: https://blocnote.arthurp.fr
|
||||||
|
|
||||||
|
## Stack technique
|
||||||
|
|
||||||
|
- Next.js 16 (App Router)
|
||||||
|
- React 19
|
||||||
|
- TypeScript
|
||||||
|
- ESLint
|
||||||
|
|
||||||
|
## Fonctionnalites
|
||||||
|
|
||||||
|
- Edition Markdown avec apercu en temps reel
|
||||||
|
- Sauvegarde automatique des notes
|
||||||
|
- Recherche et tri des notes
|
||||||
|
- Notes epinglees
|
||||||
|
- Export d'une note
|
||||||
|
- Mode clair / sombre
|
||||||
|
- Raccourcis clavier
|
||||||
|
|
||||||
|
## Lancement local
|
||||||
|
|
||||||
|
Pre-requis:
|
||||||
|
|
||||||
|
- Node.js 22+
|
||||||
|
- npm
|
||||||
|
|
||||||
|
Installation et demarrage:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm ci
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Application disponible sur http://localhost:3000
|
||||||
|
|
||||||
|
## Scripts
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev # mode developpement
|
||||||
|
npm run lint # verification lint
|
||||||
|
npm run build # build production
|
||||||
|
npm run start # lancer le build production
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variables d'environnement
|
||||||
|
|
||||||
|
Le projet peut utiliser:
|
||||||
|
|
||||||
|
- NEXT_PUBLIC_SITE_URL (exemple: https://blocnote.arthurp.fr)
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
|
Un environnement Docker est disponible via [docker-compose.yml](docker-compose.yml).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Publication GitHub
|
||||||
|
|
||||||
|
Points verifies avant publication:
|
||||||
|
|
||||||
|
- Secrets et fichiers sensibles non exposes
|
||||||
|
- Fichiers d'environnement ignores par [.gitignore](.gitignore)
|
||||||
|
- Build et lint valides
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useRef, useState } from "react";
|
||||||
|
import { Note } from "../types";
|
||||||
|
import Toolbar from "./Toolbar";
|
||||||
|
import MarkdownPreview from "./MarkdownPreview";
|
||||||
|
import { Pencil, Eye, Columns2 } from "lucide-react";
|
||||||
|
|
||||||
|
type ViewMode = "edit" | "preview" | "split";
|
||||||
|
|
||||||
|
interface EditorProps {
|
||||||
|
note: Note;
|
||||||
|
onUpdateNote: (id: string, updates: Partial<Note>) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Editor({ note, onUpdateNote }: EditorProps) {
|
||||||
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
|
const [viewMode, setViewMode] = useState<ViewMode>("split");
|
||||||
|
const [title, setTitle] = useState(note.title);
|
||||||
|
const [content, setContent] = useState(note.content);
|
||||||
|
|
||||||
|
const handleTitleChange = (newTitle: string) => {
|
||||||
|
setTitle(newTitle);
|
||||||
|
onUpdateNote(note.id, { title: newTitle });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleContentChange = (newContent: string) => {
|
||||||
|
setContent(newContent);
|
||||||
|
onUpdateNote(note.id, { content: newContent });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="editor-container">
|
||||||
|
<div className="editor-header">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="editor-title-input"
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => handleTitleChange(e.target.value)}
|
||||||
|
placeholder="Titre de la note..."
|
||||||
|
/>
|
||||||
|
<div className="view-mode-buttons">
|
||||||
|
<button
|
||||||
|
className={`btn-view ${viewMode === "edit" ? "active" : ""}`}
|
||||||
|
onClick={() => setViewMode("edit")}
|
||||||
|
title="Éditeur seul"
|
||||||
|
>
|
||||||
|
<Pencil size={16} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={`btn-view ${viewMode === "split" ? "active" : ""}`}
|
||||||
|
onClick={() => setViewMode("split")}
|
||||||
|
title="Vue partagée"
|
||||||
|
>
|
||||||
|
<Columns2 size={16} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={`btn-view ${viewMode === "preview" ? "active" : ""}`}
|
||||||
|
onClick={() => setViewMode("preview")}
|
||||||
|
title="Aperçu seul"
|
||||||
|
>
|
||||||
|
<Eye size={16} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{(viewMode === "edit" || viewMode === "split") && (
|
||||||
|
<Toolbar textareaRef={textareaRef} onContentChange={handleContentChange} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className={`editor-body ${viewMode}`}>
|
||||||
|
{(viewMode === "edit" || viewMode === "split") && (
|
||||||
|
<div className="editor-pane">
|
||||||
|
<label htmlFor="note-editor" className="sr-only">Contenu de la note en Markdown</label>
|
||||||
|
<textarea
|
||||||
|
id="note-editor"
|
||||||
|
ref={textareaRef}
|
||||||
|
className="editor-textarea"
|
||||||
|
value={content}
|
||||||
|
onChange={(e) => handleContentChange(e.target.value)}
|
||||||
|
placeholder="Écrivez en Markdown..."
|
||||||
|
spellCheck={false}
|
||||||
|
aria-label="Contenu de la note"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{(viewMode === "preview" || viewMode === "split") && (
|
||||||
|
<div className="preview-pane" role="region" aria-label="Aperçu Markdown" aria-live="polite">
|
||||||
|
<MarkdownPreview content={content} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useMemo } from "react";
|
||||||
|
import { marked } from "marked";
|
||||||
|
|
||||||
|
interface MarkdownPreviewProps {
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function MarkdownPreview({ content }: MarkdownPreviewProps) {
|
||||||
|
const html = useMemo(() => {
|
||||||
|
if (!content) return '<p class="preview-empty">Commencez à écrire pour voir l\'aperçu...</p>';
|
||||||
|
try {
|
||||||
|
return marked.parse(content, { breaks: true, gfm: true }) as string;
|
||||||
|
} catch {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
}, [content]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="markdown-preview prose"
|
||||||
|
dangerouslySetInnerHTML={{ __html: html }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,216 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState } from "react";
|
||||||
|
import { Note, SortMode } from "../types";
|
||||||
|
import {
|
||||||
|
Plus,
|
||||||
|
Search,
|
||||||
|
Pin,
|
||||||
|
Trash2,
|
||||||
|
ArrowDownAZ,
|
||||||
|
Clock,
|
||||||
|
Trash,
|
||||||
|
FileText,
|
||||||
|
PanelLeftClose,
|
||||||
|
PanelLeftOpen,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
|
function formatDate(ts: number): string {
|
||||||
|
const d = new Date(ts);
|
||||||
|
const now = new Date();
|
||||||
|
const diff = now.getTime() - ts;
|
||||||
|
if (diff < 60000) return "À l'instant";
|
||||||
|
if (diff < 3600000) return `il y a ${Math.floor(diff / 60000)} min`;
|
||||||
|
if (diff < 86400000) return `il y a ${Math.floor(diff / 3600000)}h`;
|
||||||
|
if (d.toDateString() === now.toDateString()) {
|
||||||
|
return d.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
||||||
|
}
|
||||||
|
return d.toLocaleDateString("fr-FR", {
|
||||||
|
day: "numeric",
|
||||||
|
month: "short",
|
||||||
|
year: d.getFullYear() !== now.getFullYear() ? "numeric" : undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SidebarProps {
|
||||||
|
notes: Note[];
|
||||||
|
activeNoteId: string | null;
|
||||||
|
searchQuery: string;
|
||||||
|
sortMode: SortMode;
|
||||||
|
onSelectNote: (id: string) => void;
|
||||||
|
onCreateNote: () => void;
|
||||||
|
onDeleteNote: (id: string) => void;
|
||||||
|
onTogglePin: (id: string) => void;
|
||||||
|
onSearchChange: (q: string) => void;
|
||||||
|
onSortChange: (mode: SortMode) => void;
|
||||||
|
onDeleteAll: () => void;
|
||||||
|
onExportNote: (id: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Sidebar({
|
||||||
|
notes,
|
||||||
|
activeNoteId,
|
||||||
|
searchQuery,
|
||||||
|
sortMode,
|
||||||
|
onSelectNote,
|
||||||
|
onCreateNote,
|
||||||
|
onDeleteNote,
|
||||||
|
onTogglePin,
|
||||||
|
onSearchChange,
|
||||||
|
onSortChange,
|
||||||
|
onDeleteAll,
|
||||||
|
onExportNote,
|
||||||
|
}: SidebarProps) {
|
||||||
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
const [confirmDeleteAll, setConfirmDeleteAll] = useState(false);
|
||||||
|
const [hoveredId, setHoveredId] = useState<string | null>(null);
|
||||||
|
|
||||||
|
if (collapsed) {
|
||||||
|
return (
|
||||||
|
<div className="sidebar sidebar-collapsed">
|
||||||
|
<button
|
||||||
|
className="btn-icon"
|
||||||
|
onClick={() => setCollapsed(false)}
|
||||||
|
title="Ouvrir le panneau"
|
||||||
|
>
|
||||||
|
<PanelLeftOpen size={20} />
|
||||||
|
</button>
|
||||||
|
<button className="btn-icon btn-new-note" onClick={onCreateNote} title="Nouvelle note">
|
||||||
|
<Plus size={20} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<aside className="sidebar" role="navigation" aria-label="Liste des notes">
|
||||||
|
<div className="sidebar-header">
|
||||||
|
<div className="sidebar-title-row">
|
||||||
|
<h1 className="sidebar-title">
|
||||||
|
<FileText size={22} />
|
||||||
|
BlocNote
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
className="btn-icon"
|
||||||
|
onClick={() => setCollapsed(true)}
|
||||||
|
title="Réduire le panneau"
|
||||||
|
>
|
||||||
|
<PanelLeftClose size={18} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="search-bar" role="search">
|
||||||
|
<Search size={16} className="search-icon" aria-hidden="true" />
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
placeholder="Rechercher..."
|
||||||
|
value={searchQuery}
|
||||||
|
onChange={(e) => onSearchChange(e.target.value)}
|
||||||
|
className="search-input"
|
||||||
|
aria-label="Rechercher dans les notes"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="sidebar-actions">
|
||||||
|
<button className="btn-primary" onClick={onCreateNote}>
|
||||||
|
<Plus size={16} />
|
||||||
|
Nouvelle note
|
||||||
|
</button>
|
||||||
|
<div className="sort-buttons">
|
||||||
|
<button
|
||||||
|
className={`btn-sort ${sortMode === "date" ? "active" : ""}`}
|
||||||
|
onClick={() => onSortChange("date")}
|
||||||
|
title="Trier par date"
|
||||||
|
>
|
||||||
|
<Clock size={14} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={`btn-sort ${sortMode === "alpha" ? "active" : ""}`}
|
||||||
|
onClick={() => onSortChange("alpha")}
|
||||||
|
title="Trier par ordre alphabétique"
|
||||||
|
>
|
||||||
|
<ArrowDownAZ size={14} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="notes-list" role="list" aria-label="Notes">
|
||||||
|
{notes.length === 0 && (
|
||||||
|
<div className="empty-state">
|
||||||
|
{searchQuery ? "Aucun résultat" : "Aucune note"}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{notes.map((note) => (
|
||||||
|
<div
|
||||||
|
key={note.id}
|
||||||
|
className={`note-item ${activeNoteId === note.id ? "active" : ""}`}
|
||||||
|
onClick={() => onSelectNote(note.id)}
|
||||||
|
onMouseEnter={() => setHoveredId(note.id)}
|
||||||
|
onMouseLeave={() => setHoveredId(null)}
|
||||||
|
>
|
||||||
|
<div className="note-item-content">
|
||||||
|
<div className="note-item-title">
|
||||||
|
{note.pinned && <Pin size={12} className="pin-indicator" />}
|
||||||
|
<span>{note.title || "Sans titre"}</span>
|
||||||
|
</div>
|
||||||
|
<div className="note-item-preview">
|
||||||
|
{note.content.slice(0, 60).replace(/[#*_~`>-]/g, "") || "Note vide..."}
|
||||||
|
</div>
|
||||||
|
<div className="note-item-date">{formatDate(note.updatedAt)}</div>
|
||||||
|
</div>
|
||||||
|
{hoveredId === note.id && (
|
||||||
|
<div className="note-item-actions" onClick={(e) => e.stopPropagation()}>
|
||||||
|
<button
|
||||||
|
className={`btn-icon-sm ${note.pinned ? "pinned" : ""}`}
|
||||||
|
onClick={() => onTogglePin(note.id)}
|
||||||
|
title={note.pinned ? "Désépingler" : "Épingler"}
|
||||||
|
>
|
||||||
|
<Pin size={13} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn-icon-sm"
|
||||||
|
onClick={() => onExportNote(note.id)}
|
||||||
|
title="Exporter en .txt"
|
||||||
|
>
|
||||||
|
<FileText size={13} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn-icon-sm btn-danger"
|
||||||
|
onClick={() => onDeleteNote(note.id)}
|
||||||
|
title="Supprimer"
|
||||||
|
>
|
||||||
|
<Trash2 size={13} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{notes.length > 0 && (
|
||||||
|
<div className="sidebar-footer">
|
||||||
|
{!confirmDeleteAll ? (
|
||||||
|
<button
|
||||||
|
className="btn-delete-all"
|
||||||
|
onClick={() => setConfirmDeleteAll(true)}
|
||||||
|
>
|
||||||
|
<Trash size={14} />
|
||||||
|
Tout supprimer
|
||||||
|
</button>
|
||||||
|
) : (
|
||||||
|
<div className="confirm-delete-all">
|
||||||
|
<span>Supprimer toutes les notes ?</span>
|
||||||
|
<button className="btn-confirm-yes" onClick={() => { onDeleteAll(); setConfirmDeleteAll(false); }}>
|
||||||
|
Oui
|
||||||
|
</button>
|
||||||
|
<button className="btn-confirm-no" onClick={() => setConfirmDeleteAll(false)}>
|
||||||
|
Non
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</aside>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { RefObject } from "react";
|
||||||
|
import {
|
||||||
|
Bold,
|
||||||
|
Italic,
|
||||||
|
Strikethrough,
|
||||||
|
Heading,
|
||||||
|
List,
|
||||||
|
ListOrdered,
|
||||||
|
Quote,
|
||||||
|
Code,
|
||||||
|
Link,
|
||||||
|
Minus,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
|
interface ToolbarProps {
|
||||||
|
textareaRef: RefObject<HTMLTextAreaElement | null>;
|
||||||
|
onContentChange: (content: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
type FormatAction = {
|
||||||
|
icon: React.ReactNode;
|
||||||
|
label: string;
|
||||||
|
prefix: string;
|
||||||
|
suffix: string;
|
||||||
|
block?: boolean;
|
||||||
|
defaultText?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const FORMAT_ACTIONS: FormatAction[] = [
|
||||||
|
{ icon: <Bold size={16} />, label: "Gras", prefix: "**", suffix: "**", defaultText: "texte en gras" },
|
||||||
|
{ icon: <Italic size={16} />, label: "Italique", prefix: "*", suffix: "*", defaultText: "texte en italique" },
|
||||||
|
{ icon: <Strikethrough size={16} />, label: "Barré", prefix: "~~", suffix: "~~", defaultText: "texte barré" },
|
||||||
|
{ icon: <Heading size={16} />, label: "Titre", prefix: "## ", suffix: "", block: true, defaultText: "Titre" },
|
||||||
|
{ icon: <List size={16} />, label: "Liste à puces", prefix: "- ", suffix: "", block: true, defaultText: "Élément" },
|
||||||
|
{ icon: <ListOrdered size={16} />, label: "Liste numérotée", prefix: "1. ", suffix: "", block: true, defaultText: "Élément" },
|
||||||
|
{ icon: <Quote size={16} />, label: "Citation", prefix: "> ", suffix: "", block: true, defaultText: "Citation" },
|
||||||
|
{ icon: <Code size={16} />, label: "Bloc de code", prefix: "```\n", suffix: "\n```", defaultText: "code" },
|
||||||
|
{ icon: <Link size={16} />, label: "Lien", prefix: "[", suffix: "](url)", defaultText: "texte du lien" },
|
||||||
|
{ icon: <Minus size={16} />, label: "Ligne horizontale", prefix: "\n---\n", suffix: "", defaultText: "" },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default function Toolbar({ textareaRef, onContentChange }: ToolbarProps) {
|
||||||
|
const applyFormat = (action: FormatAction) => {
|
||||||
|
const textarea = textareaRef.current;
|
||||||
|
if (!textarea) return;
|
||||||
|
|
||||||
|
const start = textarea.selectionStart;
|
||||||
|
const end = textarea.selectionEnd;
|
||||||
|
const text = textarea.value;
|
||||||
|
const selected = text.substring(start, end);
|
||||||
|
const hasSelection = selected.length > 0;
|
||||||
|
|
||||||
|
let insertText: string;
|
||||||
|
let cursorPos: number;
|
||||||
|
|
||||||
|
if (action.defaultText === "" && !hasSelection) {
|
||||||
|
// For horizontal rule, just insert without placeholder
|
||||||
|
insertText = action.prefix;
|
||||||
|
cursorPos = start + action.prefix.length;
|
||||||
|
} else if (hasSelection) {
|
||||||
|
if (action.block) {
|
||||||
|
// For block elements, check if we need a newline before
|
||||||
|
const needsNewline = start > 0 && text[start - 1] !== "\n";
|
||||||
|
const nl = needsNewline ? "\n" : "";
|
||||||
|
insertText = nl + action.prefix + selected + action.suffix;
|
||||||
|
cursorPos = start + nl.length + action.prefix.length + selected.length + action.suffix.length;
|
||||||
|
} else {
|
||||||
|
insertText = action.prefix + selected + action.suffix;
|
||||||
|
cursorPos = start + action.prefix.length + selected.length + action.suffix.length;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const placeholder = action.defaultText || "";
|
||||||
|
if (action.block) {
|
||||||
|
const needsNewline = start > 0 && text[start - 1] !== "\n";
|
||||||
|
const nl = needsNewline ? "\n" : "";
|
||||||
|
insertText = nl + action.prefix + placeholder + action.suffix;
|
||||||
|
cursorPos = start + nl.length + action.prefix.length;
|
||||||
|
} else {
|
||||||
|
insertText = action.prefix + placeholder + action.suffix;
|
||||||
|
cursorPos = start + action.prefix.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newText = text.substring(0, start) + insertText + text.substring(end);
|
||||||
|
onContentChange(newText);
|
||||||
|
|
||||||
|
// Restore focus and cursor position
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
textarea.focus();
|
||||||
|
if (hasSelection || action.defaultText === "") {
|
||||||
|
textarea.setSelectionRange(cursorPos, cursorPos);
|
||||||
|
} else {
|
||||||
|
const selectStart = cursorPos;
|
||||||
|
const selectEnd = cursorPos + (action.defaultText?.length || 0);
|
||||||
|
textarea.setSelectionRange(selectStart, selectEnd);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="toolbar" role="toolbar" aria-label="Barre d'outils de mise en forme Markdown">
|
||||||
|
{FORMAT_ACTIONS.map((action) => (
|
||||||
|
<button
|
||||||
|
key={action.label}
|
||||||
|
className="toolbar-btn"
|
||||||
|
onClick={() => applyFormat(action)}
|
||||||
|
title={action.label}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
{action.icon}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,982 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
|
|
||||||
|
/* ===== CSS Variables / Theme ===== */
|
||||||
|
:root,
|
||||||
|
[data-theme="light"] {
|
||||||
|
--bg-primary: #ffffff;
|
||||||
|
--bg-secondary: #f8f9fa;
|
||||||
|
--bg-tertiary: #f0f1f3;
|
||||||
|
--bg-hover: #e9ecef;
|
||||||
|
--bg-active: #dbeafe;
|
||||||
|
--bg-sidebar: #f8f9fa;
|
||||||
|
--text-primary: #1a1a2e;
|
||||||
|
--text-secondary: #6b7280;
|
||||||
|
--text-tertiary: #9ca3af;
|
||||||
|
--border-color: #e5e7eb;
|
||||||
|
--border-light: #f0f1f3;
|
||||||
|
--accent: #3b82f6;
|
||||||
|
--accent-hover: #2563eb;
|
||||||
|
--accent-light: #dbeafe;
|
||||||
|
--danger: #ef4444;
|
||||||
|
--danger-hover: #dc2626;
|
||||||
|
--danger-light: #fee2e2;
|
||||||
|
--pin-color: #f59e0b;
|
||||||
|
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
|
||||||
|
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
|
||||||
|
--shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
|
||||||
|
--radius: 8px;
|
||||||
|
--radius-sm: 6px;
|
||||||
|
--radius-lg: 12px;
|
||||||
|
--transition: 150ms ease;
|
||||||
|
--font-sans: var(--font-geist-sans), system-ui, -apple-system, sans-serif;
|
||||||
|
--font-mono: var(--font-geist-mono), "Fira Code", "JetBrains Mono", monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="dark"] {
|
||||||
|
--bg-primary: #0f0f17;
|
||||||
|
--bg-secondary: #16161f;
|
||||||
|
--bg-tertiary: #1e1e2a;
|
||||||
|
--bg-hover: #262636;
|
||||||
|
--bg-active: #1e3a5f;
|
||||||
|
--bg-sidebar: #12121a;
|
||||||
|
--text-primary: #e5e7eb;
|
||||||
|
--text-secondary: #9ca3af;
|
||||||
|
--text-tertiary: #6b7280;
|
||||||
|
--border-color: #2a2a3a;
|
||||||
|
--border-light: #1e1e2a;
|
||||||
|
--accent: #60a5fa;
|
||||||
|
--accent-hover: #3b82f6;
|
||||||
|
--accent-light: #1e3a5f;
|
||||||
|
--danger: #f87171;
|
||||||
|
--danger-hover: #ef4444;
|
||||||
|
--danger-light: #3b1111;
|
||||||
|
--pin-color: #fbbf24;
|
||||||
|
--shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
|
||||||
|
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
|
||||||
|
--shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Reset & Base ===== */
|
||||||
|
*, *::before, *::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
background: var(--bg-primary);
|
||||||
|
color: var(--text-primary);
|
||||||
|
transition: background var(--transition), color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Layout ===== */
|
||||||
|
.app-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Loading ===== */
|
||||||
|
.loading-screen {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
background: var(--bg-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-spinner {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: 3px solid var(--border-color);
|
||||||
|
border-top-color: var(--accent);
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: spin 0.8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Sidebar ===== */
|
||||||
|
.sidebar {
|
||||||
|
width: 300px;
|
||||||
|
min-width: 300px;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: var(--bg-sidebar);
|
||||||
|
border-right: 1px solid var(--border-color);
|
||||||
|
transition: all var(--transition);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-collapsed {
|
||||||
|
width: 52px;
|
||||||
|
min-width: 52px;
|
||||||
|
align-items: center;
|
||||||
|
padding-top: 12px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-header {
|
||||||
|
padding: 16px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-title-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary);
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Search ===== */
|
||||||
|
.search-bar {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-icon {
|
||||||
|
position: absolute;
|
||||||
|
left: 10px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px 12px 8px 34px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--bg-primary);
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 13px;
|
||||||
|
outline: none;
|
||||||
|
transition: border var(--transition), box-shadow var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input:focus {
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 3px var(--accent-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input::placeholder {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Sidebar Actions ===== */
|
||||||
|
.sidebar-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 2px;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-sort {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-sort:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-sort.active {
|
||||||
|
background: var(--accent-light);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Buttons ===== */
|
||||||
|
.btn-primary {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 7px 14px;
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background: var(--accent-hover);
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
border: none;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon-sm {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon-sm:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon-sm.pinned {
|
||||||
|
color: var(--pin-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-icon-sm.btn-danger:hover {
|
||||||
|
background: var(--danger-light);
|
||||||
|
color: var(--danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-new-note {
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff !important;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-new-note:hover {
|
||||||
|
background: var(--accent-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Notes List ===== */
|
||||||
|
.notes-list {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-list::-webkit-scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-list::-webkit-scrollbar-thumb {
|
||||||
|
background: var(--border-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 120px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
margin-bottom: 2px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item.active {
|
||||||
|
background: var(--bg-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item-content {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-primary);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pin-indicator {
|
||||||
|
color: var(--pin-color);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item-preview {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item-date {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-item-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
animation: fadeIn 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; transform: translateX(4px); }
|
||||||
|
to { opacity: 1; transform: translateX(0); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Sidebar Footer ===== */
|
||||||
|
.sidebar-footer {
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-top: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-delete-all {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 7px 12px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-delete-all:hover {
|
||||||
|
border-color: var(--danger);
|
||||||
|
color: var(--danger);
|
||||||
|
background: var(--danger-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm-delete-all {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm-yes {
|
||||||
|
padding: 4px 12px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--danger);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm-yes:hover {
|
||||||
|
background: var(--danger-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm-no {
|
||||||
|
padding: 4px 12px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-confirm-no:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Main Content ===== */
|
||||||
|
.main-content {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
background: var(--bg-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-toggle-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 12px;
|
||||||
|
right: 16px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-theme {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: var(--radius);
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-theme:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
border-color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Empty Editor ===== */
|
||||||
|
.empty-editor {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
gap: 12px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-editor h2 {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary);
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-editor p {
|
||||||
|
font-size: 15px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shortcut-hint {
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shortcut-hint kbd {
|
||||||
|
padding: 2px 6px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Editor ===== */
|
||||||
|
.editor-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 20px;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
background: var(--bg-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-title-input {
|
||||||
|
flex: 1;
|
||||||
|
padding: 6px 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
outline: none;
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-title-input::placeholder {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.view-mode-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 2px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
padding: 3px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 28px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-view:hover {
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-view.active {
|
||||||
|
background: var(--bg-primary);
|
||||||
|
color: var(--accent);
|
||||||
|
box-shadow: var(--shadow-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Toolbar ===== */
|
||||||
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 2px;
|
||||||
|
padding: 6px 16px;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbar-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 30px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbar-btn:hover {
|
||||||
|
background: var(--bg-hover);
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.toolbar-btn:active {
|
||||||
|
background: var(--accent-light);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Editor Body ===== */
|
||||||
|
.editor-body {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split .editor-pane,
|
||||||
|
.editor-body.split .preview-pane {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split .editor-pane {
|
||||||
|
border-right: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.edit .editor-pane {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.preview .preview-pane {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-pane {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-textarea {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
padding: 20px 24px;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.7;
|
||||||
|
resize: none;
|
||||||
|
outline: none;
|
||||||
|
overflow-y: auto;
|
||||||
|
tab-size: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-textarea::placeholder {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-textarea::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-textarea::-webkit-scrollbar-thumb {
|
||||||
|
background: var(--border-color);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-pane {
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 20px 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-pane::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-pane::-webkit-scrollbar-thumb {
|
||||||
|
background: var(--border-color);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Markdown Preview (Prose) ===== */
|
||||||
|
.markdown-preview {
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.75;
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview .preview-empty {
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: 800;
|
||||||
|
margin: 1em 0 0.5em;
|
||||||
|
padding-bottom: 0.3em;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview h2 {
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0.8em 0 0.4em;
|
||||||
|
padding-bottom: 0.25em;
|
||||||
|
border-bottom: 1px solid var(--border-light);
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview h3 {
|
||||||
|
font-size: 1.25em;
|
||||||
|
font-weight: 600;
|
||||||
|
margin: 0.7em 0 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview p {
|
||||||
|
margin: 0.6em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview strong {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview del {
|
||||||
|
text-decoration: line-through;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview ul, .markdown-preview ol {
|
||||||
|
margin: 0.5em 0;
|
||||||
|
padding-left: 1.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview li {
|
||||||
|
margin: 0.25em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview code {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.88em;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--bg-tertiary);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview pre {
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 16px 20px;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
background: var(--bg-tertiary);
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview pre code {
|
||||||
|
padding: 0;
|
||||||
|
background: transparent;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview blockquote {
|
||||||
|
margin: 0.8em 0;
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-left: 4px solid var(--accent);
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview blockquote p {
|
||||||
|
margin: 0.2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview hr {
|
||||||
|
margin: 1.5em 0;
|
||||||
|
border: none;
|
||||||
|
border-top: 2px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview a {
|
||||||
|
color: var(--accent);
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
transition: border-color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview a:hover {
|
||||||
|
border-bottom-color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview img {
|
||||||
|
max-width: 100%;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview th, .markdown-preview td {
|
||||||
|
padding: 8px 12px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-preview th {
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Responsive ===== */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.sidebar {
|
||||||
|
width: 260px;
|
||||||
|
min-width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-collapsed {
|
||||||
|
width: 48px;
|
||||||
|
min-width: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split .editor-pane,
|
||||||
|
.editor-body.split .preview-pane {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split .editor-pane {
|
||||||
|
height: 50%;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-body.split .preview-pane {
|
||||||
|
height: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-header {
|
||||||
|
padding: 10px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-title-input {
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-textarea {
|
||||||
|
padding: 14px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-pane {
|
||||||
|
padding: 14px 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.sidebar {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 100;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
box-shadow: var(--shadow-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-collapsed {
|
||||||
|
width: 48px;
|
||||||
|
min-width: 48px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Accessibility ===== */
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
white-space: nowrap;
|
||||||
|
border-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Focus visible for keyboard navigation */
|
||||||
|
*:focus-visible {
|
||||||
|
outline: 2px solid var(--accent);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Skip to content for a11y */
|
||||||
|
.skip-to-content {
|
||||||
|
position: absolute;
|
||||||
|
top: -100%;
|
||||||
|
left: 16px;
|
||||||
|
z-index: 9999;
|
||||||
|
padding: 8px 16px;
|
||||||
|
background: var(--accent);
|
||||||
|
color: #fff;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: top 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip-to-content:focus {
|
||||||
|
top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reduced motion preference */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*, *::before, *::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Print styles */
|
||||||
|
@media print {
|
||||||
|
.sidebar, .toolbar, .theme-toggle-wrapper, .view-mode-buttons {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.main-content {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.editor-body {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.preview-pane {
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState, useEffect, useCallback, useRef } from "react";
|
||||||
|
import { Note, SortMode } from "../types";
|
||||||
|
|
||||||
|
const STORAGE_KEY = "blocnote-notes";
|
||||||
|
const AUTOSAVE_INTERVAL = 2000;
|
||||||
|
|
||||||
|
function generateId(): string {
|
||||||
|
return Date.now().toString(36) + Math.random().toString(36).slice(2, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadNotes(): Note[] {
|
||||||
|
if (typeof window === "undefined") return [];
|
||||||
|
try {
|
||||||
|
const raw = localStorage.getItem(STORAGE_KEY);
|
||||||
|
return raw ? JSON.parse(raw) : [];
|
||||||
|
} catch {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveNotes(notes: Note[]) {
|
||||||
|
if (typeof window === "undefined") return;
|
||||||
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(notes));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useNotes() {
|
||||||
|
const [notes, setNotes] = useState<Note[]>([]);
|
||||||
|
const [activeNoteId, setActiveNoteId] = useState<string | null>(null);
|
||||||
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
|
const [sortMode, setSortMode] = useState<SortMode>("date");
|
||||||
|
const [loaded, setLoaded] = useState(false);
|
||||||
|
const notesRef = useRef(notes);
|
||||||
|
|
||||||
|
// Keep ref in sync
|
||||||
|
useEffect(() => {
|
||||||
|
notesRef.current = notes;
|
||||||
|
}, [notes]);
|
||||||
|
|
||||||
|
// Load from localStorage on mount
|
||||||
|
useEffect(() => {
|
||||||
|
const loaded = loadNotes();
|
||||||
|
// This hydration step must run after mount to avoid server/client mismatches.
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||||
|
setNotes(loaded);
|
||||||
|
if (loaded.length > 0) {
|
||||||
|
setActiveNoteId(loaded[0].id);
|
||||||
|
}
|
||||||
|
setLoaded(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Autosave every 2 seconds
|
||||||
|
useEffect(() => {
|
||||||
|
if (!loaded) return;
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
saveNotes(notesRef.current);
|
||||||
|
}, AUTOSAVE_INTERVAL);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, [loaded]);
|
||||||
|
|
||||||
|
// Also save on notes change (debounced via ref + interval above)
|
||||||
|
useEffect(() => {
|
||||||
|
if (loaded) {
|
||||||
|
saveNotes(notes);
|
||||||
|
}
|
||||||
|
}, [notes, loaded]);
|
||||||
|
|
||||||
|
const createNote = useCallback(() => {
|
||||||
|
const now = Date.now();
|
||||||
|
const newNote: Note = {
|
||||||
|
id: generateId(),
|
||||||
|
title: "Nouvelle note",
|
||||||
|
content: "",
|
||||||
|
createdAt: now,
|
||||||
|
updatedAt: now,
|
||||||
|
pinned: false,
|
||||||
|
};
|
||||||
|
setNotes((prev) => [newNote, ...prev]);
|
||||||
|
setActiveNoteId(newNote.id);
|
||||||
|
return newNote;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const updateNote = useCallback((id: string, updates: Partial<Note>) => {
|
||||||
|
setNotes((prev) =>
|
||||||
|
prev.map((note) =>
|
||||||
|
note.id === id
|
||||||
|
? { ...note, ...updates, updatedAt: Date.now() }
|
||||||
|
: note
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const deleteNote = useCallback(
|
||||||
|
(id: string) => {
|
||||||
|
setNotes((prev) => {
|
||||||
|
const filtered = prev.filter((n) => n.id !== id);
|
||||||
|
if (activeNoteId === id) {
|
||||||
|
setActiveNoteId(filtered.length > 0 ? filtered[0].id : null);
|
||||||
|
}
|
||||||
|
return filtered;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
[activeNoteId]
|
||||||
|
);
|
||||||
|
|
||||||
|
const deleteAllNotes = useCallback(() => {
|
||||||
|
setNotes([]);
|
||||||
|
setActiveNoteId(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const togglePin = useCallback((id: string) => {
|
||||||
|
setNotes((prev) =>
|
||||||
|
prev.map((note) =>
|
||||||
|
note.id === id ? { ...note, pinned: !note.pinned, updatedAt: Date.now() } : note
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const exportNote = useCallback(
|
||||||
|
(id: string) => {
|
||||||
|
const note = notes.find((n) => n.id === id);
|
||||||
|
if (!note) return;
|
||||||
|
const blob = new Blob([note.content], { type: "text/plain;charset=utf-8" });
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement("a");
|
||||||
|
a.href = url;
|
||||||
|
a.download = `${note.title.replace(/[^a-zA-Z0-9À-ÿ\s-_]/g, "")}.txt`;
|
||||||
|
a.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
},
|
||||||
|
[notes]
|
||||||
|
);
|
||||||
|
|
||||||
|
const activeNote = notes.find((n) => n.id === activeNoteId) ?? null;
|
||||||
|
|
||||||
|
// Filter & sort
|
||||||
|
const filteredNotes = notes
|
||||||
|
.filter((note) => {
|
||||||
|
if (!searchQuery) return true;
|
||||||
|
const q = searchQuery.toLowerCase();
|
||||||
|
return (
|
||||||
|
note.title.toLowerCase().includes(q) ||
|
||||||
|
note.content.toLowerCase().includes(q)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
// Pinned first
|
||||||
|
if (a.pinned && !b.pinned) return -1;
|
||||||
|
if (!a.pinned && b.pinned) return 1;
|
||||||
|
// Then sort
|
||||||
|
if (sortMode === "date") return b.updatedAt - a.updatedAt;
|
||||||
|
return a.title.localeCompare(b.title, "fr");
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
notes: filteredNotes,
|
||||||
|
activeNote,
|
||||||
|
activeNoteId,
|
||||||
|
searchQuery,
|
||||||
|
sortMode,
|
||||||
|
loaded,
|
||||||
|
setActiveNoteId,
|
||||||
|
setSearchQuery,
|
||||||
|
setSortMode,
|
||||||
|
createNote,
|
||||||
|
updateNote,
|
||||||
|
deleteNote,
|
||||||
|
deleteAllNotes,
|
||||||
|
togglePin,
|
||||||
|
exportNote,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
import { Theme } from "../types";
|
||||||
|
|
||||||
|
export function useTheme() {
|
||||||
|
const [theme, setTheme] = useState<Theme>("light");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const saved = localStorage.getItem("blocnote-theme") as Theme | null;
|
||||||
|
if (saved) {
|
||||||
|
// Reading persisted theme must happen on client after mount.
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||||
|
setTheme(saved);
|
||||||
|
} else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||||
|
setTheme("dark");
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.documentElement.setAttribute("data-theme", theme);
|
||||||
|
localStorage.setItem("blocnote-theme", theme);
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
|
const toggleTheme = () => setTheme((t) => (t === "light" ? "dark" : "light"));
|
||||||
|
|
||||||
|
return { theme, toggleTheme };
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
import type { Metadata, Viewport } from "next";
|
||||||
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
|
import "./globals.css";
|
||||||
|
|
||||||
|
const geistSans = Geist({
|
||||||
|
variable: "--font-geist-sans",
|
||||||
|
subsets: ["latin"],
|
||||||
|
display: "swap",
|
||||||
|
});
|
||||||
|
|
||||||
|
const geistMono = Geist_Mono({
|
||||||
|
variable: "--font-geist-mono",
|
||||||
|
subsets: ["latin"],
|
||||||
|
display: "swap",
|
||||||
|
});
|
||||||
|
|
||||||
|
const APP_URL = process.env.NEXT_PUBLIC_SITE_URL || "https://blocnote.arthurp.fr";
|
||||||
|
|
||||||
|
export const viewport: Viewport = {
|
||||||
|
width: "device-width",
|
||||||
|
initialScale: 1,
|
||||||
|
maximumScale: 5,
|
||||||
|
themeColor: [
|
||||||
|
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
|
||||||
|
{ media: "(prefers-color-scheme: dark)", color: "#0f0f17" },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
metadataBase: new URL(APP_URL),
|
||||||
|
title: {
|
||||||
|
default: "BlocNote — Bloc-notes Markdown en ligne gratuit",
|
||||||
|
template: "%s | BlocNote",
|
||||||
|
},
|
||||||
|
description:
|
||||||
|
"BlocNote est un bloc-notes en ligne moderne et gratuit avec support Markdown complet, sauvegarde automatique, mode sombre, export, et raccourcis clavier. Aucune inscription requise.",
|
||||||
|
keywords: [
|
||||||
|
"bloc-notes en ligne",
|
||||||
|
"notes markdown",
|
||||||
|
"éditeur markdown gratuit",
|
||||||
|
"bloc-note en ligne",
|
||||||
|
"prise de notes",
|
||||||
|
"notepad en ligne",
|
||||||
|
"éditeur de texte en ligne",
|
||||||
|
"markdown preview",
|
||||||
|
"sauvegarde automatique notes",
|
||||||
|
"mode sombre notes",
|
||||||
|
"notes sans inscription",
|
||||||
|
"blocnote",
|
||||||
|
],
|
||||||
|
authors: [{ name: "BlocNote" }],
|
||||||
|
creator: "BlocNote",
|
||||||
|
publisher: "BlocNote",
|
||||||
|
robots: {
|
||||||
|
index: true,
|
||||||
|
follow: true,
|
||||||
|
googleBot: {
|
||||||
|
index: true,
|
||||||
|
follow: true,
|
||||||
|
"max-video-preview": -1,
|
||||||
|
"max-image-preview": "large",
|
||||||
|
"max-snippet": -1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
alternates: {
|
||||||
|
canonical: APP_URL,
|
||||||
|
languages: {
|
||||||
|
"fr-FR": APP_URL,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
type: "website",
|
||||||
|
locale: "fr_FR",
|
||||||
|
url: APP_URL,
|
||||||
|
siteName: "BlocNote",
|
||||||
|
title: "BlocNote — Bloc-notes Markdown en ligne gratuit",
|
||||||
|
description:
|
||||||
|
"Prenez des notes en Markdown avec aperçu en temps réel, sauvegarde automatique et mode sombre. Gratuit, sans inscription.",
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: "/og-image.png",
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: "BlocNote — Éditeur de notes Markdown en ligne",
|
||||||
|
type: "image/png",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: "summary_large_image",
|
||||||
|
title: "BlocNote — Bloc-notes Markdown en ligne gratuit",
|
||||||
|
description:
|
||||||
|
"Prenez des notes en Markdown avec aperçu en temps réel, sauvegarde automatique et mode sombre. Gratuit, sans inscription.",
|
||||||
|
images: ["/og-image.png"],
|
||||||
|
},
|
||||||
|
icons: {
|
||||||
|
icon: [
|
||||||
|
{ url: "/favicon.ico", sizes: "any" },
|
||||||
|
{ url: "/icon-192.png", sizes: "192x192", type: "image/png" },
|
||||||
|
{ url: "/icon-512.png", sizes: "512x512", type: "image/png" },
|
||||||
|
],
|
||||||
|
apple: [
|
||||||
|
{ url: "/apple-touch-icon.png", sizes: "180x180", type: "image/png" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
manifest: "/manifest.json",
|
||||||
|
category: "productivity",
|
||||||
|
};
|
||||||
|
|
||||||
|
const jsonLd = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebApplication",
|
||||||
|
name: "BlocNote",
|
||||||
|
url: APP_URL,
|
||||||
|
description:
|
||||||
|
"Bloc-notes en ligne moderne et gratuit avec support Markdown, sauvegarde automatique, mode sombre et export.",
|
||||||
|
applicationCategory: "ProductivityApplication",
|
||||||
|
operatingSystem: "All",
|
||||||
|
browserRequirements: "Requires a modern web browser",
|
||||||
|
offers: {
|
||||||
|
"@type": "Offer",
|
||||||
|
price: "0",
|
||||||
|
priceCurrency: "EUR",
|
||||||
|
},
|
||||||
|
featureList: [
|
||||||
|
"Éditeur Markdown avec aperçu en temps réel",
|
||||||
|
"Sauvegarde automatique",
|
||||||
|
"Mode sombre et clair",
|
||||||
|
"Export en fichier texte",
|
||||||
|
"Raccourcis clavier",
|
||||||
|
"Notes épinglables",
|
||||||
|
"Recherche instantanée",
|
||||||
|
],
|
||||||
|
inLanguage: "fr",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RootLayout({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) {
|
||||||
|
return (
|
||||||
|
<html lang="fr" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<script
|
||||||
|
type="application/ld+json"
|
||||||
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||||
|
/>
|
||||||
|
</head>
|
||||||
|
<body
|
||||||
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||||
|
>
|
||||||
|
<a href="#main-content" className="skip-to-content">Aller au contenu principal</a>
|
||||||
|
{children}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { useNotes } from "./hooks/useNotes";
|
||||||
|
import { useTheme } from "./hooks/useTheme";
|
||||||
|
import Sidebar from "./components/Sidebar";
|
||||||
|
import Editor from "./components/Editor";
|
||||||
|
import { Sun, Moon, FileText } from "lucide-react";
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
const {
|
||||||
|
notes,
|
||||||
|
activeNote,
|
||||||
|
activeNoteId,
|
||||||
|
searchQuery,
|
||||||
|
sortMode,
|
||||||
|
loaded,
|
||||||
|
setActiveNoteId,
|
||||||
|
setSearchQuery,
|
||||||
|
setSortMode,
|
||||||
|
createNote,
|
||||||
|
updateNote,
|
||||||
|
deleteNote,
|
||||||
|
deleteAllNotes,
|
||||||
|
togglePin,
|
||||||
|
exportNote,
|
||||||
|
} = useNotes();
|
||||||
|
|
||||||
|
const { theme, toggleTheme } = useTheme();
|
||||||
|
|
||||||
|
// Ctrl+N shortcut
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = (e: KeyboardEvent) => {
|
||||||
|
if ((e.ctrlKey || e.metaKey) && e.key === "n") {
|
||||||
|
e.preventDefault();
|
||||||
|
createNote();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("keydown", handler);
|
||||||
|
return () => window.removeEventListener("keydown", handler);
|
||||||
|
}, [createNote]);
|
||||||
|
|
||||||
|
if (!loaded) {
|
||||||
|
return (
|
||||||
|
<div className="loading-screen" role="status" aria-label="Chargement de l'application">
|
||||||
|
<div className="loading-spinner" aria-hidden="true" />
|
||||||
|
<span className="sr-only">Chargement en cours...</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="app-container">
|
||||||
|
<Sidebar
|
||||||
|
notes={notes}
|
||||||
|
activeNoteId={activeNoteId}
|
||||||
|
searchQuery={searchQuery}
|
||||||
|
sortMode={sortMode}
|
||||||
|
onSelectNote={setActiveNoteId}
|
||||||
|
onCreateNote={createNote}
|
||||||
|
onDeleteNote={deleteNote}
|
||||||
|
onTogglePin={togglePin}
|
||||||
|
onSearchChange={setSearchQuery}
|
||||||
|
onSortChange={setSortMode}
|
||||||
|
onDeleteAll={deleteAllNotes}
|
||||||
|
onExportNote={exportNote}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<main id="main-content" className="main-content" role="main" aria-label="Éditeur de notes">
|
||||||
|
<div className="theme-toggle-wrapper">
|
||||||
|
<button
|
||||||
|
className="btn-theme"
|
||||||
|
onClick={toggleTheme}
|
||||||
|
title="Changer de thème"
|
||||||
|
aria-label={theme === "light" ? "Passer au mode sombre" : "Passer au mode clair"}
|
||||||
|
>
|
||||||
|
{theme === "light" ? <Moon size={18} aria-hidden="true" /> : <Sun size={18} aria-hidden="true" />}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{activeNote ? (
|
||||||
|
<Editor key={activeNote.id} note={activeNote} onUpdateNote={updateNote} />
|
||||||
|
) : (
|
||||||
|
<div className="empty-editor">
|
||||||
|
<FileText size={64} strokeWidth={1} />
|
||||||
|
<h2>BlocNote</h2>
|
||||||
|
<p>Sélectionnez une note ou créez-en une nouvelle</p>
|
||||||
|
<button className="btn-primary" onClick={createNote}>
|
||||||
|
Nouvelle note
|
||||||
|
</button>
|
||||||
|
<span className="shortcut-hint">
|
||||||
|
ou <kbd>Ctrl</kbd> + <kbd>N</kbd>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export default function robots(): MetadataRoute.Robots {
|
||||||
|
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://blocnote.arthurp.fr";
|
||||||
|
return {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
userAgent: "*",
|
||||||
|
allow: "/",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sitemap: `${siteUrl}/sitemap.xml`,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export default function sitemap(): MetadataRoute.Sitemap {
|
||||||
|
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://blocnote.arthurp.fr";
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
url: siteUrl,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: "weekly",
|
||||||
|
priority: 1.0,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
export interface Note {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
createdAt: number;
|
||||||
|
updatedAt: number;
|
||||||
|
pinned: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SortMode = 'date' | 'alpha';
|
||||||
|
export type Theme = 'light' | 'dark';
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
services:
|
||||||
|
blocnote:
|
||||||
|
image: node:22-alpine
|
||||||
|
container_name: blocnote
|
||||||
|
working_dir: /app
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
- node_modules:/app/node_modules
|
||||||
|
- nextjs_cache:/app/.next
|
||||||
|
ports:
|
||||||
|
- "3016:3000"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- NEXT_TELEMETRY_DISABLED=1
|
||||||
|
- HOSTNAME=0.0.0.0
|
||||||
|
command: sh -c "npm ci --include=dev && npm run build && npm start"
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 60s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
node_modules:
|
||||||
|
nextjs_cache:
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { defineConfig, globalIgnores } from "eslint/config";
|
||||||
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||||
|
import nextTs from "eslint-config-next/typescript";
|
||||||
|
|
||||||
|
const eslintConfig = defineConfig([
|
||||||
|
...nextVitals,
|
||||||
|
...nextTs,
|
||||||
|
// Override default ignores of eslint-config-next.
|
||||||
|
globalIgnores([
|
||||||
|
// Default ignores of eslint-config-next:
|
||||||
|
".next/**",
|
||||||
|
"out/**",
|
||||||
|
"build/**",
|
||||||
|
"next-env.d.ts",
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
|
const nextConfig: NextConfig = {
|
||||||
|
compress: true,
|
||||||
|
poweredByHeader: false,
|
||||||
|
async headers() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: "/(.*)",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "X-Content-Type-Options",
|
||||||
|
value: "nosniff",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "X-Frame-Options",
|
||||||
|
value: "DENY",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "X-XSS-Protection",
|
||||||
|
value: "1; mode=block",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Referrer-Policy",
|
||||||
|
value: "strict-origin-when-cross-origin",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Permissions-Policy",
|
||||||
|
value: "camera=(), microphone=(), geolocation=()",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/(.*)\\.(ico|png|svg|jpg|jpeg|gif|webp)",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "Cache-Control",
|
||||||
|
value: "public, max-age=31536000, immutable",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default nextConfig;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "blocnote",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "eslint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"lucide-react": "^0.577.0",
|
||||||
|
"marked": "^17.0.4",
|
||||||
|
"next": "16.1.6",
|
||||||
|
"react": "19.2.3",
|
||||||
|
"react-dom": "19.2.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/postcss": "^4",
|
||||||
|
"@types/node": "^20",
|
||||||
|
"@types/react": "^19",
|
||||||
|
"@types/react-dom": "^19",
|
||||||
|
"eslint": "^9",
|
||||||
|
"eslint-config-next": "16.1.6",
|
||||||
|
"tailwindcss": "^4",
|
||||||
|
"typescript": "^5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
const config = {
|
||||||
|
plugins: {
|
||||||
|
"@tailwindcss/postcss": {},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,24 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<stop offset="0%" style="stop-color:#3b82f6"/>
|
||||||
|
<stop offset="100%" style="stop-color:#2563eb"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="512" height="512" rx="96" fill="url(#bg)"/>
|
||||||
|
<g transform="translate(256,256)">
|
||||||
|
<!-- Page -->
|
||||||
|
<rect x="-100" y="-140" width="200" height="260" rx="16" fill="white" opacity="0.95"/>
|
||||||
|
<!-- Lines -->
|
||||||
|
<rect x="-68" y="-96" width="136" height="8" rx="4" fill="#3b82f6" opacity="0.3"/>
|
||||||
|
<rect x="-68" y="-72" width="100" height="8" rx="4" fill="#3b82f6" opacity="0.25"/>
|
||||||
|
<rect x="-68" y="-48" width="120" height="8" rx="4" fill="#3b82f6" opacity="0.2"/>
|
||||||
|
<rect x="-68" y="-24" width="80" height="8" rx="4" fill="#3b82f6" opacity="0.15"/>
|
||||||
|
<!-- Pen -->
|
||||||
|
<g transform="translate(60,60) rotate(-45)">
|
||||||
|
<rect x="-8" y="-80" width="16" height="100" rx="3" fill="#1e40af"/>
|
||||||
|
<polygon points="-8,20 8,20 0,36" fill="#1e40af"/>
|
||||||
|
<rect x="-8" y="-80" width="16" height="14" rx="3" fill="#fbbf24"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "BlocNote — Bloc-notes Markdown en ligne",
|
||||||
|
"short_name": "BlocNote",
|
||||||
|
"description": "Bloc-notes en ligne moderne avec support Markdown, sauvegarde automatique et mode sombre.",
|
||||||
|
"start_url": "/",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "any",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"theme_color": "#3b82f6",
|
||||||
|
"lang": "fr",
|
||||||
|
"categories": ["productivity", "utilities"],
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/icon-192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/icon-512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "any maskable"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 73 KiB |
@@ -0,0 +1,28 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<stop offset="0%" style="stop-color:#1e3a5f"/>
|
||||||
|
<stop offset="50%" style="stop-color:#1a1a2e"/>
|
||||||
|
<stop offset="100%" style="stop-color:#0f0f17"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="1200" height="630" fill="url(#bg)"/>
|
||||||
|
<!-- Icon -->
|
||||||
|
<g transform="translate(300,200)">
|
||||||
|
<rect x="0" y="0" width="100" height="130" rx="12" fill="white" opacity="0.9"/>
|
||||||
|
<rect x="16" y="22" width="68" height="5" rx="2.5" fill="#3b82f6" opacity="0.4"/>
|
||||||
|
<rect x="16" y="35" width="50" height="5" rx="2.5" fill="#3b82f6" opacity="0.3"/>
|
||||||
|
<rect x="16" y="48" width="60" height="5" rx="2.5" fill="#3b82f6" opacity="0.25"/>
|
||||||
|
<rect x="16" y="61" width="40" height="5" rx="2.5" fill="#3b82f6" opacity="0.2"/>
|
||||||
|
</g>
|
||||||
|
<!-- Title -->
|
||||||
|
<text x="430" y="255" font-family="system-ui, -apple-system, sans-serif" font-size="64" font-weight="800" fill="white" letter-spacing="-1">BlocNote</text>
|
||||||
|
<!-- Subtitle -->
|
||||||
|
<text x="430" y="305" font-family="system-ui, -apple-system, sans-serif" font-size="22" fill="#9ca3af">Bloc-notes Markdown en ligne • Gratuit</text>
|
||||||
|
<!-- Features -->
|
||||||
|
<text x="300" y="440" font-family="system-ui, -apple-system, sans-serif" font-size="18" fill="#60a5fa">✦ Markdown</text>
|
||||||
|
<text x="500" y="440" font-family="system-ui, -apple-system, sans-serif" font-size="18" fill="#60a5fa">✦ Sauvegarde auto</text>
|
||||||
|
<text x="740" y="440" font-family="system-ui, -apple-system, sans-serif" font-size="18" fill="#60a5fa">✦ Mode sombre</text>
|
||||||
|
<!-- Border accent -->
|
||||||
|
<rect x="0" y="620" width="1200" height="10" fill="#3b82f6"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2017",
|
||||||
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"incremental": true,
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"name": "next"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"next-env.d.ts",
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
".next/types/**/*.ts",
|
||||||
|
".next/dev/types/**/*.ts",
|
||||||
|
"**/*.mts"
|
||||||
|
],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||