@publier/shell 2.1.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.
Files changed (141) hide show
  1. package/README.md +1 -0
  2. package/dist/build-integration.d.mts +7 -0
  3. package/dist/build-integration.mjs +1 -0
  4. package/dist/index-DWtFsw7E.d.mts +1033 -0
  5. package/dist/index.d.mts +33 -0
  6. package/dist/index.mjs +1 -0
  7. package/dist/integration-BIJIcnAT.mjs +99 -0
  8. package/dist/integration-CKjtSkwa.d.mts +183 -0
  9. package/dist/integration.d.mts +2 -0
  10. package/dist/integration.mjs +1 -0
  11. package/dist/loaders/index.d.mts +54 -0
  12. package/dist/loaders/index.mjs +1 -0
  13. package/dist/plugins/remark-asides.d.mts +8 -0
  14. package/dist/plugins/remark-asides.mjs +2 -0
  15. package/dist/plugins/remark-snippets.d.mts +11 -0
  16. package/dist/plugins/remark-snippets.mjs +1 -0
  17. package/dist/plugins/remark-structure.d.mts +13 -0
  18. package/dist/plugins/remark-structure.mjs +1 -0
  19. package/dist/plugins/remark-vars.d.mts +7 -0
  20. package/dist/plugins/remark-vars.mjs +1 -0
  21. package/dist/presets-C7z73xlB.d.mts +16 -0
  22. package/dist/presets-DL0qjtya.mjs +1 -0
  23. package/dist/runtime/code-group-sync.d.mts +30 -0
  24. package/dist/runtime/code-group-sync.mjs +103 -0
  25. package/dist/runtime/lazy-upgrade-registry.d.mts +29 -0
  26. package/dist/runtime/lazy-upgrade-registry.mjs +1 -0
  27. package/dist/runtime/tabs-sync.d.mts +25 -0
  28. package/dist/runtime/tabs-sync.mjs +106 -0
  29. package/dist/search/index.d.mts +92 -0
  30. package/dist/search/index.mjs +1 -0
  31. package/dist/tailwind/css-plugin.d.mts +16 -0
  32. package/dist/tailwind/css-plugin.mjs +1 -0
  33. package/dist/tailwind/index.d.mts +6 -0
  34. package/dist/tailwind/index.mjs +1 -0
  35. package/dist/tailwind/loader.d.mts +94 -0
  36. package/dist/tailwind/loader.mjs +2 -0
  37. package/dist/theme-toggle-element-DzFjxwpS.mjs +1 -0
  38. package/dist/themes/almond.css +115 -0
  39. package/dist/themes/aspen.css +95 -0
  40. package/dist/themes/catppuccin.css +98 -0
  41. package/dist/themes/dark.css +98 -0
  42. package/dist/themes/dusk.css +98 -0
  43. package/dist/themes/emerald.css +95 -0
  44. package/dist/themes/light.css +95 -0
  45. package/dist/themes/maple.css +119 -0
  46. package/dist/themes/neutral.css +73 -0
  47. package/dist/themes/ocean.css +98 -0
  48. package/dist/themes/purple.css +95 -0
  49. package/dist/themes/ruby.css +95 -0
  50. package/dist/themes/solar.css +98 -0
  51. package/dist/themes/vitepress.css +95 -0
  52. package/package.json +189 -0
  53. package/publier-gate +0 -0
  54. package/src/astro-modules.d.ts +20 -0
  55. package/src/components/LastModified.astro +25 -0
  56. package/src/components/announcement-banner.astro +25 -0
  57. package/src/components/aside.astro +17 -0
  58. package/src/components/ask-ai.tsx +146 -0
  59. package/src/components/badge.astro +18 -0
  60. package/src/components/breadcrumbs.astro +23 -0
  61. package/src/components/callouts/caution.astro +13 -0
  62. package/src/components/callouts/check.astro +13 -0
  63. package/src/components/callouts/danger.astro +13 -0
  64. package/src/components/callouts/info.astro +13 -0
  65. package/src/components/callouts/note.astro +13 -0
  66. package/src/components/callouts/tip.astro +13 -0
  67. package/src/components/callouts/warning.astro +13 -0
  68. package/src/components/card-grid.astro +14 -0
  69. package/src/components/card.astro +18 -0
  70. package/src/components/code-group.astro +55 -0
  71. package/src/components/columns.astro +18 -0
  72. package/src/components/docs-layout.astro +25 -0
  73. package/src/components/file-tree-node.astro +13 -0
  74. package/src/components/file-tree.astro +9 -0
  75. package/src/components/icon.astro +18 -0
  76. package/src/components/index.ts +155 -0
  77. package/src/components/link-button.astro +21 -0
  78. package/src/components/link-card.astro +21 -0
  79. package/src/components/open-in-ai.astro +13 -0
  80. package/src/components/package-install.astro +17 -0
  81. package/src/components/panels.astro +16 -0
  82. package/src/components/search-button.astro +21 -0
  83. package/src/components/sidebar.astro +12 -0
  84. package/src/components/skip-link.astro +12 -0
  85. package/src/components/steps.astro +13 -0
  86. package/src/components/table-of-contents.astro +22 -0
  87. package/src/components/tabs.astro +17 -0
  88. package/src/components/theme-storage.ts +5 -0
  89. package/src/components/theme-toggle-element.ts +85 -0
  90. package/src/components/theme-toggle.astro +25 -0
  91. package/src/components/tile-grid.astro +13 -0
  92. package/src/components/tile.astro +17 -0
  93. package/src/components/top-nav-mobile.astro +11 -0
  94. package/src/components/top-nav.astro +20 -0
  95. package/src/components/types.ts +510 -0
  96. package/src/components/ui/blur-image.astro +60 -0
  97. package/src/components/ui/changelog-entry.astro +56 -0
  98. package/src/components/ui/cta-band.astro +30 -0
  99. package/src/components/ui/feature-grid.astro +38 -0
  100. package/src/components/ui/feature-section.astro +85 -0
  101. package/src/components/ui/frame.astro +52 -0
  102. package/src/components/ui/hero.astro +47 -0
  103. package/src/components/ui/jobs-list.astro +53 -0
  104. package/src/components/ui/logo-cloud.astro +68 -0
  105. package/src/components/ui/press-gallery.astro +52 -0
  106. package/src/components/ui/pricing-comparison-table.astro +73 -0
  107. package/src/components/ui/pricing-section.astro +113 -0
  108. package/src/components/ui/pricing-table.astro +54 -0
  109. package/src/components/ui/status-indicator.astro +38 -0
  110. package/src/components/ui/team-grid.astro +63 -0
  111. package/src/components/ui/testimonial-card.astro +42 -0
  112. package/src/components/ui/types.ts +323 -0
  113. package/src/components/update-badge.astro +15 -0
  114. package/src/components/version-switcher.astro +20 -0
  115. package/src/icons/index.tsx +246 -0
  116. package/src/icons/resolve.tsx +45 -0
  117. package/src/layouts/base-layout.astro +63 -0
  118. package/src/qwik.ts +3 -0
  119. package/src/routes/blog-index.astro +20 -0
  120. package/src/routes/blog-rss.xml.ts +40 -0
  121. package/src/routes/blog-slug.astro +32 -0
  122. package/src/routes/changelog-index.astro +25 -0
  123. package/src/routes/changelog-rss.xml.ts +47 -0
  124. package/src/routes/docs-slug.astro +31 -0
  125. package/src/routes/not-found.astro +14 -0
  126. package/src/runtime/banner-init.ts +9 -0
  127. package/src/runtime/lazy-upgrade-init.ts +5 -0
  128. package/src/runtime/sidebar-scroll-init.ts +3 -0
  129. package/src/runtime/theme-init.ts +16 -0
  130. package/src/schemas/blog.ts +37 -0
  131. package/src/schemas/changelog.ts +28 -0
  132. package/src/schemas/common.ts +82 -0
  133. package/src/schemas/docs.ts +101 -0
  134. package/src/schemas/index.ts +14 -0
  135. package/src/schemas/pages.ts +22 -0
  136. package/src/styles/base.css +627 -0
  137. package/src/styles/expressive-code.css +41 -0
  138. package/src/styles/rules.css +66 -0
  139. package/src/styles/tailwind-sources.css +17 -0
  140. package/src/tailwind/preset.css +193 -0
  141. package/src/virtual-modules.d.ts +164 -0
