@publier/shell 3.4.2 → 3.5.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.
- package/dist/index.mjs +1 -1
- package/dist/{integration-CtaVlGLq.mjs → integration-B0arJ8Mq.mjs} +1 -1
- package/dist/integration.mjs +1 -1
- package/dist/runtime/lazy-upgrade-registry.d.mts +2 -1
- package/dist/runtime/lazy-upgrade-registry.mjs +1 -1
- package/package.json +4 -3
- package/src/components/index.ts +1 -0
- package/src/components/section-switcher.astro +25 -0
- package/src/routes/docs-slug.astro +20 -4
- package/src/styles/base.css +20 -0
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./integration-
|
|
1
|
+
import{a as e,i as t,t as n}from"./integration-B0arJ8Mq.mjs";export{t as HASHED_ASSET_RE,n as docsShell,e as publierCacheControl};
|
|
@@ -37,7 +37,7 @@ mdx.
|
|
|
37
37
|
]
|
|
38
38
|
|
|
39
39
|
Missing:\n ${C.map(e=>e.pkg).join(`
|
|
40
|
-
`)}\n`);let T=n.prefetch;ie(T===void 0?void 0:JSON.stringify(T),p)&&r({prefetch:{prefetchAll:!0,defaultStrategy:`viewport`}});let{entries:E,familyOnlyCss:D,slots:O}=_?De(_,u):{entries:[],familyOnlyCss:``,slots:[]},k=m.snippets??null,se=k==null?null:k===!1?`false`:JSON.stringify(k),ce=ae(p,se??void 0,w(A.join(u,`content/snippets`))),N=JSON.parse(ce),P={...e,snippets:N===null?void 0:N},F=JSON.stringify(P),I=e.math!==!1,L=I?pe(f,l):null,R=re(F,!!(g&&Object.keys(g).length>0),N!==null&&N!==!1,I&&L!==null),z=ne(p,I&&L!==null),B=he(R,g,L),V=ge(z,L),H=me(f,l);await _e(e,n.integrations,u,r);let U=ye({root:u,mathEnabled:I}),W=Ee({searchEnabled:e.search!==!1}),G=JSON.stringify({docs:$(u,`docs`),blog:$(u,`blog`),changelog:$(u,`changelog`)}),K=JSON.parse(te(p,x,G)),q=K.filter(e=>e.pattern.endsWith(`/rss.xml`)).map(e=>({title:e.pattern===`/blog/rss.xml`?`Blog feed`:e.pattern===`/changelog/rss.xml`?`Changelog feed`:e.pattern,href:e.pattern}));if(H){let e=n.markdown?.processor,t=e?.options?.hastPlugins;e?.name!==`unified`&&Array.isArray(t)&&t.length>0&&l.warn(`[@publier/shell] docsShell() is replacing the configured "${e?.name}" Markdown processor, discarding ${t.length} HAST plugin(s) another integration already registered on it — typically astro-expressive-code >=0.43, which registers into the processor it finds at its own setup. Code fences will silently lose ALL processing (plain <pre><code>, no syntax highlighting). Fix: move docsShell() BEFORE expressiveCode() (and any other Markdown-processor-touching integration) in astro.config.ts integrations[] so they register into docsShell's unified() processor instead.`)}r({markdown:H?{processor:H({remarkPlugins:B,rehypePlugins:V})}:{remarkPlugins:[...B],rehypePlugins:[...V]},vite:{ssr:{noExternal:[`@publier/shell
|
|
40
|
+
`)}\n`);let T=n.prefetch;ie(T===void 0?void 0:JSON.stringify(T),p)&&r({prefetch:{prefetchAll:!0,defaultStrategy:`viewport`}});let{entries:E,familyOnlyCss:D,slots:O}=_?De(_,u):{entries:[],familyOnlyCss:``,slots:[]},k=m.snippets??null,se=k==null?null:k===!1?`false`:JSON.stringify(k),ce=ae(p,se??void 0,w(A.join(u,`content/snippets`))),N=JSON.parse(ce),P={...e,snippets:N===null?void 0:N},F=JSON.stringify(P),I=e.math!==!1,L=I?pe(f,l):null,R=re(F,!!(g&&Object.keys(g).length>0),N!==null&&N!==!1,I&&L!==null),z=ne(p,I&&L!==null),B=he(R,g,L),V=ge(z,L),H=me(f,l);await _e(e,n.integrations,u,r);let U=ye({root:u,mathEnabled:I}),W=Ee({searchEnabled:e.search!==!1}),G=JSON.stringify({docs:$(u,`docs`),blog:$(u,`blog`),changelog:$(u,`changelog`)}),K=JSON.parse(te(p,x,G)),q=K.filter(e=>e.pattern.endsWith(`/rss.xml`)).map(e=>({title:e.pattern===`/blog/rss.xml`?`Blog feed`:e.pattern===`/changelog/rss.xml`?`Changelog feed`:e.pattern,href:e.pattern}));if(H){let e=n.markdown?.processor,t=e?.options?.hastPlugins;e?.name!==`unified`&&Array.isArray(t)&&t.length>0&&l.warn(`[@publier/shell] docsShell() is replacing the configured "${e?.name}" Markdown processor, discarding ${t.length} HAST plugin(s) another integration already registered on it — typically astro-expressive-code >=0.43, which registers into the processor it finds at its own setup. Code fences will silently lose ALL processing (plain <pre><code>, no syntax highlighting). Fix: move docsShell() BEFORE expressiveCode() (and any other Markdown-processor-touching integration) in astro.config.ts integrations[] so they register into docsShell's unified() processor instead.`)}r({markdown:H?{processor:H({remarkPlugins:B,rehypePlugins:V})}:{remarkPlugins:[...B],rehypePlugins:[...V]},vite:{ssr:{noExternal:[`@publier/shell`],external:[`@publier/native`]},build:{rollupOptions:{external:[`@publier/native`]}},optimizeDeps:{exclude:[`@publier/shell`,`@publier/native`]},plugins:[...be(f,l,n.vite?.plugins??[]),s({root:u}),o({root:u}),Q(`virtual:publier-nav-config`,`navConfig`,v),xe({entryPath:U}),Ce(),Q(`virtual:publier-announcement`,`announcement`,y),Q(`virtual:publier-site`,`site`,h),Q(`virtual:publier-docs-config`,`docsConfig`,b),Q(`virtual:publier-feeds`,`feeds`,q),Q(`virtual:publier-fonts`,`fonts`,{slots:O}),we()]}}),r({fonts:[{name:`Inter Variable`,cssVariable:`--publier-font-builtin-sans`,provider:M.npm({remote:!1}),fallbacks:[`system-ui`,`sans-serif`],weights:[`100 900`],styles:[`normal`],subsets:[`latin`],options:{package:`@fontsource-variable/inter`}},{name:`JetBrains Mono Variable`,cssVariable:`--publier-font-builtin-mono`,provider:M.npm({remote:!1}),fallbacks:[`monospace`],weights:[`100 800`],styles:[`normal`],subsets:[`latin`],options:{package:`@fontsource-variable/jetbrains-mono`}},...E]}),i(`page-ssr`,[`import ${JSON.stringify(U)};`,`import 'virtual:publier-theme-css';`,`import 'virtual:publier-custom-css';`,`import '@publier/shell/styles/base.css';`].join(`
|
|
41
41
|
`)),i(`page`,W),i(`head-inline`,`(function(){
|
|
42
42
|
if (typeof window === 'undefined' || !window.sessionStorage || !window.fetch) return;
|
|
43
43
|
var store = window.sessionStorage;
|
package/dist/integration.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./integration-
|
|
1
|
+
import{n as e,r as t,t as n}from"./integration-B0arJ8Mq.mjs";export{n as docsShell,e as hoistMediaOutOfUtilitiesLayer,t as publierCascadeHoistPlugin};
|
|
@@ -37,5 +37,6 @@ declare const upgradeThemeToggle: () => Promise<unknown>;
|
|
|
37
37
|
* itself on `astro:page-load` after the first import.
|
|
38
38
|
*/
|
|
39
39
|
declare const upgradeImageZoom: () => Promise<unknown>;
|
|
40
|
+
declare const upgradeDetailsMenu: () => Promise<unknown>;
|
|
40
41
|
//#endregion
|
|
41
|
-
export { upgradeClipboardCopy, upgradeImageZoom, upgradeRelativeTime, upgradeTabContainer, upgradeThemeToggle };
|
|
42
|
+
export { upgradeClipboardCopy, upgradeDetailsMenu, upgradeImageZoom, upgradeRelativeTime, upgradeTabContainer, upgradeThemeToggle };
|
|
@@ -1 +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-DJTP9Mbw.mjs`),i=()=>import(`../image-zoom-runtime-CnJeWrYp.mjs`);export{e as upgradeClipboardCopy,i as upgradeImageZoom,n as upgradeRelativeTime,t as upgradeTabContainer,r as upgradeThemeToggle};
|
|
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-DJTP9Mbw.mjs`),i=()=>import(`../image-zoom-runtime-CnJeWrYp.mjs`),a=()=>import(`@github/details-menu-element`);export{e as upgradeClipboardCopy,a as upgradeDetailsMenu,i as upgradeImageZoom,n as upgradeRelativeTime,t as upgradeTabContainer,r as upgradeThemeToggle};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@publier/shell",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Qwik + Astro docs layout for Publier sites.",
|
|
6
6
|
"_filesRationale": "mixed: dist for build-time TS + source globs for shipped .astro components",
|
|
@@ -113,9 +113,10 @@
|
|
|
113
113
|
"@fontsource-variable/inter": "^5.2.8",
|
|
114
114
|
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
|
115
115
|
"@github/clipboard-copy-element": "^1.3.2",
|
|
116
|
+
"@github/details-menu-element": "^1.0.13",
|
|
116
117
|
"@github/relative-time-element": "^5.3.1",
|
|
117
118
|
"@github/tab-container-element": "^4.9.0",
|
|
118
|
-
"@publier/native": "2.2.
|
|
119
|
+
"@publier/native": "2.2.2",
|
|
119
120
|
"@tailwindcss/typography": "^0.5.20",
|
|
120
121
|
"astro-pagefind": "^2.0.1",
|
|
121
122
|
"daisyui": "^5.7.22",
|
|
@@ -154,7 +155,7 @@
|
|
|
154
155
|
"@astrojs/markdown-remark": "7.2.4",
|
|
155
156
|
"@astrojs/mdx": "^7.0.8",
|
|
156
157
|
"@qwik.dev/astro": "^1.1.0",
|
|
157
|
-
"@qwik.dev/core": "2.0.0-
|
|
158
|
+
"@qwik.dev/core": "2.0.0-rc.0",
|
|
158
159
|
"@types/mdast": "^4.0.4",
|
|
159
160
|
"astro": "7.2.6",
|
|
160
161
|
"astro-expressive-code": "^0.44.0",
|
package/src/components/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export { default as OpenInAI } from './open-in-ai.astro';
|
|
|
37
37
|
export { default as PackageInstall } from './package-install.astro';
|
|
38
38
|
export { default as Panels } from './panels.astro';
|
|
39
39
|
export { default as SearchButton } from './search-button.astro';
|
|
40
|
+
export { default as SectionSwitcher } from './section-switcher.astro';
|
|
40
41
|
export { default as Sidebar } from './sidebar.astro';
|
|
41
42
|
export { default as SkipLink } from './skip-link.astro';
|
|
42
43
|
export { default as Steps } from './steps.astro';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { navigationActiveIndex } from '@publier/native';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
sections: { label: string; href: string }[];
|
|
6
|
+
currentPath: string;
|
|
7
|
+
}
|
|
8
|
+
const { sections, currentPath } = Astro.props;
|
|
9
|
+
const active = navigationActiveIndex(JSON.stringify(sections), currentPath);
|
|
10
|
+
---
|
|
11
|
+
{sections.length > 1 && (
|
|
12
|
+
<nav aria-label="Documentation sections" class="mb-4">
|
|
13
|
+
<details class="dropdown w-full">
|
|
14
|
+
<summary class="btn btn-outline w-full justify-between font-normal" aria-label={`Documentation: ${sections[active]?.label ?? 'Choose a section'}`}>
|
|
15
|
+
<span class="truncate">{sections[active]?.label ?? 'Choose a section'}</span>
|
|
16
|
+
<span aria-hidden="true">⌄</span>
|
|
17
|
+
</summary>
|
|
18
|
+
<details-menu role="menu" class="dropdown-content menu bg-base-100 rounded-box border border-base-300 shadow-lg z-30 w-full p-2">
|
|
19
|
+
{sections.map((section, index) => (
|
|
20
|
+
<li role="none"><a role="menuitem" href={section.href} aria-current={index === active ? 'location' : undefined}>{section.label}</a></li>
|
|
21
|
+
))}
|
|
22
|
+
</details-menu>
|
|
23
|
+
</details>
|
|
24
|
+
</nav>
|
|
25
|
+
)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { getCollection, render } from 'astro:content';
|
|
3
3
|
import BaseLayout from '../layouts/base-layout.astro';
|
|
4
|
-
import { type BreadcrumbItem, DocsLayout, LastModified, Sidebar, SkipLink, TableOfContents } from '../components/index.ts';
|
|
4
|
+
import { type BreadcrumbItem, DocsLayout, LastModified, SectionSwitcher, Sidebar, SkipLink, TableOfContents } from '../components/index.ts';
|
|
5
5
|
import { buildSidebar, entryToPage } from '@publier/shell/search';
|
|
6
6
|
import { shellPlanDocsSlug, shellRenderDocsSlug } from '@publier/native';
|
|
7
7
|
import { docsConfig } from 'virtual:publier-docs-config';
|
|
@@ -13,15 +13,31 @@ const { entry } = Astro.props;
|
|
|
13
13
|
const { Content, headings } = await render(entry);
|
|
14
14
|
const all = await getCollection('docs');
|
|
15
15
|
const plan = JSON.parse(shellPlanDocsSlug(JSON.stringify({ entry_id: entry.id, title: entry.data.title, description: entry.data.description ?? null, tab_sections: docsConfig.tabSections, all_entry_ids: all.map((e) => e.id) }))) as { breadcrumbs: BreadcrumbItem[]; section_entry_ids: string[]; scope: string; current_path: string; sidebar_persist_key: string };
|
|
16
|
+
const pages = all.map((e) => entryToPage({ slug: e.id.replace(/\.(mdx?|md)$/, ''), data: e.data, headings: [] }, { urlPrefix: '/docs' }));
|
|
17
|
+
const sections = [
|
|
18
|
+
...(pages.some((page) => page.url === '/docs') ? [{ label: 'All documentation', href: '/docs' }] : []),
|
|
19
|
+
...docsConfig.tabSections.flatMap((section) => {
|
|
20
|
+
const path = `/docs/${section}`;
|
|
21
|
+
const page = pages.find((page) => page.url === path) ?? pages.find((page) => page.url.startsWith(`${path}/`));
|
|
22
|
+
return page ? [{ label: page.url === path ? page.frontmatter.title : section, href: page.url }] : [];
|
|
23
|
+
}),
|
|
24
|
+
];
|
|
25
|
+
const breadcrumbs = plan.breadcrumbs.map((crumb) => {
|
|
26
|
+
const page = pages.find((page) => page.url === crumb.href);
|
|
27
|
+
return page && crumb.href !== '/docs' ? { ...crumb, label: page.frontmatter.title } : crumb;
|
|
28
|
+
});
|
|
16
29
|
const ids = new Set(plan.section_entry_ids);
|
|
17
|
-
const sidebarItems = buildSidebar(
|
|
30
|
+
const sidebarItems = buildSidebar(pages.filter((_, index) => ids.has(all[index].id)), { urlPrefix: '/docs', meta: docsConfig.sidebarMeta });
|
|
18
31
|
const [bodyHead, bodyTail] = shellRenderDocsSlug(JSON.stringify({ title: entry.data.title, description: entry.data.description ?? null })).split('<!--publier-content-slot-->');
|
|
19
32
|
const lastUpdated = entry.data.lastUpdated instanceof Date ? entry.data.lastUpdated : null;
|
|
20
33
|
---
|
|
21
34
|
<BaseLayout title={`${entry.data.title} — Docs`} description={entry.data.description} nav="docs">
|
|
22
35
|
<SkipLink slot="skip" targetId="main-content" />
|
|
23
|
-
<DocsLayout breadcrumbs={
|
|
24
|
-
<
|
|
36
|
+
<DocsLayout breadcrumbs={breadcrumbs.length > 2 ? breadcrumbs : undefined}>
|
|
37
|
+
<Fragment slot="sidebar">
|
|
38
|
+
<SectionSwitcher sections={sections} currentPath={plan.current_path} />
|
|
39
|
+
<Sidebar items={sidebarItems} currentPath={plan.current_path} versions={docsConfig.versions.length > 0 ? docsConfig.versions : undefined} anchors={docsConfig.anchors.length > 0 ? docsConfig.anchors : undefined} scope={plan.scope} />
|
|
40
|
+
</Fragment>
|
|
25
41
|
<TableOfContents slot="toc" headings={headings} />
|
|
26
42
|
<Fragment set:html={bodyHead} />
|
|
27
43
|
<Content />
|
package/src/styles/base.css
CHANGED
|
@@ -625,3 +625,23 @@ header.alert[data-publier-banner] [data-publier-banner-dismiss] {
|
|
|
625
625
|
margin-inline-start: 0;
|
|
626
626
|
color: var(--color-base-content);
|
|
627
627
|
}
|
|
628
|
+
|
|
629
|
+
/* Native dialog top-layer placement keeps mobile docs above the sticky header. */
|
|
630
|
+
.publier-docs-dialog {
|
|
631
|
+
justify-items: start;
|
|
632
|
+
align-items: stretch;
|
|
633
|
+
}
|
|
634
|
+
.publier-docs-dialog .modal-box {
|
|
635
|
+
width: min(20rem, calc(100vw - 2rem));
|
|
636
|
+
max-width: none;
|
|
637
|
+
max-height: 100dvh;
|
|
638
|
+
height: 100dvh;
|
|
639
|
+
border-radius: 0;
|
|
640
|
+
padding: 1rem;
|
|
641
|
+
}
|
|
642
|
+
[data-publier-mobile-toc] .publier-toc__label {
|
|
643
|
+
display: none;
|
|
644
|
+
}
|
|
645
|
+
.prose :where(h2, h3, h4, h5, h6)[id] {
|
|
646
|
+
scroll-margin-top: 5rem;
|
|
647
|
+
}
|