@dreamlake/dockit 0.2.2 → 0.2.3

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.
@@ -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
  }
@@ -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,6 +26,7 @@ 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" />
@@ -64,6 +64,11 @@ 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[];
67
72
  }
68
73
  export declare const siteConfig: SiteConfig;
69
74
  /** 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.3",
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",