@@ -0,0 +1,29 @@
1
+ //#region src/runtime/lazy-upgrade-registry-runtime.d.ts
2
+ /**
3
+ * Shell-owned dispatcher for lazy-upgraded custom elements.
4
+ *
5
+ * The shell's lazy-upgrade bootstrap (`runtime/lazy-upgrade-init.ts`) dynamic-imports
6
+ * THIS module instead of directly importing each custom-element package.
7
+ * Resolving through a shell-local path ensures the consumer's bundler
8
+ * (Vite 8/Rolldown in publier-website) follows the import graph through
9
+ * `@publier/shell`'s own node_modules, where `@github/clipboard-copy-element`
10
+ * and `@github/tab-container-element` are guaranteed to resolve — they are
11
+ * declared dependencies of `@publier/shell` itself.
12
+ *
13
+ * Each `upgrade<Tag>` entrypoint calls `customElements.define(...)` as a
14
+ * side-effect. The bootstrap never uses the named exports; it just imports
15
+ * the file for its definition side-effect.
16
+ */
17
+ declare const upgradeClipboardCopy: () => Promise<unknown>;
18
+ declare const upgradeTabContainer: () => Promise<unknown>;
19
+ /**
20
+ * `<relative-time>` is a non-interactive, paint-visible custom element — the
21
+ * lazy-upgrade bootstrap (`shell_hooks/scripts.rs`) scans the DOM on initial
22
+ * load + after every `astro:after-swap` for the tag and triggers this import,
23
+ * rather than waiting for a `pointerdown` / `focusin` / `keydown` event that
24
+ * a viewer of a "Last updated 3 days ago" line would never fire.
25
+ */
26
+ declare const upgradeRelativeTime: () => Promise<unknown>;
27
+ declare const upgradeThemeToggle: () => Promise<unknown>;
28
+ //#endregion
29
+ export { upgradeClipboardCopy, upgradeRelativeTime, upgradeTabContainer, upgradeThemeToggle };
@@ -0,0 +1 @@
1
+ const e=()=>import(`@github/clipboard-copy-element`),t=()=>import(`@github/tab-container-element`),n=()=>import(`@github/relative-time-element`),r=()=>import(`../theme-toggle-element-DzFjxwpS.mjs`);export{e as upgradeClipboardCopy,n as upgradeRelativeTime,t as upgradeTabContainer,r as upgradeThemeToggle};
@@ -0,0 +1,25 @@
1
+ //#region src/runtime/tabs-sync-runtime.d.ts
2
+ /**
3
+ * Tabs sync — cross-peer + cross-tab activation for shell's Tabs /
4
+ * CodeGroup / PackageInstall.
5
+ *
6
+ * Injected globally by `docsShell()` via
7
+ * `injectScript('page', TABS_SYNC_SCRIPT)`. Stored as a string constant
8
+ * (same pattern as `LAZY_UPGRADE_SCRIPT`) because Rolldown-vite tree-
9
+ * shakes plain side-effect module imports inside an injected page
10
+ * stage — wrapping as a literal string keeps the code out of the
11
+ * import graph entirely and lands it verbatim in the page bundle.
12
+ *
13
+ * Also chosen over an inline `<script>` in `tabs.astro`: primitives'
14
+ * own `tabs.astro` has its own inline `<script>` block, and Astro's
15
+ * script-bundle hash collides across identically-named files, silently
16
+ * dropping one. This string-based injection sidesteps the whole
17
+ * inline-script pathway.
18
+ *
19
+ * Click + keyboard activation is owned by `<tab-container>` itself once
20
+ * the lazy-upgrade bootstrap (`runtime/lazy-upgrade-init.ts`) defines it.
21
+ * This script only layers peer / storage sync on top.
22
+ */
23
+ declare const TABS_SYNC_SCRIPT = "\n(() => {\n\tconst SYNC_PREFIX = 'publier-tabs-sync:';\n\n\tconst activateByLabel = (root, label) => {\n\t\tconst tabs = Array.from(root.querySelectorAll('[role=\"tab\"]'));\n\t\tconst index = tabs.findIndex((t) => t.dataset.tabLabel === label);\n\t\tif (index < 0) return;\n\t\tconst target = tabs[index];\n\t\t// Idempotence guard: tab-container fires 'tab-container-change'\n\t\t// unconditionally when selectTab runs, even when the index doesn't\n\t\t// change. Without this check, peer sync loops: root 0 syncs peer 1\n\t\t// \u2192 peer 1 fires change \u2192 peer 1 syncs peers including root 0 \u2192\n\t\t// stack-overflow. Skip if already on the requested label.\n\t\tif (target.getAttribute('aria-selected') === 'true') return;\n\t\t// tab-container-element's selectTab(index) expects a NUMBER, not an\n\t\t// element. Passing the tab button directly silently no-ops (coerces\n\t\t// to NaN). Pass the resolved index instead.\n\t\tif (typeof root.selectTab === 'function') {\n\t\t\troot.selectTab(index);\n\t\t\treturn;\n\t\t}\n\t\t// Pre-upgrade fallback: toggle ARIA + panel visibility manually so\n\t\t// SSR state stays coherent while the custom element is still loading.\n\t\t// aria-selected is the SINGLE source of truth here \u2014 daisyUI v5\n\t\t// styles `[aria-selected=true]` directly, so we deliberately do NOT\n\t\t// touch a `tab-active` class. (Toggling both would let a stale\n\t\t// `tab-active` linger on the previously-active tab once\n\t\t// `<tab-container>` upgrades and starts managing aria-selected\n\t\t// alone, which is what produced the double-highlight bug.)\n\t\tconst panels = Array.from(root.querySelectorAll('[role=\"tabpanel\"]'));\n\t\tfor (const tab of tabs) {\n\t\t\tconst isActive = tab === target;\n\t\t\ttab.setAttribute('aria-selected', isActive ? 'true' : 'false');\n\t\t\ttab.setAttribute('tabindex', isActive ? '0' : '-1');\n\t\t}\n\t\tconst activeId = target.getAttribute('aria-controls');\n\t\tfor (const panel of panels) {\n\t\t\tpanel.hidden = panel.id !== activeId;\n\t\t}\n\t};\n\n\tconst wire = () => {\n\t\tfor (const root of document.querySelectorAll('[data-publier-tabs]')) {\n\t\t\tif (root.dataset.wired === '1') continue;\n\t\t\troot.dataset.wired = '1';\n\n\t\t\tconst syncKey = root.dataset.syncKey || null;\n\t\t\tconst storageKey = syncKey ? SYNC_PREFIX + syncKey : null;\n\n\t\t\tif (storageKey) {\n\t\t\t\ttry {\n\t\t\t\t\tconst saved = localStorage.getItem(storageKey);\n\t\t\t\t\tif (saved) activateByLabel(root, saved);\n\t\t\t\t} catch {}\n\t\t\t}\n\n\t\t\t// Listen for 'tab-container-changed' (past tense), NOT\n\t\t\t// 'tab-container-change'. The former fires AFTER the state is\n\t\t\t// applied; the latter fires BEFORE (it's the cancelable phase),\n\t\t\t// so the idempotence guard in activateByLabel reads stale\n\t\t\t// aria-selected and ends up looping infinitely.\n\t\t\troot.addEventListener('tab-container-changed', (ev) => {\n\t\t\t\t// tab-container-element exposes a typed 'tab' getter on the event;\n\t\t\t\t// 'ev.detail' is deprecated upstream and returns the PANEL (not\n\t\t\t\t// the tab button) behind a console.warn. Read '.tab' directly.\n\t\t\t\tconst tab = ev.tab;\n\t\t\t\tconst label = tab && tab.dataset ? tab.dataset.tabLabel : null;\n\t\t\t\tif (!label) return;\n\t\t\t\tif (storageKey) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlocalStorage.setItem(storageKey, label);\n\t\t\t\t\t} catch {}\n\t\t\t\t}\n\t\t\t\tif (syncKey) {\n\t\t\t\t\tconst peers = document.querySelectorAll(\n\t\t\t\t\t\t'[data-publier-tabs][data-sync-key=\"' + syncKey + '\"]',\n\t\t\t\t\t);\n\t\t\t\t\tfor (const peer of peers) {\n\t\t\t\t\t\tif (peer === root) continue;\n\t\t\t\t\t\tactivateByLabel(peer, label);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\tif (!window.__publierTabsStorageWired) {\n\t\twindow.__publierTabsStorageWired = true;\n\t\twindow.addEventListener('storage', (ev) => {\n\t\t\tif (!ev.key || ev.key.indexOf(SYNC_PREFIX) !== 0 || ev.newValue == null) return;\n\t\t\tconst syncKey = ev.key.slice(SYNC_PREFIX.length);\n\t\t\tconst label = ev.newValue;\n\t\t\tconst peers = document.querySelectorAll(\n\t\t\t\t'[data-publier-tabs][data-sync-key=\"' + syncKey + '\"]',\n\t\t\t);\n\t\t\tfor (const root of peers) {\n\t\t\t\tactivateByLabel(root, label);\n\t\t\t}\n\t\t});\n\t}\n\n\twire();\n\tdocument.addEventListener('astro:page-load', wire);\n})();\n";
24
+ //#endregion
25
+ export { TABS_SYNC_SCRIPT };
@@ -0,0 +1,106 @@
1
+ const e=`
2
+ (() => {
3
+ const SYNC_PREFIX = 'publier-tabs-sync:';
4
+
5
+ const activateByLabel = (root, label) => {
6
+ const tabs = Array.from(root.querySelectorAll('[role="tab"]'));
7
+ const index = tabs.findIndex((t) => t.dataset.tabLabel === label);
8
+ if (index < 0) return;
9
+ const target = tabs[index];
10
+
11
+
12
+
13
+
14
+
15
+ if (target.getAttribute('aria-selected') === 'true') return;
16
+
17
+
18
+
19
+ if (typeof root.selectTab === 'function') {
20
+ root.selectTab(index);
21
+ return;
22
+ }
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ const panels = Array.from(root.querySelectorAll('[role="tabpanel"]'));
32
+ for (const tab of tabs) {
33
+ const isActive = tab === target;
34
+ tab.setAttribute('aria-selected', isActive ? 'true' : 'false');
35
+ tab.setAttribute('tabindex', isActive ? '0' : '-1');
36
+ }
37
+ const activeId = target.getAttribute('aria-controls');
38
+ for (const panel of panels) {
39
+ panel.hidden = panel.id !== activeId;
40
+ }
41
+ };
42
+
43
+ const wire = () => {
44
+ for (const root of document.querySelectorAll('[data-publier-tabs]')) {
45
+ if (root.dataset.wired === '1') continue;
46
+ root.dataset.wired = '1';
47
+
48
+ const syncKey = root.dataset.syncKey || null;
49
+ const storageKey = syncKey ? SYNC_PREFIX + syncKey : null;
50
+
51
+ if (storageKey) {
52
+ try {
53
+ const saved = localStorage.getItem(storageKey);
54
+ if (saved) activateByLabel(root, saved);
55
+ } catch {}
56
+ }
57
+
58
+
59
+
60
+
61
+
62
+
63
+ root.addEventListener('tab-container-changed', (ev) => {
64
+
65
+
66
+
67
+ const tab = ev.tab;
68
+ const label = tab && tab.dataset ? tab.dataset.tabLabel : null;
69
+ if (!label) return;
70
+ if (storageKey) {
71
+ try {
72
+ localStorage.setItem(storageKey, label);
73
+ } catch {}
74
+ }
75
+ if (syncKey) {
76
+ const peers = document.querySelectorAll(
77
+ '[data-publier-tabs][data-sync-key="' + syncKey + '"]',
78
+ );
79
+ for (const peer of peers) {
80
+ if (peer === root) continue;
81
+ activateByLabel(peer, label);
82
+ }
83
+ }
84
+ });
85
+ }
86
+ };
87
+
88
+ if (!window.__publierTabsStorageWired) {
89
+ window.__publierTabsStorageWired = true;
90
+ window.addEventListener('storage', (ev) => {
91
+ if (!ev.key || ev.key.indexOf(SYNC_PREFIX) !== 0 || ev.newValue == null) return;
92
+ const syncKey = ev.key.slice(SYNC_PREFIX.length);
93
+ const label = ev.newValue;
94
+ const peers = document.querySelectorAll(
95
+ '[data-publier-tabs][data-sync-key="' + syncKey + '"]',
96
+ );
97
+ for (const root of peers) {
98
+ activateByLabel(root, label);
99
+ }
100
+ });
101
+ }
102
+
103
+ wire();
104
+ document.addEventListener('astro:page-load', wire);
105
+ })();
106
+ `;export{e as TABS_SYNC_SCRIPT};
@@ -0,0 +1,92 @@
1
+ import { Page, Page as Page$1, StructuredSection, StructuredSection as StructuredSection$1, TocEntry } from "@publier/native";
2
+
3
+ //#region src/components/types.d.ts
4
+ interface SidebarLink {
5
+ type: 'link';
6
+ /** Display label. */
7
+ label: string;
8
+ /** Destination URL. */
9
+ href: string;
10
+ /** Optional short badge label rendered to the right of the link. */
11
+ badge?: {
12
+ text: string;
13
+ variant?: 'default' | 'note' | 'tip' | 'danger' | 'success';
14
+ };
15
+ /** Mark link visible with muted styling (e.g. drafts). */
16
+ muted?: boolean;
17
+ }
18
+ interface SidebarGroupEntry {
19
+ type: 'group';
20
+ /** Display label for the group header. */
21
+ label: string;
22
+ /** Child entries; may be nested further. */
23
+ children: SidebarEntry[];
24
+ /** Default collapsed state (user can toggle). Default: `false`. */
25
+ collapsed?: boolean;
26
+ /**
27
+ * When set, the group header is a single `<a>` that both navigates to
28
+ * the index page and toggles the group's expand/collapse state. When
29
+ * unset, the whole header is a pure toggle.
30
+ */
31
+ href?: string;
32
+ }
33
+ /**
34
+ * Non-interactive label above a flat list of child entries. Used for
35
+ * shallow groupings (<3 children without an index page) where a toggle
36
+ * would be more friction than it's worth.
37
+ */
38
+ interface SidebarSection {
39
+ type: 'section';
40
+ /** Display label for the section header. */
41
+ label: string;
42
+ /** Child entries (typically links, rarely nested). */
43
+ children: SidebarEntry[];
44
+ }
45
+ type SidebarEntry = SidebarLink | SidebarGroupEntry | SidebarSection;
46
+ //#endregion
47
+ //#region src/search/build-sidebar.d.ts
48
+ interface SidebarMetaOverride {
49
+ label?: string;
50
+ collapsed?: boolean;
51
+ order?: number;
52
+ pages?: string[];
53
+ }
54
+ interface BuildSidebarOptions {
55
+ meta?: Record<string, SidebarMetaOverride>;
56
+ urlPrefix?: string;
57
+ }
58
+ declare function buildSidebar(pages: Page$1[], options?: BuildSidebarOptions): SidebarEntry[];
59
+ //#endregion
60
+ //#region src/search/entry-to-page.d.ts
61
+ interface EntryLike {
62
+ slug: string;
63
+ filePath?: string;
64
+ data: {
65
+ title: string;
66
+ description?: string;
67
+ tags?: string[];
68
+ [key: string]: unknown;
69
+ };
70
+ body?: string;
71
+ headings?: Array<{
72
+ slug: string;
73
+ text: string;
74
+ depth: number;
75
+ }>;
76
+ locale?: string;
77
+ lastModified?: string;
78
+ }
79
+ interface EntryToPageOptions {
80
+ urlPrefix: string;
81
+ structuredData?: StructuredSection$1[];
82
+ }
83
+ declare function entryToPage(entry: EntryLike, options: EntryToPageOptions): Page$1;
84
+ //#endregion
85
+ //#region src/search/extract-structured-data.d.ts
86
+ declare function extractStructuredData(source: string): Promise<StructuredSection$1[]>;
87
+ declare function extractStructuredDataSync(source: string): StructuredSection$1[];
88
+ //#endregion
89
+ //#region src/search/read-meta-yaml.d.ts
90
+ declare function readMetaYaml(basePath: string): Record<string, SidebarMetaOverride>;
91
+ //#endregion
92
+ export { type BuildSidebarOptions, type EntryLike, type EntryToPageOptions, type Page, type SidebarMetaOverride, type StructuredSection, type TocEntry, buildSidebar, entryToPage, extractStructuredData, extractStructuredDataSync, readMetaYaml };
@@ -0,0 +1 @@
1
+ import{navigationBuildSidebar as e,searchEntryToPage as t,searchExtractStructuredData as n,searchReadMetaYaml as r}from"@publier/native";function i(t,n={}){return JSON.parse(e(JSON.stringify(t),JSON.stringify(n)))}function a(e,n){return JSON.parse(t(JSON.stringify(e),JSON.stringify(n)))}async function o(e){return JSON.parse(n(e))}function s(e){return JSON.parse(n(e))}function c(e){return JSON.parse(r(e))}export{i as buildSidebar,a as entryToPage,o as extractStructuredData,s as extractStructuredDataSync,c as readMetaYaml};
@@ -0,0 +1,16 @@
1
+ import { Plugin } from "vite";
2
+
3
+ //#region src/tailwind/css-plugin.d.ts
4
+ /**
5
+ * Virtual module IDs consumed by shell and Qwik prefetch helpers.
6
+ */
7
+ declare const VIRTUAL_MODULE_ID = "virtual:publier-custom-css";
8
+ declare const VIRTUAL_THEME_MODULE_ID = "virtual:publier-theme-css";
9
+ interface PublierCssPluginOptions {
10
+ /** Project root. Defaults to `process.cwd()`. */
11
+ root?: string;
12
+ }
13
+ declare function publierThemeCssPlugin(options?: PublierCssPluginOptions): Plugin;
14
+ declare function publierCssPlugin(options?: PublierCssPluginOptions): Plugin;
15
+ //#endregion
16
+ export { PublierCssPluginOptions, VIRTUAL_MODULE_ID, VIRTUAL_THEME_MODULE_ID, publierCssPlugin, publierThemeCssPlugin };
@@ -0,0 +1 @@
1
+ import{pluginHook as e}from"@publier/native";const t=`virtual:publier-custom-css`,n=`virtual:publier-theme-css`;function r(e){return JSON.stringify({root:e.root??process.cwd()})}function i(e,t){return JSON.stringify({id:e,root:t.root??process.cwd()})}function a(t={}){return{name:`publier-theme-css`,buildStart(){e(`theme`,`buildStart`,r(t))},resolveId(t){return e(`theme`,`resolveId`,JSON.stringify({id:t}))??void 0},load(n){return e(`theme`,`load`,i(n,t))??void 0}}}function o(t={}){return{name:`publier-custom-css`,buildStart(){e(`custom-css`,`buildStart`,r(t))},resolveId(t){return e(`custom-css`,`resolveId`,JSON.stringify({id:t}))??void 0},load(n){return e(`custom-css`,`load`,i(n,t))??void 0}}}export{t as VIRTUAL_MODULE_ID,n as VIRTUAL_THEME_MODULE_ID,o as publierCssPlugin,a as publierThemeCssPlugin};
@@ -0,0 +1,6 @@
1
+ import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-C7z73xlB.mjs";
2
+
3
+ //#region src/tailwind/index.d.ts
4
+ declare const PRESET_CSS_PATH: "@publier/shell/tailwind/preset.css";
5
+ //#endregion
6
+ export { AVAILABLE_THEMES, PRESET_CSS_PATH, type ThemePreset, isValidPreset, listPresets };
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"../presets-DL0qjtya.mjs";const r=`@publier/shell/tailwind/preset.css`;export{n as AVAILABLE_THEMES,r as PRESET_CSS_PATH,e as isValidPreset,t as listPresets};
@@ -0,0 +1,94 @@
1
+ import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-C7z73xlB.mjs";
2
+
3
+ //#region src/tailwind/override.d.ts
4
+ /** Shape of a parsed `theme.yaml`. Fields match `content-spec/theme.schema.json`. */
5
+ interface ThemeYaml {
6
+ /**
7
+ * Display name for the theme (e.g. in YAML editors / README). No runtime
8
+ * effect — `preset` is what selects the base CSS. Accepted and silently
9
+ * ignored by `resolveTheme`.
10
+ */
11
+ name?: string;
12
+ preset?: string;
13
+ colors?: Record<string, string>;
14
+ typography?: Record<string, string>;
15
+ layout?: Record<string, string>;
16
+ prose?: Record<string, string>;
17
+ code?: Record<string, string>;
18
+ logo?: {
19
+ light?: string;
20
+ dark?: string;
21
+ };
22
+ favicon?: string;
23
+ }
24
+ /** Allow-listed override sections — parallel to the JSON Schema. */
25
+ declare const THEME_SECTIONS: readonly ["colors", "typography", "layout", "prose", "code"];
26
+ type ThemeSection = (typeof THEME_SECTIONS)[number];
27
+ /**
28
+ * Keys accepted under each section. Mirrors content-spec/theme.schema.json.
29
+ *
30
+ * `colors` uses daisyUI v5's semantic vocabulary — primary / base-100 /
31
+ * base-content / error / etc. Values are OKLCH strings (authors write
32
+ * `"oklch(62% 0.2 40)"` directly in YAML).
33
+ */
34
+ declare const THEME_KEYS: Record<ThemeSection, readonly string[]>;
35
+ type ThemeErrorCode = 'unknown-section' | 'unknown-key' | 'unknown-preset' | 'non-string-value' | 'empty-value';
36
+ interface ThemeValidationError {
37
+ code: ThemeErrorCode;
38
+ message: string;
39
+ /** Dotted path from `theme.yaml` root, e.g. `colors.primary`. */
40
+ path: string;
41
+ }
42
+ interface ResolvedTheme {
43
+ /** Preset name that `theme.yaml` selected. `undefined` = fall back to caller default. */
44
+ preset?: string;
45
+ /** Pass-through values keyed by CSS variable name. Empty object if no overrides. */
46
+ overrides: Record<string, string>;
47
+ /** Ready-to-inject CSS. Empty string if no overrides. */
48
+ overrideCss: string;
49
+ /** Validation errors — empty array means clean. */
50
+ errors: ThemeValidationError[];
51
+ }
52
+ /**
53
+ * Validate + resolve a theme.yaml object into CSS variable overrides.
54
+ *
55
+ * Never throws — returns errors in-band so `publier doctor` (and IDE YAML-LS)
56
+ * can report them. Unknown sections/keys produce errors and are skipped.
57
+ */
58
+ declare function resolveTheme(input: ThemeYaml | null | undefined): ResolvedTheme;
59
+ /**
60
+ * Emit a CSS override block. Mirror of the Rust `render_override_css` —
61
+ * exists as a TS helper for callers composing CSS without a theme.yaml (e.g.
62
+ * programmatic customCss builders). Both sides emit the same shape.
63
+ */
64
+ declare function renderOverrideCss(overrides: Record<string, string>): string;
65
+ /**
66
+ * Combined theme loader: pick a preset + apply overrides. Preset validation
67
+ * is delegated to `isValidPreset`; an unrecognised preset yields an error
68
+ * inside the returned ResolvedTheme (doctor-friendly — never throws).
69
+ */
70
+ declare function resolveThemeWithPreset(input: ThemeYaml | null | undefined, options: {
71
+ /** Fallback preset when `theme.yaml` doesn't specify one. */defaultPreset: ThemePreset; /** Tester for whether a preset name is allowed. */
72
+ isValidPreset: (name: string) => boolean;
73
+ }): ResolvedTheme & {
74
+ preset: ThemePreset;
75
+ };
76
+ /**
77
+ * Compose the full CSS cascade for a theme — preset body + override block.
78
+ *
79
+ * Emits `${presetCss}\n${overrideCss}\n` so the override wins the cascade via
80
+ * declaration-order. Customer `customCss` is appended by the caller,
81
+ * preserving precedence. Pure — caller reads the preset CSS itself
82
+ * (see {@link loadPresetCss}).
83
+ */
84
+ declare function composeThemeCss(presetCss: string, overrideCss: string): string;
85
+ //#endregion
86
+ //#region src/tailwind/loader.d.ts
87
+ declare function presetPath(name: ThemePreset): string;
88
+ /**
89
+ * Read the raw CSS body of a preset. Intended input to `composeThemeCss`
90
+ * when wiring up an Astro integration or generating a site-scoped stylesheet.
91
+ */
92
+ declare function loadPresetCss(name: ThemePreset): Promise<string>;
93
+ //#endregion
94
+ export { AVAILABLE_THEMES, type ResolvedTheme, THEME_KEYS, THEME_SECTIONS, type ThemeErrorCode, type ThemePreset, type ThemeSection, type ThemeValidationError, type ThemeYaml, composeThemeCss, isValidPreset, listPresets, loadPresetCss, presetPath, renderOverrideCss, resolveTheme, resolveThemeWithPreset };
@@ -0,0 +1,2 @@
1
+ import{n as e,r as t,t as n}from"../presets-DL0qjtya.mjs";import{tailwindComposeThemeCss as r,tailwindReadPresetCss as i,tailwindResolveTheme as a}from"@publier/native";import{fileURLToPath as o}from"node:url";const s=[`colors`,`typography`,`layout`,`prose`,`code`],c={colors:[`primary`,`primary-content`,`secondary`,`secondary-content`,`accent`,`accent-content`,`neutral`,`neutral-content`,`base-100`,`base-200`,`base-300`,`base-content`,`info`,`info-content`,`success`,`success-content`,`warning`,`warning-content`,`error`,`error-content`],typography:[`heading`,`body`,`mono`],layout:[`nav-height`,`sidebar-width`,`toc-width`,`page-max-width`],prose:[`content-gap-y`,`line-height`,`heading-line-height`],code:[`block-radius`,`inline-radius`,`inline-padding-y`,`inline-padding-x`]};function l(e){if(!e||typeof e!=`object`||Array.isArray(e))return{preset:void 0,overrides:{},overrideCss:``,errors:[]};let t=a(JSON.stringify(e));return{preset:t.preset??void 0,overrides:t.overrides,overrideCss:t.overrideCss,errors:t.errors.map(e=>({code:e.code,message:e.message,path:e.path}))}}function u(e){let t=Object.keys(e).sort();return t.length===0?``:`:root[data-theme="light"], :root[data-theme="dark"] {\n${t.map(t=>`\t${t}: ${e[t]};`).join(`
2
+ `)}\n}\n`}function d(e,t){let n=l(e),r=t.defaultPreset;return n.preset!==void 0&&(t.isValidPreset(n.preset)?r=n.preset:n.errors.push({code:`unknown-preset`,message:`Unknown preset "${n.preset}". Theme will fall back to "${t.defaultPreset}".`,path:`preset`})),{...n,preset:r}}function f(e,t){return r(e,t)}const p=o(new URL(`./themes/`,import.meta.url));function m(e){return`${p}${e}.css`}async function h(e){return i(p,e)}export{n as AVAILABLE_THEMES,c as THEME_KEYS,s as THEME_SECTIONS,f as composeThemeCss,e as isValidPreset,t as listPresets,h as loadPresetCss,m as presetPath,u as renderOverrideCss,l as resolveTheme,d as resolveThemeWithPreset};
@@ -0,0 +1 @@
1
+ const e=`publier-theme`;function t(e){return e===`light`||e===`dark`?e:`auto`}function n(e){return e===`auto`?`light`:e===`light`?`dark`:`auto`}var r=class extends HTMLElement{#e=null;#t=null;#n=null;connectedCallback(){let e=this.querySelector(`button`);e&&(this.#n=e=>{e.preventDefault(),this.#r()},e.addEventListener(`click`,this.#n),(this.dataset.defaultScheme??`system`)===`system`&&(this.#e=window.matchMedia(`(prefers-color-scheme: dark)`),this.#t=()=>{(this.dataset.mode??`auto`)===`auto`&&this.#i()},this.#e.addEventListener(`change`,this.#t)))}disconnectedCallback(){let e=this.querySelector(`button`);e&&this.#n&&e.removeEventListener(`click`,this.#n),this.#e&&this.#t&&this.#e.removeEventListener(`change`,this.#t),this.#e=null,this.#t=null,this.#n=null}#r(){let r=n(t(this.dataset.mode));try{r===`auto`?localStorage.removeItem(e):localStorage.setItem(e,r)}catch{}this.dataset.mode=r;let i=this.dataset[`label${r.charAt(0).toUpperCase()+r.slice(1)}`],a=this.querySelector(`button`);a&&i&&(a.setAttribute(`aria-label`,i),a.setAttribute(`title`,i)),this.#i()}#i(){let e=t(this.dataset.mode),n=this.dataset.defaultScheme??`system`,r=typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches,i=e===`dark`||e===`auto`&&(n===`dark`||n===`system`&&r);document.documentElement.classList.toggle(`dark`,i),document.documentElement.dataset.theme=i?`dark`:`light`}};typeof customElements<`u`&&!customElements.get(`publier-theme-toggle`)&&customElements.define(`publier-theme-toggle`,r);export{};
@@ -0,0 +1,115 @@
1
+ [data-theme="light"] {
2
+ color-scheme: light;
3
+
4
+ --color-base-100: oklch(100.00% 0 0);
5
+ --color-base-200: oklch(100.00% 0 0);
6
+ --color-base-300: oklch(98.36% 0.014 180.72);
7
+ --color-base-content: oklch(21.01% 0.032 264.66);
8
+ --color-primary: oklch(51.09% 0.086 186.39);
9
+ --color-primary-content: oklch(100.00% 0 0);
10
+ --color-accent: oklch(71.05% 0.128 181.6);
11
+ --color-accent-content: oklch(21.01% 0.032 264.66);
12
+ --color-success: oklch(69.59% 0.149 162.48);
13
+ --color-error: oklch(57.71% 0.215 27.33);
14
+ --color-error-content: oklch(100.00% 0 0);
15
+
16
+ --radius-selector: 0.5rem;
17
+ --radius-field: 0.5rem;
18
+ --radius-box: 0.75rem;
19
+ --border: 1px;
20
+ --depth: 1;
21
+ --noise: 0;
22
+ }
23
+
24
+ [data-theme="dark"] {
25
+ color-scheme: dark;
26
+
27
+ --color-base-100: oklch(16.45% 0.01 234.58);
28
+ --color-base-200: oklch(19.44% 0.012 225.93);
29
+ --color-base-300: oklch(22.77% 0.017 230.08);
30
+ --color-base-content: oklch(92.88% 0.013 255.51);
31
+ --color-primary: oklch(71.05% 0.128 181.6);
32
+ --color-primary-content: oklch(16.45% 0.01 234.58);
33
+ --color-accent: oklch(78.45% 0.133 181.91);
34
+ --color-accent-content: oklch(16.45% 0.01 234.58);
35
+ --color-success: oklch(69.59% 0.149 162.48);
36
+ --color-error: oklch(57.71% 0.215 27.33);
37
+ --color-error-content: oklch(100.00% 0 0);
38
+
39
+ --radius-selector: 0.5rem;
40
+ --radius-field: 0.5rem;
41
+ --radius-box: 0.75rem;
42
+ --border: 1px;
43
+ --depth: 1;
44
+ --noise: 0;
45
+ }
46
+
47
+ :root {
48
+ --publier-nav-height: 4rem;
49
+ --publier-sidebar-width: 17rem;
50
+ --publier-toc-width: 14rem;
51
+ --publier-page-max-width: 56rem;
52
+ --publier-layout-width: 1400px;
53
+
54
+ --publier-nav-item-radius: 0.5rem;
55
+ --publier-nav-item-padding-y: 0.4375rem;
56
+ --publier-nav-item-padding-x: 0.75rem;
57
+ --publier-nav-item-font-weight: 500;
58
+
59
+ --publier-code-block-radius: 0.625rem;
60
+ --publier-code-inline-radius: 0.375rem;
61
+ }
62
+
63
+ :root,
64
+ :root[data-theme="light"] {
65
+ --publier-shadow-color: 0 150 137;
66
+ --publier-shadow-opacity: 0.06;
67
+ }
68
+
69
+ :root[data-theme="dark"],
70
+ .dark {
71
+ --publier-shadow-color: 0 0 0;
72
+ --publier-shadow-opacity: 0.3;
73
+ }
74
+
75
+ :root,
76
+ :root[data-theme="light"] {
77
+
78
+ --color-pl-muted: oklch(42% 0.06 186.39);
79
+ --color-pl-muted-bg: oklch(95% 0.022 186.39);
80
+ --color-pl-subtle: oklch(55% 0.03 186.39);
81
+ --color-pl-card: oklch(99.5% 0.008 186.39);
82
+ --color-pl-card-hover: oklch(97% 0.015 186.39);
83
+ --color-pl-popover: oklch(99.5% 0.008 186.39);
84
+ --color-pl-border: oklch(90% 0.02 186.39);
85
+ --color-pl-border-strong: oklch(82% 0.025 186.39);
86
+ --color-pl-sidebar-accent: oklch(95% 0.022 186.39);
87
+ --color-pl-sidebar-active: color-mix(in oklch, var(--color-primary) 10%, transparent);
88
+ --color-pl-sidebar-active-fg: var(--color-primary);
89
+
90
+ --menu-active-bg: var(--color-pl-sidebar-active);
91
+ --menu-active-color: var(--color-pl-sidebar-active-fg);
92
+ --menu-hover-bg: var(--color-pl-sidebar-accent);
93
+ --menu-hover-color: var(--color-pl-sidebar-accent-fg);
94
+ }
95
+
96
+ :root[data-theme="dark"],
97
+ .dark {
98
+
99
+ --color-pl-muted: oklch(72% 0.067 181.6);
100
+ --color-pl-muted-bg: oklch(22.5% 0.02 181.6);
101
+ --color-pl-subtle: oklch(55% 0.04 181.6);
102
+ --color-pl-card: oklch(20.5% 0.018 181.6);
103
+ --color-pl-card-hover: oklch(26% 0.03 181.6);
104
+ --color-pl-popover: oklch(20.5% 0.018 181.6);
105
+ --color-pl-border: oklch(28% 0.025 181.6);
106
+ --color-pl-border-strong: oklch(36% 0.035 181.6);
107
+ --color-pl-sidebar-accent: oklch(26% 0.03 181.6);
108
+ --color-pl-sidebar-active: color-mix(in oklch, var(--color-primary) 14%, transparent);
109
+ --color-pl-sidebar-active-fg: var(--color-primary);
110
+
111
+ --menu-active-bg: var(--color-pl-sidebar-active);
112
+ --menu-active-color: var(--color-pl-sidebar-active-fg);
113
+ --menu-hover-bg: var(--color-pl-sidebar-accent);
114
+ --menu-hover-color: var(--color-pl-sidebar-accent-fg);
115
+ }
@@ -0,0 +1,95 @@
1
+ [data-theme="light"] {
2
+ color-scheme: light;
3
+
4
+ --color-base-100: oklch(99.39% 0.008 91.48);
5
+ --color-base-200: oklch(99.39% 0.008 91.48);
6
+ --color-base-300: oklch(97.96% 0.016 73.68);
7
+ --color-base-content: oklch(19.71% 0.03 82.74);
8
+ --color-primary: oklch(76.86% 0.165 70.08);
9
+ --color-primary-content: oklch(19.71% 0.03 82.74);
10
+ --color-accent: oklch(70.49% 0.187 47.6);
11
+ --color-accent-content: oklch(19.71% 0.03 82.74);
12
+ --color-success: oklch(72.27% 0.192 149.58);
13
+ --color-error: oklch(57.71% 0.215 27.33);
14
+ --color-error-content: oklch(100.00% 0 0);
15
+
16
+ --radius-selector: 0.5rem;
17
+ --radius-field: 0.5rem;
18
+ --radius-box: 0.75rem;
19
+ --border: 1px;
20
+ --depth: 1;
21
+ --noise: 0;
22
+ }
23
+
24
+ [data-theme="dark"] {
25
+ color-scheme: dark;
26
+
27
+ --color-base-100: oklch(16.85% 0.021 79.39);
28
+ --color-base-200: oklch(19.78% 0.025 76.86);
29
+ --color-base-300: oklch(27.67% 0.041 81.98);
30
+ --color-base-content: oklch(97.66% 0.03 90.32);
31
+ --color-primary: oklch(83.69% 0.164 84.43);
32
+ --color-primary-content: oklch(16.85% 0.021 79.39);
33
+ --color-accent: oklch(75.76% 0.159 55.93);
34
+ --color-accent-content: oklch(16.85% 0.021 79.39);
35
+ --color-success: oklch(72.27% 0.192 149.58);
36
+ --color-error: oklch(57.71% 0.215 27.33);
37
+ --color-error-content: oklch(100.00% 0 0);
38
+
39
+ --radius-selector: 0.5rem;
40
+ --radius-field: 0.5rem;
41
+ --radius-box: 0.75rem;
42
+ --border: 1px;
43
+ --depth: 1;
44
+ --noise: 0;
45
+ }
46
+
47
+ :root {
48
+ --publier-nav-height: 4rem;
49
+ --publier-sidebar-width: 16rem;
50
+ --publier-toc-width: 14rem;
51
+ --publier-page-max-width: 52rem;
52
+ --publier-layout-width: 1400px;
53
+ }
54
+
55
+ :root,
56
+ :root[data-theme="light"] {
57
+
58
+ --color-pl-muted: oklch(42% 0.06 70.08);
59
+ --color-pl-muted-bg: oklch(95% 0.022 70.08);
60
+ --color-pl-subtle: oklch(55% 0.03 70.08);
61
+ --color-pl-card: oklch(99.5% 0.008 70.08);
62
+ --color-pl-card-hover: oklch(97% 0.015 70.08);
63
+ --color-pl-popover: oklch(99.5% 0.008 70.08);
64
+ --color-pl-border: oklch(90% 0.02 70.08);
65
+ --color-pl-border-strong: oklch(82% 0.025 70.08);
66
+ --color-pl-sidebar-accent: oklch(95% 0.022 70.08);
67
+ --color-pl-sidebar-active: color-mix(in oklch, var(--color-primary) 10%, transparent);
68
+ --color-pl-sidebar-active-fg: var(--color-primary);
69
+
70
+ --menu-active-bg: var(--color-pl-sidebar-active);
71
+ --menu-active-color: var(--color-pl-sidebar-active-fg);
72
+ --menu-hover-bg: var(--color-pl-sidebar-accent);
73
+ --menu-hover-color: var(--color-pl-sidebar-accent-fg);
74
+ }
75
+
76
+ :root[data-theme="dark"],
77
+ .dark {
78
+
79
+ --color-pl-muted: oklch(72% 0.067 84.43);
80
+ --color-pl-muted-bg: oklch(22.5% 0.02 84.43);
81
+ --color-pl-subtle: oklch(55% 0.04 84.43);
82
+ --color-pl-card: oklch(20.5% 0.018 84.43);
83
+ --color-pl-card-hover: oklch(26% 0.03 84.43);
84
+ --color-pl-popover: oklch(20.5% 0.018 84.43);
85
+ --color-pl-border: oklch(28% 0.025 84.43);
86
+ --color-pl-border-strong: oklch(36% 0.035 84.43);
87
+ --color-pl-sidebar-accent: oklch(26% 0.03 84.43);
88
+ --color-pl-sidebar-active: color-mix(in oklch, var(--color-primary) 14%, transparent);
89
+ --color-pl-sidebar-active-fg: var(--color-primary);
90
+
91
+ --menu-active-bg: var(--color-pl-sidebar-active);
92
+ --menu-active-color: var(--color-pl-sidebar-active-fg);
93
+ --menu-hover-bg: var(--color-pl-sidebar-accent);
94
+ --menu-hover-color: var(--color-pl-sidebar-accent-fg);
95
+ }