@publier/shell 0.3.0 → 0.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-B8fpR1il.mjs +147 -0
- package/dist/integration.mjs +1 -1
- package/dist/presets-BV7ycax-.mjs +1 -0
- package/dist/{presets-PH6ZjfE7.d.mts → presets-Cl3HtWjB.d.mts} +1 -1
- package/dist/tailwind/index.d.mts +1 -1
- package/dist/tailwind/index.mjs +1 -1
- package/dist/tailwind/loader.d.mts +6 -1
- package/dist/tailwind/loader.mjs +2 -2
- package/dist/themes/atrium.css +226 -0
- package/dist/themes/broadsheet.css +226 -0
- package/dist/themes/canopy.css +226 -0
- package/dist/themes/folio.css +230 -0
- package/dist/themes/hearth.css +3 -0
- package/dist/themes/lattice.css +223 -0
- package/dist/themes/marigold.css +226 -0
- package/dist/themes/meridian.css +227 -0
- package/dist/themes/monolith.css +226 -0
- package/dist/themes/nocturne.css +226 -0
- package/dist/themes/prism.css +228 -0
- package/package.json +12 -2
- package/src/layouts/base-layout.astro +1 -1
- package/src/tailwind/preset.css +11 -4
- package/src/virtual-modules.d.ts +5 -0
- package/dist/integration-DW8qcS1_.mjs +0 -147
- package/dist/presets-D_MQnAtK.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{i as HASHED_ASSET_RE,t as docsShell,a as publierCacheControl}from"./integration-
|
|
1
|
+
export{i as HASHED_ASSET_RE,t as docsShell,a as publierCacheControl}from"./integration-B8fpR1il.mjs";
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import{remarkAsides as e,remarkDirectivesRestoration as t}from"./plugins/remark-asides.mjs";import n from"./plugins/remark-snippets.mjs";import r from"./plugins/remark-vars.mjs";import{CODE_GROUP_SYNC_SCRIPT as i}from"./runtime/code-group-sync.mjs";import{TABS_SYNC_SCRIPT as a}from"./runtime/tabs-sync.mjs";import{publierCssPlugin as o,publierThemeCssPlugin as s}from"./tailwind/css-plugin.mjs";import{a as c,c as l,l as u,n as d,t as f}from"./presets-BV7ycax-.mjs";import{createRequire as p}from"node:module";import{configResolveShellConfig as m,contentGenerateLlmsTxt as h,generateAnalyticsBodyScripts as ee,generateAnalyticsScripts as te,resolvePublierConfig as g,shellAnnouncementBannerScript as _,shellBuildHeaders as v,shellBuildLicenseErrorMessage as ne,shellCacheControl as y,shellCollectTailwindClassTokens as b,shellComposeTailwindEntry as re,shellInjectBodyScripts as ie,shellInjectHeadScripts as ae,shellLazyUpgradeScript as oe,shellOpenInAiScript as x,shellPlanDefaultRoutes as se,shellPlanRehypePlugins as ce,shellPlanRemarkPlugins as le,shellResolvePrefetch as ue,shellResolveSnippetsConfig as de,shellRewriteHead as fe,shellRewriteModulepreload as S,shellSearchButtonScript as pe,shellSearchDialogScript as C,shellTableOfContentsScript as w,verifyLicense as me}from"@publier/native";import{existsSync as T,lstatSync as E,mkdirSync as D,readFileSync as O,readdirSync as he,writeFileSync as k}from"node:fs";import{writeFile as A}from"node:fs/promises";import j from"node:path";import{fileURLToPath as ge}from"node:url";import{fontProviders as M}from"astro/config";import{fromHtml as N}from"hast-util-from-html";import{toMdast as P}from"hast-util-to-mdast";import{gfmToMarkdown as F}from"mdast-util-gfm";import{toMarkdown as I}from"mdast-util-to-markdown";import{parse as L}from"yaml";import R from"rehype-autolink-headings";import _e from"rehype-external-links";import ve from"remark-directive";const z=/^\/(?:_astro|assets|build)\//;function B(){return v()}function ye(e){return y(e)}function be(e,t){let n=t.map(e=>e.pathname),r=fe(e,n);return{stylesheetsCount:r.stylesheetsCount,modulesCount:r.modulesCount,pagesRewritten:r.pagesRewritten,stylesheets:r.stylesheets,modules:r.modules}}function V(e,t){for(let n of e.children){if(n.type!==`element`)continue;if(t(n))return n;let e=V(n,t);if(e)return e}}function H(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`?H(e):``).join(``)}function U(e){let t=e.replace(/^\//,``).replace(/\/$/,``);if(!t)return`/`;for(let e of t.split(`/`)){let t;try{t=decodeURIComponent(e)}catch{return}if(!t||t===`.`||t===`..`||/[\\/?#]/.test(t)||[...t].some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)===127))return}return`/${t}`}function W(e){try{return E(e),!0}catch(e){if(e.code===`ENOENT`)return!1;throw e}}function G(e,t){let n=j.resolve(e),r=j.resolve(n,t);if(!r.startsWith(`${n}${j.sep}`))throw Error(`Unsafe export path: ${t}`);let i=n;for(let e of j.relative(n,r).split(j.sep))if(i=j.join(i,e),W(i)&&E(i).isSymbolicLink())throw Error(`Symlink in export path: ${t}`);return r}function K(e){return!!V(e,e=>e.tagName===`meta`&&String(e.properties.name).toLowerCase()===`robots`&&/(?:^|[\s,])(noindex|none)(?:$|[\s,])/i.test(String(e.properties.content)))}function q(e,t){let n=t.slice(1),r=(n?[`${n}/index.html`,`${n}.html`]:[`index.html`]).find(t=>W(G(e,t)));if(!r)return;let i=G(e,r);return E(i).isFile()?{relative:r,file:i}:void 0}function J(e,t){let n=[],r=/* @__PURE__ */ new Set;for(let{pathname:i}of t){let t=U(i);if(!t||r.has(t)||t===`/404`||t===`/500`)continue;let a=`${t}${t!==`/`&&i.endsWith(`/`)?`/`:``}`,o=t.slice(1),s=q(e,t);if(!s)continue;let{relative:c,file:l}=s,u=N(O(l,`utf-8`));if(K(u)||V(u,e=>e.tagName===`meta`&&String(e.properties.httpEquiv).toLowerCase()===`refresh`))continue;let d=V(u,e=>e.tagName===`title`),f=d&&H(d).replace(/\s+/g,` `).trim();if(!f)continue;let p=V(u,e=>e.tagName===`meta`&&String(e.properties.name).toLowerCase()===`description`),m=String(p?.properties.content??``).replace(/\s+/g,` `).trim()||void 0;r.add(t),n.push({url:a,title:f,description:m,collection:o.split(`/`)[0]||void 0,tree:u,directory:c===`index.html`||c.endsWith(`/index.html`)})}return n.sort((e,t)=>e.url.localeCompare(t.url))}function xe(e,t){return J(e,t).map(({url:e,title:t,description:n,collection:r})=>({url:e,title:t,description:n,collection:r}))}function Se(e,t,n){let r=G(e,`llms.txt`);if(W(r))return{written:!1,pageCount:0,skipped:`existing-file`};let i=xe(e,t);if(i.length===0)return{written:!1,pageCount:0,skipped:`no-pages`};let a=h(JSON.stringify({siteName:n.siteName,siteDescription:n.siteDescription,pages:i,collections:n.collections}));return k(r,a,{encoding:`utf-8`,flag:`wx`}),{written:!0,pageCount:i.length}}function Ce(e,t){let n=t.map(e=>e.pathname),r=S(e,n);return{jsCount:r.jsCount,fontsCount:r.fontsCount,pagesRewritten:r.pagesRewritten}}function we(e,t=[]){for(let n of e.children){if(n.type!==`element`)continue;let e=n.data,r=n.properties.dataPagefindBody===void 0?void 0:e?.position?.properties?.dataPagefindBody;r?.start.offset!==void 0&&r.end.offset!==void 0&&t.push({start:r.start.offset,end:r.end.offset}),we(n,t)}return t}function Te(e){if(!e.includes(`data-pagefind-body`)||!/noindex|none/i.test(e))return;let t=N(e,{verbose:!0});if(!K(t))return;let n=we(t).sort((e,t)=>t.start-e.start);if(n.length===0)return;let r=e;for(let{start:e,end:t}of n){let n=e;for(;n>0&&/\s/.test(r.charAt(n-1));)n--;r=r.slice(0,n)+r.slice(t)}return r}function Ee(e,t){let n=0,r=/* @__PURE__ */ new Set;for(let{pathname:i}of t){let t=U(i);if(!t||r.has(t))continue;r.add(t);let a=q(e,t);if(!a)continue;let o=Te(O(a.file,`utf-8`));o!==void 0&&(k(a.file,o,`utf-8`),n++)}return{pagesRewritten:n}}const De=/* @__PURE__ */ new Set([`nav`,`footer`,`script`,`style`,`noscript`,`template`,`button`,`input`,`select`,`textarea`,`form`,`svg`]),Oe=/* @__PURE__ */ new Set([`navigation`,`search`,`tablist`,`tab`,`button`,`menu`,`toolbar`]);function ke(e){return De.has(e.tagName)||Oe.has(String(e.properties.role))||`dataPagefindIgnore`in e.properties||`dataPublierMarkdownExclude`in e.properties||String(e.properties.dataMdast)===`ignore`}function Ae(e){e.children=e.children.filter(e=>e.type!==`comment`&&(e.type!==`element`||!ke(e)));for(let t of e.children)t.type===`element`&&Ae(t)}function je(e,t,n,r){delete e.properties.hidden,delete e.properties.ariaHidden,delete e.properties.style;for(let i of[`href`,`src`,`poster`]){let a=e.properties[i];if(typeof a!=`string`||!a)continue;let o=new URL(a,t);e.properties[i]=n||o.origin!==r?o.href:`${o.pathname}${o.search}${o.hash}`}if(e.tagName===`pre`){let t=V(e,e=>e.tagName===`code`);if(t){let n=[],r=e=>{for(let t of e.children)t.type===`element`&&(Array.isArray(t.properties.className)&&t.properties.className.includes(`ec-line`)?n.push(t):r(t))};r(t),n.length&&(t.children=[{type:`text`,value:n.map(e=>H(V(e,e=>Array.isArray(e.properties.className)&&e.properties.className.includes(`code`))??e)).join(`
|
|
2
|
+
`)}]);let i=e.properties.dataLanguage;typeof i==`string`&&(t.properties.className=[`language-${i}`])}}for(let i of e.children)i.type===`element`&&je(i,t,n,r)}function Me(e,t){let n=structuredClone(e.tree);Ae(n);let r=V(n,e=>e.tagName===`main`)??V(n,e=>e.tagName===`article`);if(!r)return;let i=e.url===`/`?`/`:e.url.replace(/\/$/,``),a=`${i}${e.directory&&i!==`/`?`/`:``}`,o=new URL(a,t||`https:`),s=o,c=V(e.tree,e=>e.tagName===`base`&&`href`in e.properties)?.properties.href;if(typeof c==`string`)try{let e=new URL(c,o);(e.protocol===`https:`||e.protocol===`http:`)&&(s=e)}catch{}je(r,s,!!t,o.origin);let l=I(P({type:`root`,children:[r]}),{fences:!0,extensions:[F()]});return l.trim()?l:void 0}function Ne(e,t,n){let r=J(e,t).filter(e=>n.collections.length===0||n.collections.includes(e.collection??`pages`)).flatMap(e=>{let t=Me(e,n.siteUrl);return t?[{page:e,markdown:t,relative:`${e.url===`/`?`index`:e.url.slice(1).replace(/\/$/,``)}.md`}]:[]}),i=G(e,`llms-full.txt`),a=/* @__PURE__ */ new Set,o=t=>{if(W(t)&&!E(t).isFile())throw Error(`Markdown export collision: ${j.relative(e,t)}`)};r.length&&(o(i),a.add(i));for(let t of r){let n=G(e,t.relative);if([...a].some(e=>n===e||n.startsWith(`${e}${j.sep}`)||e.startsWith(`${n}${j.sep}`)))throw Error(`Markdown export collision: ${t.relative}`);o(n),a.add(n)}let s={pageCount:r.length,written:0,existing:0,fullWritten:!1};for(let t of r){let n=G(e,t.relative);W(n)?s.existing++:(D(j.dirname(n),{recursive:!0}),k(n,t.markdown,{encoding:`utf-8`,flag:`wx`}),s.written++)}if(r.length&&!W(i)){let e=I({type:`root`,children:[{type:`heading`,depth:1,children:[{type:`text`,value:n.siteName}]},...n.siteDescription?[{type:`blockquote`,children:[{type:`paragraph`,children:[{type:`text`,value:n.siteDescription}]}]}]:[]]}),t=r.map(({page:e,markdown:t})=>{let r=n.siteUrl?new URL(e.url,n.siteUrl).href:e.url;return`${I({type:`root`,children:[{type:`heading`,depth:2,children:[{type:`link`,url:r,children:[{type:`text`,value:e.title}]}]}]})}\n${t}`}).join(`
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
`);k(i,`${e}\n${t}`,{encoding:`utf-8`,flag:`wx`}),s.fullWritten=!0}return s}function Pe(e,t,n){return n?ae(e,t.map(e=>e.pathname),n):0}function Fe(e,t,n){return n?ie(e,t.map(e=>e.pathname),n):0}const Ie={enabled:!1,full:!1,collections:[]},Le={enabled:!0,hotkey:`k`};function Re(e){let t=m(e),{config:n,errors:r}=JSON.parse(t);if(r.length>0){let e=r.map(e=>` - [${e.code}] ${e.path}: ${e.message}`);throw Error(`Invalid publier.config.yaml:\n${e.join(`
|
|
6
|
+
`)}`)}return{...n,announcement:n.announcement??null,llms:n.llms??Ie,search:n.search??Le}}function ze(e){try{let{errors:t}=g(L(e));return t.filter(e=>e.code===`unknown-key`).map(e=>`[@publier/shell] publier.config.yaml \`${e.path}\` has no effect and is ignored. ${e.message}`)}catch{return[]}}function Be(e){let t=j.join(e,`publier.config.yaml`);if(!T(t))return null;try{return O(t,`utf-8`)}catch{return null}}function Ve(e){e.children&&=e.children.map(t=>t.type===`element`&&t.tagName===`table`?e.properties?.dataPublierTableScroll?t:{type:`element`,tagName:`publier-table-scroll`,properties:{className:[`publier-table-scroll`],dataPublierTableScroll:!0},children:[t]}:(Ve(t),t))}function He(){return Ve}function Ue(e,t){let n=p(import.meta.url);for(let t of[e,n])try{let e=t(`remark-math`),n=t(`rehype-katex`);return{remarkMath:e.default??e,rehypeKatex:n.default??n}}catch{}return t.warn("[@publier/shell] remark-math / rehype-katex unavailable in both project and shell. Reinstall node_modules, or set `docsShell({ math: false })` to opt out."),null}function We(e,t){let n=p(import.meta.url);for(let t of[e,n])try{let e=t(`@astrojs/markdown-remark`);if(typeof e.unified==`function`)return e.unified}catch{}return t.warn("[@publier/shell] @astrojs/markdown-remark is not resolvable. On Astro 7 (Sätteri is the default Markdown processor) this means callouts, {{vars}}, <Snippet>, and math will NOT render — add `@astrojs/markdown-remark` to your dependencies."),null}function Ge(i,a,o){let s=JSON.parse(i),c=[];for(let i of s)switch(i.id){case`remark-vars`:a&&c.push([r,a]);break;case`remark-directive`:c.push(ve);break;case`remark-asides`:c.push(e);break;case`remark-directives-restoration`:c.push(t);break;case`remark-snippets`:c.push([n,i.options]);break;case`remark-math`:o&&c.push(o.remarkMath)}return c}function Ke(e,t){let n=JSON.parse(e),r=[];for(let e of n)switch(e.id){case`rehype-tables`:r.push([He,e.options]);break;case`rehype-autolink-headings`:r.push([R,e.options]);break;case`rehype-external-links`:r.push([_e,e.options]);break;case`rehype-katex`:t&&r.push(t.rehypeKatex)}return r}async function qe(e,t,n,r){if(e.mermaid===!1||t.some(e=>e.name===`astro-mermaid`))return;let i=p(import.meta.url),a=i(`node:fs`),o=i(`node:path`),{pathToFileURL:s}=i(`node:url`),c=o.join(n,`node_modules/astro-mermaid`),l;try{let e=JSON.parse(a.readFileSync(o.join(c,`package.json`),`utf8`)),t=e.exports?.[`.`]?.import??e.main;if(!t)return;l=o.join(c,t)}catch{return}let u=Function(`url`,`return import(url)`),d;try{d=await u(s(l).href)}catch{return}r({integrations:[(d.default??d)({autoTheme:!0})]})}const Je=oe();function Ye({root:e,mathEnabled:t}){let n=p(import.meta.url),r=t=>{try{return j.dirname(n.resolve(`${t}/package.json`,{paths:[e]}))}catch{return null}},i=(e,t)=>{let n=r(e);return n?{abs_path:j.join(n,t).split(j.sep).join(`/`)}:null},a=[i(`@publier/shell`,`src/components`),i(`@publier/shell`,`src/components/ui`),i(`@publier/shell`,`src/routes`),i(`@publier/primitives`,`src/components`)].filter(e=>e!==null),o=null;if(t)try{o=n.resolve(`katex/dist/katex.min.css`).split(j.sep).join(`/`)}catch{o=null}let s=re(JSON.stringify(a),o??void 0),c=b(),l=j.join(e,`.astro`);if(c.length>0){T(l)||D(l,{recursive:!0});let e=j.join(l,`publier-class-safelist.html`),t=c.split(/\s+/).filter(Boolean),n=[];for(let e=0;e<t.length;e+=200)n.push(t.slice(e,e+200).join(` `));let r=n.map(e=>`<div class="${e}"></div>`).join(`
|
|
7
|
+
`);k(e,r,`utf8`);let i=e.split(j.sep).join(`/`);s+=`@source "${i}";\n`}let u=j.join(l,`publier-tailwind-entry.css`);return(T(u)?O(u,`utf8`):``)!==s&&(D(l,{recursive:!0}),k(u,s)),u}function Xe(e,t,n){if(Ze(n))return[];try{let n=e(`@tailwindcss/vite`),r=typeof n==`function`?n:n.default;if(!r)return t.warn(`[@publier/shell] @tailwindcss/vite resolved but has no callable default export. Tailwind v4 + daisyUI utilities WILL NOT be emitted.`),[];let i=r();return Array.isArray(i)?i:[i]}catch{return t.warn('[@publier/shell] @tailwindcss/vite is not installed in this project. Tailwind v4 + daisyUI utilities WILL NOT be emitted — the site will render unstyled. Add `"@tailwindcss/vite": "^4"` to your package.json alongside `tailwindcss`.'),[]}}function Ze(e){for(let t of e){if(!t)continue;if(Array.isArray(t)){if(Ze(t))return!0;continue}let e=t.name;if(typeof e==`string`&&e.startsWith(`@tailwindcss/vite`))return!0}return!1}const Qe=[`light`,`dark`,`system`];function $e(e){return typeof e==`string`&&Qe.includes(e)}function et(e){let t=j.join(e,`theme.yaml`);if(!T(t))return{preset:`light`};let n;try{n=L(O(t,`utf8`))}catch{return{preset:`light`}}let r=n&&typeof n==`object`?n:{},i=typeof r.preset==`string`&&f.includes(r.preset)?r.preset:`light`,a=r.appearance?.default;return{preset:i,appearance:$e(a)?a:void 0}}function tt(e){if(e)try{let t=L(e)?.appearance?.default;return $e(t)?t:void 0}catch{return}}function nt(e,t,n){return n??t??l(e)}function rt(e,t=/* @__PURE__ */ new Set){let n=d[e],r=n?[...t.has(`heading`)?[]:[n.heading],...t.has(`body`)?[]:[n.body]]:t.has(`body`)?[]:[`inter`];return[...new Set(r)].map(e=>({id:e,cssVariable:u(e),name:c[e].family,weights:c[e].weights,fallbacks:c[e].serif?[`Georgia`,`serif`]:[`system-ui`,`sans-serif`],packageName:`@fontsource-variable/${e}`}))}function it(e){return{name:`publier-tailwind-entry-hmr-shim`,apply:`serve`,configureServer(t){let n=t.config.root,r=e.entryPath.startsWith(n)?e.entryPath.slice(n.length).split(j.sep).join(`/`):null;r&&t.middlewares.use(r,(e,t,n)=>{if((e.url??``).includes(`?`)||e.method!==`GET`&&e.method!==`HEAD`)return n();t.setHeader(`Content-Type`,`application/javascript`),t.setHeader(`Cache-Control`,`no-cache`),t.statusCode=200,t.end(`
|
|
8
|
+
if (import.meta.hot) {
|
|
9
|
+
import.meta.hot.accept();
|
|
10
|
+
}
|
|
11
|
+
`)})}}}const at=`import 'astro:scripts/page-ssr.js';
|
|
12
|
+
`;function ot(){return{name:`publier-dev-page-ssr-propagation`,apply:`serve`,enforce:`post`,transform(e,t){let n=t.split(`?`)[0];return!n.endsWith(`.astro`)||!n.includes(`/src/pages/`)||e.includes(at)?null:{code:at+e,map:null}}}}function Y(e,t){let n=e[t];if(n===`\\`&&t+1<e.length)return t+2;if(n===`"`||n===`'`){let r=n,i=t+1;for(;i<e.length&&e[i]!==r;)e[i]===`\\`&&i+1<e.length?i+=2:i++;return i+1}if(n===`/`&&e[t+1]===`*`){let n=e.indexOf(`*/`,t+2);return n===-1?e.length:n+2}return t}function X(e,t){let n=1,r=t+1;for(;r<e.length&&n>0;){let t=Y(e,r);if(t!==r){r=t;continue}let i=e[r];i===`{`?n++:i===`}`&&n--,r++}return r}function Z(e){let t=[],n=(r,i)=>{let a=r,o=``,s=r;for(;a<i;){let r=Y(e,a);if(r!==a){a=r;continue}let c=e[a];if(c===`@`&&e.startsWith(`@media`,a)&&/[\s(]/.test(e[a+6]??``)){let n=e.indexOf(`{`,a);if(n===-1||n>=i){a++;continue}let r=X(e,n);o+=e.slice(s,a),t.push(e.slice(a,r)),a=r,s=a}else if(c===`{`){let t=X(e,a);if(t>i)break;let r=n(a+1,t-1);o+=e.slice(s,a+1)+r+`}`,a=t,s=a}else a++}return o+=e.slice(s,i),o},r=0,i=``;for(;r<e.length;){let t=Y(e,r);if(t!==r){r=t;continue}let a=e.indexOf(`@layer utilities`,r);if(a===-1){i+=e.slice(r);break}let o=e[a+16];if(o!==` `&&o!==` `&&o!==`
|
|
13
|
+
`&&o!==`\r`&&o!==`{`){r=a+16;continue}let s=r,c=!1;for(;s<a;){let t=Y(e,s);if(t!==s){if(t>a){c=!0,r=t;break}s=t}else s++}if(c)continue;let l=e.indexOf(`{`,a);if(l===-1){i+=e.slice(r);break}i+=e.slice(r,l+1);let u=X(e,l);i+=n(l+1,u-1),i+=`}`,r=u}return t.length>0&&(i.endsWith(`
|
|
14
|
+
`)||(i+=`
|
|
15
|
+
`),i+=t.join(`
|
|
16
|
+
`),i.endsWith(`
|
|
17
|
+
`)||(i+=`
|
|
18
|
+
`)),i}function st(){return{name:`publier-cascade-hoist`,enforce:`post`,transform(e,t){if(!t.endsWith(`.css`)&&!t.includes(`.css?`))return null;let n=Z(e);return n===e?null:{code:n,map:null}},generateBundle(e,t){for(let e of Object.keys(t)){if(!e.endsWith(`.css`))continue;let n=t[e];if(!n||n.type!==`asset`)continue;let r=typeof n.source==`string`?n.source:new TextDecoder().decode(n.source),i=Z(r);i!==r&&(n.source=i)}}}}function Q(e,t,n){let r=`\0${e}`,i=`export const ${t} = ${JSON.stringify(n)};`;return{name:`publier-${e.replace(/^virtual:publier-/,``)}`,resolveId(t){if(t===e)return r},load(e){if(e===r)return i}}}function ct(e,t=6){return e.length===0?`[]`:e.length<=t?`[${e.join(`, `)}]`:`[${e.slice(0,t).join(`, `)}, +${e.length-t} more]`}function lt(e){let t=[`import '@publier/shell/runtime/marketing-nav';`,Je,a,i,`
|
|
19
|
+
(() => {
|
|
20
|
+
if (customElements.get('publier-table-scroll')) return;
|
|
21
|
+
class PublierTableScroll extends HTMLElement {
|
|
22
|
+
observer;
|
|
23
|
+
frame;
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
|
|
26
|
+
this.frame = requestAnimationFrame(() => {
|
|
27
|
+
if (!this.isConnected) return;
|
|
28
|
+
this.observer = new ResizeObserver(() => this.update());
|
|
29
|
+
this.observer.observe(this);
|
|
30
|
+
const table = this.querySelector('table');
|
|
31
|
+
if (table) this.observer.observe(table);
|
|
32
|
+
this.update();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
cancelAnimationFrame(this.frame);
|
|
37
|
+
this.observer?.disconnect();
|
|
38
|
+
}
|
|
39
|
+
update() {
|
|
40
|
+
if (this.clientWidth > 0 && this.scrollWidth > this.clientWidth) {
|
|
41
|
+
this.setAttribute('tabindex', '0');
|
|
42
|
+
this.setAttribute('role', 'region');
|
|
43
|
+
this.setAttribute('aria-label', this.querySelector('caption')?.textContent.trim() || 'Scrollable table');
|
|
44
|
+
} else {
|
|
45
|
+
this.removeAttribute('tabindex');
|
|
46
|
+
this.removeAttribute('role');
|
|
47
|
+
this.removeAttribute('aria-label');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
customElements.define('publier-table-scroll', PublierTableScroll);
|
|
52
|
+
})();
|
|
53
|
+
`,_(),x(),w()];return e.searchEnabled&&t.push(C(e.searchHotkey),pe()),t.join(`
|
|
54
|
+
`)}function ut(e,t){let n=[],r=[],i=[];for(let a of[`heading`,`body`,`mono`]){let o=e[a];if(!o?.family)continue;let s=`--publier-font-${a}`,c=a===`mono`?[`monospace`]:[`system-ui`,`sans-serif`],l=[o.weight??`400`],u=[o.style??`normal`];if(o.googleFontsUrl)n.push({name:o.family,cssVariable:s,provider:M.google(),fallbacks:c,weights:l,styles:u,subsets:[`latin`]}),r.push(a);else if(o.src){let e=j.isAbsolute(o.src)&&T(o.src)?o.src:j.join(t,`public`,o.src.replace(/^\/+/,``));n.push({name:o.family,cssVariable:s,provider:M.local(),fallbacks:c,weights:l,styles:u,subsets:[`latin`],options:{variants:[{weight:l[0],style:u[0],src:[e]}]}}),r.push(a)}else i.push(`${s}:"${o.family}",${c.join(`,`)};`)}return{entries:n,familyOnlyCss:i.length?`:root{${i.join(``)}}`:``,slots:r}}const dt=[{pkg:`astro-expressive-code`,aliases:[`astro-expressive-code`]},{pkg:`@astrojs/mdx`,aliases:[`@astrojs/mdx`]},{pkg:`@astrojs/sitemap`,aliases:[`@astrojs/sitemap`]},{pkg:`astro-pagefind`,aliases:[`astro-pagefind`,`pagefind`]},{pkg:`@qwik.dev/astro`,aliases:[`@qwik.dev/astro`]}];function $(e,t){let n=j.join(e,`src`,`content`,t);if(!T(n))return!1;try{return he(n,{recursive:!0}).some(e=>typeof e==`string`&&/\.mdx?$/.test(e))}catch{return!1}}function ft(e){return JSON.stringify(e).replace(/</g,`\\u003c`)}function pt(e={}){let t=null,n=``,r=``,i={name:`@publier/shell`,hooks:{"astro:config:setup":async({command:a,config:c,updateConfig:l,injectScript:u,injectRoute:d,logger:f})=>{let m=c.root?ge(c.root):process.cwd();try{me()}catch(e){let t=e instanceof Error?e.message:String(e),n=ne(t);throw n?Error(n):e}let h=p(j.join(m,`package.json`)),g=JSON.stringify(e),_=Be(m),v=Re(_??``);if(_)for(let e of ze(_))f.warn(e);let y=v.site;t={llms:v.llms,siteName:y.name,siteUrl:y.url??void 0,siteDescription:y.description??void 0};let b=v.vars,re=v.fonts,ie=v.nav,ae=v.announcement,oe=v.docs,x=typeof y.url==`string`&&y.url.length>0;x&&!c.site&&l({site:y.url});let fe=new Set(c.integrations.map(e=>e.name)),S=dt.filter(({aliases:e})=>!e.some(e=>fe.has(e)));S.length>0&&f.warn(`[@publier/shell] Required framework integrations are not registered in
|
|
55
|
+
astro.config.ts. As of @publier/shell@2.0.0, docsShell() no longer
|
|
56
|
+
auto-wires these. Add the following to your integrations[] array
|
|
57
|
+
(import statements + entries shown). Order matters: docsShell() must
|
|
58
|
+
come FIRST (astro-expressive-code >=0.43 registers into the Markdown
|
|
59
|
+
processor it finds at its own setup — docsShell's pinned unified()
|
|
60
|
+
processor must already be in place), and expressive-code must precede
|
|
61
|
+
mdx.
|
|
62
|
+
|
|
63
|
+
import expressiveCode from 'astro-expressive-code';
|
|
64
|
+
import mdx from '@astrojs/mdx';
|
|
65
|
+
import sitemap from '@astrojs/sitemap';
|
|
66
|
+
import pagefind from 'astro-pagefind';
|
|
67
|
+
import qwik from '@qwik.dev/astro';
|
|
68
|
+
|
|
69
|
+
integrations: [
|
|
70
|
+
docsShell({ /* options */ }),
|
|
71
|
+
expressiveCode(),
|
|
72
|
+
mdx(),
|
|
73
|
+
sitemap(),
|
|
74
|
+
pagefind(),
|
|
75
|
+
qwik({ clientRouter: true }),
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
Missing:\n ${S.map(e=>e.pkg).join(`
|
|
79
|
+
`)}\n`);let pe=dt.find(({pkg:e})=>e===`astro-pagefind`)?.aliases??[],C=c.integrations.findIndex(e=>e.name===i.name),w=c.integrations.findIndex(e=>pe.includes(e.name)),E=c.integrations[w];C>=0&&E&&w<C&&f.warn(`[@publier/shell] "${E.name}" is registered before docsShell() in integrations[]. Pagefind indexes dist/ in its own astro:build:done, before docsShell() removes noindex pages from the search index, so pages marked noindex stay in reader search. Fix: move docsShell() BEFORE pagefind() in astro.config.ts integrations[].`);let D=c.prefetch;ue(D===void 0?void 0:JSON.stringify(D),g)&&l({prefetch:{prefetchAll:!0,defaultStrategy:`viewport`}});let{entries:O,familyOnlyCss:he,slots:k}=re?ut(re,m):{entries:[],familyOnlyCss:``,slots:[]},A=et(m),N=nt(A.preset,A.appearance,tt(_)),P=rt(A.preset,new Set(k)),F=v.snippets??null,I=F==null?null:F===!1?`false`:JSON.stringify(F),L=de(g,I??void 0,T(j.join(m,`content/snippets`))),R=JSON.parse(L),_e={...e,snippets:R===null?void 0:R},ve=JSON.stringify(_e),z=e.math!==!1,B=z?Ue(h,f):null,ye=le(ve,!!(b&&Object.keys(b).length>0),R!==null&&R!==!1,z&&B!==null),be=ce(g,z&&B!==null),V=Ge(ye,b,B),H=Ke(be,B),U=We(h,f);await qe(e,c.integrations,m,l);let W=Ye({root:m,mathEnabled:z}),G=lt({searchEnabled:e.search!==!1,searchHotkey:v.search.hotkey}),K=JSON.stringify({docs:$(m,`docs`),blog:$(m,`blog`),changelog:$(m,`changelog`)}),q=JSON.parse(se(g,x,K)),J=q.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(U){let e=c.markdown?.processor,t=e?.options?.hastPlugins;e?.name!==`unified`&&Array.isArray(t)&&t.length>0&&f.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.`)}l({markdown:U?{processor:U({remarkPlugins:V,rehypePlugins:H})}:{remarkPlugins:[...V],rehypePlugins:[...H]},vite:{ssr:{noExternal:[`@publier/shell`],external:[`@publier/native`]},build:{rollupOptions:{external:[`@publier/native`]}},optimizeDeps:{exclude:[`@publier/shell`,`@publier/native`]},plugins:[...Xe(h,f,c.vite?.plugins??[]),s({root:m}),o({root:m}),Q(`virtual:publier-nav-config`,`navConfig`,ie),it({entryPath:W}),ot(),Q(`virtual:publier-announcement`,`announcement`,ae),Q(`virtual:publier-site`,`site`,y),Q(`virtual:publier-docs-config`,`docsConfig`,oe),Q(`virtual:publier-appearance`,`appearance`,{...v.appearance,default:N}),Q(`virtual:publier-feeds`,`feeds`,J),Q(`virtual:publier-fonts`,`fonts`,{slots:k,faces:P.map(e=>e.cssVariable)}),st()]}}),l({fonts:[...P.map(e=>({name:e.name,cssVariable:e.cssVariable,provider:M.npm({remote:!1}),fallbacks:e.fallbacks,weights:[e.weights],styles:[`normal`],subsets:[`latin`],options:{package:e.packageName}})),{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`}},...O]}),u(`page-ssr`,[`import ${JSON.stringify(W)};`,`import 'virtual:publier-theme-css';`,`import 'virtual:publier-custom-css';`,`import '@publier/shell/styles/base.css';`].join(`
|
|
80
|
+
`)),u(`page`,G),u(`head-inline`,`(function(){
|
|
81
|
+
if (typeof window === 'undefined' || !window.sessionStorage || !window.fetch) return;
|
|
82
|
+
var store = window.sessionStorage;
|
|
83
|
+
var ResponseCtor = window.Response;
|
|
84
|
+
var origFetch = window.fetch.bind(window);
|
|
85
|
+
var NS = 'publier:bg:';
|
|
86
|
+
var PATTERN = /^\\/(?:_astro|assets|build)\\/(?:[^\\/]*bundle-graph[^\\/]*\\.json|q-manifest[^\\/]*\\.json)(?:\\?.*)?$/;
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var inflight = Object.create(null);
|
|
92
|
+
function serve(body){
|
|
93
|
+
return new ResponseCtor(body, {
|
|
94
|
+
status: 200,
|
|
95
|
+
headers: { 'content-type': 'application/json' }
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
window.fetch = function(input, init){
|
|
99
|
+
var url = typeof input === 'string' ? input : (input && input.url) || '';
|
|
100
|
+
var method = (init && init.method) || (input && input.method) || 'GET';
|
|
101
|
+
if (!url || method !== 'GET' || !PATTERN.test(url)) {
|
|
102
|
+
return origFetch(input, init);
|
|
103
|
+
}
|
|
104
|
+
var key = NS + url;
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
var hit = store.getItem(key);
|
|
108
|
+
if (hit !== null) return Promise.resolve(serve(hit));
|
|
109
|
+
} catch (_) {}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
if (inflight[url]) return inflight[url].then(serve);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
var pending = origFetch(input, init).then(function(res){
|
|
116
|
+
if (res && res.ok) {
|
|
117
|
+
return res.clone().text().then(function(body){
|
|
118
|
+
try { store.setItem(key, body); } catch (_) {}
|
|
119
|
+
delete inflight[url];
|
|
120
|
+
return res;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
delete inflight[url];
|
|
124
|
+
return res;
|
|
125
|
+
}, function(err){
|
|
126
|
+
delete inflight[url];
|
|
127
|
+
throw err;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
inflight[url] = pending.then(function(res){
|
|
131
|
+
return res && res.ok ? res.clone().text() : '';
|
|
132
|
+
});
|
|
133
|
+
return pending;
|
|
134
|
+
};
|
|
135
|
+
})();`),he&&u(`head-inline`,`
|
|
136
|
+
const _pFonts = document.createElement('style');
|
|
137
|
+
_pFonts.textContent = ${JSON.stringify(he)};
|
|
138
|
+
document.head.appendChild(_pFonts);
|
|
139
|
+
`);{n=``,r=``;let e=v.analytics;e&&(n=te(e),r=ee(e),a===`dev`&&(n&&u(`head-inline`,`
|
|
140
|
+
const _pAnalytics = document.createRange().createContextualFragment(${ft(n)});
|
|
141
|
+
document.head.appendChild(_pAnalytics);
|
|
142
|
+
`),r&&u(`head-inline`,`
|
|
143
|
+
const _pAnalyticsBody = ${ft(r)};
|
|
144
|
+
const _pInjectBody = () => document.body.appendChild(document.createRange().createContextualFragment(_pAnalyticsBody));
|
|
145
|
+
if (document.body) _pInjectBody();
|
|
146
|
+
else document.addEventListener('DOMContentLoaded', _pInjectBody, { once: true });
|
|
147
|
+
`)))}for(let e of q)d({pattern:e.pattern,entrypoint:e.entrypoint,prerender:e.prerender});q.length>0&&f.info(`[@publier/shell] Injected default routes: ${q.map(e=>e.pattern).join(`, `)}.`),f.info(`[@publier/shell] Plugin pipeline wired.`)},"astro:build:done":async({dir:e,pages:i,logger:a})=>{let o=ge(e),s=j.join(o,`_headers`);await A(s,B(),`utf-8`),a.info(`[@publier/shell] Wrote 5 header rules to dist/_headers.`);let c=be(o,i);c.pagesRewritten>0&&a.info(`[@publier/shell] Backfilled head tags on ${c.pagesRewritten} HTML file(s) (stylesheets=${ct(c.stylesheets)}, modules=${ct(c.modules)}).`);let l=Ce(o,i);l.pagesRewritten>0&&a.info(`[@publier/shell] Injected preload tags into ${l.pagesRewritten} HTML file(s) (js=${l.jsCount}, fonts=${l.fontsCount}).`);let u=Ee(o,i);if(u.pagesRewritten>0&&a.info(`[@publier/shell] Kept ${u.pagesRewritten} noindex page(s) out of search.`),t?.llms.enabled){let e=Se(o,i,{siteName:t.siteName,siteDescription:t.siteDescription,collections:t.llms.collections});if(e.written?a.info(`[@publier/shell] Wrote dist/llms.txt (${e.pageCount} page(s)).`):e.skipped===`existing-file`?a.info(`[@publier/shell] dist/llms.txt already exists — left as-is.`):a.warn(`[@publier/shell] llms.enabled is set but no page had a <title> to index; no llms.txt written.`),t.llms.full){let e=Ne(o,i,{siteName:t.siteName,siteDescription:t.siteDescription,siteUrl:t.siteUrl,collections:t.llms.collections});a.info(`[@publier/shell] Markdown exports: ${e.written} written, ${e.existing} existing; llms-full.txt ${e.fullWritten?`written`:`unchanged`}.`)}}let d=Pe(o,i,n);d>0&&a.info(`[@publier/shell] Injected head scripts into ${d} HTML file(s).`);let f=Fe(o,i,r);f>0&&a.info(`[@publier/shell] Injected body scripts into ${f} HTML file(s).`)}}};return i}export{ye as a,z as i,Z as n,st as r,pt as t};
|
package/dist/integration.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as docsShell,n as hoistMediaOutOfUtilitiesLayer,r as publierCascadeHoistPlugin}from"./integration-
|
|
1
|
+
export{t as docsShell,n as hoistMediaOutOfUtilitiesLayer,r as publierCascadeHoistPlugin}from"./integration-B8fpR1il.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=/* @__PURE__ */ `almond.aspen.atrium.broadsheet.canopy.catppuccin.dark.dusk.emerald.enterprise.folio.hearth.lattice.light.maple.marigold.meridian.monolith.neutral.nocturne.ocean.prism.purple.ruby.solar.vitepress`.split(`.`);function t(){return e}function n(t){return e.includes(t)}const r=[`display-xl`,`display-lg`,`display-md`,`heading-lg`,`heading-md`,`heading-sm`,`title`,`body-lg`,`body-md`,`body-sm`,`caption`,`label`,`button`,`code`],i=[`size`,`weight`,`line-height`,`tracking`],a={inter:{family:`Inter Variable`,weights:`100 900`,serif:!1},"plus-jakarta-sans":{family:`Plus Jakarta Sans Variable`,weights:`200 800`,serif:!1},"source-serif-4":{family:`Source Serif 4 Variable`,weights:`200 900`,serif:!0},geist:{family:`Geist Variable`,weights:`100 900`,serif:!1},newsreader:{family:`Newsreader Variable`,weights:`200 800`,serif:!0},"ibm-plex-sans":{family:`IBM Plex Sans Variable`,weights:`100 700`,serif:!1},nunito:{family:`Nunito Variable`,weights:`200 1000`,serif:!1},"dm-sans":{family:`DM Sans Variable`,weights:`100 1000`,serif:!1},"space-grotesk":{family:`Space Grotesk Variable`,weights:`300 700`,serif:!1},manrope:{family:`Manrope Variable`,weights:`200 800`,serif:!1},outfit:{family:`Outfit Variable`,weights:`100 900`,serif:!1}},o={atrium:{heading:`plus-jakarta-sans`,body:`plus-jakarta-sans`},broadsheet:{heading:`source-serif-4`,body:`inter`},canopy:{heading:`geist`,body:`geist`},folio:{heading:`newsreader`,body:`newsreader`},hearth:{heading:`inter`,body:`inter`},lattice:{heading:`ibm-plex-sans`,body:`ibm-plex-sans`},marigold:{heading:`nunito`,body:`nunito`},meridian:{heading:`dm-sans`,body:`dm-sans`},monolith:{heading:`space-grotesk`,body:`inter`},nocturne:{heading:`manrope`,body:`manrope`},prism:{heading:`outfit`,body:`outfit`}};function s(e){return e===`inter`?`--publier-font-builtin-sans`:`--publier-font-builtin-${e}`}const c={canopy:`dark`,nocturne:`dark`};function l(e){return c[e??``]??`system`}export{a,l as c,r as i,s as l,o as n,n as o,i as r,t as s,e as t};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Node-side introspection (reading CSS files, computing contrast) lives in
|
|
6
6
|
* `./loader.ts` to keep `node:fs` out of the browser bundle path.
|
|
7
7
|
*/
|
|
8
|
-
declare const AVAILABLE_THEMES: readonly ['almond', 'aspen', 'catppuccin', 'dark', 'dusk', 'emerald', 'enterprise', 'hearth', 'light', 'maple', 'neutral', 'ocean', 'purple', 'ruby', 'solar', 'vitepress'];
|
|
8
|
+
declare const AVAILABLE_THEMES: readonly ['almond', 'aspen', 'atrium', 'broadsheet', 'canopy', 'catppuccin', 'dark', 'dusk', 'emerald', 'enterprise', 'folio', 'hearth', 'lattice', 'light', 'maple', 'marigold', 'meridian', 'monolith', 'neutral', 'nocturne', 'ocean', 'prism', 'purple', 'ruby', 'solar', 'vitepress'];
|
|
9
9
|
type ThemePreset = (typeof AVAILABLE_THEMES)[number];
|
|
10
10
|
/** Return a read-only copy of the built-in preset list. */
|
|
11
11
|
declare function listPresets(): readonly ThemePreset[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-
|
|
1
|
+
import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-Cl3HtWjB.mjs";
|
|
2
2
|
export declare const PRESET_CSS_PATH: '@publier/shell/tailwind/preset.css';
|
|
3
3
|
export { AVAILABLE_THEMES, type ThemePreset, isValidPreset, listPresets };
|
package/dist/tailwind/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as e,s as t,t as n}from"../presets-BV7ycax-.mjs";const r=`@publier/shell/tailwind/preset.css`;export{n as AVAILABLE_THEMES,r as PRESET_CSS_PATH,e as isValidPreset,t as listPresets};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Reads built-in preset files from disk. Node-only (uses `node:fs` via native).
|
|
5
5
|
* Theme resolution / override composition lives in `./override.ts`.
|
|
6
6
|
*/
|
|
7
|
-
import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-
|
|
7
|
+
import { i as listPresets, n as ThemePreset, r as isValidPreset, t as AVAILABLE_THEMES } from "../presets-Cl3HtWjB.mjs";
|
|
8
8
|
/** Shape of a parsed `theme.yaml`. Fields match `content-spec/theme.schema.json`. */
|
|
9
9
|
interface ThemeYaml {
|
|
10
10
|
/**
|
|
@@ -14,6 +14,11 @@ interface ThemeYaml {
|
|
|
14
14
|
*/
|
|
15
15
|
name?: string;
|
|
16
16
|
preset?: string;
|
|
17
|
+
/** Default appearance for a first-time visitor; overrides the preset's own. */
|
|
18
|
+
appearance?: {
|
|
19
|
+
default?: 'light' | 'dark' | 'system';
|
|
20
|
+
strict?: boolean;
|
|
21
|
+
};
|
|
17
22
|
colors?: Record<string, string>;
|
|
18
23
|
typography?: {
|
|
19
24
|
heading?: string;
|
package/dist/tailwind/loader.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)}\n}\n`}function p(e,t){let n=d(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 m(e,t){return a(e,t)}const h=c(new URL(`./themes/`,import.meta.url));function g(e){return`${h}${e}.css`}async function _(e){return o(h,e)}export{i as AVAILABLE_THEMES,u as THEME_KEYS,l as THEME_SECTIONS,m as composeThemeCss,t as isValidPreset,
|
|
1
|
+
import{i as e,o as t,r as n,s as r,t as i}from"../presets-BV7ycax-.mjs";import{tailwindComposeThemeCss as a,tailwindReadPresetCss as o,tailwindResolveTheme as s}from"@publier/native";import{fileURLToPath as c}from"node:url";const l=[`colors`,`typography`,`layout`,`prose`,`code`,`spacing`,`radius`,`elevation`,`motion`,`variants`],u={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`,`body-weight`,`heading-weight`,...e.flatMap(e=>n.map(t=>`scale-${e}-${t}`))],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`],spacing:[`xxs`,`xs`,`sm`,`md`,`base`,`lg`,`xl`,`xxl`,`section`],radius:[`button`,`control`,`card`,`panel`,`chip`],elevation:[`flat`,`raised`,`overlay`],motion:[`duration-fast`,`duration-base`,`duration-slow`,`easing`],variants:[`nav`,`button`,`card`,`hero`,`section`]};function d(e){if(!e||typeof e!=`object`||Array.isArray(e))return{preset:void 0,overrides:{},overrideCss:``,errors:[]};let t=s(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 f(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 p(e,t){let n=d(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 m(e,t){return a(e,t)}const h=c(new URL(`./themes/`,import.meta.url));function g(e){return`${h}${e}.css`}async function _(e){return o(h,e)}export{i as AVAILABLE_THEMES,u as THEME_KEYS,l as THEME_SECTIONS,m as composeThemeCss,t as isValidPreset,r as listPresets,_ as loadPresetCss,g as presetPath,f as renderOverrideCss,d as resolveTheme,p as resolveThemeWithPreset};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
:root, [data-theme="light"] {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
|
|
4
|
+
--color-base-100: #ffffff;
|
|
5
|
+
--color-base-200: #f5f5f7;
|
|
6
|
+
--color-base-300: #f0f0f0;
|
|
7
|
+
--color-base-content: #1d1d1f;
|
|
8
|
+
--color-primary: #06726e;
|
|
9
|
+
--color-primary-content: #ffffff;
|
|
10
|
+
--color-secondary: #1d1d1f;
|
|
11
|
+
--color-secondary-content: #ffffff;
|
|
12
|
+
--color-accent: #06726e;
|
|
13
|
+
--color-accent-content: #ffffff;
|
|
14
|
+
--color-neutral: #1d1d1f;
|
|
15
|
+
--color-neutral-content: #ffffff;
|
|
16
|
+
--color-error: #c4001a;
|
|
17
|
+
--color-error-content: #ffffff;
|
|
18
|
+
|
|
19
|
+
--radius-selector: 9999px;
|
|
20
|
+
--radius-field: 8px;
|
|
21
|
+
--radius-box: 18px;
|
|
22
|
+
--border: 1px;
|
|
23
|
+
--depth: 0;
|
|
24
|
+
--noise: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-theme="dark"] {
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
|
|
30
|
+
--color-base-100: #000000;
|
|
31
|
+
--color-base-200: #272729;
|
|
32
|
+
--color-base-300: #38383a;
|
|
33
|
+
--color-base-content: #f5f5f7;
|
|
34
|
+
--color-primary: #60ccc5;
|
|
35
|
+
--color-primary-content: #071f1e;
|
|
36
|
+
--color-secondary: #a1a1a6;
|
|
37
|
+
--color-secondary-content: #000000;
|
|
38
|
+
--color-accent: #60ccc5;
|
|
39
|
+
--color-accent-content: #071f1e;
|
|
40
|
+
--color-neutral: #f5f5f7;
|
|
41
|
+
--color-neutral-content: #000000;
|
|
42
|
+
--color-error: #ff6961;
|
|
43
|
+
--color-error-content: #000000;
|
|
44
|
+
|
|
45
|
+
--radius-selector: 9999px;
|
|
46
|
+
--radius-field: 8px;
|
|
47
|
+
--radius-box: 18px;
|
|
48
|
+
--border: 1px;
|
|
49
|
+
--depth: 0;
|
|
50
|
+
--noise: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (prefers-color-scheme: dark) {
|
|
54
|
+
:root:not([data-theme]) {
|
|
55
|
+
color-scheme: dark;
|
|
56
|
+
|
|
57
|
+
--color-base-100: #000000;
|
|
58
|
+
--color-base-200: #272729;
|
|
59
|
+
--color-base-300: #38383a;
|
|
60
|
+
--color-base-content: #f5f5f7;
|
|
61
|
+
--color-primary: #60ccc5;
|
|
62
|
+
--color-primary-content: #071f1e;
|
|
63
|
+
--color-secondary: #a1a1a6;
|
|
64
|
+
--color-secondary-content: #000000;
|
|
65
|
+
--color-accent: #60ccc5;
|
|
66
|
+
--color-accent-content: #071f1e;
|
|
67
|
+
--color-neutral: #f5f5f7;
|
|
68
|
+
--color-neutral-content: #000000;
|
|
69
|
+
--color-error: #ff6961;
|
|
70
|
+
--color-error-content: #000000;
|
|
71
|
+
|
|
72
|
+
--radius-selector: 9999px;
|
|
73
|
+
--radius-field: 8px;
|
|
74
|
+
--radius-box: 18px;
|
|
75
|
+
--border: 1px;
|
|
76
|
+
--depth: 0;
|
|
77
|
+
--noise: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:root {
|
|
82
|
+
|
|
83
|
+
--publier-scale-display-xl-size: 4rem;
|
|
84
|
+
--publier-scale-display-xl-weight: 600;
|
|
85
|
+
--publier-scale-display-xl-line-height: 1.05;
|
|
86
|
+
--publier-scale-display-xl-tracking: -0.02em;
|
|
87
|
+
--publier-scale-display-lg-size: 3rem;
|
|
88
|
+
--publier-scale-display-lg-weight: 600;
|
|
89
|
+
--publier-scale-display-lg-line-height: 1.08;
|
|
90
|
+
--publier-scale-display-lg-tracking: -0.02em;
|
|
91
|
+
--publier-scale-display-md-size: 2.125rem;
|
|
92
|
+
--publier-scale-display-md-weight: 600;
|
|
93
|
+
--publier-scale-display-md-line-height: 1.15;
|
|
94
|
+
--publier-scale-display-md-tracking: -0.015em;
|
|
95
|
+
--publier-scale-heading-lg-size: 1.75rem;
|
|
96
|
+
--publier-scale-heading-lg-weight: 600;
|
|
97
|
+
--publier-scale-heading-lg-line-height: 1.2;
|
|
98
|
+
--publier-scale-heading-lg-tracking: -0.01em;
|
|
99
|
+
--publier-scale-heading-md-size: 1.3125rem;
|
|
100
|
+
--publier-scale-heading-md-weight: 500;
|
|
101
|
+
--publier-scale-heading-md-line-height: 1.25;
|
|
102
|
+
--publier-scale-heading-md-tracking: -0.01em;
|
|
103
|
+
--publier-scale-heading-sm-size: 1.1875rem;
|
|
104
|
+
--publier-scale-heading-sm-weight: 600;
|
|
105
|
+
--publier-scale-heading-sm-line-height: 1.25;
|
|
106
|
+
--publier-scale-heading-sm-tracking: 0;
|
|
107
|
+
--publier-scale-title-size: 1.0625rem;
|
|
108
|
+
--publier-scale-title-weight: 600;
|
|
109
|
+
--publier-scale-title-line-height: 1.3;
|
|
110
|
+
--publier-scale-title-tracking: 0;
|
|
111
|
+
--publier-scale-body-lg-size: 1.3125rem;
|
|
112
|
+
--publier-scale-body-lg-weight: 400;
|
|
113
|
+
--publier-scale-body-lg-line-height: 1.5;
|
|
114
|
+
--publier-scale-body-lg-tracking: 0;
|
|
115
|
+
--publier-scale-body-md-size: 1.0625rem;
|
|
116
|
+
--publier-scale-body-md-weight: 400;
|
|
117
|
+
--publier-scale-body-md-line-height: 1.5;
|
|
118
|
+
--publier-scale-body-md-tracking: 0;
|
|
119
|
+
--publier-scale-body-sm-size: 0.875rem;
|
|
120
|
+
--publier-scale-body-sm-weight: 400;
|
|
121
|
+
--publier-scale-body-sm-line-height: 1.45;
|
|
122
|
+
--publier-scale-body-sm-tracking: 0;
|
|
123
|
+
--publier-scale-caption-size: 0.8125rem;
|
|
124
|
+
--publier-scale-caption-weight: 400;
|
|
125
|
+
--publier-scale-caption-line-height: 1.35;
|
|
126
|
+
--publier-scale-caption-tracking: 0;
|
|
127
|
+
--publier-scale-label-size: 0.875rem;
|
|
128
|
+
--publier-scale-label-weight: 500;
|
|
129
|
+
--publier-scale-label-line-height: 1.3;
|
|
130
|
+
--publier-scale-label-tracking: 0;
|
|
131
|
+
--publier-scale-button-size: 1.0625rem;
|
|
132
|
+
--publier-scale-button-weight: 500;
|
|
133
|
+
--publier-scale-button-line-height: 1.2;
|
|
134
|
+
--publier-scale-button-tracking: 0;
|
|
135
|
+
--publier-scale-code-size: 0.875rem;
|
|
136
|
+
--publier-scale-code-weight: 400;
|
|
137
|
+
--publier-scale-code-line-height: 1.6;
|
|
138
|
+
--publier-scale-code-tracking: 0;
|
|
139
|
+
|
|
140
|
+
--publier-font-weight-body: 400;
|
|
141
|
+
--publier-font-weight-heading: 600;
|
|
142
|
+
|
|
143
|
+
--publier-font-preset-heading: var(--publier-font-builtin-plus-jakarta-sans);
|
|
144
|
+
--publier-font-preset-body: var(--publier-font-builtin-plus-jakarta-sans);
|
|
145
|
+
|
|
146
|
+
--publier-space-xxs: 0.25rem;
|
|
147
|
+
--publier-space-xs: 0.5rem;
|
|
148
|
+
--publier-space-sm: 0.75rem;
|
|
149
|
+
--publier-space-md: 1rem;
|
|
150
|
+
--publier-space-base: 1.25rem;
|
|
151
|
+
--publier-space-lg: 1.5rem;
|
|
152
|
+
--publier-space-xl: 2rem;
|
|
153
|
+
--publier-space-xxl: 3rem;
|
|
154
|
+
--publier-space-section: 5rem;
|
|
155
|
+
|
|
156
|
+
--publier-radius-button: 9999px;
|
|
157
|
+
--publier-radius-control: 8px;
|
|
158
|
+
--publier-radius-card: 18px;
|
|
159
|
+
--publier-radius-panel: 28px;
|
|
160
|
+
--publier-radius-chip: 9999px;
|
|
161
|
+
--publier-control-radius: 8px;
|
|
162
|
+
--publier-surface-radius: 18px;
|
|
163
|
+
--publier-card-radius: 18px;
|
|
164
|
+
--publier-nav-item-radius: 9999px;
|
|
165
|
+
--publier-code-block-radius: 8px;
|
|
166
|
+
--publier-code-inline-radius: 6px;
|
|
167
|
+
|
|
168
|
+
--publier-elevation-flat: none;
|
|
169
|
+
--publier-elevation-raised: 0 0 0 1px rgb(0 0 0 / 0.02), 0 6px 20px rgb(0 0 0 / 0.08);
|
|
170
|
+
--publier-elevation-overlay: 0 0 0 1px rgb(0 0 0 / 0.02), 0 6px 20px rgb(0 0 0 / 0.08);
|
|
171
|
+
|
|
172
|
+
--publier-motion-duration-fast: 120ms;
|
|
173
|
+
--publier-motion-duration-base: 180ms;
|
|
174
|
+
--publier-motion-duration-slow: 300ms;
|
|
175
|
+
--publier-motion-easing: cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
176
|
+
|
|
177
|
+
--publier-nav-height: 4.5rem;
|
|
178
|
+
--publier-page-max-width: 75rem;
|
|
179
|
+
--publier-layout-width: 1200px;
|
|
180
|
+
--publier-shadow-color: 0 0 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:root,
|
|
184
|
+
:root[data-theme="light"] {
|
|
185
|
+
--color-pl-muted: #6e6e73;
|
|
186
|
+
--color-pl-muted-bg: #e8e8ed;
|
|
187
|
+
--color-pl-subtle: #6e6e73;
|
|
188
|
+
--color-pl-card: #ffffff;
|
|
189
|
+
--color-pl-card-hover: #ffffff;
|
|
190
|
+
--color-pl-popover: #ffffff;
|
|
191
|
+
--color-pl-border: #e0e0e0;
|
|
192
|
+
--color-pl-border-strong: #d2d2d7;
|
|
193
|
+
--color-pl-ring: #1d1d1f;
|
|
194
|
+
--color-pl-sidebar-accent: #f5f5f7;
|
|
195
|
+
--color-pl-sidebar-active: #e8fbfa;
|
|
196
|
+
--color-pl-sidebar-active-fg: #06726e;
|
|
197
|
+
|
|
198
|
+
--menu-active-bg: var(--color-pl-sidebar-active);
|
|
199
|
+
--menu-active-color: var(--color-pl-sidebar-active-fg);
|
|
200
|
+
--menu-hover-bg: var(--color-pl-sidebar-accent);
|
|
201
|
+
--menu-hover-color: var(--color-pl-sidebar-accent-fg);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:root[data-theme="dark"],
|
|
205
|
+
.dark {
|
|
206
|
+
--color-pl-muted: #a1a1a6;
|
|
207
|
+
--color-pl-muted-bg: #272729;
|
|
208
|
+
--color-pl-subtle: #a1a1a6;
|
|
209
|
+
--color-pl-card: #272729;
|
|
210
|
+
--color-pl-card-hover: #272729;
|
|
211
|
+
--color-pl-popover: #272729;
|
|
212
|
+
--color-pl-border: #38383a;
|
|
213
|
+
--color-pl-border-strong: #4a4a4d;
|
|
214
|
+
--color-pl-ring: #f5f5f7;
|
|
215
|
+
--color-pl-sidebar-accent: #272729;
|
|
216
|
+
--color-pl-sidebar-active: color-mix(in oklch, #60ccc5 14%, transparent);
|
|
217
|
+
--color-pl-sidebar-active-fg: #60ccc5;
|
|
218
|
+
|
|
219
|
+
--publier-elevation-raised: 0 0 0 1px #38383a, 0 6px 20px rgb(0 0 0 / 0.5);
|
|
220
|
+
--publier-elevation-overlay: 0 0 0 1px #38383a, 0 6px 20px rgb(0 0 0 / 0.5);
|
|
221
|
+
|
|
222
|
+
--menu-active-bg: var(--color-pl-sidebar-active);
|
|
223
|
+
--menu-active-color: var(--color-pl-sidebar-active-fg);
|
|
224
|
+
--menu-hover-bg: var(--color-pl-sidebar-accent);
|
|
225
|
+
--menu-hover-color: var(--color-pl-sidebar-accent-fg);
|
|
226
|
+
}
|