@wizzlethorpe/vaults 0.7.0 → 0.7.1
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/README.md +8 -7
- package/dist/build.js +425 -123
- package/dist/build.js.map +1 -1
- package/dist/commands/build.js +2 -1
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/password.js +1 -1
- package/dist/commands/password.js.map +1 -1
- package/dist/commands/patreon.js +24 -20
- package/dist/commands/patreon.js.map +1 -1
- package/dist/commands/preview.js +5 -4
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/push.js +7 -8
- package/dist/commands/push.js.map +1 -1
- package/dist/config.js +21 -10
- package/dist/config.js.map +1 -1
- package/dist/escape.js +29 -0
- package/dist/escape.js.map +1 -0
- package/dist/favicon.js +3 -36
- package/dist/favicon.js.map +1 -1
- package/dist/foundry-importer.js +61 -0
- package/dist/foundry-importer.js.map +1 -0
- package/dist/images.js +0 -30
- package/dist/images.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/migrate/0.6-legacy-auth-settings.js +3 -5
- package/dist/migrate/0.6-legacy-auth-settings.js.map +1 -1
- package/dist/migrate/0.7-vaults-dir.js +4 -0
- package/dist/migrate/0.7-vaults-dir.js.map +1 -1
- package/dist/migrate/registry.js +1 -7
- package/dist/migrate/registry.js.map +1 -1
- package/dist/paths.js +21 -6
- package/dist/paths.js.map +1 -1
- package/dist/render/auth-template.js +21 -142
- package/dist/render/auth-template.js.map +1 -1
- package/dist/render/bases.js +56 -44
- package/dist/render/bases.js.map +1 -1
- package/dist/render/callouts.js +29 -10
- package/dist/render/callouts.js.map +1 -1
- package/dist/render/embed.js +124 -26
- package/dist/render/embed.js.map +1 -1
- package/dist/render/extensions.js +68 -0
- package/dist/render/extensions.js.map +1 -0
- package/dist/render/external-links.js +32 -0
- package/dist/render/external-links.js.map +1 -0
- package/dist/render/frontmatter.js +17 -0
- package/dist/render/frontmatter.js.map +1 -0
- package/dist/render/handlers/assets.js +48 -15
- package/dist/render/handlers/assets.js.map +1 -1
- package/dist/render/handlers/builtin/battlemap.js +199 -0
- package/dist/render/handlers/builtin/battlemap.js.map +1 -0
- package/dist/render/handlers/builtin/dice.js +1 -1
- package/dist/render/handlers/builtin/dice.js.map +1 -1
- package/dist/render/handlers/builtin/fm-code.js +50 -0
- package/dist/render/handlers/builtin/fm-code.js.map +1 -0
- package/dist/render/handlers/builtin/fm.js +6 -12
- package/dist/render/handlers/builtin/fm.js.map +1 -1
- package/dist/render/handlers/builtin/index.js +5 -1
- package/dist/render/handlers/builtin/index.js.map +1 -1
- package/dist/render/handlers/builtin/inline-format.js +26 -0
- package/dist/render/handlers/builtin/inline-format.js.map +1 -0
- package/dist/render/handlers/builtin/statblock.js +158 -18
- package/dist/render/handlers/builtin/statblock.js.map +1 -1
- package/dist/render/handlers/dispatch.js +15 -20
- package/dist/render/handlers/dispatch.js.map +1 -1
- package/dist/render/handlers/types.js +41 -21
- package/dist/render/handlers/types.js.map +1 -1
- package/dist/render/image-srcs.js +42 -0
- package/dist/render/image-srcs.js.map +1 -0
- package/dist/render/layout.js +60 -9
- package/dist/render/layout.js.map +1 -1
- package/dist/render/pipeline.js +23 -10
- package/dist/render/pipeline.js.map +1 -1
- package/dist/render/preview.js +53 -18
- package/dist/render/preview.js.map +1 -1
- package/dist/render/slug.js +5 -0
- package/dist/render/slug.js.map +1 -1
- package/dist/render/styles.js +94 -14
- package/dist/render/styles.js.map +1 -1
- package/dist/render/wikilink.js +15 -4
- package/dist/render/wikilink.js.map +1 -1
- package/dist/scan.js +1 -1
- package/dist/scan.js.map +1 -1
- package/dist/settings.js +16 -1
- package/dist/settings.js.map +1 -1
- package/dist/version.js +36 -0
- package/dist/version.js.map +1 -0
- package/package.json +2 -1
package/dist/render/preview.js
CHANGED
|
@@ -2,24 +2,62 @@ import { unified } from "unified";
|
|
|
2
2
|
import remarkParse from "remark-parse";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
4
|
import remarkRehype from "remark-rehype";
|
|
5
|
+
import rehypeRaw from "rehype-raw";
|
|
5
6
|
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
6
7
|
import rehypeStringify from "rehype-stringify";
|
|
7
8
|
import { slugify } from "./slug.js";
|
|
9
|
+
import { stripFrontmatter } from "./frontmatter.js";
|
|
10
|
+
import { handlersPlugin } from "./handlers/dispatch.js";
|
|
11
|
+
import { htmlEscape } from "../escape.js";
|
|
8
12
|
const SUMMARY_CHARS = 320;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.use(remarkRehype)
|
|
13
|
-
.use(rehypeSanitize, {
|
|
13
|
+
// Span/code className survive sanitisation so handler output like
|
|
14
|
+
// <span class="fm-value">…</span> keeps its styling hook in the popover.
|
|
15
|
+
const previewSanitizeSchema = {
|
|
14
16
|
...defaultSchema,
|
|
15
|
-
// Strip away anything heavy or risky for a tiny popover.
|
|
16
17
|
tagNames: defaultSchema.tagNames?.filter((t) => !["img", "iframe", "video"].includes(t)),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
attributes: {
|
|
19
|
+
...defaultSchema.attributes,
|
|
20
|
+
"*": [...(defaultSchema.attributes?.["*"] ?? []), "className"],
|
|
21
|
+
code: ["className", "title"],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
// handlersPlugin needs a HandlerContext; an empty no-op plugin keeps the
|
|
25
|
+
// pipeline shape identical when no handler context is supplied so we don't
|
|
26
|
+
// have to fork the chain type.
|
|
27
|
+
const noopRemarkPlugin = () => () => { };
|
|
28
|
+
function buildPipeline(opts) {
|
|
29
|
+
// allowDangerousHtml + rehypeRaw are needed so HTML emitted by handlers
|
|
30
|
+
// (e.g. fm's <span>) survives into the rendered output instead of being
|
|
31
|
+
// dropped as raw nodes at the markdown→hast boundary.
|
|
32
|
+
return unified()
|
|
33
|
+
.use(remarkParse)
|
|
34
|
+
.use(remarkGfm)
|
|
35
|
+
.use(opts ? handlersPlugin({
|
|
36
|
+
registry: opts.registry,
|
|
37
|
+
context: {
|
|
38
|
+
pagePath: opts.pagePath,
|
|
39
|
+
frontmatter: opts.frontmatter,
|
|
40
|
+
render: opts.renderContext,
|
|
41
|
+
escape: htmlEscape,
|
|
42
|
+
},
|
|
43
|
+
}) : noopRemarkPlugin)
|
|
44
|
+
.use(remarkRehype, { allowDangerousHtml: true })
|
|
45
|
+
.use(rehypeRaw)
|
|
46
|
+
.use(rehypeSanitize, previewSanitizeSchema)
|
|
47
|
+
.use(rehypeStringify);
|
|
48
|
+
}
|
|
49
|
+
export async function buildPreview(rawMarkdown, title, opts) {
|
|
50
|
+
// Strip frontmatter, Obsidian %% comments %%, and fenced code blocks
|
|
51
|
+
// before walking the body. Code fences render as a wall of source text
|
|
52
|
+
// in a tiny hover popover, which looks worse than just omitting them —
|
|
53
|
+
// same rationale as the table skip in truncateMarkdown.
|
|
54
|
+
const body = stripFrontmatter(rawMarkdown)
|
|
55
|
+
.replace(/%%[\s\S]*?%%/g, "")
|
|
56
|
+
.replace(/^```[\s\S]*?^```[^\n]*$/gm, "")
|
|
57
|
+
.replace(/^~~~[\s\S]*?^~~~[^\n]*$/gm, "")
|
|
58
|
+
.trim();
|
|
59
|
+
const pipeline = buildPipeline(opts);
|
|
60
|
+
const summary = await renderSnippet(body, pipeline);
|
|
23
61
|
const headings = {};
|
|
24
62
|
// Match headings even when nested inside a callout/blockquote.
|
|
25
63
|
const sectionRe = /^(?:>\s*)?(#{1,6})\s+(.+)$/gm;
|
|
@@ -34,7 +72,7 @@ export async function buildPreview(rawMarkdown, title) {
|
|
|
34
72
|
const anchor = slugify(headingTitle);
|
|
35
73
|
headings[anchor] = {
|
|
36
74
|
title: headingTitle,
|
|
37
|
-
summary: await renderSnippet(sectionBody),
|
|
75
|
+
summary: await renderSnippet(sectionBody, pipeline),
|
|
38
76
|
};
|
|
39
77
|
}
|
|
40
78
|
return { title, summary, headings };
|
|
@@ -43,11 +81,11 @@ export async function buildPreview(rawMarkdown, title) {
|
|
|
43
81
|
* Truncate the markdown to the first ~SUMMARY_CHARS of body content (skipping
|
|
44
82
|
* headings, image embeds, tables) and render it to sanitised HTML.
|
|
45
83
|
*/
|
|
46
|
-
async function renderSnippet(source) {
|
|
84
|
+
async function renderSnippet(source, pipeline) {
|
|
47
85
|
const truncated = truncateMarkdown(source.trim(), SUMMARY_CHARS);
|
|
48
86
|
if (!truncated)
|
|
49
87
|
return "";
|
|
50
|
-
const file = await
|
|
88
|
+
const file = await pipeline.process(truncated);
|
|
51
89
|
return String(file).trim();
|
|
52
90
|
}
|
|
53
91
|
function truncateMarkdown(source, maxChars) {
|
|
@@ -75,7 +113,4 @@ function truncateMarkdown(source, maxChars) {
|
|
|
75
113
|
}
|
|
76
114
|
return out.join("\n\n");
|
|
77
115
|
}
|
|
78
|
-
function stripFrontmatter(s) {
|
|
79
|
-
return s.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/, "");
|
|
80
|
-
}
|
|
81
116
|
//# sourceMappingURL=preview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../src/render/preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,cAAc,EAAE,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../src/render/preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW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ases plugin. The "sibling-import
|
|
13
|
+
// avoidance" comment in bases.ts predates the current shape of slug.ts (which
|
|
14
|
+
// has no imports of its own), so a direct re-export is fine — the alias is
|
|
15
|
+
// kept so existing call sites don't churn.
|
|
16
|
+
export { slugify as slugifySimple };
|
|
12
17
|
//# sourceMappingURL=slug.js.map
|
package/dist/render/slug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../src/render/slug.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI;SACR,SAAS,CAAC,MAAM,CAAC;SACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,WAAW,EAAE;SACb,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../src/render/slug.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI;SACR,SAAS,CAAC,MAAM,CAAC;SACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,WAAW,EAAE;SACb,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,sEAAsE;AACtE,8EAA8E;AAC9E,2EAA2E;AAC3E,2CAA2C;AAC3C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,CAAC"}
|
package/dist/render/styles.js
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
// Theme + layout styles for the rendered wiki. Self-contained, no build step.
|
|
2
2
|
// Single light theme: parchment + scarlet.
|
|
3
3
|
/**
|
|
4
|
-
* Per-vault theme overrides. When `accent_color
|
|
5
|
-
* settings.md, append this
|
|
6
|
-
* shades (--accent-soft,
|
|
7
|
-
*
|
|
4
|
+
* Per-vault theme overrides. When any of `accent_color`, `bg_color`,
|
|
5
|
+
* `accent_color_dark`, `bg_color_dark` are set in settings.md, append this
|
|
6
|
+
* block after DEFAULT_CSS so it wins. The derived shades (--accent-soft,
|
|
7
|
+
* --wikilink-bg, --rule, etc) are recomputed via color-mix so they stay
|
|
8
|
+
* coherent with whatever colors the user picked.
|
|
9
|
+
*
|
|
10
|
+
* Dark overrides target both the explicit `[data-theme="dark"]` selector
|
|
11
|
+
* and the auto/prefers-dark form, so a vault setting `bg_color_dark`
|
|
12
|
+
* applies whether the visitor forced dark or arrived via OS preference.
|
|
8
13
|
*/
|
|
9
14
|
export function renderThemeOverride(opts) {
|
|
10
15
|
const blocks = [];
|
|
11
16
|
if (opts.lightAccent)
|
|
12
17
|
blocks.push(accentBlock(":root", opts.lightAccent));
|
|
13
18
|
if (opts.lightBg)
|
|
14
|
-
blocks.push(bgBlock(":root", opts.lightBg));
|
|
19
|
+
blocks.push(bgBlock(":root", opts.lightBg, "light"));
|
|
20
|
+
if (opts.darkAccent) {
|
|
21
|
+
blocks.push(accentBlock(`:root[data-theme="dark"]`, opts.darkAccent));
|
|
22
|
+
blocks.push(`@media (prefers-color-scheme: dark) {\n${accentBlock(` :root[data-theme="auto"]`, opts.darkAccent)}\n}`);
|
|
23
|
+
}
|
|
24
|
+
if (opts.darkBg) {
|
|
25
|
+
blocks.push(bgBlock(`:root[data-theme="dark"]`, opts.darkBg, "dark"));
|
|
26
|
+
blocks.push(`@media (prefers-color-scheme: dark) {\n${bgBlock(` :root[data-theme="auto"]`, opts.darkBg, "dark")}\n}`);
|
|
27
|
+
}
|
|
15
28
|
if (!blocks.length)
|
|
16
29
|
return "";
|
|
17
30
|
return "\n\n/* User theme overrides (settings.md) */\n" + blocks.join("\n");
|
|
18
31
|
}
|
|
19
|
-
|
|
32
|
+
/** `--rule` is a slightly off-bg shade for hairlines + borders. In light
|
|
33
|
+
* mode that means "darker than bg"; in dark mode the relationship inverts
|
|
34
|
+
* to "lighter than bg" or the rule disappears against the background. */
|
|
35
|
+
function bgBlock(selector, color, mode) {
|
|
36
|
+
const tint = mode === "light" ? "#000" : "#fff";
|
|
20
37
|
return `${selector} {
|
|
21
38
|
--bg: ${color};
|
|
22
|
-
--rule: color-mix(in srgb, ${color} 85%,
|
|
39
|
+
--rule: color-mix(in srgb, ${color} 85%, ${tint});
|
|
23
40
|
}`;
|
|
24
41
|
}
|
|
25
42
|
function accentBlock(selector, color) {
|
|
@@ -38,6 +55,26 @@ export const DEFAULT_CSS = `:root {
|
|
|
38
55
|
--max-width: 56rem;
|
|
39
56
|
font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
|
|
40
57
|
}
|
|
58
|
+
/* Dark palette: deep warm bg, brighter scarlet for readable contrast.
|
|
59
|
+
Activates when settings.theme = "dark", or when the visitor's OS prefers
|
|
60
|
+
dark and settings.theme = "auto". The light defaults above are the base;
|
|
61
|
+
these vars override only when [data-theme=...] matches. */
|
|
62
|
+
:root[data-theme="dark"],
|
|
63
|
+
:root[data-theme="dark"] body {
|
|
64
|
+
--bg: #1d1a17; --fg: #e8dec8; --muted: #9a8e78;
|
|
65
|
+
--accent: #d35550; --accent-soft: #e87a75; --accent-fg: #1d1a17;
|
|
66
|
+
--rule: #3a342d;
|
|
67
|
+
--wikilink-bg: rgba(211,85,80,0.16); --wikilink-bg-hover: rgba(211,85,80,0.28);
|
|
68
|
+
}
|
|
69
|
+
@media (prefers-color-scheme: dark) {
|
|
70
|
+
:root[data-theme="auto"],
|
|
71
|
+
:root[data-theme="auto"] body {
|
|
72
|
+
--bg: #1d1a17; --fg: #e8dec8; --muted: #9a8e78;
|
|
73
|
+
--accent: #d35550; --accent-soft: #e87a75; --accent-fg: #1d1a17;
|
|
74
|
+
--rule: #3a342d;
|
|
75
|
+
--wikilink-bg: rgba(211,85,80,0.16); --wikilink-bg-hover: rgba(211,85,80,0.28);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
41
78
|
* { box-sizing: border-box; }
|
|
42
79
|
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6; }
|
|
43
80
|
a { color: var(--accent); text-decoration: none; }
|
|
@@ -63,8 +100,18 @@ article a.internal.new, article a.internal.is-unresolved { opacity: 0.7; font-st
|
|
|
63
100
|
.app-grid {
|
|
64
101
|
display: grid; grid-template-columns: 15rem minmax(0, 56rem) 17rem;
|
|
65
102
|
gap: 2.5rem; max-width: 96rem; margin: 0 auto; padding: 1.5rem;
|
|
66
|
-
|
|
67
|
-
|
|
103
|
+
/* Sticky-footer plumbing: the grid fills the viewport so the main
|
|
104
|
+
column can stretch even when the article is short, and the flex
|
|
105
|
+
column inside main (below) pushes the footer to its bottom. */
|
|
106
|
+
min-height: 100vh; box-sizing: border-box;
|
|
107
|
+
}
|
|
108
|
+
main {
|
|
109
|
+
display: flex; flex-direction: column;
|
|
110
|
+
padding: 2rem 0 0; min-width: 0;
|
|
111
|
+
}
|
|
112
|
+
/* Article grows to absorb spare space; the footer falls naturally to
|
|
113
|
+
the bottom of main whatever the article's intrinsic height. */
|
|
114
|
+
main > article { flex: 1 0 auto; }
|
|
68
115
|
.sidebar { padding: 1.5rem 1.5rem 1.5rem 0; border-right: 1px solid var(--rule); font-size: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
|
|
69
116
|
/* Visual break between the header group (brand/search/auth) and the sitemap. */
|
|
70
117
|
.sidebar > nav:last-child { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
|
|
@@ -78,7 +125,7 @@ main { padding: 2rem 0 4rem; min-width: 0; }
|
|
|
78
125
|
.app-grid { grid-template-columns: 1fr; gap: 0; padding: 0.75rem; max-width: 100%; }
|
|
79
126
|
.sidebar { border: none; padding: 0.5rem 0 0; }
|
|
80
127
|
.rightbar { display: none; }
|
|
81
|
-
main { padding: 0.5rem 0
|
|
128
|
+
main { padding: 0.5rem 0 0; }
|
|
82
129
|
article h1 { font-size: 2rem; }
|
|
83
130
|
article h2 { font-size: 1.4rem; }
|
|
84
131
|
}
|
|
@@ -121,6 +168,37 @@ main { padding: 2rem 0 4rem; min-width: 0; }
|
|
|
121
168
|
.search-result-folder { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem; }
|
|
122
169
|
.search-empty { padding: 0.75rem; color: var(--muted); font-style: italic; font-size: 0.85rem; }
|
|
123
170
|
|
|
171
|
+
/* Sidebar row that holds the theme toggle (always present) and, on
|
|
172
|
+
multi-role builds, the auth box. Lays them out left-to-right with the
|
|
173
|
+
auth box absorbing remaining width so its existing button styling stays
|
|
174
|
+
correct regardless of theme-toggle width. */
|
|
175
|
+
.sidebar-row {
|
|
176
|
+
display: flex; align-items: center; gap: 0.5rem;
|
|
177
|
+
}
|
|
178
|
+
.sidebar-row > .auth-box { flex: 1; min-width: 0; }
|
|
179
|
+
|
|
180
|
+
/* Theme toggle: small square icon button matching the auth-box height so
|
|
181
|
+
they line up. Sun icon when current theme is dark (click → switch to
|
|
182
|
+
light); moon icon when current is light. The script paints the icon. */
|
|
183
|
+
.theme-toggle {
|
|
184
|
+
flex: 0 0 auto;
|
|
185
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
186
|
+
width: 2rem; height: 2rem;
|
|
187
|
+
padding: 0; margin: 0;
|
|
188
|
+
background: transparent;
|
|
189
|
+
color: var(--accent);
|
|
190
|
+
border: 1px solid var(--rule);
|
|
191
|
+
border-radius: 4px;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
|
|
194
|
+
}
|
|
195
|
+
.theme-toggle:hover {
|
|
196
|
+
background: var(--wikilink-bg);
|
|
197
|
+
border-color: var(--accent-soft);
|
|
198
|
+
}
|
|
199
|
+
.theme-toggle .theme-toggle-icon { display: inline-flex; }
|
|
200
|
+
.theme-toggle .theme-toggle-icon svg { display: block; }
|
|
201
|
+
|
|
124
202
|
/* Auth box; sits under the search box; populated by JS from a non-HttpOnly
|
|
125
203
|
display cookie set by the Function on login. */
|
|
126
204
|
.auth-box {
|
|
@@ -145,7 +223,8 @@ main { padding: 2rem 0 4rem; min-width: 0; }
|
|
|
145
223
|
width: 100%;
|
|
146
224
|
display: block;
|
|
147
225
|
text-align: center;
|
|
148
|
-
padding: 0.
|
|
226
|
+
padding: 0.55rem 0.75rem;
|
|
227
|
+
line-height: 1;
|
|
149
228
|
border-radius: 4px;
|
|
150
229
|
border: 1px solid var(--accent);
|
|
151
230
|
background: transparent;
|
|
@@ -165,7 +244,8 @@ main { padding: 2rem 0 4rem; min-width: 0; }
|
|
|
165
244
|
/* Signed-in auth UI: keep status on the left and present Sign out as a
|
|
166
245
|
right-side action split by a divider. */
|
|
167
246
|
.auth-box.auth-signed-in {
|
|
168
|
-
|
|
247
|
+
height: 2rem;
|
|
248
|
+
padding: 0 0.35rem 0 0.65rem;
|
|
169
249
|
flex-wrap: nowrap;
|
|
170
250
|
gap: 0;
|
|
171
251
|
}
|
|
@@ -182,12 +262,12 @@ main { padding: 2rem 0 4rem; min-width: 0; }
|
|
|
182
262
|
align-items: center;
|
|
183
263
|
justify-content: center;
|
|
184
264
|
margin-left: auto;
|
|
185
|
-
padding: 0.
|
|
265
|
+
padding: 0.25rem 0.6rem;
|
|
186
266
|
border-left: 1px solid var(--rule);
|
|
187
267
|
border-radius: 0;
|
|
188
268
|
text-decoration: none;
|
|
189
269
|
font-weight: 600;
|
|
190
|
-
line-height: 1
|
|
270
|
+
line-height: 1;
|
|
191
271
|
white-space: nowrap;
|
|
192
272
|
}
|
|
193
273
|
.auth-box.auth-signed-in .auth-action:hover {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/render/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAy0B1B,CAAC"}
|
package/dist/render/wikilink.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { findAndReplace } from "mdast-util-find-and-replace";
|
|
2
2
|
import { slugify } from "./slug.js";
|
|
3
|
-
// Matches [[Page]], [[Page|alias]], [[Page#anchor]], [[Page#anchor|alias]]
|
|
4
|
-
//
|
|
5
|
-
|
|
3
|
+
// Matches [[Page]], [[Page|alias]], [[Page#anchor]], [[Page#anchor|alias]],
|
|
4
|
+
// and chained [[Page#H1#H2]] (Obsidian's nested-heading form). Negative
|
|
5
|
+
// lookbehind blocks ![[embed]] from being consumed here.
|
|
6
|
+
//
|
|
7
|
+
// The anchor capture allows `#` so chained headings parse as a single
|
|
8
|
+
// anchor string; the resolver below splits on `#` and uses the deepest
|
|
9
|
+
// segment for the URL fragment.
|
|
10
|
+
const WIKILINK_RE = /(?<!!)(?<!\[)\[\[([^\[\]|#\n]+?)(?:#([^\[\]|\n]+?))?(?:\|([^\[\]#\n]+?))?\]\]/g;
|
|
6
11
|
export function wikiLinkPlugin(opts) {
|
|
7
12
|
return () => (tree) => {
|
|
8
13
|
findAndReplace(tree, [
|
|
@@ -10,7 +15,13 @@ export function wikiLinkPlugin(opts) {
|
|
|
10
15
|
WIKILINK_RE,
|
|
11
16
|
(_match, rawName, rawAnchor, rawAlias) => {
|
|
12
17
|
const name = rawName.trim();
|
|
13
|
-
|
|
18
|
+
// Chained heading anchors like `H1#H2` resolve to the deepest segment
|
|
19
|
+
// (the actual heading the reader lands on); the URL fragment is just
|
|
20
|
+
// that final slug since rehype-slug emits one slug per heading.
|
|
21
|
+
const rawAnchorTrimmed = rawAnchor?.trim();
|
|
22
|
+
const anchor = rawAnchorTrimmed?.includes("#")
|
|
23
|
+
? rawAnchorTrimmed.split("#").map((s) => s.trim()).filter(Boolean).pop()
|
|
24
|
+
: rawAnchorTrimmed;
|
|
14
25
|
const display = rawAlias?.trim() ?? name;
|
|
15
26
|
const slug = slugify(name);
|
|
16
27
|
// Resolution order:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wikilink.js","sourceRoot":"","sources":["../../src/render/wikilink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"wikilink.js","sourceRoot":"","sources":["../../src/render/wikilink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,4EAA4E;AAC5E,wEAAwE;AACxE,yDAAyD;AACzD,EAAE;AACF,sEAAsE;AACtE,uEAAuE;AACvE,gCAAgC;AAChC,MAAM,WAAW,GAAG,gFAAgF,CAAC;AAErG,MAAM,UAAU,cAAc,CAAC,IAM9B;IACC,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE;QACpB,cAAc,CAAC,IAAI,EAAE;YACnB;gBACE,WAAW;gBACX,CAAC,MAAc,EAAE,OAAe,EAAE,SAAkB,EAAE,QAAiB,EAAE,EAAE;oBACzE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;oBAC5B,sEAAsE;oBACtE,qEAAqE;oBACrE,gEAAgE;oBAChE,MAAM,gBAAgB,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC;oBAC3C,MAAM,MAAM,GAAG,gBAAgB,EAAE,QAAQ,CAAC,GAAG,CAAC;wBAC5C,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAA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,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBACnH,CAAC,CAAC,GAAG,CAAC;oBAER,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ;wBAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACzD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;wBAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;oBAEtF,0EAA0E;oBAC1E,0EAA0E;oBAC1E,mBAAmB;oBACnB,MAAM,SAAS,GAAG,IAAI,IAAI,IAAI;wBAC5B,CAAC,CAAC,CAAC,UAAU,EAAE,eAAe,CAAC;wBAC/B,CAAC,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;oBAE1D,MAAM,IAAI,GAAS;wBACjB,IAAI,EAAE,MAAM;wBACZ,GAAG,EAAE,IAAI;wBACT,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAiB,CAAC;wBAC3D,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,EAAE;qBACrC,CAAC;oBACF,OAAO,IAAI,CAAC;gBACd,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/scan.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readdir, readFile, stat } from "node:fs/promises";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { join, relative, sep } from "node:path";
|
|
4
|
-
const IGNORED_DIRS = new Set([".git", ".obsidian", ".trash", "node_modules", ".
|
|
4
|
+
const IGNORED_DIRS = new Set([".git", ".obsidian", ".trash", "node_modules", ".vaults"]);
|
|
5
5
|
const IGNORED_FILES = new Set([".DS_Store", ".vaultrc.json"]);
|
|
6
6
|
export async function scanVault(root) {
|
|
7
7
|
const out = [];
|
package/dist/scan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAgBhD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAgBhD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;AACzF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;AAE9D,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,GAAG,GAAkB,EAAE,CAAC;IAC9B,MAAM,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,GAA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Q,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;QAClD,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAC9C,QAAQ,EAAE,GAAG;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAClD,KAAK;YACL,SAAS;SACV,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/settings.js
CHANGED
|
@@ -50,7 +50,22 @@ const SCHEMA = {
|
|
|
50
50
|
bg_color: {
|
|
51
51
|
default: "",
|
|
52
52
|
type: "string",
|
|
53
|
-
description: "Override the background color. Any CSS color works: '#f4ecd8', 'wheat', 'rgb(244 236 216)'. Empty = use the built-in parchment.",
|
|
53
|
+
description: "Override the background color for the light palette. Any CSS color works: '#f4ecd8', 'wheat', 'rgb(244 236 216)'. Empty = use the built-in parchment.",
|
|
54
|
+
},
|
|
55
|
+
accent_color_dark: {
|
|
56
|
+
default: "",
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Override the accent color for the dark palette. Any CSS color works. Empty = use the built-in dark accent (a brighter scarlet).",
|
|
59
|
+
},
|
|
60
|
+
bg_color_dark: {
|
|
61
|
+
default: "",
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Override the background color for the dark palette. Any CSS color works. Empty = use the built-in deep warm dark.",
|
|
64
|
+
},
|
|
65
|
+
theme: {
|
|
66
|
+
default: "auto",
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Default colour theme: 'auto' (follows the visitor's OS preference), 'light' (parchment + scarlet), or 'dark'. Visitors can flip via the sidebar toggle; their choice persists in localStorage.",
|
|
54
69
|
},
|
|
55
70
|
favicon: {
|
|
56
71
|
default: "",
|
package/dist/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AAsCjC,MAAM,MAAM,GAA6C;IACvD,UAAU,EAAE;QACV,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,8DAA8D;KAC5E;IACD,aAAa,EAAE;QACb,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6DAA6D;KAC3E;IACD,cAAc,EAAE;QACd,OAAO,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;QACzB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,iEAAiE;KAC/E;IACD,MAAM,EAAE;QACN,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,kHAAkH;KACrH;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EACT,+IAA+I;KAClJ;IACD,mBAAmB,EAAE;QACnB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,oLAAoL;KACvL;IACD,aAAa,EAAE;QACb,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,SAAS;QACf,WAAW,EACT,wEAAwE;KAC3E;IACD,YA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,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Single source of truth for the CLI's runtime-visible version.
|
|
2
|
+
//
|
|
3
|
+
// Read once at module load from package.json so a release-time bump
|
|
4
|
+
// propagates to:
|
|
5
|
+
// - `vaults --version`
|
|
6
|
+
// - the manifest's `cli_version` field (so synced clients can warn on
|
|
7
|
+
// skew between the CLI that built the deploy and the client reading it)
|
|
8
|
+
// - any future place that needs to identify the CLI's own version
|
|
9
|
+
//
|
|
10
|
+
// The manifest also carries `manifest_version` (incremented on breaking
|
|
11
|
+
// shape changes) and `id_scheme` (for entry-id derivation), declared here
|
|
12
|
+
// because they're protocol-level constants that travel with the CLI.
|
|
13
|
+
import { readFile } from "node:fs/promises";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { dirname, resolve } from "node:path";
|
|
16
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
// Package.json sits next to dist/ at runtime, and next to src/ in dev.
|
|
18
|
+
const pkgPath = resolve(here, "..", "package.json");
|
|
19
|
+
const pkg = JSON.parse(await readFile(pkgPath, "utf8"));
|
|
20
|
+
export const CLI_VERSION = pkg.version;
|
|
21
|
+
/**
|
|
22
|
+
* Manifest schema/protocol version. Increment on breaking shape changes
|
|
23
|
+
* (renamed top-level fields, removed fields, semantic shifts). Additive
|
|
24
|
+
* changes don't bump it — clients should ignore unknown fields.
|
|
25
|
+
*/
|
|
26
|
+
export const MANIFEST_VERSION = 1;
|
|
27
|
+
/**
|
|
28
|
+
* Document-id derivation scheme, advertised in the manifest so a future
|
|
29
|
+
* algorithm change (e.g. SHA-1 → SHA-256, longer slice) can be detected
|
|
30
|
+
* by clients holding entries derived under an older scheme.
|
|
31
|
+
*
|
|
32
|
+
* "v1": SHA-1 of `vaults:<kind>:<vaultId>:<path>`, first 16 hex chars.
|
|
33
|
+
* Folder-keyed for entry IDs (one JournalEntry per folder).
|
|
34
|
+
*/
|
|
35
|
+
export const ID_SCHEME = "v1";
|
|
36
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,oEAAoE;AACpE,iBAAiB;AACjB,yBAAyB;AACzB,wEAAwE;AACxE,4EAA4E;AAC5E,oEAAoE;AACpE,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,qEAAqE;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,uEAAuE;AACvE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACpD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAwB,CAAC;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAW,GAAG,CAAC,OAAO,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAU,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wizzlethorpe/vaults",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Sync an Obsidian vault to a Cloudflare-hosted wiki with role-based access. Renders locally, deploys to Cloudflare Pages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"obsidian",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@types/node": "^22.10.0",
|
|
57
57
|
"@types/picomatch": "^3.0.1",
|
|
58
58
|
"@types/unist": "^3.0.3",
|
|
59
|
+
"esbuild": "^0.28.0",
|
|
59
60
|
"tsx": "^4.21.0",
|
|
60
61
|
"typescript": "^5.9.3"
|
|
61
62
|
},
|