nuartz 0.1.5 → 0.1.7

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.
Files changed (45) hide show
  1. package/dist/__tests__/backlinks.test.js +48 -50
  2. package/dist/__tests__/backlinks.test.js.map +1 -1
  3. package/dist/__tests__/fs.test.js +100 -105
  4. package/dist/__tests__/fs.test.js.map +1 -1
  5. package/dist/__tests__/markdown.test.js +61 -63
  6. package/dist/__tests__/markdown.test.js.map +1 -1
  7. package/dist/__tests__/search.test.js +52 -54
  8. package/dist/__tests__/search.test.js.map +1 -1
  9. package/dist/backlinks.js +2 -6
  10. package/dist/backlinks.js.map +1 -1
  11. package/dist/config.js +1 -4
  12. package/dist/config.js.map +1 -1
  13. package/dist/fs.js +16 -24
  14. package/dist/fs.js.map +1 -1
  15. package/dist/index.js +11 -28
  16. package/dist/index.js.map +1 -1
  17. package/dist/markdown.js +44 -50
  18. package/dist/markdown.js.map +1 -1
  19. package/dist/plugins/arrows.js +3 -7
  20. package/dist/plugins/arrows.js.map +1 -1
  21. package/dist/plugins/callout.js +3 -7
  22. package/dist/plugins/callout.js.map +1 -1
  23. package/dist/plugins/callout.test.js +39 -44
  24. package/dist/plugins/callout.test.js.map +1 -1
  25. package/dist/plugins/comment.js +3 -7
  26. package/dist/plugins/comment.js.map +1 -1
  27. package/dist/plugins/comment.test.js +32 -37
  28. package/dist/plugins/comment.test.js.map +1 -1
  29. package/dist/plugins/highlight.js +3 -7
  30. package/dist/plugins/highlight.js.map +1 -1
  31. package/dist/plugins/highlight.test.js +28 -33
  32. package/dist/plugins/highlight.test.js.map +1 -1
  33. package/dist/plugins/tag.js +3 -7
  34. package/dist/plugins/tag.js.map +1 -1
  35. package/dist/plugins/tag.test.js +42 -47
  36. package/dist/plugins/tag.test.js.map +1 -1
  37. package/dist/plugins/wikilink.js +3 -7
  38. package/dist/plugins/wikilink.js.map +1 -1
  39. package/dist/plugins/wikilink.test.js +54 -59
  40. package/dist/plugins/wikilink.test.js.map +1 -1
  41. package/dist/search.js +1 -4
  42. package/dist/search.js.map +1 -1
  43. package/dist/types.js +1 -2
  44. package/package.json +25 -5
  45. package/styles/prose.css +254 -0
