@tryvitris/website-harness 1.0.1 → 1.0.2
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/agent/graph.yaml +16 -8
- package/agent/refs/browser.md +2 -0
- package/agent/refs/compose.md +2 -0
- package/agent/refs/design-quality.md +2 -0
- package/agent/refs/direction.md +2 -0
- package/agent/refs/implement.md +2 -0
- package/agent/refs/template-adaptation.md +2 -0
- package/agent/refs/template-library.md +2 -0
- package/agent/refs/typography.md +15 -0
- package/bin/api/agent/evaluate.js +7 -6
- package/bin/api/agent/grade.js +7 -6
- package/bin/api/cli/api.js +15 -14
- package/bin/api/cli.js +17 -16
- package/bin/api/engine.js +8 -7
- package/bin/api/hosting.js +9 -8
- package/bin/api/index.js +4 -3
- package/bin/api/render.js +2 -1
- package/bin/api/theme.js +2 -1
- package/bin/chunks/{chunk-JBSGJR7X.js → chunk-ATPI2YRF.js} +2 -2
- package/bin/chunks/{chunk-KIWEFRNG.js → chunk-BMD5GVUT.js} +6 -6
- package/bin/chunks/{chunk-AUO5I56E.js → chunk-C3F7XQD2.js} +194 -1
- package/bin/chunks/{chunk-UR4NWYVW.js → chunk-CPQQQ5YB.js} +3 -3
- package/bin/chunks/{chunk-LKN75JGA.js → chunk-GE6UUEG2.js} +13 -8
- package/bin/chunks/{chunk-445FZZEC.js → chunk-GM57SNLL.js} +9 -9
- package/bin/chunks/{chunk-RE4GOHSU.js → chunk-GO3XEQBA.js} +3 -3
- package/bin/chunks/{chunk-GQPUILFR.js → chunk-JPQCUN2J.js} +1301 -1252
- package/bin/chunks/{chunk-37F7XIMH.js → chunk-JTXFTNEA.js} +6 -1
- package/bin/chunks/{chunk-L44ZTNDM.js → chunk-NMTFSWPK.js} +6 -6
- package/bin/chunks/{chunk-VKU5TY5C.js → chunk-OQGUEQ6F.js} +1 -1
- package/bin/chunks/{chunk-M72KKZIB.js → chunk-Q6FLOYHS.js} +4 -3
- package/bin/chunks/{chunk-H3BS2EBR.js → chunk-QRIYA3GJ.js} +3 -3
- package/bin/chunks/chunk-S2XVNTQP.js +90 -0
- package/bin/chunks/{chunk-54QPYUM2.js → chunk-XJTAR7KM.js} +1 -1
- package/bin/chunks/{chunk-72Y4YMTV.js → chunk-YYK6367V.js} +2 -2
- package/bin/chunks/{chunk-65LRZIBP.js → chunk-YYYPSFFZ.js} +2 -2
- package/bin/chunks/{design-context-store-ETVS4N6W.js → design-context-store-BDYBQQCO.js} +7 -6
- package/bin/chunks/{packets-XFXKHSEY.js → packets-RXFWDCK2.js} +7 -6
- package/bin/chunks/{preparation-3OR7LVPQ.js → preparation-ETEEMB5H.js} +7 -6
- package/bin/cloudflare/backend.js +90 -11
- package/bin/types/src/agent/browser-typography.d.ts +33 -0
- package/bin/types/src/agent/theme-suite-identity.d.ts +1 -0
- package/bin/types/src/agent/typography-policy.d.ts +6 -0
- package/bin/types/src/compile/site.d.ts +1 -1
- package/bin/types/src/theme.d.ts +3 -1
- package/bin/types/src/types.d.ts +6 -1
- package/bin/types/src/typography.d.ts +27 -0
- package/bin/vitris-art.js +7 -6
- package/bin/vitris-build.js +5 -4
- package/bin/vitris-create-site.js +9 -8
- package/bin/vitris-cursor-hook.js +7 -6
- package/bin/vitris-eval.js +9 -8
- package/bin/vitris-go.js +9 -8
- package/bin/vitris-harvest.js +8 -7
- package/bin/vitris-knowledge.js +8 -7
- package/bin/vitris-launch-preflight.js +7 -6
- package/bin/vitris-motion-view.js +7 -6
- package/bin/vitris-references.js +5 -4
- package/bin/vitris-refresh.js +8 -7
- package/bin/vitris-stock.js +1 -1
- package/bin/vitris-templates.js +91 -1
- package/bin/vitris-themes.js +7 -6
- package/bin/vitris-upgrade.js +8 -7
- package/bin/vitris-verify-browser.js +33 -8
- package/bin/vitris-verify-performance.js +5 -4
- package/bin/vitris.js +17 -16
- package/design-system/MASTER.md +4 -0
- package/docs/CLI.md +4 -0
- package/package.json +2 -2
- package/templates/site/site.json +1 -0
- package/templates/site/theme/defaults.json +78 -17
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MINIMUM_TYPE_PX,
|
|
3
|
+
TYPE_ROLES,
|
|
4
|
+
TYPE_SELECTORS,
|
|
5
|
+
resolvedTypography
|
|
6
|
+
} from "./chunk-S2XVNTQP.js";
|
|
7
|
+
|
|
1
8
|
// src/agent/theme-cloud.json
|
|
2
9
|
var theme_cloud_default = {
|
|
3
10
|
version: 1,
|
|
@@ -118726,6 +118733,187 @@ function visualTheme2(id, release = THEME_RELEASE2) {
|
|
|
118726
118733
|
}
|
|
118727
118734
|
var themeHash = (t) => digest(t);
|
|
118728
118735
|
|
|
118736
|
+
// src/agent/browser-typography.ts
|
|
118737
|
+
var TYPOGRAPHY_SCENARIO = "typography-v1-2026-10-28";
|
|
118738
|
+
async function captureTypography(page3, theme2, path, width, state) {
|
|
118739
|
+
const roles = resolvedTypography(theme2);
|
|
118740
|
+
const variants = theme2.typography?.variants || {};
|
|
118741
|
+
const result = await page3.evaluate(`(async ({roles,variants,minimum,selectors}) => {
|
|
118742
|
+
const failures=[],observations=[];
|
|
118743
|
+
await Promise.race([document.fonts.ready,new Promise(resolve=>setTimeout(resolve,5000))]);
|
|
118744
|
+
if(document.fonts.status!=='loaded')failures.push('Fonts did not settle before typography measurement');
|
|
118745
|
+
const settling=document.getAnimations().filter(a=>a.playState==='running'&&Number.isFinite(a.effect?.getComputedTiming().endTime));
|
|
118746
|
+
if(settling.length)await Promise.race([Promise.all(settling.map(a=>a.finished.catch(()=>{}))),new Promise(resolve=>setTimeout(resolve,1000))]);
|
|
118747
|
+
const probe=document.createElement('span');
|
|
118748
|
+
probe.setAttribute('aria-hidden','true');
|
|
118749
|
+
probe.style.cssText='all:initial!important;position:fixed!important;left:-10000px!important;visibility:hidden!important';
|
|
118750
|
+
document.body.append(probe);
|
|
118751
|
+
const expected={};
|
|
118752
|
+
const resolve=(key,style)=>{
|
|
118753
|
+
for(const [property,value] of Object.entries({fontSize:style.size,fontWeight:String(style.weight),lineHeight:style.lineHeight,letterSpacing:style.tracking,fontFamily:'var(--font-'+style.font+')'})){
|
|
118754
|
+
const cssProperty=property.replace(/[A-Z]/g,c=>'-'+c.toLowerCase());
|
|
118755
|
+
probe.style.removeProperty(cssProperty);probe.style.setProperty(cssProperty,value,'important');
|
|
118756
|
+
if(!probe.style[property])failures.push('Invalid CSS for typography '+key+'.'+property+': '+value);
|
|
118757
|
+
}
|
|
118758
|
+
const s=getComputedStyle(probe);
|
|
118759
|
+
if(!Number.isFinite(parseFloat(s.fontSize))||parseFloat(s.fontSize)<minimum-.001)failures.push('Typography '+key+' resolves below '+minimum+'px');
|
|
118760
|
+
return {size:parseFloat(s.fontSize),weight:s.fontWeight,lineHeight:s.lineHeight,tracking:s.letterSpacing,family:s.fontFamily};
|
|
118761
|
+
};
|
|
118762
|
+
for(const [role,style] of Object.entries(roles))expected[role]=resolve(role,style);
|
|
118763
|
+
for(const [name,style] of Object.entries(variants))expected['variant:'+name]=resolve(name,{...roles[style.role],...style});
|
|
118764
|
+
const roleFor=e=>{
|
|
118765
|
+
for(let a=e;a;a=a.parentElement){
|
|
118766
|
+
if(a.hasAttribute('data-type-role'))return a.getAttribute('data-type-role');
|
|
118767
|
+
for(const [role,matches] of Object.entries(selectors))if(a.matches(matches.join(',')))return role;
|
|
118768
|
+
}
|
|
118769
|
+
return 'body';
|
|
118770
|
+
};
|
|
118771
|
+
const selector=e=>{
|
|
118772
|
+
const segments=[];for(let a=e;a&&a!==document.body&&segments.length<5;a=a.parentElement){
|
|
118773
|
+
let part=a.tagName.toLowerCase();if(a.id){segments.unshift(part+'#'+CSS.escape(a.id));break;}
|
|
118774
|
+
const index=a.parentElement?[...a.parentElement.children].filter(s=>s.tagName===a.tagName).indexOf(a)+1:1;
|
|
118775
|
+
part+=[...a.classList].slice(0,2).map(c=>'.'+CSS.escape(c)).join('');segments.unshift(part+':nth-of-type('+index+')');
|
|
118776
|
+
}return segments.join(' > ');
|
|
118777
|
+
};
|
|
118778
|
+
const visible=e=>{
|
|
118779
|
+
if(e.closest('script,style,noscript,template')||e===probe)return false;
|
|
118780
|
+
if(!e.checkVisibility({checkOpacity:true,checkVisibilityCSS:true}))return false;
|
|
118781
|
+
const rect=e.getBoundingClientRect(),s=getComputedStyle(e);
|
|
118782
|
+
if(rect.width<=1&&rect.height<=1&&['hidden','clip'].includes(s.overflow))return false;
|
|
118783
|
+
return true;
|
|
118784
|
+
};
|
|
118785
|
+
// Controls, placeholders and options need a sample even without child text nodes.
|
|
118786
|
+
const elements=[...document.querySelectorAll('body *')].filter(e=>visible(e)&&(
|
|
118787
|
+
[...e.childNodes].some(n=>n.nodeType===3&&n.textContent.trim())||e.matches('input:not([type=hidden]),textarea,select')||['before','after'].some(p=>{const c=getComputedStyle(e,'::'+p).content;return c&&c!=='none'&&c!=='normal'&&c!=='""';})
|
|
118788
|
+
));
|
|
118789
|
+
const seenFonts=new Set();
|
|
118790
|
+
const close=(a,b)=>a===b||(Number.isFinite(parseFloat(a))&&Number.isFinite(parseFloat(b))&&Math.abs(parseFloat(a)-parseFloat(b))<=.1);
|
|
118791
|
+
for(const e of elements){
|
|
118792
|
+
const role=roleFor(e),variantElement=e.closest('[data-type-variant]'),variant=variantElement?.getAttribute('data-type-variant');
|
|
118793
|
+
const spec=variant?variants[variant]:undefined;
|
|
118794
|
+
const key=variant?'variant:'+variant:role,exp=expected[key];
|
|
118795
|
+
const s=getComputedStyle(e),size=parseFloat(s.fontSize),loc=selector(e);
|
|
118796
|
+
let scale=1;
|
|
118797
|
+
if(typeof e.getScreenCTM==='function'){const m=e.getScreenCTM();if(m)scale=Math.min(Math.hypot(m.a,m.b),Math.hypot(m.c,m.d));}
|
|
118798
|
+
for(let a=e;a;a=a.parentElement){
|
|
118799
|
+
const st=getComputedStyle(a);
|
|
118800
|
+
if(typeof e.getScreenCTM!=='function'&&st.transform!=='none'){const m=new DOMMatrix(st.transform);scale*=Math.min(Math.hypot(m.a,m.b),Math.hypot(m.c,m.d));}
|
|
118801
|
+
if(typeof e.getScreenCTM!=='function'&&st.scale!=='none'){const values=st.scale.split(' ').map(Number);scale*=Math.min(Math.abs(values[0]),Math.abs(values[1]??values[0]));}
|
|
118802
|
+
if(typeof e.getScreenCTM!=='function')scale*=parseFloat(st.zoom)||1;
|
|
118803
|
+
}
|
|
118804
|
+
const text=(e.matches('input,textarea,select')?(e.value||e.getAttribute('placeholder')||e.getAttribute('aria-label')||e.tagName):[...e.childNodes].filter(n=>n.nodeType===3).map(n=>n.textContent).join(' ')).trim().replace(/\\s+/g,' ').slice(0,120);
|
|
118805
|
+
const observation={selector:loc,text,role,...(variant?{variant}:{}),size,renderedSize:size*scale,weight:s.fontWeight,lineHeight:s.lineHeight,tracking:s.letterSpacing,family:s.fontFamily};
|
|
118806
|
+
observations.push(observation);
|
|
118807
|
+
if(!exp||spec&&spec.role!==role)failures.push(loc+': unknown or incompatible type role/variant '+key+' (role '+role+')');
|
|
118808
|
+
const checkSize=(fontSize,label)=>{if(fontSize*scale<minimum-.001)failures.push(loc+label+': rendered '+(fontSize*scale).toFixed(2)+'px is below '+minimum+'px: '+text);};
|
|
118809
|
+
checkSize(size,'');
|
|
118810
|
+
for(const pseudo of ['::before','::after',...(e.matches('input,textarea')?['::placeholder']:[])]){
|
|
118811
|
+
const ps=getComputedStyle(e,pseudo);
|
|
118812
|
+
if(pseudo==='::placeholder'?!e.getAttribute('placeholder'):(!ps.content||['none','normal','""'].includes(ps.content)))continue;
|
|
118813
|
+
if(ps.display!=='none'&&ps.visibility!=='hidden'&&Number(ps.opacity)!==0)checkSize(parseFloat(ps.fontSize),pseudo);
|
|
118814
|
+
}
|
|
118815
|
+
if(exp){
|
|
118816
|
+
const emphasis=!!e.closest('strong,b');
|
|
118817
|
+
for(const field of ['size','weight','lineHeight','tracking','family']){
|
|
118818
|
+
if(field==='weight'&&emphasis)continue;
|
|
118819
|
+
if(!close(String(observation[field]),String(exp[field])))failures.push(loc+': '+key+' '+field+' is '+observation[field]+'; expected '+exp[field]+' ('+text+')');
|
|
118820
|
+
}
|
|
118821
|
+
}
|
|
118822
|
+
const fontKey=s.fontFamily+'/'+s.fontWeight;
|
|
118823
|
+
if(!seenFonts.has(fontKey)){
|
|
118824
|
+
seenFonts.add(fontKey);
|
|
118825
|
+
const first=s.fontFamily.split(',')[0].trim().replace(/^['"]|['"]$/g,'').toLowerCase();
|
|
118826
|
+
const faces=[...document.fonts].filter(f=>f.family.replace(/^['"]|['"]$/g,'').toLowerCase()===first);
|
|
118827
|
+
if(faces.length){
|
|
118828
|
+
const weight=Number(s.fontWeight);
|
|
118829
|
+
const match=faces.some(f=>{const range=f.weight==='normal'?[400]:f.weight==='bold'?[700]:f.weight.split(' ').map(Number);return f.status==='loaded'&&weight>=range[0]&&weight<=(range[1]??range[0]);});
|
|
118830
|
+
if(!match)failures.push(loc+': requested font '+first+' weight '+weight+' has no loaded matching face');
|
|
118831
|
+
}
|
|
118832
|
+
}
|
|
118833
|
+
}
|
|
118834
|
+
probe.remove();return {observations,failures:[...new Set(failures)]};
|
|
118835
|
+
})(${JSON.stringify({ roles, variants, minimum: MINIMUM_TYPE_PX, selectors: TYPE_SELECTORS })})`);
|
|
118836
|
+
return { path, width, state, scenario: TYPOGRAPHY_SCENARIO, ...result };
|
|
118837
|
+
}
|
|
118838
|
+
function typographyConsistencyFailures(captures) {
|
|
118839
|
+
const first = /* @__PURE__ */ new Map();
|
|
118840
|
+
const failures = /* @__PURE__ */ new Set();
|
|
118841
|
+
for (const capture of captures) for (const observation of capture.observations) {
|
|
118842
|
+
if (!TYPE_ROLES.includes(observation.role)) continue;
|
|
118843
|
+
const key = `${capture.width}/${observation.role}/${observation.variant || "default"}`;
|
|
118844
|
+
const prior = first.get(key);
|
|
118845
|
+
if (!prior) {
|
|
118846
|
+
first.set(key, { observation, path: capture.path });
|
|
118847
|
+
continue;
|
|
118848
|
+
}
|
|
118849
|
+
if (Math.abs(prior.observation.size - observation.size) > 0.1 || prior.observation.family !== observation.family) failures.add(`Type role drift ${key}: ${capture.path} ${observation.selector} differs from ${prior.path} ${prior.observation.selector}`);
|
|
118850
|
+
}
|
|
118851
|
+
return [...failures];
|
|
118852
|
+
}
|
|
118853
|
+
function typographyEvidenceFailures(report, routes) {
|
|
118854
|
+
if (!report || report.scenario !== TYPOGRAPHY_SCENARIO || !Array.isArray(report.captures) || !Array.isArray(report.failures)) return ["Missing current rendered typography evidence"];
|
|
118855
|
+
const errors = [...report.failures];
|
|
118856
|
+
for (const path of routes) for (const width of [375, 1080]) if (!report.captures.some((c) => c.path === path && c.width === width && c.state === "resting" && c.scenario === TYPOGRAPHY_SCENARIO && Array.isArray(c.observations) && c.observations.length)) errors.push(`Missing typography coverage: ${path} ${width}px`);
|
|
118857
|
+
for (const capture of report.captures) {
|
|
118858
|
+
if (!Array.isArray(capture.failures) || !Array.isArray(capture.observations)) {
|
|
118859
|
+
errors.push("Malformed typography capture");
|
|
118860
|
+
continue;
|
|
118861
|
+
}
|
|
118862
|
+
errors.push(...capture.failures.map((f) => `${capture.path} ${capture.width}px ${capture.state}: ${f}`));
|
|
118863
|
+
for (const observation of capture.observations) if (!Number.isFinite(observation.renderedSize) || observation.renderedSize < MINIMUM_TYPE_PX - 1e-3) errors.push(`Undersized typography evidence: ${capture.path} ${observation.selector}`);
|
|
118864
|
+
}
|
|
118865
|
+
errors.push(...typographyConsistencyFailures(report.captures.filter((c) => Array.isArray(c.observations))));
|
|
118866
|
+
return [...new Set(errors)];
|
|
118867
|
+
}
|
|
118868
|
+
async function captureTypographyStates(page3, theme2, path, width) {
|
|
118869
|
+
const blocked = [];
|
|
118870
|
+
const fence = async (route) => {
|
|
118871
|
+
const request2 = route.request();
|
|
118872
|
+
if (request2.method() !== "GET" || request2.isNavigationRequest()) {
|
|
118873
|
+
if (new URL(request2.url()).pathname !== "/api/t") blocked.push(`Typography disclosure attempted ${request2.method()} ${new URL(request2.url()).pathname}; request blocked`);
|
|
118874
|
+
await route.abort();
|
|
118875
|
+
} else await route.fallback();
|
|
118876
|
+
};
|
|
118877
|
+
await page3.route("**/*", fence);
|
|
118878
|
+
try {
|
|
118879
|
+
const captures = [await captureTypography(page3, theme2, path, width, "resting")];
|
|
118880
|
+
const tabs = await page3.locator('[role="tab"]:visible').all();
|
|
118881
|
+
const selected = [];
|
|
118882
|
+
for (const tab of tabs) if (await tab.getAttribute("aria-selected") === "true") selected.push(tab);
|
|
118883
|
+
for (const [index, tab] of tabs.entries()) if (await tab.isEnabled()) {
|
|
118884
|
+
await tab.click();
|
|
118885
|
+
captures.push(await captureTypography(page3, theme2, path, width, `tab-${index}`));
|
|
118886
|
+
}
|
|
118887
|
+
for (const tab of selected) if (await tab.isVisible()) await tab.click();
|
|
118888
|
+
const closed = [], originallyOpen = [];
|
|
118889
|
+
for (const detail of await page3.locator("details").all()) (await detail.getAttribute("open") === null ? closed : originallyOpen).push(detail);
|
|
118890
|
+
for (const [index, detail] of closed.entries()) {
|
|
118891
|
+
await detail.evaluate((e) => {
|
|
118892
|
+
e.open = true;
|
|
118893
|
+
});
|
|
118894
|
+
captures.push(await captureTypography(page3, theme2, path, width, `detail-${index}`));
|
|
118895
|
+
await detail.evaluate((e) => {
|
|
118896
|
+
e.open = false;
|
|
118897
|
+
});
|
|
118898
|
+
}
|
|
118899
|
+
for (const detail of originallyOpen) await detail.evaluate((e) => {
|
|
118900
|
+
e.open = true;
|
|
118901
|
+
});
|
|
118902
|
+
const toggles = await page3.locator('[data-nav-toggle],button[aria-expanded][aria-controls],button[aria-haspopup="dialog"][aria-controls]').all();
|
|
118903
|
+
for (const [index, toggle] of toggles.entries()) {
|
|
118904
|
+
if (!await toggle.isVisible() || !await toggle.isEnabled() || await toggle.getAttribute("aria-expanded") === "true") continue;
|
|
118905
|
+
await toggle.click();
|
|
118906
|
+
captures.push(await captureTypography(page3, theme2, path, width, `disclosure-${index}`));
|
|
118907
|
+
await page3.keyboard.press("Escape");
|
|
118908
|
+
if (await toggle.isVisible() && await toggle.getAttribute("aria-expanded") === "true") await toggle.click();
|
|
118909
|
+
}
|
|
118910
|
+
captures[0].failures.push(...blocked);
|
|
118911
|
+
return captures;
|
|
118912
|
+
} finally {
|
|
118913
|
+
await page3.unroute("**/*", fence);
|
|
118914
|
+
}
|
|
118915
|
+
}
|
|
118916
|
+
|
|
118729
118917
|
export {
|
|
118730
118918
|
CLOUD_CATALOG,
|
|
118731
118919
|
cloudEntry,
|
|
@@ -118770,5 +118958,10 @@ export {
|
|
|
118770
118958
|
ARCHIVE_THEMES,
|
|
118771
118959
|
VISUAL_THEMES2,
|
|
118772
118960
|
visualTheme2,
|
|
118773
|
-
themeHash
|
|
118961
|
+
themeHash,
|
|
118962
|
+
TYPOGRAPHY_SCENARIO,
|
|
118963
|
+
captureTypography,
|
|
118964
|
+
typographyConsistencyFailures,
|
|
118965
|
+
typographyEvidenceFailures,
|
|
118966
|
+
captureTypographyStates
|
|
118774
118967
|
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-2NW7KSPA.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyPreservedSite
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YYYPSFFZ.js";
|
|
7
7
|
import {
|
|
8
8
|
EXIT_CODES
|
|
9
9
|
} from "./chunk-JCRGE6AL.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
gradeAll,
|
|
15
15
|
sourceRevision
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JPQCUN2J.js";
|
|
17
17
|
import {
|
|
18
18
|
parseReleaseRecord
|
|
19
19
|
} from "./chunk-M4LNHYYR.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
buildVerified,
|
|
22
22
|
findHarnessRoot,
|
|
23
23
|
isPreserveSite
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QRIYA3GJ.js";
|
|
25
25
|
import {
|
|
26
26
|
json,
|
|
27
27
|
save
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultTheme
|
|
3
3
|
} from "./chunk-YYPYYOEV.js";
|
|
4
|
+
import {
|
|
5
|
+
typographyVariables,
|
|
6
|
+
typographyVariantCss
|
|
7
|
+
} from "./chunk-S2XVNTQP.js";
|
|
4
8
|
|
|
5
9
|
// src/theme.ts
|
|
6
10
|
function mergeTheme(partial) {
|
|
@@ -12,8 +16,9 @@ function mergeTheme(partial) {
|
|
|
12
16
|
if (!partial?.radiusLg) merged.radiusLg = partial?.radiusLg || defaultTheme.radiusLg;
|
|
13
17
|
return merged;
|
|
14
18
|
}
|
|
15
|
-
function themeCss(tokens) {
|
|
19
|
+
function themeCss(tokens, typography) {
|
|
16
20
|
const t = mergeTheme(tokens);
|
|
21
|
+
const sharedType = typography?.version === 1;
|
|
17
22
|
return `:root {
|
|
18
23
|
--color-bg: ${t.colorBg};
|
|
19
24
|
--color-text: ${t.colorText};
|
|
@@ -39,12 +44,12 @@ function themeCss(tokens) {
|
|
|
39
44
|
--space-7: 3rem;
|
|
40
45
|
--space-8: 4.5rem;
|
|
41
46
|
--space-9: 6rem;
|
|
42
|
-
--step-0: ${t.typeStep0 || "clamp(0.9rem, 0.85rem + 0.2vw, 1rem)"};
|
|
43
|
-
--step-1: ${t.typeStep1 || "clamp(1rem, 0.95rem + 0.3vw, 1.125rem)"};
|
|
44
|
-
--step-2: ${t.typeStep2 || "clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem)"};
|
|
45
|
-
--step-3: ${t.typeStep3 || "clamp(1.6rem, 1.25rem + 1.2vw, 2.25rem)"};
|
|
47
|
+
--step-0: ${sharedType ? "var(--type-caption-size)" : t.typeStep0 || "clamp(0.9rem, 0.85rem + 0.2vw, 1rem)"};
|
|
48
|
+
--step-1: ${sharedType ? "var(--type-body-size)" : t.typeStep1 || "clamp(1rem, 0.95rem + 0.3vw, 1.125rem)"};
|
|
49
|
+
--step-2: ${sharedType ? "var(--type-subheading-size)" : t.typeStep2 || "clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem)"};
|
|
50
|
+
--step-3: ${sharedType ? "var(--type-section-size)" : t.typeStep3 || "clamp(1.6rem, 1.25rem + 1.2vw, 2.25rem)"};
|
|
46
51
|
--step-4: ${t.typeStep4 || "clamp(2.1rem, 1.5rem + 2.2vw, 3.5rem)"};
|
|
47
|
-
--step-5: ${t.typeStep5 || "clamp(2.6rem, 1.7rem + 3.4vw, 4.75rem)"};
|
|
52
|
+
--step-5: ${sharedType ? "var(--type-display-size)" : t.typeStep5 || "clamp(2.6rem, 1.7rem + 3.4vw, 4.75rem)"};
|
|
48
53
|
--tap-min: 44px;
|
|
49
54
|
--header-h: 4.75rem;
|
|
50
55
|
--section-y: ${t.sectionY || "clamp(3.5rem, 3rem + 3vw, 6rem)"};
|
|
@@ -53,8 +58,8 @@ function themeCss(tokens) {
|
|
|
53
58
|
--shadow-2: 0 8px 24px color-mix(in srgb, var(--color-text) 8%, transparent);
|
|
54
59
|
--shadow-3: 0 20px 48px color-mix(in srgb, var(--color-text) 12%, transparent);
|
|
55
60
|
--ring: 0 0 0 3px color-mix(in srgb, var(--color-focus) 35%, transparent);
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
61
|
+
${sharedType ? typographyVariables(t) + "\n" : ""}}
|
|
62
|
+
${sharedType ? typographyVariantCss(t) + "\n" : ""}`;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
export {
|
|
@@ -11,40 +11,40 @@ import {
|
|
|
11
11
|
runDoctor,
|
|
12
12
|
shareSite,
|
|
13
13
|
synthesizeSite
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BMD5GVUT.js";
|
|
15
15
|
import {
|
|
16
16
|
verifySite
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CPQQQ5YB.js";
|
|
18
18
|
import {
|
|
19
19
|
upgradeSite
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ATPI2YRF.js";
|
|
21
21
|
import {
|
|
22
22
|
createSite
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-Q6FLOYHS.js";
|
|
24
24
|
import {
|
|
25
25
|
explainStage
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OQGUEQ6F.js";
|
|
27
27
|
import {
|
|
28
28
|
runSite,
|
|
29
29
|
statusSite,
|
|
30
30
|
workflowArgvFromFlags
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GO3XEQBA.js";
|
|
32
32
|
import {
|
|
33
33
|
EXIT_CODES
|
|
34
34
|
} from "./chunk-JCRGE6AL.js";
|
|
35
35
|
import {
|
|
36
36
|
siteInputsFromFlags
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-JPQCUN2J.js";
|
|
38
38
|
import {
|
|
39
39
|
buildVerified,
|
|
40
40
|
findHarnessRoot
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-QRIYA3GJ.js";
|
|
42
42
|
import {
|
|
43
43
|
approvedOrigin,
|
|
44
44
|
inspectForms,
|
|
45
45
|
safeId,
|
|
46
46
|
validateFormConfig
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-NMTFSWPK.js";
|
|
48
48
|
import {
|
|
49
49
|
files
|
|
50
50
|
} from "./chunk-T6PE4KN4.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
capturePreservedSite,
|
|
3
3
|
verifyPreservedSite
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YYYPSFFZ.js";
|
|
5
5
|
import {
|
|
6
6
|
AGENT_RUNTIME_HISTORY_ENTRIES
|
|
7
7
|
} from "./chunk-34H54KEY.js";
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
verifyAllowedWrites,
|
|
69
69
|
withMutationLock,
|
|
70
70
|
writeVisualProbe
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-JPQCUN2J.js";
|
|
72
72
|
import {
|
|
73
73
|
QUESTION_VERSION,
|
|
74
74
|
questionSemanticsHash
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
findHarnessRoot,
|
|
100
100
|
findKernelRoot,
|
|
101
101
|
isPreserveSite
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-QRIYA3GJ.js";
|
|
103
103
|
import {
|
|
104
104
|
STUDY_CAPTURE_HEIGHT,
|
|
105
105
|
STUDY_CAPTURE_VIEWPORTS,
|