@iksnerd/blazon 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/chunks/{site-builder-NRN9UNyn.js → site-builder-DlaZeZHi.js} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/ui/assets/{index-BpdgjM9E.js → index-dkJG6W9p.js} +3 -3
- package/dist/ui/index.html +1 -1
- package/mcp/dist/index.js +1 -1
- package/package.json +5 -2
- package/plugins/blazon.copy/README.md +14 -12
- package/plugins/blazon.favicons/README.md +3 -0
- package/plugins/blazon.print-book/README.md +8 -3
- package/plugins/blazon.tailwind/README.md +1 -1
- package/plugins/shipped.lock +4 -4
package/README.md
CHANGED
|
@@ -157,6 +157,8 @@ A plugin whose manifest lists a variable that is set, and that the entry does no
|
|
|
157
157
|
| [`blazon.platform-tokens`](docs/manual/14-shipped-plugins.md#blazonplatform-tokens) | Android XML, Swift and Kotlin from the color and dimension tokens |
|
|
158
158
|
| [`blazon.press-kit`](docs/manual/14-shipped-plugins.md#blazonpress-kit) | A folder and zip for people outside the brand: logos, colors, fonts, a one-page PDF |
|
|
159
159
|
| [`blazon.social-cards`](docs/manual/14-shipped-plugins.md#blazonsocial-cards) | Marketing images from the tokens and logo, checked for contrast |
|
|
160
|
+
| [`blazon.tailwind`](docs/manual/14-shipped-plugins.md#blazontailwind) | A Tailwind v4 theme from the tokens |
|
|
161
|
+
| [`blazon.shadcn`](docs/manual/14-shipped-plugins.md#blazonshadcn) | The shadcn/ui variables, as a mapping and as CSS |
|
|
160
162
|
|
|
161
163
|
Several need Chrome for their PDF or PNG output; the manual says which. The starter's config lists `blazon.copy` with blazon's own rules, and `blazon.tailwind` and `blazon.shadcn`, which need only Node and write the Tailwind and shadcn/ui files. It leaves out the other plugins of blazon's own book (the deck, the social cards, the favicons, the logo kit, the press kit and the platform and Office files), because most need Chrome and a new book has no use for the kits yet; add one by name when you want it. To write your own, see [Writing a plugin](docs/manual/13-writing-a-plugin.md). A plugin can be pinned, so one that changed on disk does not run.
|
|
162
164
|
|
|
@@ -197,7 +199,7 @@ getVar('interactive.primary'); // "var(--interactive-primary)"
|
|
|
197
199
|
|
|
198
200
|
## Configuration
|
|
199
201
|
|
|
200
|
-
`blazon.json` is optional
|
|
202
|
+
`blazon.json` is optional only in name: a brand must name a `logo`, or `blazon check` fails with `logo-missing`. The common options:
|
|
201
203
|
|
|
202
204
|
```json
|
|
203
205
|
{
|
|
@@ -10380,7 +10380,7 @@ function Eg(e) {
|
|
|
10380
10380
|
} : void 0;
|
|
10381
10381
|
}
|
|
10382
10382
|
function Dg(e = {
|
|
10383
|
-
commit: "
|
|
10383
|
+
commit: "47ee9dec4bf851c1630469bd7c71ddfef1841e57",
|
|
10384
10384
|
dirty: !1
|
|
10385
10385
|
}, t) {
|
|
10386
10386
|
if (e) return {
|
package/dist/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dn as s, Dt as c, E as l, Ft as u, G as d, It as f, Jt as p, K as m, M as h, Mt as g, Nt as _, O as v, On as y, Pt as b, Qt as x, R as S, Rt as ee, S as C, T as w, Tt as T, Ut as te, Vt as ne, W as re, Xt as ie, Zt as ae, _ as oe, _n as se, _t as ce, a as le, an as ue, b as de, bt as fe, c as pe, cn as me, d as he, dn as E, en as ge, f as _e, fn as ve, g as ye, gt as be, h as xe, hn as Se, ht as Ce, i as we, j as Te, jt as Ee, k as De, l as Oe, ln as ke, m as Ae, mn as je, mt as D, on as Me, p as Ne, pn as Pe, q as Fe, s as Ie, sn as Le, t as Re, tn as ze, u as Be, un as Ve, ut as He, v as Ue, vt as We, w as Ge, wt as Ke, x as qe, y as Je, yt as Ye, z as Xe, zt as Ze } from "../chunks/site-builder-
|
|
1
|
+
import { $t as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dn as s, Dt as c, E as l, Ft as u, G as d, It as f, Jt as p, K as m, M as h, Mt as g, Nt as _, O as v, On as y, Pt as b, Qt as x, R as S, Rt as ee, S as C, T as w, Tt as T, Ut as te, Vt as ne, W as re, Xt as ie, Zt as ae, _ as oe, _n as se, _t as ce, a as le, an as ue, b as de, bt as fe, c as pe, cn as me, d as he, dn as E, en as ge, f as _e, fn as ve, g as ye, gt as be, h as xe, hn as Se, ht as Ce, i as we, j as Te, jt as Ee, k as De, l as Oe, ln as ke, m as Ae, mn as je, mt as D, on as Me, p as Ne, pn as Pe, q as Fe, s as Ie, sn as Le, t as Re, tn as ze, u as Be, un as Ve, ut as He, v as Ue, vt as We, w as Ge, wt as Ke, x as qe, y as Je, yt as Ye, z as Xe, zt as Ze } from "../chunks/site-builder-DlaZeZHi.js";
|
|
2
2
|
import O from "node:path";
|
|
3
3
|
import k from "node:fs";
|
|
4
4
|
import { spawn as Qe } from "node:child_process";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e, B as t, Cn as n, D as r, Dn as i, En as a, Et as o, F as s, G as c, Gt as l, H as u, Ht as d, I as f, J as p, K as m, Kt as h, L as g, Lt as _, N as v, O as y, On as b, Ot as x, P as S, Q as C, Sn as w, St as T, Tn as E, U as D, Ut as O, V as k, W as A, Wt as j, X as M, Xt as N, Y as P, Yt as F, Z as I, Zt as L, at as R, bn as z, ct as B, dt as V, et as H, ft as U, gn as W, ht as G, i as K, in as q, it as J, j as Y, k as X, kt as Z, lt as Q, mt as $, n as ee, nn as te, nt as ne, o as re, ot as ie, pn as ae, pt as oe, qt as se, r as ce, rn as le, rt as ue, st as de, t as fe, tt as pe, ut as me, vn as he, wn as ge, xn as _e, xt as ve, yn as ye } from "./chunks/site-builder-
|
|
1
|
+
import { $ as e, B as t, Cn as n, D as r, Dn as i, En as a, Et as o, F as s, G as c, Gt as l, H as u, Ht as d, I as f, J as p, K as m, Kt as h, L as g, Lt as _, N as v, O as y, On as b, Ot as x, P as S, Q as C, Sn as w, St as T, Tn as E, U as D, Ut as O, V as k, W as A, Wt as j, X as M, Xt as N, Y as P, Yt as F, Z as I, Zt as L, at as R, bn as z, ct as B, dt as V, et as H, ft as U, gn as W, ht as G, i as K, in as q, it as J, j as Y, k as X, kt as Z, lt as Q, mt as $, n as ee, nn as te, nt as ne, o as re, ot as ie, pn as ae, pt as oe, qt as se, r as ce, rn as le, rt as ue, st as de, t as fe, tt as pe, ut as me, vn as he, wn as ge, xn as _e, xt as ve, yn as ye } from "./chunks/site-builder-DlaZeZHi.js";
|
|
2
2
|
// src/plugins/index.ts
|
|
3
3
|
var be = /* @__PURE__ */ b({
|
|
4
4
|
BASE_ENV: () => p,
|
|
@@ -77,6 +77,6 @@ ${s} [data-section-asset] img { max-height: 330px; width: auto; max-width: 100%;
|
|
|
77
77
|
/* The viewer's small type, raised by the same 1.11 as the body: its smallest (a caption, a label) is 12px, 9 pt on the
|
|
78
78
|
slide and 8.1 pt at the smallest scale a slide is drawn at. In :where, so a rule above that sets a size (a heading) wins */
|
|
79
79
|
${pS.map(([e,t])=>`${s} :where([class~="${e}"]) { font-size: ${t}px; }`).join(`
|
|
80
|
-
`)}`}var pS=[[`text-[0.625rem]`,12],[`text-[11px]`,12.5],[`text-xs`,13.5],[`text-[0.8rem]`,14],[`text-[13px]`,14.5],[`text-sm`,16],[`text-[15px]`,17],[`text-base`,18],[`text-lg`,20]];function mS(e,t,n,r){let i=document.createElement(`div`);i.dataset.printSlide=e,r&&(i.dataset.printSqueeze=``);let a=document.createElement(`div`);a.dataset.printSlideBody=``,e===`content`&&(a.className=`blazon-prose`);let o=t.map(e=>e.cloneNode(!0));if(n===`split`){a.dataset.layout=`split`;let e=document.createElement(`div`);e.append(...o.slice(0,-1));let t=document.createElement(`div`);t.append(o.at(-1)),a.append(e,t)}else a.append(...o);let s=t[0]?.dataset.printContinued;return e===`content`&&s&&a.prepend(hS(s)),i.append(a),i}function hS(e){let t=document.createElement(`div`);t.dataset.printContinuedLabel=``;let[n,r]=[document.createElement(`span`),document.createElement(`span`)];return n.textContent=e,r.textContent=` (continued)`,t.append(n,r),t}function gS(e,t){let n=document.createElement(`div`);n.dataset.printFooter=``;let[r,i]=[document.createElement(`span`),document.createElement(`span`)];return r.textContent=e,i.textContent=String(t),n.append(r,i),n}var _S=`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`;function vS(e,t){let n=e.matches(_S)?[e]:[...e.querySelectorAll(_S)];return Math.floor(n.reduce((e,n)=>e+n.getBoundingClientRect().height*(1-t),0))}function yS(e,t){let n=[...e.querySelectorAll(_S)],r=n.map(e=>e.getBoundingClientRect().height),i=r.reduce((e,t)=>e+t,0);for(let a=0;a<bS;a++){let a=e.scrollHeight-iS.height;if(a<=1||i<=0)return;n.forEach((e,n)=>{let o=e.getBoundingClientRect().height;e.style.maxHeight=`${Math.max(r[n]*t,o-a*r[n]/i)}px`})}}var bS=4,xS=.5;function SS(e,t){for(let n of e.querySelectorAll(`[data-min-size]`)){let e=Number(n.dataset.minSize);if(!(e>0))continue;let r=n.dataset.minAxis===`height`?`height`:`width`;n.style[r]=`${e/t}px`,n.style[r===`width`?`height`:`width`]=`auto`}}function CS(e,t){let n=e.querySelector(`[data-print-slide-body]`);if(e.dataset.printSlide!==`content`)return;e.dataset.printSqueeze!==void 0&&yS(n,t);let r=1,i=[...n.querySelectorAll(`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`)].map(e=>[e,e.getBoundingClientRect().width]);for(let e=0;e<bS;e++){let e=n.scrollHeight;if(!e||e-iS.height/r<=1)break;let t=Math.max(xS,iS.height/e);if(t>=r)break;r=t,n.style.zoom=String(r),n.style.width=`${iS.width/r}px`,n.style.height=`${iS.height/r}px`,SS(n,r);for(let[e,t]of i)t>0&&(e.style.maxWidth=`${t}px`)}n.scrollHeight-iS.height/r>1&&(e.dataset.printClipped=``)}var wS=2,TS=e=>e instanceof HTMLElement&&![`STYLE`,`SCRIPT`].includes(e.tagName)&&e.getBoundingClientRect().height>0;function ES(e){if(e instanceof HTMLTableElement){let t=[...e.tBodies].flatMap(e=>[...e.rows]);return t.length>1?{target:e,groups:t.map(e=>[e]),head:e.tHead}:null}let t=[],n=-1/0;for(let r of e.children){if(!TS(r))continue;let e=r.getBoundingClientRect().top;t.length===0||e-n>=wS?t.push([r]):t.at(-1).push(r),n=e}return t.length>1?{target:e,groups:t,head:null}:null}function DS(e){if(e instanceof HTMLTableElement||e instanceof HTMLUListElement||e instanceof HTMLOListElement)return!0;let{display:t,flexWrap:n}=getComputedStyle(e);return t.includes(`grid`)||t.includes(`flex`)&&n!==`nowrap`}function OS(e){let t=null;for(let n of[e,...e.querySelectorAll(`table, div, ul, ol, section`)]){if(!DS(n)||n.closest(`figure`)!==null&&e.contains(n.closest(`figure`)))continue;let r=ES(n);r&&(!t||r.groups.length>t.groups.length)&&(t=r)}return t}function kS(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function AS(e,t,n,r,i=``){let a=OS(e);if(!a)return null;if(jS(a)){let o=e.cloneNode(!0),s=o;for(let t of kS(e,a.target))s=s.children[t];for(let e of s.children)e instanceof HTMLElement&&(e.style.gridColumn=`auto`);e.after(o);try{let a=IS(o,t-e.getBoundingClientRect().height+o.getBoundingClientRect().height,n,r,i,!0);if(a)return a}finally{o.remove()}}return IS(e,t,n,r,i,!1)}function jS({target:e,groups:t}){return!(e instanceof HTMLTableElement)&&getComputedStyle(e).display.includes(`grid`)&&t.length>1&&t.every(e=>e.length===1&&e[0].classList.contains(`col-span-full`))}function MS(e){return e.length>2&&e.slice(0,-1).every(t=>Math.abs(t-e[0])<=1)}var NS=48;function PS({target:e,groups:t}){return e instanceof HTMLTableElement&&t.length>3&&e.getBoundingClientRect().width*2+NS<=iS.width&&e.tFoot===null&&e.caption===null&&e.querySelector(`[rowspan], [colspan], table table`)===null}function FS(e,t,n){let r=e.cloneNode(!0),i=e=>[...e.querySelectorAll(`tbody tr`)];i(e).slice(n).forEach(e=>e.remove()),i(r).slice(0,n).forEach(e=>e.remove());let a=document.createElement(`div`);a.dataset.printColumns=``,a.style.cssText=`display:flex;align-items:flex-start;gap:${NS}px;margin-bottom:${getComputedStyle(e).marginBottom}`;for(let n of[e,r]){for(let e of[...n.tBodies])e.rows.length===0&&e.remove();let e=document.createElement(`colgroup`);for(let n of t)e.append(Object.assign(document.createElement(`col`),{style:`width:${n}px`}));n.prepend(e),n.style.cssText=`table-layout:fixed;width:${t.reduce((e,t)=>e+t,0)}px;margin:0`,a.append(n)}return a}function IS(e,t,n,r,i,a){let o=OS(e);if(!o)return null;let{target:s,groups:c,head:l}=o,u=e.getBoundingClientRect().top,d=c.map(e=>e[0].getBoundingClientRect().top),f=Math.max(...c.at(-1).map(e=>e.getBoundingClientRect().bottom)),p=d.map((e,t)=>(d[t+1]??f)-e),m=d[0]-u,h=Math.max(0,t-m-p.reduce((e,t)=>e+t,0)),g=(l?d[0]-l.getBoundingClientRect().top:0)+(i?32:0),_=PS(o),v=d.length>1?d[1]-Math.max(...c[0].map(e=>e.getBoundingClientRect().bottom)):0,y=!_&&!a&&!(s instanceof HTMLTableElement||s instanceof HTMLUListElement||s instanceof HTMLOListElement)&&MS(p)?zS+(iS.height-aS)+Math.max(0,v):0,b=_||a?Rx(p,n-m,r-g,_?2:1):Lx(p,n-m+y,r-g+y).map(e=>[e]),x=b.map(e=>[e[0][0],e.at(-1)[1]]);if(x.length<2&&!(a||_&&b[0].length>1))return null;let S=_?[...(l?.rows[0]??s.tBodies[0].rows[0]).cells].map(e=>e.getBoundingClientRect().width):[],C=kS(e,s),w=[],T=[];return x.forEach(([t,n],r)=>{let a=e.cloneNode(!0),o=a,l=[a];for(let e of C)l.push(o=o.children[e]);l.forEach((e,t)=>{let n=l[t+1];if(!n)return;let i=[...e.children],a=i.indexOf(n);i.forEach((e,t)=>{(t<a&&r>0||t>a&&r<x.length-1)&&e.remove()})});let u=new Set(c.slice(t,n).flat()),d=s instanceof HTMLTableElement?[...o.querySelectorAll(`tbody tr`)]:[...o.children].filter(e=>e instanceof HTMLElement),f=s instanceof HTMLTableElement?c.flat():[...s.children].filter(e=>e instanceof HTMLElement);if(d.forEach((e,t)=>{u.has(f[t])||e.remove()}),o instanceof HTMLTableElement)for(let e of[...o.tBodies])e.rows.length===0&&e.remove();o instanceof HTMLOListElement&&(o.start=s.start+f.slice(0,f.indexOf(c[t][0])).filter(e=>e.tagName===`LI`).length);let v=a,y=b[r];if(_&&y.length>1&&o instanceof HTMLTableElement){let e=FS(o,S,y[0][1]-t);o===a?v=e:o.replaceWith(e)}if(r>0){v.dataset.printContinued=i;for(let e of v.querySelectorAll(`[id]`))e.removeAttribute(`id`);v.removeAttribute(`id`)}w.push(v);let E=Math.max(...y.map(([e,t])=>p.slice(e,t).reduce((e,t)=>e+t,0)));T.push(E+(r===0?m:g)+(r===x.length-1?h:0))}),{els:w,heights:T}}function LS(e,t,n){let r=0,i=n-1;for(i>=0&&e[i].lead&&(r+=t[i--]);i>=0&&e[i].kind===`heading`;)r+=t[i--];return r}function RS(e,t){let n=e=>(e?.textContent??``).replace(/\s+/g,` `).trim();for(let r=t-1;r>=0&&e[r].kind!==`opener`;r--){let t=e[r].el;if(/^H[2-6]$/.test(t.tagName)&&n(t))return n(t)}return n(e[t].el.querySelector(`h2, h3, h4, h5, h6`))}var zS=16;function BS(e,t,n){let r=[],i=[];return e.forEach((a,o)=>{let s=t[o],c=LS(e,t,o),l=a.kind!==`opener`&&c+s>n*1.1111111111111112?AS(a.el,s,n-c-zS,n-zS,RS(e,o)):null;l?l.els.forEach((e,t)=>{r.push({el:e,origin:a.el,...t===0&&a.kind&&{kind:a.kind},...t>0&&{continued:!0},...a.figure&&{figure:!0},...a.table&&{table:!0}}),i.push(l.heights[t])}):(r.push(a),i.push(s))}),{blocks:r,heights:i}}function VS(e){return e.length===0?[[]]:Rx(e,10,10,3)}function HS(e,t,n){let r=n-t;return e.map(e=>r>0?Math.max(1,Math.round((e-t)/r)+1):1)}var US=e=>`print-page-${e}`;function WS(e){let t=e.split(`/`).pop()??``,n=/^(?:\d+(?:\.\d+)?[-_.])?(.+?)\.(?:md|markdown)$/.exec(t);return n?`doc/${n[1]}`:null}function GS(e,t){try{return new URL(e,t).origin===t}catch{return!1}}function KS(e,t,n){let r;try{r=new URL(e,t)}catch{return null}if(r.origin!==t)return null;let i=decodeURIComponent(r.hash.slice(1)),a=WS(r.pathname);return a===null?null:i&&(n.headingPage.get(`${a}#section-${i}`)??n.headingPage.get(`${a}#${i}`))||n.chapterPage.get(a)||null}function qS(e,t,n){let r=0;for(let i of e.querySelectorAll(`a[href]`)){let e=i.getAttribute(`href`)??``,a=KS(e,t,n);if(a===null)GS(e,t)&&i.removeAttribute(`href`);else{if(i.setAttribute(`href`,`#${US(a)}`),!i.querySelector(`[data-print-page-ref]`)){let e=i.ownerDocument.createElement(`span`);e.dataset.printPageRef=``,e.textContent=`, p. ${a}`,i.append(e)}r++}}return r}var JS=15e3;
|
|
81
|
-
`),[m,h]=(0,_.useState)(),g=VS(m?.key===p?m.lines:f.map(()=>1)),v=sS(g.length),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=(0,_.useRef)(null),[S,C]=(0,_.useState)([]);(0,_.useEffect)(()=>{let e=!1;return
|
|
82
|
-
M`,...f].map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex items-start justify-between gap-6 border-b py-1 text-lg`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 whitespace-pre-line [overflow-wrap:anywhere]`,children:e}),(0,Z.jsx)(`span`,{className:`flex-none whitespace-nowrap`,children:`9999`})]},t))}),(0,Z.jsx)(`div`,{ref:x,"data-print-deck":``}),(0,Z.jsx)(`div`,{ref:b,"data-print-flow":``,"aria-hidden":`true`,children:d.map(e=>(0,Z.jsxs)(`section`,{"data-print-chapter":e.id,children:[(0,Z.jsx)(`h2`,{"data-print-chapter-title":``,className:`sr-only`,children:e.title}),e.body()]},e.id))})]})}function
|
|
80
|
+
`)}`}var pS=[[`text-[0.625rem]`,12],[`text-[11px]`,12.5],[`text-xs`,13.5],[`text-[0.8rem]`,14],[`text-[13px]`,14.5],[`text-sm`,16],[`text-[15px]`,17],[`text-base`,18],[`text-lg`,20]];function mS(e,t,n,r){let i=document.createElement(`div`);i.dataset.printSlide=e,r&&(i.dataset.printSqueeze=``);let a=document.createElement(`div`);a.dataset.printSlideBody=``,e===`content`&&(a.className=`blazon-prose`);let o=t.map(e=>e.cloneNode(!0));if(n===`split`){a.dataset.layout=`split`;let e=document.createElement(`div`);e.append(...o.slice(0,-1));let t=document.createElement(`div`);t.append(o.at(-1)),a.append(e,t)}else a.append(...o);let s=t[0]?.dataset.printContinued;return e===`content`&&s&&a.prepend(hS(s)),i.append(a),i}function hS(e){let t=document.createElement(`div`);t.dataset.printContinuedLabel=``;let[n,r]=[document.createElement(`span`),document.createElement(`span`)];return n.textContent=e,r.textContent=` (continued)`,t.append(n,r),t}function gS(e,t){let n=document.createElement(`div`);n.dataset.printFooter=``;let[r,i]=[document.createElement(`span`),document.createElement(`span`)];return r.textContent=e,i.textContent=String(t),n.append(r,i),n}var _S=`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`;function vS(e,t){let n=e.matches(_S)?[e]:[...e.querySelectorAll(_S)];return Math.floor(n.reduce((e,n)=>e+n.getBoundingClientRect().height*(1-t),0))}function yS(e,t){let n=[...e.querySelectorAll(_S)],r=n.map(e=>e.getBoundingClientRect().height),i=r.reduce((e,t)=>e+t,0);for(let a=0;a<bS;a++){let a=e.scrollHeight-iS.height;if(a<=1||i<=0)return;n.forEach((e,n)=>{let o=e.getBoundingClientRect().height;e.style.maxHeight=`${Math.max(r[n]*t,o-a*r[n]/i)}px`})}}var bS=4,xS=.5;function SS(e,t){for(let n of e.querySelectorAll(`[data-min-size]`)){let e=Number(n.dataset.minSize);if(!(e>0))continue;let r=n.dataset.minAxis===`height`?`height`:`width`;n.style[r]=`${e/t}px`,n.style[r===`width`?`height`:`width`]=`auto`}}function CS(e,t){let n=e.querySelector(`[data-print-slide-body]`);if(e.dataset.printSlide!==`content`)return;e.dataset.printSqueeze!==void 0&&yS(n,t);let r=1,i=[...n.querySelectorAll(`[data-frame] img:not([data-min-size]), [data-section-asset] img:not([data-min-size])`)].map(e=>[e,e.getBoundingClientRect().width]);for(let e=0;e<bS;e++){let e=n.scrollHeight;if(!e||e-iS.height/r<=1)break;let t=Math.max(xS,iS.height/e);if(t>=r)break;r=t,n.style.zoom=String(r),n.style.width=`${iS.width/r}px`,n.style.height=`${iS.height/r}px`,SS(n,r);for(let[e,t]of i)t>0&&(e.style.maxWidth=`${t}px`)}n.scrollHeight-iS.height/r>1&&(e.dataset.printClipped=``)}var wS=2,TS=e=>e instanceof HTMLElement&&![`STYLE`,`SCRIPT`].includes(e.tagName)&&e.getBoundingClientRect().height>0;function ES(e){if(e instanceof HTMLTableElement){let t=[...e.tBodies].flatMap(e=>[...e.rows]);return t.length>1?{target:e,groups:t.map(e=>[e]),head:e.tHead}:null}let t=[],n=-1/0;for(let r of e.children){if(!TS(r))continue;let e=r.getBoundingClientRect().top;t.length===0||e-n>=wS?t.push([r]):t.at(-1).push(r),n=e}return t.length>1?{target:e,groups:t,head:null}:null}function DS(e){if(e instanceof HTMLTableElement||e instanceof HTMLUListElement||e instanceof HTMLOListElement)return!0;let{display:t,flexWrap:n}=getComputedStyle(e);return t.includes(`grid`)||t.includes(`flex`)&&n!==`nowrap`}function OS(e){let t=null;for(let n of[e,...e.querySelectorAll(`table, div, ul, ol, section`)]){if(!DS(n)||n.closest(`figure`)!==null&&e.contains(n.closest(`figure`)))continue;let r=ES(n);r&&(!t||r.groups.length>t.groups.length)&&(t=r)}return t}function kS(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement)n.unshift([...r.parentElement.children].indexOf(r));return n}function AS(e,t,n,r,i=``){let a=OS(e);if(!a)return null;if(jS(a)){let o=e.cloneNode(!0),s=o;for(let t of kS(e,a.target))s=s.children[t];for(let e of s.children)e instanceof HTMLElement&&(e.style.gridColumn=`auto`);e.after(o);try{let a=IS(o,t-e.getBoundingClientRect().height+o.getBoundingClientRect().height,n,r,i,!0);if(a)return a}finally{o.remove()}}return IS(e,t,n,r,i,!1)}function jS({target:e,groups:t}){return!(e instanceof HTMLTableElement)&&getComputedStyle(e).display.includes(`grid`)&&t.length>1&&t.every(e=>e.length===1&&e[0].classList.contains(`col-span-full`))}function MS(e){return e.length>2&&e.slice(0,-1).every(t=>Math.abs(t-e[0])<=1)}var NS=48;function PS({target:e,groups:t}){return e instanceof HTMLTableElement&&t.length>3&&e.getBoundingClientRect().width*2+NS<=iS.width&&e.tFoot===null&&e.caption===null&&e.querySelector(`[rowspan], [colspan], table table`)===null}function FS(e,t,n){let r=e.cloneNode(!0),i=e=>[...e.querySelectorAll(`tbody tr`)];i(e).slice(n).forEach(e=>e.remove()),i(r).slice(0,n).forEach(e=>e.remove());let a=document.createElement(`div`);a.dataset.printColumns=``,a.style.cssText=`display:flex;align-items:flex-start;gap:${NS}px;margin-bottom:${getComputedStyle(e).marginBottom}`;for(let n of[e,r]){for(let e of[...n.tBodies])e.rows.length===0&&e.remove();let e=document.createElement(`colgroup`);for(let n of t)e.append(Object.assign(document.createElement(`col`),{style:`width:${n}px`}));n.prepend(e),n.style.cssText=`table-layout:fixed;width:${t.reduce((e,t)=>e+t,0)}px;margin:0`,a.append(n)}return a}function IS(e,t,n,r,i,a){let o=OS(e);if(!o)return null;let{target:s,groups:c,head:l}=o,u=e.getBoundingClientRect().top,d=c.map(e=>e[0].getBoundingClientRect().top),f=Math.max(...c.at(-1).map(e=>e.getBoundingClientRect().bottom)),p=d.map((e,t)=>(d[t+1]??f)-e),m=d[0]-u,h=Math.max(0,t-m-p.reduce((e,t)=>e+t,0)),g=(l?d[0]-l.getBoundingClientRect().top:0)+(i?32:0),_=PS(o),v=d.length>1?d[1]-Math.max(...c[0].map(e=>e.getBoundingClientRect().bottom)):0,y=!_&&!a&&!(s instanceof HTMLTableElement||s instanceof HTMLUListElement||s instanceof HTMLOListElement)&&MS(p)?zS+(iS.height-aS)+Math.max(0,v):0,b=_||a?Rx(p,n-m,r-g,_?2:1):Lx(p,n-m+y,r-g+y).map(e=>[e]),x=b.map(e=>[e[0][0],e.at(-1)[1]]);if(x.length<2&&!(a||_&&b[0].length>1))return null;let S=_?[...(l?.rows[0]??s.tBodies[0].rows[0]).cells].map(e=>e.getBoundingClientRect().width):[],C=kS(e,s),w=[],T=[];return x.forEach(([t,n],r)=>{let a=e.cloneNode(!0),o=a,l=[a];for(let e of C)l.push(o=o.children[e]);l.forEach((e,t)=>{let n=l[t+1];if(!n)return;let i=[...e.children],a=i.indexOf(n);i.forEach((e,t)=>{(t<a&&r>0||t>a&&r<x.length-1)&&e.remove()})});let u=new Set(c.slice(t,n).flat()),d=s instanceof HTMLTableElement?[...o.querySelectorAll(`tbody tr`)]:[...o.children].filter(e=>e instanceof HTMLElement),f=s instanceof HTMLTableElement?c.flat():[...s.children].filter(e=>e instanceof HTMLElement);if(d.forEach((e,t)=>{u.has(f[t])||e.remove()}),o instanceof HTMLTableElement)for(let e of[...o.tBodies])e.rows.length===0&&e.remove();o instanceof HTMLOListElement&&(o.start=s.start+f.slice(0,f.indexOf(c[t][0])).filter(e=>e.tagName===`LI`).length);let v=a,y=b[r];if(_&&y.length>1&&o instanceof HTMLTableElement){let e=FS(o,S,y[0][1]-t);o===a?v=e:o.replaceWith(e)}if(r>0){v.dataset.printContinued=i;for(let e of v.querySelectorAll(`[id]`))e.removeAttribute(`id`);v.removeAttribute(`id`)}w.push(v);let E=Math.max(...y.map(([e,t])=>p.slice(e,t).reduce((e,t)=>e+t,0)));T.push(E+(r===0?m:g)+(r===x.length-1?h:0))}),{els:w,heights:T}}function LS(e,t,n){let r=0,i=n-1;for(i>=0&&e[i].lead&&(r+=t[i--]);i>=0&&e[i].kind===`heading`;)r+=t[i--];return r}function RS(e,t){let n=e=>(e?.textContent??``).replace(/\s+/g,` `).trim();for(let r=t-1;r>=0&&e[r].kind!==`opener`;r--){let t=e[r].el;if(/^H[2-6]$/.test(t.tagName)&&n(t))return n(t)}return n(e[t].el.querySelector(`h2, h3, h4, h5, h6`))}var zS=16;function BS(e,t,n){let r=[],i=[];return e.forEach((a,o)=>{let s=t[o],c=LS(e,t,o),l=a.kind!==`opener`&&c+s>n*1.1111111111111112?AS(a.el,s,n-c-zS,n-zS,RS(e,o)):null;l?l.els.forEach((e,t)=>{r.push({el:e,origin:a.el,...t===0&&a.kind&&{kind:a.kind},...t>0&&{continued:!0},...a.figure&&{figure:!0},...a.table&&{table:!0}}),i.push(l.heights[t])}):(r.push(a),i.push(s))}),{blocks:r,heights:i}}function VS(e){return e.length===0?[[]]:Rx(e,10,10,3)}function HS(e,t,n){let r=n-t;return e.map(e=>r>0?Math.max(1,Math.round((e-t)/r)+1):1)}var US=e=>`print-page-${e}`;function WS(e){let t=e.split(`/`).pop()??``,n=/^(?:\d+(?:\.\d+)?[-_.])?(.+?)\.(?:md|markdown)$/.exec(t);return n?`doc/${n[1]}`:null}function GS(e,t){try{return new URL(e,t).origin===t}catch{return!1}}function KS(e,t,n){let r;try{r=new URL(e,t)}catch{return null}if(r.origin!==t)return null;let i=decodeURIComponent(r.hash.slice(1)),a=WS(r.pathname);return a===null?null:i&&(n.headingPage.get(`${a}#section-${i}`)??n.headingPage.get(`${a}#${i}`))||n.chapterPage.get(a)||null}function qS(e,t,n){let r=0;for(let i of e.querySelectorAll(`a[href]`)){let e=i.getAttribute(`href`)??``,a=KS(e,t,n);if(a===null)GS(e,t)&&i.removeAttribute(`href`);else{if(i.setAttribute(`href`,`#${US(a)}`),!i.querySelector(`[data-print-page-ref]`)){let e=i.ownerDocument.createElement(`span`);e.dataset.printPageRef=``,e.textContent=`, p. ${a}`,i.append(e)}r++}}return r}var JS=15e3,YS=new WeakSet;if(typeof document<`u`)for(let e of[`load`,`error`])document.addEventListener(e,e=>YS.add(e.target),!0);function XS(){return[...document.querySelectorAll(`link[rel~="stylesheet"]`)].filter(e=>!e.sheet&&!YS.has(e))}function ZS(e){return new Promise(t=>{let n=setInterval(()=>e.isConnected||r(),50);function r(){clearInterval(n),t()}e.addEventListener(`load`,r),e.addEventListener(`error`,r)})}async function QS(e){let t=[...e.querySelectorAll(`img`)];for(let e of t)e.loading=`eager`;let n=(async()=>{for(;await Promise.all(XS().map(ZS)),e.offsetHeight,await document.fonts?.ready,XS().length!==0||(document.fonts?.status??`loaded`)!==`loaded`;);await Promise.all(t.map(e=>e.decode?.().catch(()=>void 0)))})();await Promise.race([n,new Promise(e=>setTimeout(e,JS))])}function $S({data:e,view:t,mode:n,selection:r,title:i,subtitle:a,favicons:o,layout:s=`compact`}){let{squeezeFloor:c}=dS(s),l=i??e.title,u=a??e.description,d=tS(r,e,t,n,o),f=d.map(e=>e.title),p=f.join(`
|
|
81
|
+
`),[m,h]=(0,_.useState)(),g=VS(m?.key===p?m.lines:f.map(()=>1)),v=sS(g.length),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=(0,_.useRef)(null),[S,C]=(0,_.useState)([]);(0,_.useEffect)(()=>{let e=!1;return QS(y.current).then(()=>{if(e||!y.current)return;let[t,n,...r]=[...y.current.children].map(e=>e.getBoundingClientRect().height);h({key:p,lines:HS(r,t,n)})}),()=>{e=!0}},[p]),(0,_.useEffect)(()=>{let e=!1;if(Reflect.deleteProperty(window,`__blazonPrint`),o!==void 0&&m?.key===p)return QS(b.current).then(async()=>{if(e||!b.current||!x.current)return;let t=[],n=[],r=new Map,i=new Map;for(let e of b.current.querySelectorAll(`[data-print-chapter]`)){let a=Yx(e),{blocks:o,heights:s}=BS(a,Xx(a,e),aS),u=o.map((e,t)=>({height:s[t],...e.kind&&{kind:e.kind},...e.figure&&{figure:!0},...e.table&&{table:!0},...e.lead&&{lead:!0},...e.continued&&{continued:!0},...e.figure&&vS(e.el,c)>0&&{slack:vS(e.el,c)}})),d=Kx(Ux(u,aS),u,aS);t.push(v+n.length),i.set(e.dataset.printChapter,v+n.length);for(let t of e.querySelectorAll(`section[id]`)){let i=o.findIndex(e=>t.contains(e.origin??e.el)),a=d.findIndex(e=>e.blocks.includes(i));i>=0&&a>=0&&r.set(`${e.dataset.printChapter}#${t.id}`,v+n.length+a)}for(let e of d){let t=o[e.blocks[0]].kind===`opener`?`opener`:`content`,r=mS(t,e.blocks.map(e=>o[e].el),e.layout,e.squeeze);t===`content`&&r.append(gS(l,v+n.length)),n.push(r)}}n.forEach((e,t)=>void(e.id=US(v+t)));for(let e of n)qS(e,window.location.origin,{chapterPage:i,headingPage:r});x.current.replaceChildren(...n),await QS(x.current),e||(n.forEach(e=>CS(e,c)),C(t),window.__blazonPrint={ready:!0,pages:v-1+n.length,layout:s,clipped:n.flatMap((e,t)=>e.dataset.printClipped===void 0?[]:[v+t])})}),()=>{e=!0}},[r,o,l,v,m,p,s,c]);let w=Ee(e.theme.inverse,e.theme.inverseText)?`dark`:`light`,T=Te(e,e.theme.inverse,w===`dark`);return(0,Z.jsxs)(`main`,{"data-print-book":``,className:`bg-background text-foreground`,children:[(0,Z.jsx)(`style`,{children:fS(s)}),(0,Z.jsxs)(`div`,{"data-print-slide":`cover`,className:`flex flex-col justify-end gap-6 bg-[var(--blazon-inverse)] p-20 text-[var(--blazon-inverse-text)]`,children:[T&&(0,Z.jsx)(`img`,{"data-print-cover-logo":``,className:`mb-auto h-12 w-auto self-start`,src:T,alt:``}),(0,Z.jsx)(`h1`,{className:`font-heading text-[96px] leading-[0.95] font-semibold tracking-[-0.035em]`,children:l}),u&&(0,Z.jsx)(`p`,{className:`max-w-3xl text-xl opacity-80`,children:u})]}),g.map((e,t)=>(0,Z.jsxs)(`div`,{"data-print-slide":`contents`,"data-print-contents":``,children:[(0,Z.jsx)(`h2`,{className:`mb-8`,children:t===0?`Contents`:`Contents (continued)`}),(0,Z.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(3, minmax(0, 1fr))`,columnGap:48},children:e.map(([e,t])=>(0,Z.jsx)(`ol`,{className:`flex flex-col gap-y-2`,children:d.slice(e,t).map((t,n)=>(0,Z.jsxs)(`li`,{"data-chapter":t.id,className:`flex items-start justify-between gap-6 border-b py-1 text-lg`,children:[(0,Z.jsx)(`span`,{"data-title":``,className:`min-w-0 [overflow-wrap:anywhere]`,children:t.title}),S[e+n]!==void 0&&(0,Z.jsx)(`span`,{"data-page":``,className:`flex-none whitespace-nowrap`,children:S[e+n]})]},t.id))},e))}),(0,Z.jsxs)(`div`,{"data-print-footer":``,children:[(0,Z.jsx)(`span`,{children:l}),(0,Z.jsx)(`span`,{children:2+t})]})]},t)),(0,Z.jsx)(`ol`,{ref:y,"aria-hidden":`true`,"data-print-probe":``,className:`flex flex-col`,style:{position:`absolute`,left:-1e5,top:0,width:oS},children:[`M`,`M
|
|
82
|
+
M`,...f].map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex items-start justify-between gap-6 border-b py-1 text-lg`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 whitespace-pre-line [overflow-wrap:anywhere]`,children:e}),(0,Z.jsx)(`span`,{className:`flex-none whitespace-nowrap`,children:`9999`})]},t))}),(0,Z.jsx)(`div`,{ref:x,"data-print-deck":``}),(0,Z.jsx)(`div`,{ref:b,"data-print-flow":``,"aria-hidden":`true`,children:d.map(e=>(0,Z.jsxs)(`section`,{"data-print-chapter":e.id,children:[(0,Z.jsx)(`h2`,{"data-print-chapter-title":``,className:`sr-only`,children:e.title}),e.body()]},e.id))})]})}function eC(e){let[t=``,n=``]=tC(e,`?`),r={selection:t.slice(7)};for(let e of n.split(`&`)){let[t=``,n=``]=tC(e,`=`);if(t===`title`||t===`subtitle`||t===`layout`)try{let e=decodeURIComponent(n);t===`layout`?r.layout=uS(e):e!==``&&(r[t]=e)}catch{}}return r}function tC(e,t){let n=e.indexOf(t);return n<0?[e]:[e.slice(0,n),e.slice(n+1)]}function nC(){let[e,t]=(0,_.useState)(()=>window.location.hash);return(0,_.useEffect)(()=>{let e=()=>t(window.location.hash);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function rC({data:e,view:t,hash:n,query:r,mode:i,favicons:a}){if(r)return(0,Z.jsx)(iy,{data:t,query:r});if(n.startsWith(`#doc/`)){let r=e.docs.find(e=>e.slug===n.slice(5));if(r)return(0,Z.jsx)(Jv,{data:t,doc:r,mode:i})}let o=Fy[n];if(o)return(0,Z.jsx)(o,{data:t});if(n===`#review`)return(0,Z.jsx)(Hy,{data:e});if(n===`#favicons`&&a!==null)return a?(0,Z.jsx)(Nx,{data:e,favicons:a}):null;if(n.startsWith(`#assets/`)){let t=ye(e).find(e=>`#assets/${e.category}`===n);if(t)return(0,Z.jsx)(Dx,{data:e,assets:t.assets,title:t.label,description:t.description,rules:t.rules,kind:be(t)})}return(0,Z.jsx)(Px,{})}function iC(e,t,n,r){if(n)return{section:`Search`,page:n};if(t.startsWith(`#doc/`)){let n=e.docs.find(e=>e.slug===t.slice(5));if(n)return{section:_e(n),page:n.title}}if(t===`#tokens/all`)return{section:`Tokens`,page:`All tokens`};let i=he.find(e=>e.hash===t);if(i)return{section:`Tokens`,page:i.label};if(t===`#review`)return{section:`Quality`,page:`Review`};if(t===`#favicons`&&r!==null)return{section:`Assets`,page:`Favicons`};let a=ye(e).find(e=>`#assets/${e.category}`===t);return a?{section:`Assets`,page:a.label}:{section:e.title,page:`Not found`}}var aC=()=>void 0;function oC(){let{toggleSidebar:e}=Cm();return(0,Z.jsx)(Tu,{variant:`ghost`,size:`icon`,"aria-label":`Menu`,className:`-ml-1 lg:hidden`,onClick:e,children:(0,Z.jsx)(td,{})})}function sC(){let e=b(),t=nC(),[n,r]=ze(),[i,a]=(0,_.useState)({text:``,hash:t});i.hash!==t&&a({text:``,hash:t});let o=i.text,s=e=>a({text:e,hash:t}),[c,l]=zd(e),u=Pd(),d=(0,_.useMemo)(()=>Ud(e,Vd(e,c,n)),[e,c,n]),f=(0,_.useRef)(null),p=(0,_.useRef)(e),[m,h]=t.split(`?`),g=m||ge(e),v=new URLSearchParams(h??``).get(`token`);if((0,_.useEffect)(()=>Ie(d),[d]),(0,_.useEffect)(()=>{document.documentElement.toggleAttribute(`data-mode-themed`,Bd(e)!==void 0)},[e]),(0,_.useEffect)(()=>{e!==p.current&&Ad(`Updated`)},[e]),(0,_.useEffect)(()=>{window.scrollTo?.(0,0)},[t]),(0,_.useEffect)(()=>{if(!v)return;let e=[...document.querySelectorAll(`[data-token="${CSS.escape(v)}"]`)],t=e.find(e=>e.getClientRects().length>0)??e[0];t&&(t.scrollIntoView?.({block:`center`}),t.classList.remove(`blazon-flash`),t.offsetWidth,t.classList.add(`blazon-flash`))},[v,g]),g===`#print`||g.startsWith(`#print/`))return(0,Z.jsx)($S,{data:e,view:d,mode:n,...eC(t),favicons:u});let y=o.trim().toLowerCase(),x=iC(e,g,y,u);return(0,Z.jsx)(Od,{children:(0,Z.jsx)(fm,{children:(0,Z.jsxs)(wm,{open:!0,onOpenChange:aC,className:`flex-col`,children:[(0,Z.jsxs)(`header`,{className:`sticky top-0 z-20 flex h-14 shrink-0 items-center gap-2 border-b bg-background/95 px-4 backdrop-blur`,children:[(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 lg:w-[calc(var(--sidebar-width)-1rem)]`,children:[(0,Z.jsx)(oC,{}),(0,Z.jsx)(Hm,{data:e,mode:n})]}),(0,Z.jsx)(Kh,{className:`hidden min-w-0 md:flex`,children:(0,Z.jsxs)(qh,{children:[(0,Z.jsx)(Jh,{children:x.section}),(0,Z.jsx)(Xh,{}),(0,Z.jsx)(Jh,{className:`min-w-0`,children:(0,Z.jsx)(Yh,{className:`truncate`,children:x.page})})]})}),(0,Z.jsxs)(`div`,{className:`ml-auto flex min-w-0 items-center gap-2`,children:[(0,Z.jsxs)(`label`,{className:`relative min-w-0`,children:[(0,Z.jsx)(ld,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,Z.jsx)(Wf,{type:`search`,placeholder:`Search tokens and pages`,"aria-label":`Search`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-[clamp(140px,28vw,320px)] pl-8`})]}),(0,Z.jsx)(Kd,{data:e,selected:c,onSelect:l,exclude:Bd(e),className:`hidden md:flex`}),(0,Z.jsx)(Gh,{}),(0,Z.jsx)(Tu,{variant:`ghost`,size:`icon`,"aria-label":n===`dark`?`Light mode`:`Dark mode`,onClick:()=>r(n===`dark`?`light`:`dark`),children:n===`dark`?(0,Z.jsx)(dd,{}):(0,Z.jsx)(rd,{})})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1`,children:[(0,Z.jsx)(Um,{data:e,hash:g,mode:n,favicons:u,contexts:c,onSelectContext:l,className:`lg:top-14 lg:h-[calc(100svh-3.5rem)]`}),(0,Z.jsx)(Dm,{ref:f,lang:Hd(e,`locale`,c),className:`min-w-0`,children:(0,Z.jsx)(rC,{data:e,view:d,hash:g,query:y,mode:n,favicons:u})})]})]})})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(sC,{})}));
|
package/dist/ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Brand Book</title>
|
|
7
7
|
<link rel="icon" href="data:," />
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-dkJG6W9p.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-Biy1hkeq.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/mcp/dist/index.js
CHANGED
|
@@ -22544,7 +22544,7 @@ function buildPageText(description) {
|
|
|
22544
22544
|
* read from the packages installed at the repository root. The server's `version` is blazon's, since it ships inside blazon.
|
|
22545
22545
|
*/
|
|
22546
22546
|
var VERSIONS = {
|
|
22547
|
-
"blazon": "0.3.
|
|
22547
|
+
"blazon": "0.3.3",
|
|
22548
22548
|
"sdk": "1.32.2",
|
|
22549
22549
|
"zod": "4.6.7"
|
|
22550
22550
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iksnerd/blazon",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Brand book and design token compiler: DTCG tokens, brand rules checked by blazon check, a static brand book that wears the brand",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,8 +40,9 @@
|
|
|
40
40
|
"test": "vitest run",
|
|
41
41
|
"test:related": "vitest related --run",
|
|
42
42
|
"test:files": "vitest run",
|
|
43
|
+
"test:guards": "vitest run test/core/no-private-markers.test.ts test/core/layers.test.ts",
|
|
43
44
|
"test:deck": "vitest run test/deck/brand-deck-plan test/deck/brand-deck-fonts.test.ts test/deck/brand-deck-examples.test.ts test/deck/examples-deck.test.ts test/plugins/shipped/brand-deck test/brand/brand-python.test.ts",
|
|
44
|
-
"test:docs": "vitest run test/docs/manual.test.ts test/docs/rfc.test.ts test/docs/checks-generated.test.ts test/docs/versions.test.ts",
|
|
45
|
+
"test:docs": "vitest run test/docs/manual.test.ts test/docs/rfc.test.ts test/docs/checks-generated.test.ts test/docs/layers-generated.test.ts test/docs/versions.test.ts test/docs/changelog-fragments.test.ts",
|
|
45
46
|
"conformance:reads": "rm -f reads.json reads.json.lines && CONFORMANCE_READS=reads.json vitest run test/plugins/host && tsx scripts/conformance-reads.ts reads.json",
|
|
46
47
|
"test:watch": "vitest",
|
|
47
48
|
"typecheck": "node node_modules/typescript7/bin/tsc --noEmit && node scripts/typecheck-mcp.mjs",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"format:files": "prettier --check --no-error-on-unmatched-pattern",
|
|
55
56
|
"check": "npm run typecheck && npm run lint && npm run lint:py && npm run format:check",
|
|
56
57
|
"checks-docs": "tsx scripts/gen-checks-docs.ts",
|
|
58
|
+
"layers-docs": "tsx scripts/gen-layers-docs.ts",
|
|
57
59
|
"docs:stats": "tsx scripts/docs-stats.ts",
|
|
58
60
|
"gen:mcp": "tsx scripts/gen-mcp-operations.ts",
|
|
59
61
|
"shipped-lock": "tsx scripts/shipped-lock.mjs",
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"prepack": "npm run build && npm run build-starter",
|
|
63
65
|
"prepublishOnly": "npm run prepack && npm run check-pack",
|
|
64
66
|
"release": "node scripts/release.mjs",
|
|
67
|
+
"changelog:preview": "node scripts/release.mjs --preview",
|
|
65
68
|
"blazon:src": "tsx scripts/blazon-src.ts",
|
|
66
69
|
"build:viewer": "vite build -c vite.viewer.config.ts",
|
|
67
70
|
"dev:blazon": "tsx scripts/blazon-src.ts dev examples/blazon",
|
|
@@ -4,18 +4,20 @@ The plugin blazon ships to hold a brand book's text to the brand's copy rules: t
|
|
|
4
4
|
|
|
5
5
|
The source is `src/shipped/copy/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.copy.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. It loads nothing from `node_modules`, so the pin covers all the code it runs, apart from Node itself. Name it in `blazon.json` and give it the rules:
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "blazon.copy",
|
|
12
|
+
"options": {
|
|
13
|
+
"avoid": [{ "terms": ["powerful", "seamless", "robust", "effortless"], "say": "a number, or nothing" }],
|
|
14
|
+
"headings": "sentence",
|
|
15
|
+
"sentences": { "maxWords": 25 },
|
|
16
|
+
"skip": ["11-voice.md"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
With no options it checks nothing. The options and the findings are in [the manual](../../docs/manual/14-shipped-plugins.md#blazoncopy), and the design is [RFC 0006](../../docs/rfc/0006-copy-rules.md).
|
|
@@ -11,3 +11,6 @@ The source is `src/shipped/favicons/`, and `npm run build` (`npm run build:plugi
|
|
|
11
11
|
| Variable | Says | Secret |
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| `BLAZON_CHROME` | The path to a Chrome or Chromium program. Without it the plugin uses the Google Chrome installed on the computer. It never downloads a browser | no |
|
|
14
|
+
| `HOME`, `TMPDIR` | Listed in the manifest, for the browser the plugin starts | no |
|
|
15
|
+
|
|
16
|
+
The manifest lists all three, so the entry in `blazon.json` approves them in its `env`: `["BLAZON_CHROME", "HOME", "TMPDIR"]`.
|
|
@@ -31,16 +31,21 @@ It exits `2` with the reason and writes nothing when the request or its options
|
|
|
31
31
|
|
|
32
32
|
## Use it
|
|
33
33
|
|
|
34
|
-
```
|
|
35
|
-
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"plugins": [
|
|
37
|
+
{ "name": "blazon.print-book", "env": ["BLAZON_CHROME", "HOME", "TMPDIR"], "options": { "preset": "essentials" } }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
36
40
|
```
|
|
37
41
|
|
|
38
|
-
The source is `src/shipped/print-book/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.print-book.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. The program loads `playwright-core` and `pdf-lib` from `node_modules` when it runs; that is outside the pin.
|
|
42
|
+
The source is `src/shipped/print-book/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.print-book.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. The program loads `playwright-core` and `pdf-lib` from `node_modules` when it runs; that is outside the pin. Blazon finds the plugins it ships by itself, as the plugins chapter of the manual says, so there is nothing to install or pin. The entry must approve the three variables the manifest lists (`env` above), or a set `HOME` stops the plugin with a message that says what to add.
|
|
39
43
|
|
|
40
44
|
## Variables
|
|
41
45
|
|
|
42
46
|
| Variable | Says | Secret |
|
|
43
47
|
|---|---|---|
|
|
44
48
|
| `BLAZON_CHROME` | The path to a Chrome or Chromium program. Without it the plugin uses the Google Chrome installed on the computer. It never downloads a browser | no |
|
|
49
|
+
| `HOME`, `TMPDIR` | Listed in the manifest, for the browser the plugin starts | no |
|
|
45
50
|
|
|
46
51
|
`BLAZON_PRINT_SECONDS` (how long to wait for the page to lay itself out: 30 by default, and at most 30) is read too, but blazon does not pass it. It is for running the plugin by hand and for its tests.
|
|
@@ -20,4 +20,4 @@ A brand with no token in any namespace gets neither file. The plugin takes no op
|
|
|
20
20
|
| Code | Severity | When |
|
|
21
21
|
|---|---|---|
|
|
22
22
|
| `blazon.tailwind/variable-duplicate` | error | Two tokens with different values write one Tailwind variable (`color.brand` and `colors.brand` are both `--color-brand`); `tailwind.css` keeps the first |
|
|
23
|
-
| `blazon.tailwind/option-invalid` | error | The
|
|
23
|
+
| `blazon.tailwind/option-invalid` | error | The entry gives an option, or `options` is not an object |
|
package/plugins/shipped.lock
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"kind": "tree",
|
|
13
13
|
"path": "blazon.copy",
|
|
14
14
|
"entry": "bin/blazon-blazon.copy.🔌",
|
|
15
|
-
"digest": "t1:
|
|
15
|
+
"digest": "t1:8e39042f7aff2bce72948220cf3c6b36a8001acb49555a86309bee7e25729f2f",
|
|
16
16
|
"source": "computed"
|
|
17
17
|
},
|
|
18
18
|
"blazon.favicons": {
|
|
19
19
|
"kind": "tree",
|
|
20
20
|
"path": "blazon.favicons",
|
|
21
21
|
"entry": "bin/blazon-blazon.favicons.🔌",
|
|
22
|
-
"digest": "t1:
|
|
22
|
+
"digest": "t1:7c3e99fa5a5f9ecbeb9a638907b4224a7a7cecbe1e1c05d37a81b82ff7f9e76c",
|
|
23
23
|
"source": "computed"
|
|
24
24
|
},
|
|
25
25
|
"blazon.logo-geometry": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"kind": "tree",
|
|
62
62
|
"path": "blazon.print-book",
|
|
63
63
|
"entry": "bin/blazon-blazon.print-book.🔌",
|
|
64
|
-
"digest": "t1:
|
|
64
|
+
"digest": "t1:a1b5ca8bc80c8b202cf67268f65f4e10a65ddfb5eb32a0df9f527c165e764dd5",
|
|
65
65
|
"source": "computed"
|
|
66
66
|
},
|
|
67
67
|
"blazon.shadcn": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"kind": "tree",
|
|
83
83
|
"path": "blazon.tailwind",
|
|
84
84
|
"entry": "bin/blazon-blazon.tailwind.🔌",
|
|
85
|
-
"digest": "t1:
|
|
85
|
+
"digest": "t1:9b758e21a03563b547a0ed6e7f7f6489ee942e8e8714f82489ab4529bf9fa9e7",
|
|
86
86
|
"source": "computed"
|
|
87
87
|
}
|
|
88
88
|
}
|