@dreamlake/dockit 0.2.2 → 0.2.4

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.
@@ -54,9 +54,10 @@ function Sidebar() {
54
54
  className: "hidden md:flex sticky overflow-y-auto flex-col",
55
55
  style: { top: 40, height: "calc(100vh - 40px)", padding: "22px 12px 32px 18px", gap: 2 },
56
56
  children: groups.map((group) => {
57
- const isFolded = group.label ? collapsed.has(group.label) : false;
57
+ const soleSection = groups.length === 1;
58
+ const isFolded = !soleSection && group.label ? collapsed.has(group.label) : false;
58
59
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", style: { gap: 1, marginBottom: isFolded ? 4 : 14, transition: "margin-bottom 0.2s ease" }, children: [
59
- group.label && /* @__PURE__ */ jsxs(
60
+ group.label && !soleSection && /* @__PURE__ */ jsxs(
60
61
  "button",
61
62
  {
62
63
  type: "button",
@@ -19,30 +19,22 @@ function HiddenRevealChip() {
19
19
  onClick: () => setShow(false),
20
20
  "aria-label": "Dev mode on — hidden pages are visible. Click to hide again.",
21
21
  title: "Dev mode on — hidden pages are visible (Cmd+Shift+D to toggle)",
22
+ className: "text-doc-template-warn",
22
23
  style: {
23
24
  display: "inline-flex",
24
25
  alignItems: "center",
25
- justifyContent: "center",
26
- width: 16,
27
- height: 16,
28
- padding: 0,
29
- border: 0,
30
- background: "transparent",
26
+ padding: "2px 7px",
27
+ border: "1px solid color-mix(in srgb, var(--color-doc-template-warn) 45%, transparent)",
28
+ borderRadius: 4,
29
+ background: "var(--color-doc-template-warn-soft)",
30
+ fontFamily: "var(--font-doc-template-mono)",
31
+ fontSize: 10,
32
+ fontWeight: 600,
33
+ letterSpacing: "0.08em",
34
+ lineHeight: 1.4,
31
35
  cursor: "pointer"
32
36
  },
33
- children: /* @__PURE__ */ jsx(
34
- "span",
35
- {
36
- "aria-hidden": true,
37
- style: {
38
- width: 8,
39
- height: 8,
40
- borderRadius: 999,
41
- background: "var(--color-doc-template-warn)",
42
- boxShadow: "0 0 0 3px var(--color-doc-template-warn-soft)"
43
- }
44
- }
45
- )
37
+ children: "DEV"
46
38
  }
47
39
  );
48
40
  }
@@ -96,7 +96,7 @@ function HeadSync() {
96
96
  tag.remove();
97
97
  }
98
98
  let robotsTag = document.querySelector('meta[name="robots"]');
99
- if (current?.noindex) {
99
+ if (current?.noindex || siteConfig.indexable !== true) {
100
100
  if (!robotsTag) {
101
101
  robotsTag = document.createElement("meta");
102
102
  robotsTag.name = "robots";
@@ -17,6 +17,8 @@ async function onRenderHtml(pageContext) {
17
17
  const themeScript = dangerouslySkipEscape(
18
18
  `<script>(function(){try{var raw=localStorage.getItem('doc:theme');var t=raw;try{t=JSON.parse(raw);}catch(_){}var d=document.documentElement;if(t==='light'){d.setAttribute('data-theme','light');}else if(t==='dark'){d.setAttribute('data-theme','dark');}else{d.setAttribute('data-theme',window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light');}}catch(e){}})()<\/script>`
19
19
  );
20
+ const headScripts = (siteConfig.headScripts ?? []).filter((src) => /^(https?:)?\/\/[^"'<>\s]+$|^\/[^"'<>\s]*$/.test(src)).map((src) => `<script src="${src}" defer><\/script>`).join("\n ");
21
+ const headScriptTags = headScripts ? dangerouslySkipEscape(headScripts) : "";
20
22
  return {
21
23
  documentHtml: escapeInject`<!DOCTYPE html>
22
24
  <html lang="en">
@@ -24,12 +26,13 @@ async function onRenderHtml(pageContext) {
24
26
  <meta charset="UTF-8" />
25
27
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
26
28
  ${themeScript}
29
+ ${headScriptTags}
27
30
  <link rel="preconnect" href="https://fonts.googleapis.com" />
28
31
  <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
29
32
  <link href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap" rel="stylesheet" />
30
33
  <title>${title}</title>
31
34
  ${description ? escapeInject`<meta name="description" content="${description}" />` : ""}
32
- ${current?.noindex ? escapeInject`<meta name="robots" content="noindex, nofollow" />` : ""}
35
+ ${current?.noindex || siteConfig.indexable !== true ? escapeInject`<meta name="robots" content="noindex, nofollow" />` : ""}
33
36
  ${mdHref ? escapeInject`<link rel="alternate" type="text/markdown" href="${mdHref}" />` : ""}
34
37
  </head>
35
38
  <body>
@@ -64,6 +64,17 @@ export interface SiteConfig {
64
64
  * per-page imports. Same-name entries override the library's. Typed
65
65
  * loosely to avoid coupling this module to React. */
66
66
  mdxComponents?: Record<string, unknown>;
67
+ /** External script URLs injected as `<script src defer>` into every page's
68
+ * head at SSR time (e.g. the Studio design-integration bridge). URLs only
69
+ * — http(s), protocol-relative, or absolute-path; anything else is
70
+ * silently dropped. */
71
+ headScripts?: string[];
72
+ /** Search-engine visibility. DEFAULT FALSE per org policy: every page
73
+ * gets `<meta name="robots" content="noindex, nofollow">` unless a site
74
+ * explicitly opts in with `indexable: true`. Page-level `noindex`
75
+ * frontmatter still applies on indexable sites. The site's own pagefind
76
+ * search and the llms/skill surfaces are unaffected. */
77
+ indexable?: boolean;
67
78
  }
68
79
  export declare const siteConfig: SiteConfig;
69
80
  /** Merge site-provided values into the singleton (mutates in place). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamlake/dockit",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "The DreamLake documentation shell — Vike + React + Tailwind v4 + MDX docs framework with sidebar, TOC, search, and theming",
5
5
  "license": "MIT",
6
6
  "type": "module",