hermes-web-ui 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/hermes-web-ui.mjs +114 -19
- package/dist/assets/ChatView-DrzZz5ex.css +1 -0
- package/dist/assets/ChatView-WnNeYrS7.js +38 -0
- package/dist/assets/JobsView-BF9wWdwU.js +831 -0
- package/dist/assets/JobsView-BhwwXuLt.css +1 -0
- package/dist/assets/Modal-CQVLL_Oc.js +276 -0
- package/dist/assets/_plugin-vue_export-helper-D5N3Hfca.js +231 -0
- package/dist/assets/chat-640V6r6N.js +1 -0
- package/dist/assets/client-BxIiwrqC.js +1 -0
- package/dist/assets/index-4iFlrAYJ.js +307 -0
- package/dist/assets/index-CMJKLUKk.css +1 -0
- package/dist/assets/jobs-Cuol6Mqb.js +1 -0
- package/dist/assets/use-message-B8ClBznx.js +117 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +21 -0
- package/package.json +3 -11
- package/index.html +0 -13
- package/src/App.vue +0 -54
- package/src/api/chat.ts +0 -87
- package/src/api/client.ts +0 -44
- package/src/api/jobs.ts +0 -100
- package/src/api/system.ts +0 -25
- package/src/assets/hero.png +0 -0
- package/src/assets/vite.svg +0 -1
- package/src/components/chat/ChatInput.vue +0 -123
- package/src/components/chat/ChatPanel.vue +0 -289
- package/src/components/chat/MarkdownRenderer.vue +0 -187
- package/src/components/chat/MessageItem.vue +0 -189
- package/src/components/chat/MessageList.vue +0 -94
- package/src/components/jobs/JobCard.vue +0 -244
- package/src/components/jobs/JobFormModal.vue +0 -188
- package/src/components/jobs/JobsPanel.vue +0 -58
- package/src/components/layout/AppSidebar.vue +0 -169
- package/src/composables/useKeyboard.ts +0 -39
- package/src/env.d.ts +0 -7
- package/src/main.ts +0 -10
- package/src/router/index.ts +0 -24
- package/src/stores/app.ts +0 -66
- package/src/stores/chat.ts +0 -344
- package/src/stores/jobs.ts +0 -72
- package/src/styles/global.scss +0 -60
- package/src/styles/theme.ts +0 -71
- package/src/styles/variables.scss +0 -56
- package/src/views/ChatView.vue +0 -25
- package/src/views/JobsView.vue +0 -93
- package/src/views/SettingsView.vue +0 -257
- package/tsconfig.app.json +0 -17
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -24
- package/vite.config.ts +0 -39
- /package/{assets/logo.png → dist/assets/logo-BAarh-tH.png} +0 -0
- /package/{public → dist}/favicon.svg +0 -0
- /package/{public → dist}/icons.svg +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import { NButton } from 'naive-ui'
|
|
4
|
-
import { useChatStore } from '@/stores/chat'
|
|
5
|
-
|
|
6
|
-
const chatStore = useChatStore()
|
|
7
|
-
const inputText = ref('')
|
|
8
|
-
const textareaRef = ref<HTMLTextAreaElement>()
|
|
9
|
-
|
|
10
|
-
function handleSend() {
|
|
11
|
-
const text = inputText.value.trim()
|
|
12
|
-
if (!text) return
|
|
13
|
-
|
|
14
|
-
chatStore.sendMessage(text)
|
|
15
|
-
inputText.value = ''
|
|
16
|
-
|
|
17
|
-
// Reset textarea height
|
|
18
|
-
if (textareaRef.value) {
|
|
19
|
-
textareaRef.value.style.height = 'auto'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function handleKeydown(e: KeyboardEvent) {
|
|
24
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
25
|
-
e.preventDefault()
|
|
26
|
-
handleSend()
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function handleInput(e: Event) {
|
|
31
|
-
const el = e.target as HTMLTextAreaElement
|
|
32
|
-
el.style.height = 'auto'
|
|
33
|
-
el.style.height = Math.min(el.scrollHeight, 100) + 'px'
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<template>
|
|
38
|
-
<div class="chat-input-area">
|
|
39
|
-
<div class="input-wrapper">
|
|
40
|
-
<textarea
|
|
41
|
-
ref="textareaRef"
|
|
42
|
-
v-model="inputText"
|
|
43
|
-
class="input-textarea"
|
|
44
|
-
placeholder="Type a message... (Enter to send, Shift+Enter for new line)"
|
|
45
|
-
rows="1"
|
|
46
|
-
@keydown="handleKeydown"
|
|
47
|
-
@input="handleInput"
|
|
48
|
-
></textarea>
|
|
49
|
-
<div class="input-actions">
|
|
50
|
-
<NButton
|
|
51
|
-
v-if="chatStore.isStreaming"
|
|
52
|
-
size="small"
|
|
53
|
-
type="error"
|
|
54
|
-
@click="chatStore.stopStreaming()"
|
|
55
|
-
>
|
|
56
|
-
Stop
|
|
57
|
-
</NButton>
|
|
58
|
-
<NButton
|
|
59
|
-
size="small"
|
|
60
|
-
type="primary"
|
|
61
|
-
:disabled="!inputText.trim() || chatStore.isStreaming"
|
|
62
|
-
@click="handleSend"
|
|
63
|
-
>
|
|
64
|
-
<template #icon>
|
|
65
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
|
|
66
|
-
</template>
|
|
67
|
-
Send
|
|
68
|
-
</NButton>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</template>
|
|
73
|
-
|
|
74
|
-
<style scoped lang="scss">
|
|
75
|
-
@use '@/styles/variables' as *;
|
|
76
|
-
|
|
77
|
-
.chat-input-area {
|
|
78
|
-
padding: 12px 20px 16px;
|
|
79
|
-
border-top: 1px solid $border-color;
|
|
80
|
-
flex-shrink: 0;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.input-wrapper {
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
gap: 10px;
|
|
87
|
-
background-color: $bg-input;
|
|
88
|
-
border: 1px solid $border-color;
|
|
89
|
-
border-radius: $radius-md;
|
|
90
|
-
padding: 10px 12px;
|
|
91
|
-
transition: border-color $transition-fast;
|
|
92
|
-
|
|
93
|
-
&:focus-within {
|
|
94
|
-
border-color: $accent-primary;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.input-textarea {
|
|
99
|
-
flex: 1;
|
|
100
|
-
background: none;
|
|
101
|
-
border: none;
|
|
102
|
-
outline: none;
|
|
103
|
-
color: $text-primary;
|
|
104
|
-
font-family: $font-ui;
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
line-height: 1.5;
|
|
107
|
-
resize: none;
|
|
108
|
-
max-height: 100px;
|
|
109
|
-
min-height: 20px;
|
|
110
|
-
overflow-y: auto;
|
|
111
|
-
|
|
112
|
-
&::placeholder {
|
|
113
|
-
color: $text-muted;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.input-actions {
|
|
118
|
-
display: flex;
|
|
119
|
-
gap: 6px;
|
|
120
|
-
flex-shrink: 0;
|
|
121
|
-
align-items: center;
|
|
122
|
-
}
|
|
123
|
-
</style>
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, computed } from 'vue'
|
|
3
|
-
import { NButton, NTooltip, NPopconfirm, useMessage } from 'naive-ui'
|
|
4
|
-
import MessageList from './MessageList.vue'
|
|
5
|
-
import ChatInput from './ChatInput.vue'
|
|
6
|
-
import { useChatStore } from '@/stores/chat'
|
|
7
|
-
import { useAppStore } from '@/stores/app'
|
|
8
|
-
|
|
9
|
-
const chatStore = useChatStore()
|
|
10
|
-
const appStore = useAppStore()
|
|
11
|
-
const message = useMessage()
|
|
12
|
-
|
|
13
|
-
const showSessions = ref(true)
|
|
14
|
-
|
|
15
|
-
const sortedSessions = computed(() => {
|
|
16
|
-
return [...chatStore.sessions].sort((a, b) => b.updatedAt - a.updatedAt)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const activeSessionLabel = computed(() =>
|
|
20
|
-
chatStore.activeSession?.title || 'New Chat',
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
function handleNewChat() {
|
|
24
|
-
chatStore.newChat()
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function copySessionId() {
|
|
28
|
-
if (chatStore.activeSessionId) {
|
|
29
|
-
navigator.clipboard.writeText(chatStore.activeSessionId)
|
|
30
|
-
message.success('Copied')
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function handleDeleteSession(id: string) {
|
|
35
|
-
chatStore.deleteSession(id)
|
|
36
|
-
message.success('Session deleted')
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function formatTime(ts: number) {
|
|
40
|
-
const d = new Date(ts)
|
|
41
|
-
const now = new Date()
|
|
42
|
-
const isToday = d.toDateString() === now.toDateString()
|
|
43
|
-
if (isToday) return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
|
44
|
-
return d.toLocaleDateString([], { month: 'short', day: 'numeric' })
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<div class="chat-panel">
|
|
50
|
-
<!-- Session List -->
|
|
51
|
-
<aside class="session-list" :class="{ collapsed: !showSessions }">
|
|
52
|
-
<div class="session-list-header">
|
|
53
|
-
<span v-if="showSessions" class="session-list-title">Sessions</span>
|
|
54
|
-
<NButton quaternary size="tiny" @click="handleNewChat" circle>
|
|
55
|
-
<template #icon>
|
|
56
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
|
57
|
-
</template>
|
|
58
|
-
</NButton>
|
|
59
|
-
</div>
|
|
60
|
-
<div v-if="showSessions" class="session-items">
|
|
61
|
-
<button
|
|
62
|
-
v-for="s in sortedSessions"
|
|
63
|
-
:key="s.id"
|
|
64
|
-
class="session-item"
|
|
65
|
-
:class="{ active: s.id === chatStore.activeSessionId }"
|
|
66
|
-
@click="chatStore.switchSession(s.id)"
|
|
67
|
-
>
|
|
68
|
-
<div class="session-item-content">
|
|
69
|
-
<span class="session-item-title">{{ s.title }}</span>
|
|
70
|
-
<span class="session-item-time">{{ formatTime(s.updatedAt) }}</span>
|
|
71
|
-
</div>
|
|
72
|
-
<NPopconfirm
|
|
73
|
-
v-if="s.id !== chatStore.activeSessionId || sortedSessions.length > 1"
|
|
74
|
-
@positive-click="handleDeleteSession(s.id)"
|
|
75
|
-
>
|
|
76
|
-
<template #trigger>
|
|
77
|
-
<button class="session-item-delete" @click.stop>
|
|
78
|
-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
79
|
-
</button>
|
|
80
|
-
</template>
|
|
81
|
-
Delete this session?
|
|
82
|
-
</NPopconfirm>
|
|
83
|
-
</button>
|
|
84
|
-
</div>
|
|
85
|
-
</aside>
|
|
86
|
-
|
|
87
|
-
<!-- Chat Area -->
|
|
88
|
-
<div class="chat-main">
|
|
89
|
-
<header class="chat-header">
|
|
90
|
-
<div class="header-left">
|
|
91
|
-
<NButton quaternary size="small" @click="showSessions = !showSessions" circle>
|
|
92
|
-
<template #icon>
|
|
93
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>
|
|
94
|
-
</template>
|
|
95
|
-
</NButton>
|
|
96
|
-
<span class="header-session-title">{{ activeSessionLabel }}</span>
|
|
97
|
-
<span class="model-badge">{{ appStore.selectedModel }}</span>
|
|
98
|
-
</div>
|
|
99
|
-
<div class="header-actions">
|
|
100
|
-
<NTooltip trigger="hover">
|
|
101
|
-
<template #trigger>
|
|
102
|
-
<NButton quaternary size="small" @click="copySessionId" circle>
|
|
103
|
-
<template #icon>
|
|
104
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
|
105
|
-
</template>
|
|
106
|
-
</NButton>
|
|
107
|
-
</template>
|
|
108
|
-
Copy Session ID
|
|
109
|
-
</NTooltip>
|
|
110
|
-
<NButton size="small" @click="handleNewChat">
|
|
111
|
-
<template #icon>
|
|
112
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
|
113
|
-
</template>
|
|
114
|
-
New Chat
|
|
115
|
-
</NButton>
|
|
116
|
-
</div>
|
|
117
|
-
</header>
|
|
118
|
-
|
|
119
|
-
<MessageList />
|
|
120
|
-
<ChatInput />
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</template>
|
|
124
|
-
|
|
125
|
-
<style scoped lang="scss">
|
|
126
|
-
@use '@/styles/variables' as *;
|
|
127
|
-
|
|
128
|
-
.chat-panel {
|
|
129
|
-
display: flex;
|
|
130
|
-
height: 100%;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.session-list {
|
|
134
|
-
width: 220px;
|
|
135
|
-
border-right: 1px solid $border-color;
|
|
136
|
-
display: flex;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
flex-shrink: 0;
|
|
139
|
-
transition: width $transition-normal, opacity $transition-normal;
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
|
|
142
|
-
&.collapsed {
|
|
143
|
-
width: 0;
|
|
144
|
-
border-right: none;
|
|
145
|
-
opacity: 0;
|
|
146
|
-
pointer-events: none;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.session-list-header {
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
justify-content: space-between;
|
|
154
|
-
padding: 12px;
|
|
155
|
-
flex-shrink: 0;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.session-list-title {
|
|
159
|
-
font-size: 12px;
|
|
160
|
-
font-weight: 600;
|
|
161
|
-
color: $text-muted;
|
|
162
|
-
text-transform: uppercase;
|
|
163
|
-
letter-spacing: 0.5px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.session-items {
|
|
167
|
-
flex: 1;
|
|
168
|
-
overflow-y: auto;
|
|
169
|
-
padding: 0 6px 12px;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.session-item {
|
|
173
|
-
display: flex;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: space-between;
|
|
176
|
-
width: 100%;
|
|
177
|
-
padding: 8px 10px;
|
|
178
|
-
border: none;
|
|
179
|
-
background: none;
|
|
180
|
-
border-radius: $radius-sm;
|
|
181
|
-
cursor: pointer;
|
|
182
|
-
text-align: left;
|
|
183
|
-
color: $text-secondary;
|
|
184
|
-
transition: all $transition-fast;
|
|
185
|
-
margin-bottom: 2px;
|
|
186
|
-
|
|
187
|
-
&:hover {
|
|
188
|
-
background: rgba($accent-primary, 0.06);
|
|
189
|
-
color: $text-primary;
|
|
190
|
-
|
|
191
|
-
.session-item-delete {
|
|
192
|
-
opacity: 1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&.active {
|
|
197
|
-
background: rgba($accent-primary, 0.1);
|
|
198
|
-
color: $text-primary;
|
|
199
|
-
font-weight: 500;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.session-item-content {
|
|
204
|
-
flex: 1;
|
|
205
|
-
overflow: hidden;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.session-item-title {
|
|
209
|
-
display: block;
|
|
210
|
-
font-size: 13px;
|
|
211
|
-
white-space: nowrap;
|
|
212
|
-
overflow: hidden;
|
|
213
|
-
text-overflow: ellipsis;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.session-item-time {
|
|
217
|
-
display: block;
|
|
218
|
-
font-size: 11px;
|
|
219
|
-
color: $text-muted;
|
|
220
|
-
margin-top: 2px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.session-item-delete {
|
|
224
|
-
flex-shrink: 0;
|
|
225
|
-
opacity: 0;
|
|
226
|
-
padding: 2px;
|
|
227
|
-
border: none;
|
|
228
|
-
background: none;
|
|
229
|
-
color: $text-muted;
|
|
230
|
-
cursor: pointer;
|
|
231
|
-
border-radius: 3px;
|
|
232
|
-
transition: all $transition-fast;
|
|
233
|
-
|
|
234
|
-
&:hover {
|
|
235
|
-
color: $error;
|
|
236
|
-
background: rgba($error, 0.1);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.chat-main {
|
|
241
|
-
flex: 1;
|
|
242
|
-
display: flex;
|
|
243
|
-
flex-direction: column;
|
|
244
|
-
overflow: hidden;
|
|
245
|
-
min-width: 0;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.chat-header {
|
|
249
|
-
display: flex;
|
|
250
|
-
align-items: center;
|
|
251
|
-
justify-content: space-between;
|
|
252
|
-
padding: 12px 16px;
|
|
253
|
-
border-bottom: 1px solid $border-color;
|
|
254
|
-
flex-shrink: 0;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.header-left {
|
|
258
|
-
display: flex;
|
|
259
|
-
align-items: center;
|
|
260
|
-
gap: 8px;
|
|
261
|
-
overflow: hidden;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.header-session-title {
|
|
265
|
-
font-size: 14px;
|
|
266
|
-
font-weight: 500;
|
|
267
|
-
color: $text-primary;
|
|
268
|
-
white-space: nowrap;
|
|
269
|
-
overflow: hidden;
|
|
270
|
-
text-overflow: ellipsis;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.model-badge {
|
|
274
|
-
font-size: 11px;
|
|
275
|
-
color: $text-muted;
|
|
276
|
-
background: rgba($accent-primary, 0.1);
|
|
277
|
-
padding: 2px 8px;
|
|
278
|
-
border-radius: 10px;
|
|
279
|
-
border: 1px solid $border-color;
|
|
280
|
-
flex-shrink: 0;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.header-actions {
|
|
284
|
-
display: flex;
|
|
285
|
-
align-items: center;
|
|
286
|
-
gap: 4px;
|
|
287
|
-
flex-shrink: 0;
|
|
288
|
-
}
|
|
289
|
-
</style>
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import MarkdownIt from 'markdown-it'
|
|
4
|
-
import hljs from 'highlight.js'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{ content: string }>()
|
|
7
|
-
|
|
8
|
-
const md: MarkdownIt = new MarkdownIt({
|
|
9
|
-
html: false,
|
|
10
|
-
linkify: true,
|
|
11
|
-
typographer: true,
|
|
12
|
-
highlight(str: string, lang: string): string {
|
|
13
|
-
if (lang && hljs.getLanguage(lang)) {
|
|
14
|
-
try {
|
|
15
|
-
return `<pre class="hljs-code-block"><div class="code-header"><span class="code-lang">${lang}</span><button class="copy-btn" onclick="navigator.clipboard.writeText(this.closest('.hljs-code-block').querySelector('code').textContent)">Copy</button></div><code class="hljs language-${lang}">${hljs.highlight(str, { language: lang, ignoreIllegals: true }).value}</code></pre>`
|
|
16
|
-
} catch {
|
|
17
|
-
// fall through
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return `<pre class="hljs-code-block"><div class="code-header"><button class="copy-btn" onclick="navigator.clipboard.writeText(this.closest('.hljs-code-block').querySelector('code').textContent)">Copy</button></div><code class="hljs">${md.utils.escapeHtml(str)}</code></pre>`
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const renderedHtml = computed(() => md.render(props.content))
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<div class="markdown-body" v-html="renderedHtml"></div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<style lang="scss">
|
|
32
|
-
@use '@/styles/variables' as *;
|
|
33
|
-
|
|
34
|
-
.markdown-body {
|
|
35
|
-
font-size: 14px;
|
|
36
|
-
line-height: 1.65;
|
|
37
|
-
|
|
38
|
-
p {
|
|
39
|
-
margin: 0 0 8px;
|
|
40
|
-
|
|
41
|
-
&:last-child {
|
|
42
|
-
margin-bottom: 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
ul, ol {
|
|
47
|
-
padding-left: 20px;
|
|
48
|
-
margin: 4px 0 8px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
li {
|
|
52
|
-
margin: 2px 0;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
strong {
|
|
56
|
-
color: $text-primary;
|
|
57
|
-
font-weight: 600;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
em {
|
|
61
|
-
color: $text-secondary;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
a {
|
|
65
|
-
color: $accent-primary;
|
|
66
|
-
text-decoration: underline;
|
|
67
|
-
text-underline-offset: 2px;
|
|
68
|
-
|
|
69
|
-
&:hover {
|
|
70
|
-
color: $accent-hover;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
blockquote {
|
|
75
|
-
margin: 8px 0;
|
|
76
|
-
padding: 4px 12px;
|
|
77
|
-
border-left: 3px solid $border-color;
|
|
78
|
-
color: $text-secondary;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
code:not(.hljs) {
|
|
82
|
-
background: $code-bg;
|
|
83
|
-
padding: 2px 6px;
|
|
84
|
-
border-radius: 4px;
|
|
85
|
-
font-family: $font-code;
|
|
86
|
-
font-size: 13px;
|
|
87
|
-
color: $accent-primary;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
table {
|
|
91
|
-
width: 100%;
|
|
92
|
-
border-collapse: collapse;
|
|
93
|
-
margin: 8px 0;
|
|
94
|
-
|
|
95
|
-
th, td {
|
|
96
|
-
padding: 6px 12px;
|
|
97
|
-
border: 1px solid $border-color;
|
|
98
|
-
text-align: left;
|
|
99
|
-
font-size: 13px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
th {
|
|
103
|
-
background: rgba($accent-primary, 0.08);
|
|
104
|
-
color: $text-primary;
|
|
105
|
-
font-weight: 600;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
td {
|
|
109
|
-
color: $text-secondary;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
hr {
|
|
114
|
-
border: none;
|
|
115
|
-
border-top: 1px solid $border-color;
|
|
116
|
-
margin: 12px 0;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.hljs-code-block {
|
|
121
|
-
margin: 8px 0;
|
|
122
|
-
border-radius: $radius-sm;
|
|
123
|
-
overflow: hidden;
|
|
124
|
-
background: $code-bg;
|
|
125
|
-
border: 1px solid $border-color;
|
|
126
|
-
|
|
127
|
-
.code-header {
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: space-between;
|
|
130
|
-
align-items: center;
|
|
131
|
-
padding: 6px 12px;
|
|
132
|
-
background: rgba(0, 0, 0, 0.03);
|
|
133
|
-
border-bottom: 1px solid $border-color;
|
|
134
|
-
|
|
135
|
-
.code-lang {
|
|
136
|
-
font-size: 11px;
|
|
137
|
-
color: $text-muted;
|
|
138
|
-
text-transform: uppercase;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.copy-btn {
|
|
142
|
-
font-size: 11px;
|
|
143
|
-
color: $text-muted;
|
|
144
|
-
background: none;
|
|
145
|
-
border: none;
|
|
146
|
-
cursor: pointer;
|
|
147
|
-
padding: 2px 6px;
|
|
148
|
-
border-radius: 3px;
|
|
149
|
-
transition: all $transition-fast;
|
|
150
|
-
|
|
151
|
-
&:hover {
|
|
152
|
-
color: $text-primary;
|
|
153
|
-
background: rgba(0, 0, 0, 0.05);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
code.hljs {
|
|
159
|
-
display: block;
|
|
160
|
-
padding: 12px;
|
|
161
|
-
font-family: $font-code;
|
|
162
|
-
font-size: 13px;
|
|
163
|
-
line-height: 1.5;
|
|
164
|
-
overflow-x: auto;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// highlight.js theme override — pure ink B&W
|
|
169
|
-
.hljs {
|
|
170
|
-
color: #2a2a2a;
|
|
171
|
-
background: none;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.hljs-keyword,
|
|
175
|
-
.hljs-selector-tag { color: #1a1a1a; font-weight: 600; }
|
|
176
|
-
.hljs-string,
|
|
177
|
-
.hljs-attr { color: #555555; }
|
|
178
|
-
.hljs-number { color: #333333; }
|
|
179
|
-
.hljs-comment { color: #999999; font-style: italic; }
|
|
180
|
-
.hljs-built_in { color: #444444; }
|
|
181
|
-
.hljs-type { color: #3a3a3a; }
|
|
182
|
-
.hljs-variable { color: #1a1a1a; }
|
|
183
|
-
.hljs-title,
|
|
184
|
-
.hljs-title\.function_ { color: #1a1a1a; }
|
|
185
|
-
.hljs-params { color: #2a2a2a; }
|
|
186
|
-
.hljs-meta { color: #999999; }
|
|
187
|
-
</style>
|