Files
cms-SiteForge/app/static/studio-experience-v829.js
浅念 e21dbb6518 upgrade: adopt V8.33.1 — final merge, our patches upstreamed natively
V8.33.0 absorbed our entire platform patch set as native features
(discovery/env_for macro override/blocks.css priority/type-mapping fix/
frontend entries/locale override) and synced trade-pro from our remote;
V8.33.1 adds HESU PIPE industrial-theme home fixes (1.3.1).

Zero patch re-application this round — all verified native. Theme
suites 35/35; full run 428 passed + same 10 known Windows env fails
(FAILED set unchanged). Live: container 8.33.1-dev.1 healthy, hesupipe
192 entries intact, trade-pro build 203 pages 0 errors.

Patch registry retired to archive — future upgrades are plain overlay.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-26 14:27:17 +08:00

48 lines
2.4 KiB
JavaScript

/* SiteForge V8.29: presentation-only studio helpers. No persisted-schema changes. */
'use strict';
(function(root){
const themes=new Set(['automotive','industrial','corporate','minimal','trade-pro']);
const pages=new Set(['home','listing','product','article','about','contact']);
const categories={
visual:new Set(['hero','banner','carousel','gallery','image','image_text','image-grid','video','slider']),
business:new Set(['collection','products','product_list','brand_wall','brands','features','stats','testimonials','faq','contact','form','cta','map']),
advanced:new Set(['layout','columns','tabs','accordion','html-embed','embed','spacer','divider'])
};
function categoryOf(key){for(const [name,ids] of Object.entries(categories))if(ids.has(key))return name;return 'basic'}
function groupBlocks(blocks,query=''){
const result={basic:[],visual:[],business:[],advanced:[]};
const q=String(query).trim().toLocaleLowerCase().slice(0,70);
for(const [key,block] of Object.entries(blocks||{})){
if(!block||typeof block!=='object')continue;
const text=[key,block.name,block.description].join(' ').toLocaleLowerCase();
if(q&&!text.includes(q))continue;
result[categoryOf(key)].push({key,block});
}
return result;
}
function previewUrl(theme,page){
if(!themes.has(theme)||!pages.has(page))return null;
return `/api/factory/themes/${theme}/preview?page_type=${page}`;
}
/* Only CSS-token values accepted by the existing server-side block validator. */
const designPalettes={
automotive:['#ffffff','#14283d','#f3f6f9','#102e47'],
industrial:['#ffffff','#193f59','#eef5f8','#104a6d'],
corporate:['#ffffff','#262d58','#f4f3fb','#34397b'],
minimal:['#faf9f5','#292924','#f0efe9','#30302c'],
'trade-pro':['#ffffff','#17365c','#eef4fc','#0b3d91']
};
function stylePreset(theme,preset){
const [base,ink,soft,dark]=designPalettes[themes.has(theme)?theme:'corporate'];
switch(preset){
case 'clean':return {background:base,text_color:ink,padding:72};
case 'soft':return {background:soft,text_color:ink,padding:58};
case 'feature':return {background:dark,text_color:'#ffffff',padding:90};
default:return null;
}
}
const api=Object.freeze({categoryOf,groupBlocks,previewUrl,stylePreset});
if(typeof module!=='undefined'&&module.exports)module.exports=api;
if(root)root.SiteForgeStudioExperience=api;
})(typeof window!=='undefined'?window:null);