|
1 | | -<details id="markdownDropdown" class="ml-3 group relative z-10 inline-block" data-heap-id="markdown-dropdown"> |
2 | | - <summary |
3 | | - class="dropdown-base hover:bg-gray-50 dark:hover:bg-gray-900 inline-flex cursor-pointer items-center gap-0 py-1 pl-2 text-sm font-semibold transition-colors" |
4 | | - data-heap-id="markdown-dropdown-toggle" |
| 1 | +<div class="ml-3 relative inline-block" x-data="{ open: false }" @click.outside="open = false"> |
| 2 | + <div class="flex shadow rounded-sm overflow-hidden border border-gray-200 dark:border-gray-700"> |
| 3 | + <!-- Primary copy button --> |
| 4 | + <button |
| 5 | + onclick="copyMarkdown()" |
| 6 | + data-heap-id="copy-markdown-button" |
| 7 | + class="bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors whitespace-nowrap text-gray-900 dark:text-white" |
5 | 8 | > |
6 | | - <span class="font-normal">Page options</span> |
7 | | - <span class="icon-svg transition-transform group-open:rotate-180"> |
8 | | - {{ partialCached "icon" "arrow_drop_down" "arrow_drop_down" }} |
| 9 | + <span class="icon-svg icon-sm"> |
| 10 | + {{ partial "icon" "content_copy" }} |
9 | 11 | </span> |
10 | | - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /> |
11 | | - </svg> |
12 | | - </summary> |
| 12 | + <span class="icon-svg icon-sm hidden"> |
| 13 | + {{ partial "icon" "check_circle" }} |
| 14 | + </span> |
| 15 | + <span>Copy as Markdown</span> |
| 16 | + </button> |
13 | 17 |
|
14 | | - <!-- Dropdown menu --> |
15 | | - <div |
16 | | - class="dropdown-base absolute right-0 z-50 mt-1 w-65 origin-top-right p-2 text-sm shadow-md [display:none] group-open:[display:block]" |
17 | | - data-heap-id="markdown-dropdown-menu" |
| 18 | + <!-- Dropdown toggle --> |
| 19 | + <button |
| 20 | + @click="open = !open" |
| 21 | + type="button" |
| 22 | + data-heap-id="markdown-dropdown-toggle" |
| 23 | + class="bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-center px-2 border-l border-gray-200 dark:border-gray-700 transition-colors text-gray-900 dark:text-white" |
| 24 | + aria-label="More options" |
18 | 25 | > |
19 | | - <button |
20 | | - onclick="copyMarkdown()" |
21 | | - data-heap-id="copy-markdown-button" |
22 | | - class="sub-button" |
23 | | - > |
24 | | - <span class="icon-svg mt-[2px] text-base leading-none"> |
25 | | - {{ partial "icon" "content_copy" }} |
26 | | - </span> |
27 | | - <span class="icon-svg hidden mt-[2px] text-base leading-none"> |
28 | | - {{ partial "icon" "check_circle" }} |
29 | | - </span> |
30 | | - <div class="leading-tight"> |
31 | | - <div class="text-base">Copy page as Markdown for LLMs</div> |
32 | | - </div> |
33 | | - </button> |
34 | | - |
35 | | - <button |
36 | | - onclick="viewPlainText()" |
37 | | - data-heap-id="view-markdown-button" |
38 | | - class="sub-button" |
39 | | - > |
40 | | - <span class="icon-svg mt-[2px] text-base leading-none"> |
41 | | - {{ partial "icon" "description" }} |
42 | | - </span> |
43 | | - <div class="leading-tight"> |
44 | | - <div class="text-base">View page as plain text</div> |
45 | | - </div> |
46 | | - </button> |
| 26 | + <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 27 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path> |
| 28 | + </svg> |
| 29 | + </button> |
| 30 | + </div> |
47 | 31 |
|
48 | | - <button |
49 | | - onclick="openInDocsAI()" |
50 | | - data-heap-id="search-docs-ai-button" |
51 | | - class="sub-button" |
52 | | - > |
53 | | - <span class="icon-svg mt-[2px] text-base leading-none"> |
54 | | - {{ partial "icon" "search" }} |
55 | | - </span> |
56 | | - <div class="leading-tight"> |
57 | | - <div class="text-base">Ask questions with Docs AI</div> |
58 | | - </div> |
59 | | - </button> |
60 | | - {{ if eq hugo.Environment "production" }} |
61 | | - <button |
62 | | - onclick="openInClaude()" |
63 | | - data-heap-id="search-docs-ai-button" |
64 | | - class="sub-button" |
65 | | - > |
66 | | - <span class="icon-svg mt-[2px] text-base leading-none"> |
67 | | - {{ partial "icon" "/icons/claude.svg" }} |
68 | | - </span> |
69 | | - <div class="leading-tight"> |
70 | | - <div class="text-base">Open in Claude</div> |
71 | | - </div> |
72 | | - </button> |
73 | | - {{ end }} |
| 32 | + <!-- Dropdown menu --> |
| 33 | + <div |
| 34 | + x-show="open" |
| 35 | + x-collapse |
| 36 | + x-cloak |
| 37 | + class="absolute right-0 top-full mt-1 min-w-full bg-white dark:bg-gray-800 rounded-sm shadow-lg overflow-hidden z-50 border border-gray-200 dark:border-gray-700" |
| 38 | + data-heap-id="markdown-dropdown-menu" |
| 39 | + > |
| 40 | + <button |
| 41 | + onclick="viewPlainText()" |
| 42 | + data-heap-id="view-markdown-button" |
| 43 | + class="flex w-full items-center gap-2 px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap" |
| 44 | + > |
| 45 | + <span class="icon-svg icon-sm"> |
| 46 | + {{ partialCached "icon" "open_in_new" "open_in_new" }} |
| 47 | + </span> |
| 48 | + <span>Open Markdown</span> |
| 49 | + </button> |
74 | 50 |
|
75 | | - </div> |
76 | | - </details> |
| 51 | + <button |
| 52 | + onclick="openInDocsAI()" |
| 53 | + data-heap-id="search-docs-ai-button" |
| 54 | + class="flex w-full items-center gap-2 px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap" |
| 55 | + > |
| 56 | + <span class="icon-svg icon-sm"> |
| 57 | + {{ partialCached "icon" "search" "search" }} |
| 58 | + </span> |
| 59 | + <span>Ask Docs AI</span> |
| 60 | + </button> |
| 61 | + <button |
| 62 | + onclick="openInClaude()" |
| 63 | + data-heap-id="open-claude-button" |
| 64 | + class="flex w-full items-center gap-2 px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap" |
| 65 | + > |
| 66 | + <span class="icon-svg icon-sm"> |
| 67 | + {{ partialCached "icon" "/icons/claude.svg" "claude" }} |
| 68 | + </span> |
| 69 | + <span>Open in Claude</span> |
| 70 | + </button> |
| 71 | + </div> |
| 72 | +</div> |
77 | 73 |
|
78 | 74 | <script> |
79 | 75 | function getCurrentPlaintextUrl() { |
|
0 commit comments