@chankay/site-shell 0.1.0

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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/PLAN.md +137 -0
  3. package/README.md +186 -0
  4. package/dist/constants.d.ts +9 -0
  5. package/dist/constants.d.ts.map +1 -0
  6. package/dist/constants.js +15 -0
  7. package/dist/custom-element/SiteShellElement.d.ts +8 -0
  8. package/dist/custom-element/SiteShellElement.d.ts.map +1 -0
  9. package/dist/custom-element/SiteShellElement.js +28 -0
  10. package/dist/custom-element/register.d.ts +2 -0
  11. package/dist/custom-element/register.d.ts.map +1 -0
  12. package/dist/custom-element/register.js +10 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +4 -0
  16. package/dist/mountSiteShell.d.ts +3 -0
  17. package/dist/mountSiteShell.d.ts.map +1 -0
  18. package/dist/mountSiteShell.js +18 -0
  19. package/dist/register.d.ts +3 -0
  20. package/dist/register.d.ts.map +1 -0
  21. package/dist/register.js +3 -0
  22. package/dist/render/footer.d.ts +2 -0
  23. package/dist/render/footer.d.ts.map +1 -0
  24. package/dist/render/footer.js +35 -0
  25. package/dist/render/index.d.ts +3 -0
  26. package/dist/render/index.d.ts.map +1 -0
  27. package/dist/render/index.js +12 -0
  28. package/dist/render/navbar.d.ts +3 -0
  29. package/dist/render/navbar.d.ts.map +1 -0
  30. package/dist/render/navbar.js +52 -0
  31. package/dist/render/styles.d.ts +2 -0
  32. package/dist/render/styles.d.ts.map +1 -0
  33. package/dist/render/styles.js +186 -0
  34. package/dist/tokens.css +160 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -0
  36. package/dist/types.d.ts +13 -0
  37. package/dist/types.d.ts.map +1 -0
  38. package/dist/types.js +1 -0
  39. package/dist/utils.d.ts +8 -0
  40. package/dist/utils.d.ts.map +1 -0
  41. package/dist/utils.js +55 -0
  42. package/package.json +38 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 chankay
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/PLAN.md ADDED
@@ -0,0 +1,137 @@
1
+ # Static `site-shell` V1 Plan
2
+
3
+ ## Summary
4
+
5
+ Build a minimal `@chankay/site-shell` v1 as a purely static Web Component plus one shared CSS token file. Do not integrate CMS, config API, React SDK, or Module Federation.
6
+
7
+ The component renders a fixed navbar and fixed footer for demo subdomains. Shared brand links are hardcoded in the package. Each demo provides only its own `site_name` and GitHub repository URL through HTML attributes. The shell removes theme switching and shows a GitHub icon link instead.
8
+
9
+ ## Key Changes
10
+
11
+ ### 1. Deliverables
12
+
13
+ Create one package: `@chankay/site-shell`
14
+
15
+ Expose:
16
+
17
+ - custom element: `<chankay-site-shell>`
18
+ - token stylesheet: a shared CSS variables file for demos to import
19
+ - optional browser bundle that registers the custom element
20
+
21
+ No runtime fetches. No external config dependency.
22
+
23
+ ### 2. Web Component behavior
24
+
25
+ `<chankay-site-shell>` renders:
26
+
27
+ - fixed navbar
28
+ - brand logo: fixed to main-site brand logo
29
+ - links: fixed `Posts` and `Demos`
30
+ - `site_name`: provided by demo via attribute
31
+ - GitHub icon: links to the demo project repository via attribute
32
+ - fixed footer
33
+ - fixed layout and fixed styling
34
+ - brand/logo/main-site links remain static
35
+ - no demo-specific footer configuration in v1
36
+
37
+ Recommended attributes:
38
+
39
+ - `site-name`
40
+ - `repo-url`
41
+ - `position="header" | "footer" | "both"`
42
+
43
+ Defaults:
44
+
45
+ - `position="both"`
46
+ - empty `site-name` renders no site-name text
47
+ - missing `repo-url` hides the GitHub action
48
+
49
+ ### 3. Styling and tokens
50
+
51
+ Ship one shared CSS variables file from `site-shell` and make demos import it directly.
52
+
53
+ Purpose:
54
+
55
+ - keep shell colors consistent across all demos
56
+ - let demos optionally consume the same token variables for their own page styling
57
+ - avoid forcing Tailwind integration
58
+
59
+ Rules:
60
+
61
+ - token file contains only the minimum color, surface, border, and text variables needed for visual consistency
62
+ - Web Component uses the same variables internally
63
+ - footer styles are fixed in v1
64
+ - shell renders with isolated component styles while tokens remain globally consumable by host demos
65
+
66
+ ### 4. Internal package structure
67
+
68
+ Keep one package with lightweight internal separation:
69
+
70
+ - `tokens/`
71
+ - shared CSS variables source
72
+ - `render/`
73
+ - navbar and footer markup generation
74
+ - `custom-element/`
75
+ - element definition and attribute handling
76
+ - `assets/`
77
+ - logo and icon assets if needed
78
+
79
+ Do not add config parsing, remote data loading, schema versioning, or adapter layers in v1.
80
+
81
+ ## Test Plan
82
+
83
+ - component renders fixed navbar and footer with no runtime fetch
84
+ - `site-name` shows correctly and can be omitted safely
85
+ - `repo-url` shows a working GitHub icon link and hides cleanly when absent
86
+ - fixed `Posts` and `Demos` links always point to the intended main-site URLs
87
+ - token CSS file can be imported by a demo page and variables resolve correctly
88
+ - shell remains visually stable when host page has its own CSS or Tailwind
89
+ - `position="header"` and `position="footer"` render only the requested section
90
+
91
+ ## Release Process
92
+
93
+ - `site-shell` is versioned independently from `www` and `admin`
94
+ - publishing `site-shell` does not require a `www` or `admin` release
95
+ - production app release tags remain unchanged and continue using `admin-v*` and `www-v*`
96
+
97
+ Release trigger:
98
+
99
+ - create and publish a GitHub Release with tag prefix `site-shell-v*`
100
+ - example tag: `site-shell-v1.0.0`
101
+
102
+ Release workflow responsibilities:
103
+
104
+ - add a dedicated workflow file for package publishing, for example `.github/workflows/site-shell-release.yml`
105
+ - install workspace dependencies with `pnpm`
106
+ - build only `@chankay/site-shell`
107
+ - run `check-types` and test commands scoped to `@chankay/site-shell`
108
+ - publish the package to public npm
109
+ - attach browser assets to the GitHub Release
110
+
111
+ Published artifacts:
112
+
113
+ - npm package: `@chankay/site-shell`
114
+ - browser module entry: `dist/register.js`
115
+ - shared token stylesheet: `dist/tokens.css`
116
+ - GitHub Release asset archive: `site-shell-browser-assets.zip`
117
+
118
+ Consumer guidance:
119
+
120
+ - demos with a bundler install `@chankay/site-shell` from npm
121
+ - pure static demos load `dist/register.js` and `dist/tokens.css` from a versioned npm CDN path
122
+ - demos should pin an explicit package or asset version and must not follow `latest` implicitly
123
+
124
+ Versioning rules:
125
+
126
+ - patch: bug fixes and non-breaking style corrections
127
+ - minor: additive attributes, additive tokens, or non-breaking behavior additions
128
+ - major: breaking attribute changes, breaking token changes, artifact path changes, or breaking DOM and style contract changes
129
+
130
+ ## Assumptions and Defaults
131
+
132
+ - v1 is intentionally static and not CMS-driven
133
+ - main-site brand logo URL and `Posts` and `Demos` URLs are hardcoded in the package
134
+ - `site_name` is demo-specific and is passed by attribute, not fetched
135
+ - GitHub repository URL is demo-specific and is passed by attribute
136
+ - theme toggle is removed entirely in v1
137
+ - footer content and layout are fixed and not configurable in v1
package/README.md ADDED
@@ -0,0 +1,186 @@
1
+ # `@chankay/site-shell`
2
+
3
+ Static Web Component shell for Chankay demo sites.
4
+
5
+ ## What it provides
6
+
7
+ - `<chankay-site-shell>` custom element
8
+ - fixed Chankay navbar and footer for demo sites
9
+ - shared token stylesheet for host apps
10
+ - browser-ready registration entry for static sites
11
+
12
+ ## Package outputs
13
+
14
+ - `dist/index.js`: programmatic API, including `mountSiteShell()`
15
+ - `dist/register.js`: browser entry that registers `<chankay-site-shell>`
16
+ - `dist/tokens.css`: shared token stylesheet for shell and host demos
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pnpm add @chankay/site-shell
22
+ ```
23
+
24
+ ## Integration workflow
25
+
26
+ ### 1. Choose an integration mode
27
+
28
+ - static or plain HTML demos: load `dist/register.js` and `dist/tokens.css`
29
+ - bundled demos: install the package and use either the custom element or `mountSiteShell()`
30
+
31
+ Always pin an explicit version. Do not consume `latest` implicitly.
32
+
33
+ ### 2. Reserve shell slots in the host demo
34
+
35
+ For the clearest layout control, reserve separate header and footer slots in the demo page:
36
+
37
+ ```html
38
+ <div id="demo-shell-header"></div>
39
+ <main>...</main>
40
+ <div id="demo-shell-footer"></div>
41
+ ```
42
+
43
+ You can also use a single element with `position="both"` when the host page does not need separate mounting points.
44
+
45
+ ### 3. Static demo integration
46
+
47
+ ```html
48
+ <link
49
+ rel="stylesheet"
50
+ href="https://cdn.jsdelivr.net/npm/@chankay/site-shell@0.1.0/dist/tokens.css"
51
+ />
52
+ <script type="module">
53
+ import "https://cdn.jsdelivr.net/npm/@chankay/site-shell@0.1.0/dist/register.js"
54
+ </script>
55
+
56
+ <chankay-site-shell
57
+ position="header"
58
+ site-name="Bezier Playground"
59
+ repo-url="https://github.com/chankay/bezier-demo"
60
+ ></chankay-site-shell>
61
+ <main>...</main>
62
+ <chankay-site-shell position="footer"></chankay-site-shell>
63
+ ```
64
+
65
+ ### 4. Bundled demo integration
66
+
67
+ ```ts
68
+ import "@chankay/site-shell/register"
69
+
70
+ import { mountSiteShell } from "@chankay/site-shell"
71
+
72
+ mountSiteShell({
73
+ target: "#demo-shell-header",
74
+ position: "header",
75
+ siteName: "Bezier Playground",
76
+ repoUrl: "https://github.com/chankay/bezier-demo",
77
+ })
78
+
79
+ mountSiteShell({
80
+ target: "#demo-shell-footer",
81
+ position: "footer",
82
+ })
83
+ ```
84
+
85
+ ### 5. Optional shared token usage
86
+
87
+ Import `@chankay/site-shell/tokens.css` into the host demo when you want host content to reuse the same palette and spacing baseline as the shell.
88
+
89
+ The published stylesheet is built from the shared token source in
90
+ `packages/ui/src/tokens.css`, then extended with `site-shell`-specific aliases.
91
+
92
+ ## Public API
93
+
94
+ ### Custom element attributes
95
+
96
+ - `site-name`: Optional demo label rendered next to the fixed Chankay brand.
97
+ - `repo-url`: Optional GitHub repository URL for the demo project.
98
+ - `position`: Optional section selector. Accepts `header`, `footer`, or `both`.
99
+
100
+ Behavior defaults:
101
+
102
+ - omitted `site-name`: hides the demo name label
103
+ - omitted `repo-url`: hides the GitHub icon action
104
+ - omitted `position`: defaults to `both`
105
+
106
+ ### Programmatic API
107
+
108
+ ```ts
109
+ import { mountSiteShell } from "@chankay/site-shell"
110
+ ```
111
+
112
+ `mountSiteShell()` accepts:
113
+
114
+ - `target`: `Element` or CSS selector
115
+ - `position`: `header`, `footer`, or `both`
116
+ - `siteName`: optional demo label
117
+ - `repoUrl`: optional GitHub repository URL
118
+
119
+ ## Development workflow
120
+
121
+ ### Local preview
122
+
123
+ From the repository root:
124
+
125
+ ```bash
126
+ pnpm run dev:site-shell
127
+ ```
128
+
129
+ Then open `http://127.0.0.1:4310/dev/preview.html`.
130
+
131
+ - TypeScript changes rebuild automatically into `dist/`
132
+ - token changes from `packages/ui/src/tokens.css` and `src/tokens.aliases.css` rebuild `dist/tokens.css`
133
+ - Refresh the browser after edits to preview the latest output
134
+
135
+ ### Common package commands
136
+
137
+ ```bash
138
+ pnpm run dev:site-shell
139
+ pnpm --filter @chankay/site-shell build
140
+ pnpm --filter @chankay/site-shell check-types
141
+ pnpm --filter @chankay/site-shell test:run
142
+ pnpm --filter @chankay/site-shell preview:dev
143
+ pnpm --filter @chankay/site-shell preview
144
+ ```
145
+
146
+ Use `preview` when you want a one-off local server without watch mode.
147
+
148
+ ### Source layout
149
+
150
+ - `src/custom-element/`: custom element definition and registration
151
+ - `src/render/`: static navbar and footer markup and styles
152
+ - `src/tokens.aliases.css`: `site-shell`-specific CSS variable aliases
153
+ - `scripts/copy-tokens.mjs`: builds `dist/tokens.css` from the shared token source
154
+ - `dev/preview.html`: local preview host page
155
+
156
+ ## Release workflow
157
+
158
+ ### Versioning
159
+
160
+ - `patch`: bug fixes and non-breaking style corrections
161
+ - `minor`: additive attributes, additive tokens, or non-breaking behavior additions
162
+ - `major`: breaking attribute changes, breaking token changes, or breaking DOM/style contract changes
163
+
164
+ ### Publishing
165
+
166
+ 1. Update the package implementation and docs.
167
+ 2. Validate locally:
168
+ - `pnpm --filter @chankay/site-shell build`
169
+ - `pnpm --filter @chankay/site-shell check-types`
170
+ - `pnpm --filter @chankay/site-shell test:run`
171
+ 3. Publish a GitHub Release with tag `site-shell-vX.Y.Z`.
172
+
173
+ The workflow in `.github/workflows/site-shell-release.yml` then:
174
+
175
+ - installs workspace dependencies
176
+ - builds `@chankay/site-shell`
177
+ - runs type checks and tests
178
+ - publishes `@chankay/site-shell` to public npm
179
+ - uploads browser assets to the GitHub Release
180
+
181
+ ### Release artifacts
182
+
183
+ - npm package: `@chankay/site-shell`
184
+ - browser entry: `dist/register.js`
185
+ - token stylesheet: `dist/tokens.css`
186
+ - release archive: `site-shell-browser-assets.zip`
@@ -0,0 +1,9 @@
1
+ export declare const SITE_SHELL_TAG_NAME = "chankay-site-shell";
2
+ export declare const MAIN_SITE_URL = "https://chankay.com";
3
+ export declare const BRAND_NAME = "Chan Kay";
4
+ export declare const BRAND_LOGO_URL = "https://chankay.com/favicon/website-logo.svg";
5
+ export declare const POSTS_URL = "https://chankay.com/posts";
6
+ export declare const DEMOS_URL = "https://chankay.com/demos";
7
+ export declare const FOOTER_NOTE = "Shared navigation shell for Chankay demo projects.";
8
+ export declare const GITHUB_ICON_SVG: string;
9
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,uBAAuB,CAAA;AAEvD,eAAO,MAAM,aAAa,wBAAwB,CAAA;AAClD,eAAO,MAAM,UAAU,aAAa,CAAA;AACpC,eAAO,MAAM,cAAc,iDAA8C,CAAA;AACzE,eAAO,MAAM,SAAS,8BAA2B,CAAA;AACjD,eAAO,MAAM,SAAS,8BAA2B,CAAA;AACjD,eAAO,MAAM,WAAW,uDAAuD,CAAA;AAE/E,eAAO,MAAM,eAAe,QAOpB,CAAA"}
@@ -0,0 +1,15 @@
1
+ export const SITE_SHELL_TAG_NAME = "chankay-site-shell";
2
+ export const MAIN_SITE_URL = "https://chankay.com";
3
+ export const BRAND_NAME = "Chan Kay";
4
+ export const BRAND_LOGO_URL = `${MAIN_SITE_URL}/favicon/website-logo.svg`;
5
+ export const POSTS_URL = `${MAIN_SITE_URL}/posts`;
6
+ export const DEMOS_URL = `${MAIN_SITE_URL}/demos`;
7
+ export const FOOTER_NOTE = "Shared navigation shell for Chankay demo projects.";
8
+ export const GITHUB_ICON_SVG = `
9
+ <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
10
+ <path
11
+ fill="currentColor"
12
+ d="M12 1.75a10.25 10.25 0 0 0-3.24 19.98c.5.09.68-.21.68-.48l-.01-1.86c-2.77.6-3.35-1.33-3.35-1.33a2.64 2.64 0 0 0-1.1-1.46c-.9-.62.07-.61.07-.61a2.09 2.09 0 0 1 1.53 1.03 2.13 2.13 0 0 0 2.9.83 2.13 2.13 0 0 1 .63-1.34c-2.22-.25-4.56-1.12-4.56-4.97a3.9 3.9 0 0 1 1.03-2.7 3.62 3.62 0 0 1 .1-2.66s.84-.27 2.75 1.03a9.5 9.5 0 0 1 5 0c1.9-1.3 2.74-1.03 2.74-1.03a3.62 3.62 0 0 1 .1 2.66 3.89 3.89 0 0 1 1.03 2.7c0 3.86-2.35 4.71-4.58 4.96a2.38 2.38 0 0 1 .68 1.84l-.01 2.72c0 .27.18.58.69.48A10.25 10.25 0 0 0 12 1.75Z"
13
+ />
14
+ </svg>
15
+ `.trim();
@@ -0,0 +1,8 @@
1
+ export declare class SiteShellElement extends HTMLElement {
2
+ static observedAttributes: string[];
3
+ constructor();
4
+ connectedCallback(): void;
5
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
6
+ private render;
7
+ }
8
+ //# sourceMappingURL=SiteShellElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteShellElement.d.ts","sourceRoot":"","sources":["../../src/custom-element/SiteShellElement.ts"],"names":[],"mappings":"AAIA,qBAAa,gBAAiB,SAAQ,WAAW;IAChD,MAAM,CAAC,kBAAkB,WAAwC;;IAOjE,iBAAiB;IAIjB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUvF,OAAO,CAAC,MAAM;CAQd"}
@@ -0,0 +1,28 @@
1
+ import { renderSiteShell } from "../render/index.js";
2
+ import { siteShellStyles } from "../render/styles.js";
3
+ import { readSiteShellAttributes } from "../utils.js";
4
+ export class SiteShellElement extends HTMLElement {
5
+ static observedAttributes = ["position", "repo-url", "site-name"];
6
+ constructor() {
7
+ super();
8
+ this.attachShadow({ mode: "open" });
9
+ }
10
+ connectedCallback() {
11
+ this.render();
12
+ }
13
+ attributeChangedCallback(name, oldValue, newValue) {
14
+ if (oldValue === newValue) {
15
+ return;
16
+ }
17
+ if (name === "position" || name === "repo-url" || name === "site-name") {
18
+ this.render();
19
+ }
20
+ }
21
+ render() {
22
+ if (!this.shadowRoot) {
23
+ return;
24
+ }
25
+ const attributes = readSiteShellAttributes(this);
26
+ this.shadowRoot.innerHTML = `<style>${siteShellStyles}</style>${renderSiteShell(attributes)}`;
27
+ }
28
+ }
@@ -0,0 +1,2 @@
1
+ export declare function defineSiteShellElement(): void;
2
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/custom-element/register.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,SAQrC"}
@@ -0,0 +1,10 @@
1
+ import { SITE_SHELL_TAG_NAME } from "../constants.js";
2
+ import { SiteShellElement } from "./SiteShellElement.js";
3
+ export function defineSiteShellElement() {
4
+ if (typeof customElements === "undefined") {
5
+ throw new Error("Custom Elements are not available in the current runtime.");
6
+ }
7
+ if (!customElements.get(SITE_SHELL_TAG_NAME)) {
8
+ customElements.define(SITE_SHELL_TAG_NAME, SiteShellElement);
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ export { SITE_SHELL_TAG_NAME } from "./constants.js";
2
+ export { SiteShellElement } from "./custom-element/SiteShellElement.js";
3
+ export { defineSiteShellElement } from "./custom-element/register.js";
4
+ export { mountSiteShell } from "./mountSiteShell.js";
5
+ export type { MountSiteShellOptions, SiteShellAttributes, SiteShellPosition } from "./types.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { SITE_SHELL_TAG_NAME } from "./constants.js";
2
+ export { SiteShellElement } from "./custom-element/SiteShellElement.js";
3
+ export { defineSiteShellElement } from "./custom-element/register.js";
4
+ export { mountSiteShell } from "./mountSiteShell.js";
@@ -0,0 +1,3 @@
1
+ import type { MountSiteShellOptions } from "./types.js";
2
+ export declare function mountSiteShell({ target, siteName, repoUrl, position, }: MountSiteShellOptions): HTMLElement;
3
+ //# sourceMappingURL=mountSiteShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mountSiteShell.d.ts","sourceRoot":"","sources":["../src/mountSiteShell.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,cAAc,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,GACR,EAAE,qBAAqB,GAAG,WAAW,CAoBrC"}
@@ -0,0 +1,18 @@
1
+ import { SITE_SHELL_TAG_NAME } from "./constants.js";
2
+ import { defineSiteShellElement } from "./custom-element/register.js";
3
+ import { normalizeSiteShellPosition, resolveMountTarget } from "./utils.js";
4
+ export function mountSiteShell({ target, siteName, repoUrl, position, }) {
5
+ defineSiteShellElement();
6
+ const container = resolveMountTarget(target);
7
+ const element = document.createElement(SITE_SHELL_TAG_NAME);
8
+ const normalizedPosition = normalizeSiteShellPosition(position);
9
+ element.setAttribute("position", normalizedPosition);
10
+ if (siteName?.trim()) {
11
+ element.setAttribute("site-name", siteName.trim());
12
+ }
13
+ if (repoUrl?.trim()) {
14
+ element.setAttribute("repo-url", repoUrl.trim());
15
+ }
16
+ container.appendChild(element);
17
+ return element;
18
+ }
@@ -0,0 +1,3 @@
1
+ import { defineSiteShellElement } from "./custom-element/register.js";
2
+ export { defineSiteShellElement };
3
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAIrE,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { defineSiteShellElement } from "./custom-element/register.js";
2
+ defineSiteShellElement();
3
+ export { defineSiteShellElement };
@@ -0,0 +1,2 @@
1
+ export declare function renderFooter(): string;
2
+ //# sourceMappingURL=footer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/render/footer.ts"],"names":[],"mappings":"AASA,wBAAgB,YAAY,IAAI,MAAM,CAkCrC"}
@@ -0,0 +1,35 @@
1
+ import { BRAND_LOGO_URL, BRAND_NAME, DEMOS_URL, FOOTER_NOTE, MAIN_SITE_URL, POSTS_URL, } from "../constants.js";
2
+ export function renderFooter() {
3
+ const currentYear = new Date().getFullYear();
4
+ return `
5
+ <footer class="site-shell-footer">
6
+ <div class="site-shell-container site-shell-footer-inner">
7
+ <div class="site-shell-footer-top">
8
+ <a class="site-shell-brand" href="${MAIN_SITE_URL}" aria-label="${BRAND_NAME} home">
9
+ <img
10
+ class="site-shell-brand-logo"
11
+ src="${BRAND_LOGO_URL}"
12
+ alt="${BRAND_NAME} logo"
13
+ loading="lazy"
14
+ decoding="async"
15
+ />
16
+ <span class="site-shell-brand-copy">
17
+ <span class="site-shell-brand-name">${BRAND_NAME}</span>
18
+ </span>
19
+ </a>
20
+
21
+ <nav class="site-shell-footer-links" aria-label="Chankay footer navigation">
22
+ <a class="site-shell-link" href="${MAIN_SITE_URL}">Home</a>
23
+ <a class="site-shell-link" href="${POSTS_URL}">Posts</a>
24
+ <a class="site-shell-link" href="${DEMOS_URL}">Demos</a>
25
+ </nav>
26
+ </div>
27
+
28
+ <div class="site-shell-footer-bottom">
29
+ <p class="site-shell-footnote">${FOOTER_NOTE}</p>
30
+ <p class="site-shell-copyright">© ${currentYear} ${BRAND_NAME}</p>
31
+ </div>
32
+ </div>
33
+ </footer>
34
+ `;
35
+ }
@@ -0,0 +1,3 @@
1
+ import type { SiteShellAttributes } from "../types.js";
2
+ export declare function renderSiteShell(attributes: SiteShellAttributes): string;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,wBAAgB,eAAe,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CAYvE"}
@@ -0,0 +1,12 @@
1
+ import { renderFooter } from "./footer.js";
2
+ import { renderNavbar } from "./navbar.js";
3
+ export function renderSiteShell(attributes) {
4
+ const sections = [];
5
+ if (attributes.position !== "footer") {
6
+ sections.push(renderNavbar(attributes));
7
+ }
8
+ if (attributes.position !== "header") {
9
+ sections.push(renderFooter());
10
+ }
11
+ return `<div class="site-shell-root">${sections.join("")}</div>`;
12
+ }
@@ -0,0 +1,3 @@
1
+ import type { SiteShellAttributes } from "../types.js";
2
+ export declare function renderNavbar(attributes: SiteShellAttributes): string;
3
+ //# sourceMappingURL=navbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../src/render/navbar.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AA8BtD,wBAAgB,YAAY,CAAC,UAAU,EAAE,mBAAmB,GAAG,MAAM,CA0BpE"}
@@ -0,0 +1,52 @@
1
+ import { BRAND_LOGO_URL, BRAND_NAME, DEMOS_URL, GITHUB_ICON_SVG, MAIN_SITE_URL, POSTS_URL, } from "../constants.js";
2
+ import { escapeHtml } from "../utils.js";
3
+ function renderSiteName(siteName) {
4
+ if (!siteName) {
5
+ return "";
6
+ }
7
+ return `<span class="site-shell-site-name">${escapeHtml(siteName)}</span>`;
8
+ }
9
+ function renderRepoLink(repoUrl) {
10
+ if (!repoUrl) {
11
+ return "";
12
+ }
13
+ return `
14
+ <a
15
+ class="site-shell-icon-link"
16
+ href="${repoUrl}"
17
+ target="_blank"
18
+ rel="noreferrer noopener"
19
+ aria-label="Open the demo repository on GitHub"
20
+ title="Open the demo repository on GitHub"
21
+ >
22
+ ${GITHUB_ICON_SVG}
23
+ </a>
24
+ `;
25
+ }
26
+ export function renderNavbar(attributes) {
27
+ return `
28
+ <header class="site-shell-header">
29
+ <div class="site-shell-container site-shell-header-inner">
30
+ <a class="site-shell-brand" href="${MAIN_SITE_URL}" aria-label="${BRAND_NAME} home">
31
+ <img
32
+ class="site-shell-brand-logo"
33
+ src="${BRAND_LOGO_URL}"
34
+ alt="${BRAND_NAME} logo"
35
+ loading="lazy"
36
+ decoding="async"
37
+ />
38
+ <span class="site-shell-brand-copy">
39
+ <span class="site-shell-brand-name">${BRAND_NAME}</span>
40
+ ${renderSiteName(attributes.siteName)}
41
+ </span>
42
+ </a>
43
+
44
+ <nav class="site-shell-nav" aria-label="Chankay demo navigation">
45
+ <a class="site-shell-link" href="${POSTS_URL}">Posts</a>
46
+ <a class="site-shell-link" href="${DEMOS_URL}">Demos</a>
47
+ ${renderRepoLink(attributes.repoUrl)}
48
+ </nav>
49
+ </div>
50
+ </header>
51
+ `;
52
+ }
@@ -0,0 +1,2 @@
1
+ export declare const siteShellStyles: string;
2
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/render/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,QAyLpB,CAAA"}
@@ -0,0 +1,186 @@
1
+ export const siteShellStyles = `
2
+ :host {
3
+ display: block;
4
+ color: var(--site-shell-foreground, var(--foreground, #26231f));
5
+ font-family: var(
6
+ --site-shell-font-sans,
7
+ var(--font-sans, "Montserrat", "Segoe UI", sans-serif)
8
+ );
9
+ }
10
+
11
+ :host *,
12
+ :host *::before,
13
+ :host *::after {
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ a {
18
+ color: inherit;
19
+ }
20
+
21
+ .site-shell-root {
22
+ display: grid;
23
+ gap: 0;
24
+ }
25
+
26
+ .site-shell-header {
27
+ border-bottom: 1px solid var(--site-shell-border, var(--border, #e4ddd2));
28
+ background:
29
+ linear-gradient(180deg, color-mix(in oklab, var(--site-shell-card, var(--card, #f7f4ee)) 92%, white) 0%, var(--site-shell-background, var(--background, #f7f4ee)) 100%);
30
+ box-shadow: var(--site-shell-shadow, var(--shadow-sm, 0 10px 30px rgba(15, 23, 42, 0.08)));
31
+ }
32
+
33
+ .site-shell-footer {
34
+ border-top: 1px solid var(--site-shell-border, var(--border, #e4ddd2));
35
+ background: var(--site-shell-card, var(--card, #f7f4ee));
36
+ }
37
+
38
+ .site-shell-container {
39
+ width: min(1120px, calc(100% - 2rem));
40
+ margin: 0 auto;
41
+ }
42
+
43
+ .site-shell-header-inner {
44
+ min-height: var(--site-shell-navbar-height, var(--navbar-height, 4rem));
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: space-between;
48
+ gap: 1rem;
49
+ padding: 0.85rem 0;
50
+ flex-wrap: wrap;
51
+ }
52
+
53
+ .site-shell-footer-inner {
54
+ display: grid;
55
+ gap: 1rem;
56
+ padding: 1.5rem 0;
57
+ }
58
+
59
+ .site-shell-footer-top,
60
+ .site-shell-footer-bottom {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ gap: 1rem;
65
+ flex-wrap: wrap;
66
+ }
67
+
68
+ .site-shell-brand {
69
+ display: inline-flex;
70
+ align-items: center;
71
+ gap: 0.75rem;
72
+ text-decoration: none;
73
+ min-width: 0;
74
+ }
75
+
76
+ .site-shell-brand-logo {
77
+ width: 2rem;
78
+ height: 2rem;
79
+ flex: none;
80
+ object-fit: contain;
81
+ }
82
+
83
+ .site-shell-brand-copy {
84
+ display: inline-flex;
85
+ align-items: center;
86
+ gap: 0.5rem;
87
+ min-width: 0;
88
+ }
89
+
90
+ .site-shell-brand-name {
91
+ font-size: 1rem;
92
+ font-weight: 700;
93
+ letter-spacing: 0.02em;
94
+ }
95
+
96
+ .site-shell-site-name {
97
+ color: var(--site-shell-muted-foreground, var(--muted-foreground, #6a6358));
98
+ font-size: 0.92rem;
99
+ white-space: nowrap;
100
+ overflow: hidden;
101
+ text-overflow: ellipsis;
102
+ }
103
+
104
+ .site-shell-site-name::before {
105
+ content: "/";
106
+ display: inline-block;
107
+ margin-right: 0.5rem;
108
+ color: var(--site-shell-border-strong, color-mix(in oklab, var(--site-shell-border, var(--border, #e4ddd2)) 80%, var(--site-shell-foreground, #26231f)));
109
+ }
110
+
111
+ .site-shell-nav,
112
+ .site-shell-footer-links {
113
+ display: flex;
114
+ align-items: center;
115
+ gap: 0.45rem;
116
+ flex-wrap: wrap;
117
+ }
118
+
119
+ .site-shell-link {
120
+ display: inline-flex;
121
+ align-items: center;
122
+ gap: 0.35rem;
123
+ padding: 0.6rem 0.9rem;
124
+ border-radius: 999px;
125
+ text-decoration: none;
126
+ color: var(--site-shell-muted-foreground, var(--muted-foreground, #6a6358));
127
+ font-size: 0.95rem;
128
+ font-weight: 600;
129
+ transition:
130
+ background-color 160ms ease,
131
+ color 160ms ease,
132
+ transform 160ms ease;
133
+ }
134
+
135
+ .site-shell-link:hover,
136
+ .site-shell-link:focus-visible,
137
+ .site-shell-icon-link:hover,
138
+ .site-shell-icon-link:focus-visible {
139
+ background: var(--site-shell-accent, var(--accent, #e7f0df));
140
+ color: var(--site-shell-accent-foreground, var(--accent-foreground, #2f5f44));
141
+ outline: none;
142
+ transform: translateY(-1px);
143
+ }
144
+
145
+ .site-shell-icon-link {
146
+ display: inline-flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ width: 2.5rem;
150
+ height: 2.5rem;
151
+ border-radius: 999px;
152
+ text-decoration: none;
153
+ color: var(--site-shell-foreground, var(--foreground, #26231f));
154
+ border: 1px solid var(--site-shell-border, var(--border, #e4ddd2));
155
+ background: color-mix(in oklab, var(--site-shell-card, var(--card, #f7f4ee)) 92%, white);
156
+ transition:
157
+ background-color 160ms ease,
158
+ color 160ms ease,
159
+ transform 160ms ease;
160
+ }
161
+
162
+ .site-shell-icon-link svg {
163
+ width: 1.15rem;
164
+ height: 1.15rem;
165
+ }
166
+
167
+ .site-shell-footnote,
168
+ .site-shell-copyright {
169
+ margin: 0;
170
+ color: var(--site-shell-muted-foreground, var(--muted-foreground, #6a6358));
171
+ font-size: 0.9rem;
172
+ line-height: 1.5;
173
+ }
174
+
175
+ @media (max-width: 640px) {
176
+ .site-shell-header-inner,
177
+ .site-shell-footer-top,
178
+ .site-shell-footer-bottom {
179
+ align-items: flex-start;
180
+ }
181
+
182
+ .site-shell-brand-copy {
183
+ flex-wrap: wrap;
184
+ }
185
+ }
186
+ `.trim();
@@ -0,0 +1,160 @@
1
+ /* Generated from packages/ui/src/tokens.css and packages/site-shell/src/tokens.aliases.css */
2
+ :root {
3
+ --background: oklch(0.97 0.01 80.72);
4
+ --foreground: oklch(0.3 0.04 30.2);
5
+ --navbar-height: 4rem;
6
+ --card: oklch(0.97 0.01 80.72);
7
+ --card-foreground: oklch(0.3 0.04 30.2);
8
+ --popover: oklch(0.97 0.01 80.72);
9
+ --popover-foreground: oklch(0.3 0.04 30.2);
10
+ --primary: oklch(0.52 0.13 144.17);
11
+ --primary-foreground: oklch(1 0 0);
12
+ --secondary: oklch(0.96 0.02 147.64);
13
+ --secondary-foreground: oklch(0.43 0.12 144.31);
14
+ --muted: oklch(0.94 0.01 74.42);
15
+ --muted-foreground: oklch(0.45 0.05 39.21);
16
+ --accent: oklch(0.9 0.05 146.04);
17
+ --accent-foreground: oklch(0.43 0.12 144.31);
18
+ --destructive: oklch(0.54 0.19 26.72);
19
+ --border: oklch(0.92 0.015 74.64);
20
+ --input: oklch(0.88 0.02 74.64);
21
+ --ring: oklch(0.52 0.13 144.17);
22
+ --chart-1: oklch(0.67 0.16 144.21);
23
+ --chart-2: oklch(0.58 0.14 144.18);
24
+ --chart-3: oklch(0.52 0.13 144.17);
25
+ --chart-4: oklch(0.43 0.12 144.31);
26
+ --chart-5: oklch(0.22 0.05 145.73);
27
+ --sidebar: oklch(0.94 0.01 74.42);
28
+ --sidebar-foreground: oklch(0.3 0.04 30.2);
29
+ --sidebar-primary: oklch(0.52 0.13 144.17);
30
+ --sidebar-primary-foreground: oklch(1 0 0);
31
+ --sidebar-accent: oklch(0.9 0.05 146.04);
32
+ --sidebar-accent-foreground: oklch(0.43 0.12 144.31);
33
+ --sidebar-border: oklch(0.92 0.015 74.64);
34
+ --sidebar-ring: oklch(0.52 0.13 144.17);
35
+ --destructive-foreground: oklch(1 0 0);
36
+ --font-sans: Montserrat, sans-serif;
37
+ --font-serif: Merriweather, serif;
38
+ --font-mono: Source Code Pro, monospace;
39
+ --radius: 0.5rem;
40
+ --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
41
+ --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
42
+ --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
43
+ --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
44
+ --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
45
+ --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
46
+ --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
47
+ --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
48
+ --tracking-normal: 0em;
49
+ }
50
+
51
+ .dark,
52
+ [data-theme="dark"] {
53
+ --background: oklch(0.27 0 106.64);
54
+ --foreground: oklch(0.81 0.01 93.01);
55
+ --card: oklch(0.27 0 106.64);
56
+ --card-foreground: oklch(0.98 0.01 95.1);
57
+ --popover: oklch(0.31 0 106.6);
58
+ --popover-foreground: oklch(0.92 0 106.48);
59
+ --primary: oklch(0.67 0.13 38.76);
60
+ --primary-foreground: oklch(1 0 0);
61
+ --secondary: oklch(0.98 0.01 95.1);
62
+ --secondary-foreground: oklch(0.31 0 106.6);
63
+ --muted: oklch(0.22 0 106.71);
64
+ --muted-foreground: oklch(0.77 0.02 99.07);
65
+ --accent: oklch(0.21 0.01 95.42);
66
+ --accent-foreground: oklch(0.97 0.01 98.88);
67
+ --destructive: oklch(0.64 0.21 25.33);
68
+ --border: oklch(0.44 0.008 106.89);
69
+ --input: oklch(0.43 0.01 100.22);
70
+ --ring: oklch(0.59 0.17 253.06);
71
+ --chart-1: oklch(0.56 0.13 43);
72
+ --chart-2: oklch(0.69 0.16 290.41);
73
+ --chart-3: oklch(0.21 0.01 95.42);
74
+ --chart-4: oklch(0.31 0.05 289.32);
75
+ --chart-5: oklch(0.56 0.13 42.06);
76
+ --sidebar: oklch(0.24 0 67.71);
77
+ --sidebar-foreground: oklch(0.81 0.01 93.01);
78
+ --sidebar-primary: oklch(0.33 0 0);
79
+ --sidebar-primary-foreground: oklch(0.99 0 0);
80
+ --sidebar-accent: oklch(0.17 0 106.62);
81
+ --sidebar-accent-foreground: oklch(0.81 0.01 93.01);
82
+ --sidebar-border: oklch(0.96 0 0);
83
+ --sidebar-ring: oklch(0.77 0 0);
84
+ --destructive-foreground: oklch(1 0 0);
85
+ --radius: 0.5rem;
86
+ --shadow-2xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
87
+ --shadow-xs: 0px 4px 8px -1px hsl(0 0% 0% / 0.05);
88
+ --shadow-sm: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
89
+ --shadow: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 1px 2px -2px hsl(0 0% 0% / 0.1);
90
+ --shadow-md: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 2px 4px -2px hsl(0 0% 0% / 0.1);
91
+ --shadow-lg: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 4px 6px -2px hsl(0 0% 0% / 0.1);
92
+ --shadow-xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.1), 0px 8px 10px -2px hsl(0 0% 0% / 0.1);
93
+ --shadow-2xl: 0px 4px 8px -1px hsl(0 0% 0% / 0.25);
94
+ }
95
+
96
+ @theme inline {
97
+ --color-background: var(--background);
98
+ --color-foreground: var(--foreground);
99
+ --color-card: var(--card);
100
+ --color-card-foreground: var(--card-foreground);
101
+ --color-popover: var(--popover);
102
+ --color-popover-foreground: var(--popover-foreground);
103
+ --color-primary: var(--primary);
104
+ --color-primary-foreground: var(--primary-foreground);
105
+ --color-secondary: var(--secondary);
106
+ --color-secondary-foreground: var(--secondary-foreground);
107
+ --color-muted: var(--muted);
108
+ --color-muted-foreground: var(--muted-foreground);
109
+ --color-accent: var(--accent);
110
+ --color-accent-foreground: var(--accent-foreground);
111
+ --color-destructive: var(--destructive);
112
+ --color-border: var(--border);
113
+ --color-input: var(--input);
114
+ --color-ring: var(--ring);
115
+ --color-chart-1: var(--chart-1);
116
+ --color-chart-2: var(--chart-2);
117
+ --color-chart-3: var(--chart-3);
118
+ --color-chart-4: var(--chart-4);
119
+ --color-chart-5: var(--chart-5);
120
+ --color-sidebar: var(--sidebar);
121
+ --color-sidebar-foreground: var(--sidebar-foreground);
122
+ --color-sidebar-primary: var(--sidebar-primary);
123
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
124
+ --color-sidebar-accent: var(--sidebar-accent);
125
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
126
+ --color-sidebar-border: var(--sidebar-border);
127
+ --color-sidebar-ring: var(--sidebar-ring);
128
+ --color-destructive-foreground: var(--destructive-foreground);
129
+ --font-sans: var(--font-sans);
130
+ --font-mono: var(--font-mono);
131
+ --font-serif: var(--font-serif);
132
+ --radius-sm: calc(var(--radius) - 4px);
133
+ --radius-md: calc(var(--radius) - 2px);
134
+ --radius-lg: var(--radius);
135
+ --radius-xl: calc(var(--radius) + 4px);
136
+ --shadow-2xs: var(--shadow-2xs);
137
+ --shadow-xs: var(--shadow-xs);
138
+ --shadow-sm: var(--shadow-sm);
139
+ --shadow: var(--shadow);
140
+ --shadow-md: var(--shadow-md);
141
+ --shadow-lg: var(--shadow-lg);
142
+ --shadow-xl: var(--shadow-xl);
143
+ --shadow-2xl: var(--shadow-2xl);
144
+ }
145
+
146
+ :root {
147
+ --site-shell-background: var(--background);
148
+ --site-shell-foreground: var(--foreground);
149
+ --site-shell-card: var(--card);
150
+ --site-shell-border: var(--border);
151
+ --site-shell-primary: var(--primary);
152
+ --site-shell-primary-foreground: var(--primary-foreground);
153
+ --site-shell-accent: var(--accent);
154
+ --site-shell-accent-foreground: var(--accent-foreground);
155
+ --site-shell-muted-foreground: var(--muted-foreground);
156
+ --site-shell-navbar-height: var(--navbar-height);
157
+ --site-shell-font-sans: var(--font-sans);
158
+ --site-shell-radius: var(--radius);
159
+ --site-shell-shadow: var(--shadow-sm);
160
+ }
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/types.ts","../src/render/footer.ts","../src/utils.ts","../src/render/navbar.ts","../src/render/index.ts","../src/render/styles.ts","../src/custom-element/SiteShellElement.ts","../src/custom-element/register.ts","../src/mountSiteShell.ts","../src/index.ts","../src/register.ts","../../../node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/global.d.ts","../../../node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts","../../../node_modules/.pnpm/@types+react@19.1.8/node_modules/@types/react/index.d.ts","../../../node_modules/.pnpm/@types+react-dom@19.1.6_@types+react@19.1.8/node_modules/@types/react-dom/index.d.ts"],"fileIdsList":[[74],[72,73],[63,65,66],[60,67],[60,61,67,68,69],[60,61,63,68],[68],[60],[61,62,64],[60,61,63],[61]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3d3c03ab2ca58334b3fab025292e51b82d9fcf02b8502d6d5bb55864fe0449c7","signature":"679bb16e18717803513a637afdf302e12589d9a13ade0ccf7da3c1cb1cbf7a46","impliedFormat":99},{"version":"edcc3f8b316386debcb9f008b6194b9d3c33998696cb1d5c235205ca2e6f558c","signature":"9a8a559bcb086f4bc3e333149ef71dff46b93cf0773cdae8c0b4c5faf27be804","impliedFormat":99},{"version":"b8a46625f199e2919ce2b5335e4b7ccaff2ae672f81644764477bf61c90adea9","signature":"acbe72ae3352fbad84fa443925f7fce26f117ed4dfc2113b4b0a1e426f6db830","impliedFormat":99},{"version":"0edff3826ef7e28ff6b461a29aef8118d84396fb0d492e79e22de5c7d7058a86","signature":"af903fe20d109cf03989d0502fe266f9163ca46b829e2641a00f1b70a6b1da97","impliedFormat":99},{"version":"1b9b3d71d551ec1f84f181f7775aa57f7e8d2eecd7679324627cb4884804b798","signature":"d0cb8e659e3122d28650dfc6dac30bd04fe89282c60ddd0a923893fc13c89014","impliedFormat":99},{"version":"c901a742c0b9d9cf9ed0dd34b09ff48fd5fe564af884a076d8eeac9440b721aa","signature":"b1698bf0f700ba394e1070b75acd7dc79a3df34eda8d5e20ed6f4bf235b376c4","impliedFormat":99},{"version":"9266b9b51b4dc465ed7867dcae22a02db69ca3dd34b7707b62f12837d4efdd19","signature":"e65ad01f6a564b889685ba9c6a821ce2da26ec29ee0c5747b94e8a2ab7232906","impliedFormat":99},{"version":"a1358d061f8c037d8b58d379010ae67e59d4e5d181442ba1999ae38306ef82d8","signature":"088faa800f54734d60d92ef643a136ca1faccf235d4032737084056596c49012","impliedFormat":99},{"version":"fd4a05e86f22e1a4c02502df6213a1634171d24ac6803686370f08892dde0240","signature":"614de76e71772194492b6719ce9b40b9142a2a38b2e9ab08468b6ed905ee8d47","impliedFormat":99},{"version":"99bc394e6b9f0571550f399f66ac653bbde200fb48bc57cbb0b56e8aff5ce033","signature":"3a1bd1b90385654347f09e3598b6fac29728f0bb1d8a8204ab6532c3174edb26","impliedFormat":99},{"version":"c6888953885c07f4d746e4818fc0cdbe6ad718064ff1aa3e39dbf1e289c18353","signature":"5de79f98ad5f1b2d90a277293dc1ee16fa0d54e1bf8e9473376b5903d061860d","impliedFormat":99},{"version":"66991b37b32262a827789d574ad27bf5fa4c988ba6d6abcacfb522c50e51d073","signature":"24aa3752a628df646041680962c1cf0da867913e782db99318ff4a755b2a6ac4","impliedFormat":99},{"version":"170d4db14678c68178ee8a3d5a990d5afb759ecb6ec44dbd885c50f6da6204f6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"d4d7d3f832882a4b2d611a7eaaa80c780c3342b5732090130fa9af4a40bd051e","impliedFormat":1},{"version":"a0acca63c9e39580f32a10945df231815f0fe554c074da96ba6564010ffbd2d8","impliedFormat":1}],"root":[[60,71]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":199,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[75,1],[74,2],[67,3],[68,4],[70,5],[69,6],[71,7],[62,8],[65,9],[64,10],[63,11]],"latestChangedDtsFile":"./register.d.ts","version":"5.8.3"}
@@ -0,0 +1,13 @@
1
+ export type SiteShellPosition = "both" | "header" | "footer";
2
+ export interface SiteShellAttributes {
3
+ position: SiteShellPosition;
4
+ repoUrl: string | null;
5
+ siteName: string | null;
6
+ }
7
+ export interface MountSiteShellOptions {
8
+ position?: SiteShellPosition;
9
+ repoUrl?: string | null;
10
+ siteName?: string | null;
11
+ target: Element | string;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE5D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAA;CACxB"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { SiteShellAttributes, SiteShellPosition } from "./types.js";
2
+ export declare function asOptionalText(value: string | null | undefined): string | null;
3
+ export declare function asOptionalHttpUrl(value: string | null | undefined): string | null;
4
+ export declare function normalizeSiteShellPosition(value: string | null | undefined): SiteShellPosition;
5
+ export declare function escapeHtml(value: string): string;
6
+ export declare function readSiteShellAttributes(element: Pick<Element, "getAttribute">): SiteShellAttributes;
7
+ export declare function resolveMountTarget(target: Element | string): Element;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAIxE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAO9E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAYjF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB,CAS9F;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,GACpC,mBAAmB,CAMrB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAWpE"}
package/dist/utils.js ADDED
@@ -0,0 +1,55 @@
1
+ const VALID_POSITIONS = new Set(["both", "header", "footer"]);
2
+ export function asOptionalText(value) {
3
+ if (typeof value !== "string") {
4
+ return null;
5
+ }
6
+ const normalized = value.trim();
7
+ return normalized.length > 0 ? normalized : null;
8
+ }
9
+ export function asOptionalHttpUrl(value) {
10
+ const normalized = asOptionalText(value);
11
+ if (!normalized) {
12
+ return null;
13
+ }
14
+ try {
15
+ const url = new URL(normalized);
16
+ return url.protocol === "http:" || url.protocol === "https:" ? url.toString() : null;
17
+ }
18
+ catch {
19
+ return null;
20
+ }
21
+ }
22
+ export function normalizeSiteShellPosition(value) {
23
+ if (typeof value !== "string") {
24
+ return "both";
25
+ }
26
+ const normalized = value.trim().toLowerCase();
27
+ return VALID_POSITIONS.has(normalized)
28
+ ? normalized
29
+ : "both";
30
+ }
31
+ export function escapeHtml(value) {
32
+ return value
33
+ .replaceAll("&", "&amp;")
34
+ .replaceAll("<", "&lt;")
35
+ .replaceAll(">", "&gt;")
36
+ .replaceAll('"', "&quot;")
37
+ .replaceAll("'", "&#39;");
38
+ }
39
+ export function readSiteShellAttributes(element) {
40
+ return {
41
+ position: normalizeSiteShellPosition(element.getAttribute("position")),
42
+ repoUrl: asOptionalHttpUrl(element.getAttribute("repo-url")),
43
+ siteName: asOptionalText(element.getAttribute("site-name")),
44
+ };
45
+ }
46
+ export function resolveMountTarget(target) {
47
+ if (typeof target !== "string") {
48
+ return target;
49
+ }
50
+ const element = document.querySelector(target);
51
+ if (!element) {
52
+ throw new Error(`Could not find a mount target for selector: ${target}`);
53
+ }
54
+ return element;
55
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@chankay/site-shell",
3
+ "version": "0.1.0",
4
+ "description": "Static Web Component shell for Chankay demo sites",
5
+ "type": "module",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "PLAN.md"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./register": {
18
+ "types": "./dist/register.d.ts",
19
+ "default": "./dist/register.js"
20
+ },
21
+ "./tokens.css": "./dist/tokens.css"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "scripts": {
27
+ "build": "pnpm build:components && pnpm build:tokens",
28
+ "build:components": "tsc -p tsconfig.json",
29
+ "build:tokens": "node scripts/copy-tokens.mjs",
30
+ "check-types": "tsc --noEmit",
31
+ "lint": "eslint src tests --max-warnings=20 --fix",
32
+ "preview": "pnpm build && node scripts/serve-preview.mjs",
33
+ "preview:dev": "node scripts/dev.mjs",
34
+ "test": "pnpm test:run",
35
+ "test:run": "pnpm build && node --test tests/site-shell.test.js",
36
+ "clean": "rm -rf dist && rm -rf .turbo"
37
+ }
38
+ }