repoview 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "repoview",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "GitHub-like repo browsing for local Git repositories (Markdown, live reload, broken link scanner).",
7
+ "homepage": "https://github.com/h4x3rotab/repoview#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/h4x3rotab/repoview/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/h4x3rotab/repoview.git"
14
+ },
7
15
  "license": "MIT",
8
16
  "author": "Hang Yin <hangyin@phala.com>",
9
17
  "bin": {
package/public/app.css CHANGED
@@ -1,5 +1,5 @@
1
1
  :root {
2
- color-scheme: light;
2
+ color-scheme: light dark;
3
3
  --bg: #ffffff;
4
4
  --panel: #ffffff;
5
5
  --text: #24292f;
@@ -11,6 +11,20 @@
11
11
  --accent: #0969da;
12
12
  }
13
13
 
14
+ @media (prefers-color-scheme: dark) {
15
+ :root {
16
+ --bg: #0d1117;
17
+ --panel: #151b23;
18
+ --text: #f0f6fc;
19
+ --muted: #9198a1;
20
+ --border: #3d444d;
21
+ --subtleBg: #151b23;
22
+ --btn: #21262d;
23
+ --btnHover: #30363d;
24
+ --accent: #4493f8;
25
+ }
26
+ }
27
+
14
28
  html,
15
29
  body {
16
30
  height: 100%;
@@ -39,7 +53,7 @@ a {
39
53
  position: sticky;
40
54
  top: 0;
41
55
  z-index: 10;
42
- background: rgba(255, 255, 255, 0.92);
56
+ background: color-mix(in srgb, var(--bg) 92%, transparent);
43
57
  backdrop-filter: saturate(180%) blur(8px);
44
58
  border-bottom: 1px solid var(--border);
45
59
  }
@@ -117,7 +131,7 @@ a {
117
131
  padding: 3px 8px;
118
132
  border: 1px solid var(--border);
119
133
  border-radius: 999px;
120
- background: #fff;
134
+ background: var(--panel);
121
135
  }
122
136
 
123
137
  .mono {
@@ -149,7 +163,8 @@ a {
149
163
  }
150
164
 
151
165
  .crumb-sep {
152
- color: rgba(31, 35, 40, 0.28);
166
+ color: var(--muted);
167
+ opacity: 0.5;
153
168
  }
154
169
 
155
170
  .panel {
@@ -248,7 +263,7 @@ a {
248
263
  }
249
264
 
250
265
  .file-table tr:hover td {
251
- background: #f6f8fa;
266
+ background: var(--subtleBg);
252
267
  }
253
268
 
254
269
  .item {
@@ -300,19 +315,25 @@ a {
300
315
  margin: 0;
301
316
  padding: 16px;
302
317
  overflow: auto;
303
- background: #f6f8fa;
318
+ background: var(--subtleBg);
304
319
  }
305
320
 
306
321
  .note {
307
322
  padding: 12px;
308
323
  border: 1px solid var(--border);
309
324
  border-radius: 6px;
310
- background: #f6f8fa;
325
+ background: var(--subtleBg);
311
326
  }
312
327
 
313
328
  .error {
314
329
  padding: 12px;
315
- color: #cf222e;
330
+ color: var(--error, #cf222e);
331
+ }
332
+
333
+ @media (prefers-color-scheme: dark) {
334
+ .error {
335
+ color: #f85149;
336
+ }
316
337
  }
317
338
 
318
339
  .markdown-body .markdown-alert {
@@ -321,7 +342,7 @@ a {
321
342
  border: 1px solid var(--border);
322
343
  border-left-width: 4px;
323
344
  border-radius: 6px;
324
- background: #f6f8fa;
345
+ background: var(--subtleBg);
325
346
  }
326
347
 
327
348
  .markdown-body .markdown-alert-title {
@@ -353,7 +374,7 @@ a {
353
374
  padding: 12px;
354
375
  border: 1px solid var(--border);
355
376
  border-radius: 12px;
356
- background: #f6f8fa;
377
+ background: var(--subtleBg);
357
378
  overflow: auto;
358
379
  }
359
380
 
package/src/markdown.js CHANGED
@@ -288,7 +288,7 @@ export function createMarkdownRenderer() {
288
288
  "input",
289
289
  ],
290
290
  allowedAttributes: {
291
- "*": ["class", "id", "aria-label", "aria-hidden", "role"],
291
+ "*": ["class", "id", "aria-label", "aria-hidden", "role", "align"],
292
292
  a: ["href", "name", "title", "target", "rel", "tabindex"],
293
293
  img: ["src", "alt", "title", "width", "height", "loading"],
294
294
  input: ["type", "checked", "disabled"],
package/src/views.js CHANGED
@@ -44,8 +44,9 @@ function pageTemplate({ title, repoName, gitInfo, relPathPosix, bodyHtml }) {
44
44
  <meta charset="utf-8" />
45
45
  <meta name="viewport" content="width=device-width, initial-scale=1" />
46
46
  <title>${escapeHtml(title)}</title>
47
- <link rel="stylesheet" href="/static/vendor/github-markdown-css/github-markdown-light.css" />
48
- <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github.css" />
47
+ <link rel="stylesheet" href="/static/vendor/github-markdown-css/github-markdown.css" />
48
+ <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github.css" media="(prefers-color-scheme: light)" />
49
+ <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github-dark.css" media="(prefers-color-scheme: dark)" />
49
50
  <link rel="stylesheet" href="/static/vendor/katex/katex.min.css" />
50
51
  <link rel="stylesheet" href="/static/app.css" />
51
52
  </head>
@@ -138,8 +139,9 @@ function pageTemplateWithLinks({
138
139
  <meta charset="utf-8" />
139
140
  <meta name="viewport" content="width=device-width, initial-scale=1" />
140
141
  <title>${escapeHtml(title)}</title>
141
- <link rel="stylesheet" href="/static/vendor/github-markdown-css/github-markdown-light.css" />
142
- <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github.css" />
142
+ <link rel="stylesheet" href="/static/vendor/github-markdown-css/github-markdown.css" />
143
+ <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github.css" media="(prefers-color-scheme: light)" />
144
+ <link rel="stylesheet" href="/static/vendor/highlight.js/styles/github-dark.css" media="(prefers-color-scheme: dark)" />
143
145
  <link rel="stylesheet" href="/static/vendor/katex/katex.min.css" />
144
146
  <link rel="stylesheet" href="/static/app.css" />
145
147
  </head>