Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@tauri-apps/plugin-updater": "^2.10.0",
"@tiptap/core": "^3.19.0",
"@tiptap/extension-code-block-lowlight": "^3.20.0",
"@tiptap/extension-highlight": "^3.20.0",
"@tiptap/extension-image": "^3.18.0",
"@tiptap/extension-link": "^3.18.0",
"@tiptap/extension-mathematics": "^3.18.0",
Expand Down
15 changes: 12 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
--color-border: rgba(28, 25, 23, 0.08);
--color-accent: #1c1917;
--color-selection: rgba(250, 204, 21, 0.4); /* Tailwind yellow-400 */
--color-text-selection: rgba(96, 165, 250, 0.35); /* Tailwind blue-400 */

/* Editor font settings - simplified (overridden by ThemeContext) */
--editor-font-family:
Expand Down Expand Up @@ -61,6 +62,7 @@
--color-border: rgba(250, 249, 249, 0.07);
--color-accent: #fafaf9;
--color-selection: rgba(253, 224, 71, 0.35); /* Tailwind yellow-300 */
--color-text-selection: rgba(147, 197, 253, 0.3); /* Tailwind blue-300 */

/* Syntax highlighting colors - Dark (GitHub) */
--color-syntax-keyword: #ea4a5a;
Expand Down Expand Up @@ -145,13 +147,13 @@ body {
-moz-osx-font-smoothing: grayscale;
}

/* Text and image selection highlight */
/* Text and image selection highlight - always blue, distinct from yellow highlight marks */
::selection {
background-color: var(--color-selection);
background-color: var(--color-text-selection);
}

::-moz-selection {
background-color: var(--color-selection);
background-color: var(--color-text-selection);
}

/* Hide scrollbar while allowing scroll */
Expand Down Expand Up @@ -394,6 +396,13 @@ html.dark {
color: var(--color-text);
}

/* Highlighted text - yellow background, theme-aware text color */
.prose mark {
background-color: rgba(250, 204, 21, 0.4);
color: inherit;
border-radius: 0.15em;
}

/* Code blocks and inline code */
.prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
color: var(--color-code);
Expand Down
10 changes: 10 additions & 0 deletions src/components/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Image from "@tiptap/extension-image";
import TaskList from "@tiptap/extension-task-list";
import TaskItem from "@tiptap/extension-task-item";
import { TableKit } from "@tiptap/extension-table";
import Highlight from "@tiptap/extension-highlight";
import { Markdown } from "@tiptap/markdown";
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
import { lowlight } from "./lowlight";
Expand Down Expand Up @@ -79,6 +80,7 @@ import {
BoldIcon,
ItalicIcon,
StrikethroughIcon,
HighlighterIcon,
Heading1Icon,
Heading2Icon,
Heading3Icon,
Expand Down Expand Up @@ -283,6 +285,13 @@ function FormatBar({
>
<StrikethroughIcon className="w-4.5 h-4.5 stroke-[1.5]" />
</ToolbarButton>
<ToolbarButton
onClick={() => editor.chain().focus().toggleHighlight().run()}
isActive={editor.isActive("highlight")}
title={`Highlight (${mod}${isMac ? "" : "+"}${shift}${isMac ? "" : "+"}H)`}
>
<HighlighterIcon className="w-4.5 h-4.5 stroke-[1.5]" />
</ToolbarButton>

<div className="w-px h-4.5 border-l border-border mx-2" />

Expand Down Expand Up @@ -1098,6 +1107,7 @@ export function Editor({
inline: false,
allowBase64: false,
}),
Highlight,
TaskList,
TaskItem.configure({
nested: true,
Expand Down
20 changes: 20 additions & 0 deletions src/components/icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,26 @@ export function LinkOffIcon({ className = "w-4.5 h-4.5" }: IconProps) {
);
}

export function HighlighterIcon({ className = "w-4.5 h-4.5" }: IconProps) {
return (
<svg
className={className}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M9 11l6 6l-3.5 3.5a2.121 2.121 0 0 1 -3 -3l.5 -.5" />
<path d="M11 6l6.5 6.5" />
<path d="M4 20h4.5" />
<path d="M13.5 6.5l3.5 -3.5l4 4l-3.5 3.5" />
</svg>
);
}

export function ImageIcon({ className = "w-4.5 h-4.5" }: IconProps) {
return (
<svg
Expand Down
1 change: 1 addition & 0 deletions src/lib/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const shortcutCategories: ShortcutCategory[] = [
{ keys: ["**bold**"], description: "Bold text" },
{ keys: ["*italic*"], description: "Italic text" },
{ keys: ["~~text~~"], description: "Strikethrough" },
{ keys: ["==text=="], description: "Highlight" },
{ keys: ["-"], description: "Bullet list" },
{ keys: ["1."], description: "Numbered list" },
{ keys: ["- [ ]"], description: "Task list" },
Expand Down