@@ -0,0 +1,254 @@
1
+ /*
2
+ * nuartz prose styles
3
+ * Requires shadcn CSS variables (--border, --foreground, --muted, --muted-foreground, etc.)
4
+ *
5
+ * Usage:
6
+ * import "nuartz/styles.css"
7
+ * <article class="prose" dangerouslySetInnerHTML={{ __html }} />
8
+ *
9
+ * IMPORTANT: Uses var(--xxx) directly, NOT hsl(var(--xxx)).
10
+ * Modern shadcn (Tailwind v4) defines variables as oklch/lab values,
11
+ * so hsl() wrapping would produce invalid CSS like hsl(lab(...)).
12
+ */
13
+
14
+ /* ── Prose base ──────────────────────────────────── */
15
+ .prose {
16
+ color: var(--foreground);
17
+ line-height: 1.7;
18
+ }
19
+
20
+ /* ── Headings ────────────────────────────────────── */
21
+ .prose h1, .prose h2, .prose h3,
22
+ .prose h4, .prose h5, .prose h6 {
23
+ color: var(--foreground);
24
+ font-weight: 600;
25
+ letter-spacing: -0.025em;
26
+ scroll-margin-top: 5rem;
27
+ }
28
+ .prose h1 { font-size: 1.75rem; margin: 2.25rem 0 1rem; font-weight: 700; }
29
+ .prose h2 { font-size: 1.4rem; margin: 1.9rem 0 1rem; }
30
+ .prose h3 { font-size: 1.12rem; margin: 1.62rem 0 1rem; }
31
+ .prose h4, .prose h5, .prose h6 { font-size: 1rem; margin: 1.5rem 0 1rem; }
32
+
33
+ /* Heading anchors */
34
+ .prose :is(h1, h2, h3, h4, h5, h6) a.heading-anchor {
35
+ display: inline-flex;
36
+ align-items: center;
37
+ margin-left: 0.4em;
38
+ color: color-mix(in srgb, var(--muted-foreground) 45%, transparent);
39
+ text-decoration: none !important;
40
+ opacity: 0;
41
+ transition: opacity 0.15s, color 0.15s;
42
+ cursor: pointer;
43
+ }
44
+ .prose :is(h1, h2, h3, h4, h5, h6) a.heading-anchor svg {
45
+ width: 0.8em;
46
+ height: 0.8em;
47
+ }
48
+ .prose :is(h1, h2, h3, h4, h5, h6):hover a.heading-anchor { opacity: 1; }
49
+ .prose :is(h1, h2, h3, h4, h5, h6) a.heading-anchor:hover { color: var(--foreground); }
50
+
51
+ /* ── Block elements ──────────────────────────────── */
52
+ .prose p { margin: 1rem 0; }
53
+ .prose ul { margin: 1rem 0; padding-left: 1.5rem; list-style-type: disc; }
54
+ .prose ol { margin: 1rem 0; padding-left: 1.5rem; list-style-type: decimal; }
55
+ .prose li { line-height: 1.7; }
56
+ .prose li + li { margin-top: 0.25rem; }
57
+
58
+ /* ── Links ───────────────────────────────────────── */
59
+ .prose a {
60
+ color: var(--foreground);
61
+ text-decoration: underline;
62
+ text-underline-offset: 2px;
63
+ text-decoration-color: color-mix(in srgb, var(--foreground) 30%, transparent);
64
+ transition: text-decoration-color 0.15s;
65
+ }
66
+ .prose a:hover {
67
+ text-decoration-color: color-mix(in srgb, var(--foreground) 70%, transparent);
68
+ }
69
+
70
+ /* ── Blockquote ──────────────────────────────────── */
71
+ .prose blockquote {
72
+ margin: 1rem 0;
73
+ padding-left: 1rem;
74
+ border-left: 3px solid color-mix(in srgb, var(--muted-foreground) 40%, transparent);
75
+ color: var(--muted-foreground);
76
+ font-style: italic;
77
+ }
78
+
79
+ /* ── Inline code ─────────────────────────────────── */
80
+ .prose code {
81
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
82
+ font-size: 0.9em;
83
+ background: var(--muted);
84
+ color: var(--foreground);
85
+ border-radius: 0.25rem;
86
+ padding: 0.1rem 0.375rem;
87
+ }
88
+ .prose code::before,
89
+ .prose code::after { content: none; }
90
+
91
+ /* ── Code blocks (pre) ───────────────────────────── */
92
+ .prose pre {
93
+ margin: 1rem 0;
94
+ overflow-x: auto;
95
+ border-radius: 0.5rem;
96
+ padding: 1rem;
97
+ border-width: 1px;
98
+ background: var(--muted);
99
+ }
100
+ .prose pre code {
101
+ background: transparent;
102
+ padding: 0;
103
+ font-size: 0.875rem;
104
+ }
105
+
106
+ /* ── Table (shadcn style) ────────────────────────── */
107
+ .prose table {
108
+ margin: 1rem 0;
109
+ width: 100%;
110
+ border-collapse: collapse;
111
+ font-size: 0.875rem;
112
+ }
113
+ .prose table th {
114
+ height: 2.5rem;
115
+ padding: 0.5rem;
116
+ text-align: left;
117
+ vertical-align: middle;
118
+ font-weight: 600;
119
+ color: var(--foreground);
120
+ border-bottom-width: 2px;
121
+ }
122
+ .prose table td {
123
+ padding: 0.5rem;
124
+ vertical-align: middle;
125
+ }
126
+ .prose table tr {
127
+ border-bottom-width: 1px;
128
+ transition: background-color 0.15s;
129
+ }
130
+ .prose table tr:last-child {
131
+ border-bottom-width: 0;
132
+ }
133
+ .prose table tr:hover {
134
+ background-color: var(--muted);
135
+ }
136
+
137
+ /* ── Horizontal rule ─────────────────────────────── */
138
+ .prose hr {
139
+ margin: 2rem 0;
140
+ height: 1px;
141
+ border: none;
142
+ background-color: var(--border);
143
+ }
144
+
145
+ /* ── Images ──────────────────────────────────────── */
146
+ .prose img {
147
+ margin: 1rem 0;
148
+ border-radius: 0.5rem;
149
+ max-width: 100%;
150
+ }
151
+ .prose p > img + em {
152
+ display: block;
153
+ transform: translateY(-0.75rem);
154
+ color: var(--muted-foreground);
155
+ font-size: 0.875rem;
156
+ text-align: center;
157
+ }
158
+
159
+ /* ── Checkbox ────────────────────────────────────── */
160
+ .prose input[type="checkbox"] {
161
+ margin-right: 0.5rem;
162
+ accent-color: var(--foreground);
163
+ }
164
+
165
+ /* ── Footnotes ───────────────────────────────────── */
166
+ .prose .footnotes {
167
+ margin-top: 2rem;
168
+ border-top-width: 1px;
169
+ padding-top: 1rem;
170
+ font-size: 0.875rem;
171
+ color: var(--muted-foreground);
172
+ }
173
+
174
+ /* ── Shiki dual-theme ────────────────────────────── */
175
+ [data-rehype-pretty-code-figure] span[style] {
176
+ color: var(--shiki-light) !important;
177
+ }
178
+ .dark [data-rehype-pretty-code-figure] span[style] {
179
+ color: var(--shiki-dark) !important;
180
+ }
181
+
182
+ /* ── Code blocks (rehype-pretty-code) ────────────── */
183
+ [data-rehype-pretty-code-figure] {
184
+ position: relative;
185
+ margin: 1rem 0;
186
+ }
187
+ [data-rehype-pretty-code-figure] pre {
188
+ overflow-x: auto;
189
+ padding: 0.75rem 1rem;
190
+ border-radius: 0.5rem;
191
+ border-width: 1px;
192
+ background: var(--muted);
193
+ font-size: 0.8125rem;
194
+ line-height: 1.7;
195
+ }
196
+
197
+ /* Language label */
198
+ .code-lang-label {
199
+ position: absolute;
200
+ top: 0.375rem;
201
+ right: 2.25rem;
202
+ font-size: 0.65rem;
203
+ font-family: ui-monospace, monospace;
204
+ text-transform: uppercase;
205
+ letter-spacing: 0.05em;
206
+ color: color-mix(in srgb, var(--muted-foreground) 60%, transparent);
207
+ user-select: none;
208
+ pointer-events: none;
209
+ }
210
+
211
+ /* Copy button — visible on hover */
212
+ [data-rehype-pretty-code-figure] .copy-code-btn {
213
+ opacity: 0;
214
+ transition: opacity 0.15s, color 0.15s, background-color 0.15s;
215
+ }
216
+ [data-rehype-pretty-code-figure]:hover .copy-code-btn {
217
+ opacity: 1;
218
+ }
219
+
220
+ /* Line styles */
221
+ [data-line] { padding: 0 0.5rem; }
222
+ [data-highlighted-line] { background-color: oklch(0.97 0.01 250 / 0.4); }
223
+ .dark [data-highlighted-line] { background-color: oklch(0.3 0.01 250 / 0.3); }
224
+
225
+ /* ── Wikilinks ───────────────────────────────────── */
226
+ .wikilink {
227
+ color: var(--foreground);
228
+ text-decoration: underline;
229
+ text-underline-offset: 2px;
230
+ text-decoration-color: color-mix(in srgb, var(--foreground) 30%, transparent);
231
+ transition: text-decoration-color 0.15s;
232
+ }
233
+ .wikilink:hover {
234
+ text-decoration-color: color-mix(in srgb, var(--foreground) 70%, transparent);
235
+ }
236
+ .wikilink.broken {
237
+ opacity: 0.5;
238
+ text-decoration-style: dashed;
239
+ }
240
+
241
+ /* ── Inline tags ─────────────────────────────────── */
242
+ a.tag {
243
+ display: inline-block;
244
+ border-radius: 9999px;
245
+ background: var(--muted);
246
+ padding: 0.125rem 0.375rem;
247
+ font-size: 0.75rem;
248
+ font-weight: 500;
249
+ color: var(--muted-foreground);
250
+ text-decoration: none;
251
+ }
252
+ a.tag:hover {
253
+ opacity: 0.8;
254
+ }