@noirmd/previewer 1.2.0 → 2.0.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/dist/NReditor.cjs +851 -895
- package/dist/NReditor.cjs.map +1 -1
- package/dist/NReditor.d.cts +1 -1
- package/dist/NReditor.d.ts +1 -1
- package/dist/NReditor.js +852 -896
- package/dist/NReditor.js.map +1 -1
- package/dist/admonition.css +55 -0
- package/dist/{markdown.css → base.css} +96 -126
- package/dist/blockquote.css +16 -0
- package/dist/button.css +32 -0
- package/dist/card.css +143 -0
- package/dist/codeblock.css +59 -0
- package/dist/core.cjs +9 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +9 -1
- package/dist/core.js.map +1 -1
- package/dist/details.css +45 -0
- package/dist/editor.css +56 -9
- package/dist/fonts/material-icons-round.woff2 +0 -0
- package/dist/index.cjs +852 -883
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -70
- package/dist/index.d.ts +41 -70
- package/dist/index.js +851 -877
- package/dist/index.js.map +1 -1
- package/dist/list.css +18 -0
- package/dist/modal.css +82 -0
- package/dist/react.cjs +852 -886
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +44 -73
- package/dist/react.d.ts +44 -73
- package/dist/react.js +851 -880
- package/dist/react.js.map +1 -1
- package/dist/slide.css +21 -0
- package/dist/table.css +36 -0
- package/dist/toc.css +45 -0
- package/dist/vanilla.cjs +42 -28
- package/dist/vanilla.cjs.map +1 -1
- package/dist/vanilla.css +32 -677
- package/dist/vanilla.d.cts +8 -2
- package/dist/vanilla.d.ts +8 -2
- package/dist/vanilla.js +41 -28
- package/dist/vanilla.js.map +1 -1
- package/dist/variables.css +53 -0
- package/dist/vue.cjs +931 -1121
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +63 -214
- package/dist/vue.d.ts +63 -214
- package/dist/vue.js +930 -1120
- package/dist/vue.js.map +1 -1
- package/editor.css +56 -9
- package/package.json +5 -10
- package/markdown.css +0 -344
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Admonition
|
|
3
|
+
============================================================ */
|
|
4
|
+
|
|
5
|
+
.nr-admonition {
|
|
6
|
+
border-radius: var(--nr-radius);
|
|
7
|
+
margin-bottom: 1.5rem;
|
|
8
|
+
border: 1px solid;
|
|
9
|
+
padding: 1rem;
|
|
10
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.nr-admonition--note {
|
|
14
|
+
border-color: rgba(59, 130, 246, 0.2);
|
|
15
|
+
background: rgba(59, 130, 246, 0.05);
|
|
16
|
+
color: var(--nr-info);
|
|
17
|
+
}
|
|
18
|
+
.nr-admonition--info {
|
|
19
|
+
border-color: rgba(59, 130, 246, 0.3);
|
|
20
|
+
background: rgba(59, 130, 246, 0.1);
|
|
21
|
+
color: var(--nr-info);
|
|
22
|
+
}
|
|
23
|
+
.nr-admonition--warning {
|
|
24
|
+
border-color: rgba(245, 158, 11, 0.3);
|
|
25
|
+
background: rgba(245, 158, 11, 0.1);
|
|
26
|
+
color: var(--nr-warning);
|
|
27
|
+
}
|
|
28
|
+
.nr-admonition--danger {
|
|
29
|
+
border-color: rgba(239, 68, 68, 0.3);
|
|
30
|
+
background: rgba(239, 68, 68, 0.1);
|
|
31
|
+
color: var(--nr-danger);
|
|
32
|
+
}
|
|
33
|
+
.nr-admonition--greentext {
|
|
34
|
+
border-color: rgba(34, 197, 94, 0.3);
|
|
35
|
+
background: rgba(34, 197, 94, 0.1);
|
|
36
|
+
color: var(--nr-success);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.nr-admonition__title {
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
font-size: 1rem;
|
|
42
|
+
margin: 0 0 0.5rem;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 0.5rem;
|
|
46
|
+
}
|
|
47
|
+
.nr-admonition__icon {
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.nr-admonition__body {
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
line-height: 1.625;
|
|
54
|
+
opacity: 0.9;
|
|
55
|
+
}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Global / Reusable Styles
|
|
3
|
+
|
|
4
|
+
Base typography, inline elements, generic element resets
|
|
5
|
+
(for raw HTML content) and the highlight.js theme.
|
|
6
|
+
Imported by vanilla.css — do not import standalone.
|
|
7
|
+
============================================================ */
|
|
8
|
+
|
|
9
|
+
/* ── Root prose base ─────────────────────────────────────── */
|
|
10
|
+
|
|
11
|
+
.nr-prose {
|
|
12
|
+
color: var(--nr-text);
|
|
13
|
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
14
|
+
line-height: 1.625;
|
|
15
|
+
word-wrap: break-word;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ── Alignment utilities ─────────────────────────────────── */
|
|
19
|
+
|
|
20
|
+
.nr-prose .text-center { text-align: center; }
|
|
21
|
+
.nr-prose .text-right { text-align: right; }
|
|
22
|
+
|
|
23
|
+
/* ── Heading & paragraph typography ──────────────────────── */
|
|
4
24
|
|
|
5
25
|
.md-h1 {
|
|
6
26
|
font-size: 1.5rem;
|
|
@@ -91,128 +111,69 @@
|
|
|
91
111
|
.md-p { font-size: 1rem; }
|
|
92
112
|
}
|
|
93
113
|
|
|
94
|
-
/* ──
|
|
95
|
-
|
|
114
|
+
/* ── Inline elements ─────────────────────────────────────── */
|
|
115
|
+
|
|
116
|
+
.nr-link {
|
|
117
|
+
color: var(--nr-accent);
|
|
96
118
|
text-decoration: none !important;
|
|
97
|
-
color: var(--color-accent-primary, #0ea5e9);
|
|
98
119
|
transition: color 0.15s;
|
|
99
120
|
}
|
|
100
|
-
.nr-
|
|
121
|
+
.nr-link:hover {
|
|
101
122
|
text-decoration: underline !important;
|
|
102
|
-
color: var(--
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* ── Lists ── */
|
|
106
|
-
.nr-prose ul,
|
|
107
|
-
.nr-prose ol {
|
|
108
|
-
list-style-type: disc;
|
|
109
|
-
margin: 0.75rem 0;
|
|
110
|
-
padding-left: 1.5rem;
|
|
111
|
-
font-size: 0.875rem;
|
|
112
|
-
line-height: 1.625;
|
|
113
|
-
}
|
|
114
|
-
@media (min-width: 640px) {
|
|
115
|
-
.nr-prose ul, .nr-prose ol { font-size: 1rem; }
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.nr-prose ol {
|
|
119
|
-
list-style-type: decimal;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.nr-prose li {
|
|
123
|
-
margin: 0.25rem 0;
|
|
124
|
-
line-height: 1.625;
|
|
125
|
-
display: list-item;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.nr-prose li::marker {
|
|
129
|
-
color: var(--color-text-secondary, #64748b);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/* Nested lists */
|
|
133
|
-
.nr-prose li > ul,
|
|
134
|
-
.nr-prose li > ol {
|
|
135
|
-
margin: 0.25rem 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* ── Tables ── */
|
|
139
|
-
.nr-prose table {
|
|
140
|
-
width: 100%;
|
|
141
|
-
border-collapse: collapse;
|
|
142
|
-
margin: 1rem 0;
|
|
143
|
-
font-size: 0.875rem;
|
|
144
|
-
line-height: 1.5;
|
|
145
|
-
}
|
|
146
|
-
@media (min-width: 640px) {
|
|
147
|
-
.nr-prose table { font-size: 1rem; }
|
|
123
|
+
color: var(--nr-accent-hover);
|
|
148
124
|
}
|
|
149
125
|
|
|
150
|
-
.nr-
|
|
151
|
-
|
|
126
|
+
.nr-inline-code {
|
|
127
|
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
128
|
+
font-size: 0.875em;
|
|
129
|
+
background: var(--nr-bg-secondary);
|
|
130
|
+
padding: 0.125rem 0.375rem;
|
|
131
|
+
border-radius: var(--nr-radius-sm);
|
|
132
|
+
color: var(--nr-text);
|
|
152
133
|
}
|
|
153
134
|
|
|
154
|
-
.nr-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
background: var(--color-background-secondary-solid, #f1f5f9);
|
|
160
|
-
border-bottom: 1px solid var(--color-border, #e2e8f0);
|
|
135
|
+
.nr-highlight {
|
|
136
|
+
background: rgba(234, 179, 8, 0.2);
|
|
137
|
+
color: inherit;
|
|
138
|
+
padding: 0 0.125rem;
|
|
139
|
+
border-radius: 0.25rem;
|
|
161
140
|
}
|
|
162
141
|
|
|
163
|
-
.nr-
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
.nr-spoiler {
|
|
143
|
+
background: var(--nr-text);
|
|
144
|
+
color: var(--nr-text);
|
|
145
|
+
padding: 0 0.25rem;
|
|
146
|
+
border-radius: var(--nr-radius-sm);
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
transition: background 0.15s, color 0.15s;
|
|
166
149
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
150
|
+
.nr-spoiler:hover {
|
|
151
|
+
background: transparent;
|
|
152
|
+
color: var(--nr-text);
|
|
170
153
|
}
|
|
171
154
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
margin: 1rem 0;
|
|
175
|
-
padding: 0.5rem 1rem;
|
|
176
|
-
border-left: 4px solid var(--color-accent-primary, #0ea5e9);
|
|
177
|
-
color: var(--color-text-secondary, #64748b);
|
|
178
|
-
font-style: italic;
|
|
179
|
-
font-size: 0.875rem;
|
|
180
|
-
line-height: 1.625;
|
|
181
|
-
}
|
|
182
|
-
@media (min-width: 640px) {
|
|
183
|
-
.nr-prose blockquote { font-size: 1rem; }
|
|
155
|
+
.nr-underline {
|
|
156
|
+
text-underline-offset: 2px;
|
|
184
157
|
}
|
|
185
158
|
|
|
186
|
-
.nr-
|
|
187
|
-
|
|
159
|
+
.nr-icon {
|
|
160
|
+
font-size: 1em;
|
|
161
|
+
line-height: 1;
|
|
162
|
+
vertical-align: top;
|
|
188
163
|
}
|
|
189
164
|
|
|
190
|
-
/* ──
|
|
191
|
-
.nr-prose :not(pre) > code {
|
|
192
|
-
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
193
|
-
font-size: 0.875em;
|
|
194
|
-
background: var(--color-background-secondary-solid, #f1f5f9);
|
|
195
|
-
padding: 0.125rem 0.375rem;
|
|
196
|
-
border-radius: 0.25rem;
|
|
197
|
-
color: var(--color-text-primary, #0f172a);
|
|
198
|
-
}
|
|
165
|
+
/* ── Generic element resets (raw HTML content) ───────────── */
|
|
199
166
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
overflow-x: auto;
|
|
205
|
-
font-size: 0.8125rem;
|
|
206
|
-
line-height: 1.6;
|
|
207
|
-
border-radius: 0.75rem;
|
|
208
|
-
background: var(--color-background-secondary-solid, #f1f5f9);
|
|
167
|
+
.nr-prose a {
|
|
168
|
+
text-decoration: none !important;
|
|
169
|
+
color: var(--color-accent-primary, #0ea5e9);
|
|
170
|
+
transition: color 0.15s;
|
|
209
171
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
172
|
+
.nr-prose a:hover:not(.nr-button):not(.nr-card__action-link) {
|
|
173
|
+
text-decoration: underline !important;
|
|
174
|
+
color: var(--color-accent-hover, #38bdf8);
|
|
213
175
|
}
|
|
214
176
|
|
|
215
|
-
/* ── Inline formatting ── */
|
|
216
177
|
.nr-prose strong,
|
|
217
178
|
.nr-prose b {
|
|
218
179
|
font-weight: 700;
|
|
@@ -229,56 +190,65 @@
|
|
|
229
190
|
opacity: 0.7;
|
|
230
191
|
}
|
|
231
192
|
|
|
232
|
-
/* ── Highlight ── */
|
|
233
193
|
.nr-prose mark {
|
|
234
194
|
background: rgba(250, 204, 21, 0.2);
|
|
235
195
|
padding: 0 0.125rem;
|
|
236
196
|
border-radius: 0.125rem;
|
|
237
197
|
}
|
|
238
198
|
|
|
239
|
-
/* ── Horizontal rules ── */
|
|
240
199
|
.nr-prose hr {
|
|
241
200
|
border: none;
|
|
242
201
|
border-top: 1px solid var(--color-border, #e2e8f0);
|
|
243
202
|
margin: 2rem 0;
|
|
244
203
|
}
|
|
245
204
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
color: var(--color-text-primary, #0f172a);
|
|
251
|
-
border-radius: 0.25rem;
|
|
252
|
-
padding: 0 0.25rem;
|
|
253
|
-
cursor: pointer;
|
|
254
|
-
transition: background-color 0.2s, color 0.2s;
|
|
205
|
+
.nr-prose img {
|
|
206
|
+
max-width: 100%;
|
|
207
|
+
height: auto;
|
|
208
|
+
border-radius: 0.5rem;
|
|
255
209
|
}
|
|
256
210
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
211
|
+
/* ── Generic wrapper / fallbacks ─────────────────────────── */
|
|
212
|
+
|
|
213
|
+
.nr-raw-html {
|
|
214
|
+
width: 100%;
|
|
215
|
+
margin: 1rem 0;
|
|
261
216
|
}
|
|
262
217
|
|
|
263
|
-
|
|
264
|
-
|
|
218
|
+
.nr-unknown-directive {
|
|
219
|
+
margin: 1rem 0;
|
|
220
|
+
padding: 1rem;
|
|
221
|
+
border-radius: var(--nr-radius);
|
|
222
|
+
border: 1px solid var(--nr-border);
|
|
223
|
+
background: color-mix(in srgb, var(--nr-bg) 5%, transparent);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.nr-hr {
|
|
227
|
+
border: none;
|
|
228
|
+
border-top: 1px solid var(--nr-border);
|
|
229
|
+
margin: 2rem 0;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.nr-image {
|
|
265
233
|
max-width: 100%;
|
|
266
234
|
height: auto;
|
|
267
235
|
border-radius: 0.5rem;
|
|
268
236
|
}
|
|
269
237
|
|
|
270
|
-
/* ── Scrollbar (
|
|
238
|
+
/* ── Scrollbar (code blocks and tables) ──────────────────── */
|
|
239
|
+
|
|
271
240
|
.nr-prose pre::-webkit-scrollbar,
|
|
272
|
-
.nr-prose .
|
|
241
|
+
.nr-prose .nr-table-wrap::-webkit-scrollbar {
|
|
273
242
|
height: 4px;
|
|
274
243
|
}
|
|
275
244
|
.nr-prose pre::-webkit-scrollbar-thumb,
|
|
276
|
-
.nr-prose .
|
|
245
|
+
.nr-prose .nr-table-wrap::-webkit-scrollbar-thumb {
|
|
277
246
|
background: var(--color-border, #e2e8f0);
|
|
278
247
|
border-radius: 2px;
|
|
279
248
|
}
|
|
280
249
|
|
|
281
|
-
/* ── highlight.js theme — NoirMD
|
|
250
|
+
/* ── highlight.js theme — NoirMD ─────────────────────────── */
|
|
251
|
+
|
|
282
252
|
.hljs {
|
|
283
253
|
color: #e2e8f0;
|
|
284
254
|
background: transparent;
|
|
@@ -341,4 +311,4 @@
|
|
|
341
311
|
}
|
|
342
312
|
.hljs-strong {
|
|
343
313
|
font-weight: 700;
|
|
344
|
-
}
|
|
314
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Blockquote
|
|
3
|
+
============================================================ */
|
|
4
|
+
|
|
5
|
+
.nr-blockquote {
|
|
6
|
+
margin: 1rem 0;
|
|
7
|
+
padding: 0.5rem 1rem;
|
|
8
|
+
border-left: 4px solid rgba(14, 165, 233, 0.3);
|
|
9
|
+
color: var(--nr-text-secondary);
|
|
10
|
+
font-style: italic;
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
line-height: 1.625;
|
|
13
|
+
}
|
|
14
|
+
@media (min-width: 640px) {
|
|
15
|
+
.nr-blockquote { font-size: 1rem; }
|
|
16
|
+
}
|
package/dist/button.css
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Button
|
|
3
|
+
============================================================ */
|
|
4
|
+
|
|
5
|
+
.nr-button-wrap {
|
|
6
|
+
margin: 0.25rem 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.nr-button {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
width: fit-content;
|
|
13
|
+
padding: 0.5rem 1rem;
|
|
14
|
+
border-radius: 0.75rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
font-size: 0.875rem;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
gap: 0.5rem;
|
|
19
|
+
transition: all 0.15s;
|
|
20
|
+
border: 1px solid var(--nr-border);
|
|
21
|
+
background: color-mix(in srgb, var(--nr-bg) 5%, transparent);
|
|
22
|
+
color: var(--nr-text);
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
.nr-button:hover {
|
|
26
|
+
transform: scale(1.05);
|
|
27
|
+
background: color-mix(in srgb, var(--nr-bg) 10%, transparent);
|
|
28
|
+
color: var(--nr-text);
|
|
29
|
+
}
|
|
30
|
+
.nr-button:active {
|
|
31
|
+
transform: scale(0.95);
|
|
32
|
+
}
|
package/dist/card.css
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Card
|
|
3
|
+
============================================================ */
|
|
4
|
+
|
|
5
|
+
.nr-card-grid {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
gap: 1.5rem;
|
|
9
|
+
margin: 1.5rem 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.nr-card {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
height: 100%;
|
|
16
|
+
border-radius: var(--nr-radius-lg);
|
|
17
|
+
border: 1px solid var(--nr-border);
|
|
18
|
+
transition: all 0.2s;
|
|
19
|
+
position: relative;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
min-width: 18rem;
|
|
22
|
+
width: 18rem;
|
|
23
|
+
max-width: 20rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.nr-card--interactive {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
border-color: rgba(14, 165, 233, 0.1);
|
|
29
|
+
}
|
|
30
|
+
.nr-card--interactive:hover {
|
|
31
|
+
border-color: rgba(14, 165, 233, 0.5);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.nr-card__image {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 160px;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
position: relative;
|
|
39
|
+
}
|
|
40
|
+
.nr-card__image--tall {
|
|
41
|
+
height: 240px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.nr-card__img {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
object-fit: cover;
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.nr-card__gradient {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
background: linear-gradient(to top, color-mix(in srgb, var(--nr-bg) 40%, transparent), transparent);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.nr-card__body {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
flex: 1;
|
|
61
|
+
padding: 1.5rem;
|
|
62
|
+
position: relative;
|
|
63
|
+
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
|
64
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
65
|
+
}
|
|
66
|
+
.nr-card__body--overlap {
|
|
67
|
+
margin-top: -2.5rem;
|
|
68
|
+
background: color-mix(in srgb, var(--nr-bg) 80%, transparent);
|
|
69
|
+
border-radius: 0.75rem 0.75rem 0 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.nr-card__header {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: 0.75rem;
|
|
76
|
+
margin-bottom: 0.75rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.nr-card__icon-wrap {
|
|
80
|
+
width: 2.5rem;
|
|
81
|
+
height: 2.5rem;
|
|
82
|
+
font-size: 1.6em;
|
|
83
|
+
border-radius: 0.75rem;
|
|
84
|
+
background: rgba(14, 165, 233, 0.2);
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
color: var(--nr-accent);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.nr-card__title {
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
font-weight: 900;
|
|
95
|
+
letter-spacing: -0.025em;
|
|
96
|
+
line-height: 1.25;
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.nr-card__description {
|
|
101
|
+
font-size: 0.875rem;
|
|
102
|
+
opacity: 0.8;
|
|
103
|
+
line-height: 1.625;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.nr-card__content {
|
|
108
|
+
margin-top: 0.5rem;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: 0.5rem;
|
|
112
|
+
flex: 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.nr-card__action {
|
|
116
|
+
margin-top: 1.5rem;
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: flex-end;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.nr-card__action-link {
|
|
122
|
+
background: rgba(14, 165, 233, 0.2);
|
|
123
|
+
padding: 0.5rem 1rem;
|
|
124
|
+
border-radius: 0.75rem;
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: 0.375rem;
|
|
128
|
+
font-size: 0.625rem;
|
|
129
|
+
font-weight: 900;
|
|
130
|
+
text-transform: uppercase;
|
|
131
|
+
letter-spacing: 0.1em;
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
color: var(--nr-text);
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
transition: all 0.15s;
|
|
136
|
+
}
|
|
137
|
+
.nr-card:hover .nr-card__action-link {
|
|
138
|
+
opacity: 1;
|
|
139
|
+
color: var(--nr-accent);
|
|
140
|
+
}
|
|
141
|
+
.nr-card__action-link:hover {
|
|
142
|
+
background: rgba(14, 165, 233, 0.3);
|
|
143
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
NoirMD Vanilla — Code Block
|
|
3
|
+
============================================================ */
|
|
4
|
+
|
|
5
|
+
.nr-codeblock {
|
|
6
|
+
position: relative;
|
|
7
|
+
margin: 1rem 0;
|
|
8
|
+
border-radius: var(--nr-radius);
|
|
9
|
+
border: 1px solid var(--nr-border);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background: rgba(30, 41, 59, 0.05);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.nr-codeblock__header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.5rem;
|
|
18
|
+
padding: 0.5rem 1rem;
|
|
19
|
+
border-bottom: 1px solid var(--nr-border);
|
|
20
|
+
background: rgba(30, 41, 59, 0.1);
|
|
21
|
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
22
|
+
font-size: 0.75rem;
|
|
23
|
+
color: var(--nr-text-secondary);
|
|
24
|
+
}
|
|
25
|
+
@media (min-width: 640px) {
|
|
26
|
+
.nr-codeblock__header { font-size: 0.875rem; }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.nr-codeblock__pre {
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 1rem;
|
|
32
|
+
overflow: auto;
|
|
33
|
+
font-size: 0.75rem;
|
|
34
|
+
line-height: 1.5;
|
|
35
|
+
}
|
|
36
|
+
@media (min-width: 640px) {
|
|
37
|
+
.nr-codeblock__pre { font-size: 0.875rem; }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nr-codeblock__pre code {
|
|
41
|
+
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.nr-codeblock__copy {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 0.5rem;
|
|
47
|
+
right: 0.5rem;
|
|
48
|
+
padding: 0.375rem;
|
|
49
|
+
border-radius: var(--nr-radius-sm);
|
|
50
|
+
border: none;
|
|
51
|
+
background: rgba(30, 41, 59, 0.2);
|
|
52
|
+
color: var(--nr-text-secondary);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
transition: background 0.15s, color 0.15s;
|
|
55
|
+
}
|
|
56
|
+
.nr-codeblock__copy:hover {
|
|
57
|
+
background: rgba(30, 41, 59, 0.4);
|
|
58
|
+
color: var(--nr-text);
|
|
59
|
+
}
|
package/dist/core.cjs
CHANGED
|
@@ -126,6 +126,7 @@ function parseMarkdown(markdown) {
|
|
|
126
126
|
if (!markdown) return [];
|
|
127
127
|
const lines = markdown.replace(/\r\n/g, "\n").replace(/\r/g, "").split("\n");
|
|
128
128
|
const result = [];
|
|
129
|
+
const usedIds = /* @__PURE__ */ new Set();
|
|
129
130
|
let i = 0;
|
|
130
131
|
while (i < lines.length) {
|
|
131
132
|
const line = lines[i];
|
|
@@ -135,7 +136,14 @@ function parseMarkdown(markdown) {
|
|
|
135
136
|
const level = match[1].length;
|
|
136
137
|
const rawText = match[2];
|
|
137
138
|
const { text: text2, classes: classes2, id: customId } = extractAttributes(rawText);
|
|
138
|
-
const
|
|
139
|
+
const baseId = customId || generateId(text2.replace(/->|<-/g, ""));
|
|
140
|
+
let id2 = baseId;
|
|
141
|
+
let n = 1;
|
|
142
|
+
while (usedIds.has(id2)) {
|
|
143
|
+
n++;
|
|
144
|
+
id2 = `${baseId}-${n}`;
|
|
145
|
+
}
|
|
146
|
+
usedIds.add(id2);
|
|
139
147
|
result.push({ type: "header", level, text: text2, id: id2, classes: classes2 || void 0 });
|
|
140
148
|
i++;
|
|
141
149
|
continue;
|