@lightspeed/crane 2.0.4 → 2.0.5
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/CHANGELOG.md +16 -0
- package/dist/cli.mjs +1 -1
- package/package.json +2 -2
- package/template/preview/shared/preview.ts +70 -25
- package/template/reference/sections/about-us/component/Stats.vue +2 -2
- package/template/reference/sections/intro-slider/component/Slider.vue +1 -1
- package/template/reference/sections/intro-slider/component/Title.vue +2 -2
- package/template/reference/sections/intro-slider/settings/content.ts +17 -0
- package/template/reference/sections/tag-lines/component/HighlightedText.vue +1 -1
- package/template/reference/sections/tag-lines/component/Title.vue +1 -1
- package/template/reference/sections/tag-lines/settings/content.ts +34 -0
- package/template/reference/sections/trending-categories/component/Title.vue +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.5 - 2026-01-14
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add support for Category and Product selectors in the Deck content editor.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @lightspeed/crane-api@1.1.1
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Add better error handling during 'preview' mode.
|
|
17
|
+
- Fix reference template showcases errors for 'preview' mode.
|
|
18
|
+
|
|
3
19
|
## 2.0.4 - 2026-01-07
|
|
4
20
|
|
|
5
21
|
### Added
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as ct from"fs";import V,{existsSync as re,statSync as ni,rename as pn,unlink as un,writeFileSync as fn,readFileSync as oi,promises as _t,createReadStream as si}from"fs";import*as Oe from"path";import W,{resolve as U,parse as He,dirname as dn,relative as ri,basename as ii,sep as hn}from"path";import ai from"cac";import{red as ci,yellow as li,green as Le}from"kolorist";import St from"prompts";import pi from"adm-zip";import{glob as z,globSync as mn}from"glob";import{normalizePath as ui,defineConfig as yn,build as qe,createServer as fi}from"vite";import{SectionTypeEnum as ue,ValidationTypeEnum as Me,PluginTypeEnum as Ee,ConfigTypeEnum as Y,BackgroundStyleEnum as Tt,ButtonAppearanceEnum as di,ButtonSizeEnum as hi,ButtonShapeEnum as mi,OverlayTypeEnum as lt,DesignEditorType as Pe,TemplatePageEnum as be,ReservedTemplatePageNameEnum as yi}from"@lightspeed/crane-api";import{pathToFileURL as gn,URL as gi}from"url";import $i from"ajv/dist/2020.js";import Ei from"ajv-formats";import bi from"node:zlib";import{promisify as _i}from"node:util";import{JSONPath as Si}from"jsonpath-plus";import{builtinModules as $n}from"module";import{viteExternalsPlugin as En}from"vite-plugin-externals";import Ti from"vite-plugin-compression";import wi from"@vitejs/plugin-vue";import Ci from"vite-tsconfig-paths";import Ai from"vite-plugin-checker";import{encode as Ri}from"@jridgewell/sourcemap-codec";import*as ie from"process";import Oi from"tinycolor2";import se from"node:fs";import ye from"node:path";import ae from"node:process";import bn from"util";import{fileURLToPath as vi}from"node:url";import{readFile as _n}from"fs/promises";import Ii,{AxiosError as Sn}from"axios";import{ConcurrencyManager as Li}from"axios-concurrency";import{inc as ji}from"semver";import xi from"cli-progress";const Ni="2.0.3",ce={[ue.SECTION]:{source:"sections",dist:"dist/sections"},[ue.HEADER]:{source:"headers",dist:"dist/headers"},[ue.FOOTER]:{source:"footers",dist:"dist/footers"}};var K=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientChunks=2]="ClientChunks",e[e.ClientAsset=3]="ClientAsset",e[e.Asset=4]="Asset",e[e.TemplateAsset=5]="TemplateAsset",e[e.Dependency=6]="Dependency",e[e.SourceCode=7]="SourceCode",e[e.LayoutClient=8]="LayoutClient",e[e.LayoutAsset=9]="LayoutAsset",e[e.SlotServer=10]="SlotServer",e[e.SlotClient=11]="SlotClient",e[e.SlotClientChunks=12]="SlotClientChunks",e[e.SlotClientAsset=13]="SlotClientAsset",e))(K||{});const Pi="https://blockbuster.ecwid.com",Di="/api/v1/custom-apps/resources/sections/upload",ki="/api/v1/custom-apps/resources/templates/upload",Fi="/api/v1/custom-apps/manifests/sections",Hi="/api/v1/custom-apps/manifests/templates",Mi=5,Gi=3,Bi=[K.Server,K.Client,K.ClientChunks,K.ClientAsset,K.Asset],qi=[K.LayoutClient,K.LayoutAsset],Ui=[K.SlotServer,K.SlotClient,K.SlotClientChunks,K.SlotClientAsset],zi=[K.Dependency,K.TemplateAsset,K.SourceCode],Ue={DEFAULT:"Error while deploying:",ASSET_FILES_UPLOAD:"Error while uploading asset files:",MANIFEST_DEPLOYMENT:"Error while deploying manifest file:",DEPRECATED_VERSION_DEPLOYMENT:"You are using a non-supported version of crane. Please update to the latest crane version to continue.",INCORRECT_DISTRIBUTION_FOLDER:e=>`Distribution folder [${e}] is not found or has incorrect structure, please execute the build command first.`},Tn={catalog:"products",category:"category",product:"product"},Ki=e=>Tn[e],wn=e=>e in Tn;function Qe(e,t=2){if(!+e)return"0 Bytes";const n=1024,o=t<0?0:t,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**i).toFixed(o))} ${s[i]}`}const I={error:e=>console.log(ci(e)),warn:e=>console.log(li(e)),info:e=>console.log(Le(e))},je="_temp",Xi="dist",le="dist/sections",ze="dist/headers",Ke="dist/footers",Ce="dist/templates",Xe="layouts",Cn="preview",_e=`dist/${Xe}`,Vi=[le,ze,Ke,Ce,_e],An=2*1024*1024,Rn=500*1024;function pt(e){return!!e}function On(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}const Wi="Resource name can only contain alphanumeric characters, dashes, and underscores";function Yi(e){if(typeof e=="string"||typeof e=="number"){const t=/^[a-zA-Z0-9_-]+$/.test(e.toString());if(t)return{isValid:t,errorMessage:null}}return{isValid:!1,errorMessage:Wi}}function Zi(e){return e===!0?!0:typeof e=="string"&&e.trim().length===0}async function xe(e,t){try{const n=U(process.cwd(),t?`${e}${je}.mjs`:`${e}.mjs`),o=`?timestamp=${Date.now()}`;return(await import(gn(n).href+o)).default}catch(n){const o=`File [${e}${t?je:""}.mjs] is either invalid or undefined`,s=n instanceof Error?n.message:o;throw new Error(s)}}function vn(e){return Object.keys(e).length===0}function Qi(e){return W.parse(e).name}function Ji(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ea(e){return e.replace(/\\/g,"/")}function ta(e){return e.replace(/^dist\/layouts\//,"").replace(/^layouts\//,"")}function Je(e){return ta(ea(e))}function na(e){const t=Je(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[n,o]=t;if(!wn(n))throw new Error(`Layout cannot be placed in a non-storefront section: ${n}`);const s=Ki(n);return{id:o,sectionId:n,pageId:s}}const oa={catalog:"products",category:"category",product:"product"};async function sa(e){const t=Je(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[n,o]=t;return{id:o,sectionId:n}}async function ra(e){return Promise.all(e.map(async t=>{const n=t.sectionId,o=oa[n];return{id:t.id,sectionId:n,pageId:o}}))}async function ia(){const e=`${_e}/{product,catalog,category}/*`,t=await z(e,{ignore:["node_modules/**"]});return Promise.all(t.map(sa))}async function aa(){const e=await ia();return await ra(e)}function Ve(e,t,...n){if(!e||!t)throw new Error(`Cannot build layout path. Invalid parameters - sectionId: "${e}", layoutId: "${t}"`);return`${_e}/${e}/${t}/${n.join("/")}`}const et=(e=ue.SECTION)=>ce[e].dist,We={[K.Server]:{type:"server_js_compressed",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/server/`},[K.Client]:{type:"client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/`},[K.ClientChunks]:{type:"client_js_chunks",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/chunks/`,fileName:"*"},[K.ClientAsset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/assets/`},[K.Asset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/assets/`},[K.TemplateAsset]:{type:"template_assets",fileName:"*",isSingleton:!1,toPath:()=>`${Ce}/assets/`},[K.Dependency]:{type:"dependencies",fileName:"package.json",isSingleton:!0,toPath:()=>{}},[K.SourceCode]:{type:"source_code",fileName:"source-code.zip",isSingleton:!0,toPath:()=>{}},[K.LayoutClient]:{type:"layout_client_js",fileName:"index.mjs",isSingleton:!0,toPath:({sectionId:e,layoutId:t})=>Ve(e,t,"")},[K.LayoutAsset]:{type:"layout_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t})=>Ve(e,t,"assets/")},[K.SlotServer]:{type:"slot_server_js",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/server/")},[K.SlotClient]:{type:"slot_client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/")},[K.SlotClientChunks]:{type:"slot_client_js_chunks",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/chunks/")},[K.SlotClientAsset]:{type:"slot_client_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/assets/")}},In="https://json-schema.org/draft/2020-12/schema",Ln="https://lightspeedhq.com/template-default.schema.json",jn="Default Section",xn="Default section for a Custom Template",Nn="object",Pn={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"default"},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"},showcase_id:{description:"Showcase id of the section",type:"string"}},required:["type","id"],additionalProperties:!1}},ca={$schema:In,$id:Ln,title:jn,description:xn,type:Nn,$defs:Pn},Dn={__proto__:null,$defs:Pn,$id:Ln,$schema:In,default:ca,description:xn,title:jn,type:Nn},kn="https://json-schema.org/draft/2020-12/schema",Fn="https://lightspeedhq.com/template-custom.schema.json",Hn="Custom Section",Mn="Custom section for a Custom Template",Gn="object",Bn={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"custom"},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{$ref:"showcase_overrides.schema.json"}},required:["type","id"],additionalProperties:!1}},la={$schema:kn,$id:Fn,title:Hn,description:Mn,type:Gn,$defs:Bn},qn={__proto__:null,$defs:Bn,$id:Fn,$schema:kn,default:la,description:Mn,title:Hn,type:Gn},Un="https://json-schema.org/draft/2020-12/schema",zn="https://lightspeedhq.com/template-custom-content.schema.json",Kn="Custom Section :: Content Configuration",Xn="Content tab configuration of a Custom Section for a Custom Template",Vn="object",Wn={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"INPUTBOX"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TEXTAREA"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"BUTTON"},title:{$ref:"common.schema.json#/$defs/label_type"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title","buttonType"],additionalProperties:!0},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"IMAGE"},static:{type:"boolean"},imageData:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{type:"object"},MOBILE_WEBP_HI_RES:{type:"object"},WEBP_LOW_RES:{type:"object"},WEBP_HI_2X_RES:{type:"object"},ORIGINAL:{type:"object"}},additionalProperties:!1,minProperties:1},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TOGGLE"},enabled:{type:"boolean"}},required:["type"],additionalProperties:!0},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"SELECTBOX"},value:{type:"string"}},required:["type"],additionalProperties:!0},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"LOGO"},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",$ref:"common.schema.json#/$defs/label_type"},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},menu:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"MENU"}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"DECK"},cards:{type:"array",items:{type:"object",properties:{settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1}},required:["settings"]}}},required:["type","cards"]},product_selector:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"PRODUCT_SELECTOR"},product:{type:"object",properties:{id:{type:"number"}}},products:{type:"object",properties:{productIds:{type:"array",items:{type:"number"}}}},categoryId:{type:"number"},maxProducts:{type:"number"}},required:["type"],additionalProperties:!1},category_selector:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"CATEGORY_SELECTOR"},categories:{type:"object",properties:{categoryIds:{type:"array",items:{type:"number"}}}},maxCategories:{type:"number"}},required:["type"],additionalProperties:!1}},pa={$schema:Un,$id:zn,title:Kn,description:Xn,type:Vn,$defs:Wn},Yn={__proto__:null,$defs:Wn,$id:zn,$schema:Un,default:pa,description:Xn,title:Kn,type:Vn},Zn="https://json-schema.org/draft/2020-12/schema",Qn="https://lightspeedhq.com/template-custom-design.schema.json",Jn="Custom Section :: Design Configuration",eo="Design tab configuration of a Custom Section for a Custom Template",to="object",no={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",const:"TEXT"},font:{description:"Default font for the text",type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",const:"BUTTON"},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the button",type:"boolean"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",const:"IMAGE"},static:{type:"boolean"},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",const:"TOGGLE"},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},info:{type:"object",properties:{type:{description:"Type of the info",type:"string",const:"INFO"},font:{description:"Default font for the info",type:"string"},size:{description:"Default size for the info",type:"integer",minimum:1},bold:{description:"Default boldness for the info",type:"boolean"},italic:{description:"Default italic style for the info",type:"boolean"},color:{description:"Default color for the info",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the info",type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",const:"SELECTBOX"},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",const:"LOGO"},font:{description:"Default font for the text logo",type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the logo",type:"boolean"},spacing:{description:"Default spacing size for the text logo",type:"integer",minimum:1,exclusiveMaximum:10},capitalization:{description:"Default capitalization style for the text logo",type:"string",enum:["none","all","small"]},frame:{description:"Default frame for the text logo",type:"object",properties:{visible:{description:"Default visibility for the frame on text logo",type:"boolean"},width:{description:"Default width size for the frame on text logo",type:"integer",minimum:1,exclusiveMaximum:50},color:{oneOf:[{description:"Default color for frame on logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for frame on logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},ua={$schema:Zn,$id:Qn,title:Jn,description:eo,type:to,$defs:no},oo={__proto__:null,$defs:no,$id:Qn,$schema:Zn,default:ua,description:eo,title:Jn,type:to},so="https://json-schema.org/draft/2020-12/schema",ro="https://lightspeedhq.com/section-content.schema.json",io="Custom Section - Content",ao="The content of a custom section",co="object",lo={"^.*$":{type:"object",properties:{type:{type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","INFO","DECK","MENU","NAVIGATION_MENU","LOGO","DIVIDER","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"#/$defs/Deck"}},{if:{properties:{type:{const:"MENU"}}},then:{$ref:"#/$defs/Menu"}},{if:{properties:{type:{const:"NAVIGATION_MENU"}}},then:{$ref:"#/$defs/NavigationMenu"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}},{if:{properties:{type:{const:"PRODUCT_SELECTOR"}}},then:{$ref:"#/$defs/ProductSelector"}},{if:{properties:{type:{const:"CATEGORY_SELECTOR"}}},then:{$ref:"#/$defs/CategorySelector"}}]}},po={Inputbox:{type:"object",properties:{type:{const:"INPUTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/InputboxDefaults"}},required:["type","label","placeholder"]},Textarea:{type:"object",properties:{type:{const:"TEXTAREA"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/TextareaDefaults"}},required:["type","label","placeholder"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ButtonDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},static:{type:"boolean"},defaults:{$ref:"#/$defs/ImageDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDefaults"}},required:["type","label","description"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label","placeholder","description","options"]},Menu:{type:"object",properties:{type:{const:"MENU"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},NavigationMenu:{type:"object",properties:{type:{const:"NAVIGATION_MENU"}},required:["type"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoEditorButton"},defaults:{$ref:"#/$defs/InfoDefaults"}},required:["type","label","description"]},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},InputboxDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},TextareaDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},ButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["title"]},ImageDefaults:{type:"object",properties:{imageData:{$ref:"section-commons.schema.json#/$defs/Image"}}},ToggleDefaults:{type:"object",properties:{enabled:{type:"boolean"}}},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}}},InfoDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoButtonDefaults"}}},SelectboxOption:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},value:{type:"string"}}},InfoEditorButton:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string"}}},InfoButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string",minLength:0}}},Deck:{type:"object",properties:{type:{const:"DECK"},cards:{description:"Cards of the content configuration element",type:"object",properties:{defaultCardContent:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/ButtonDefaults"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}}]}},minProperties:1}},required:["label","settings"]}},required:["defaultCardContent"]},label:{$ref:"../common.schema.json#/$defs/label_type"},addButtonLabel:{$ref:"../common.schema.json#/$defs/label_type"},maxCards:{type:"number"}},required:["cards","maxCards","label","addButtonLabel","type"]},ProductSelector:{type:"object",properties:{type:{const:"PRODUCT_SELECTOR"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ProductSelectorDefaults"}},required:["type","label"]},ProductSelectorDefaults:{type:"object",properties:{maxProducts:{type:"number"}}},CategorySelector:{type:"object",properties:{type:{const:"CATEGORY_SELECTOR"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/CategorySelectorDefaults"}},required:["type","label"]},CategorySelectorDefaults:{type:"object",properties:{maxCategories:{type:"number"}}}},uo=!1,fa={$schema:so,$id:ro,title:io,description:ao,type:co,patternProperties:lo,$defs:po,additionalProperties:uo},fo={__proto__:null,$defs:po,$id:ro,$schema:so,additionalProperties:uo,default:fa,description:ao,patternProperties:lo,title:io,type:co},ho="https://json-schema.org/draft/2020-12/schema",mo="https://lightspeedhq.com/section-layout.schema.json",yo="Section Layout Schema",go="Schema for validating section layout configurations",$o="array",Eo={type:"object",required:["layoutId","selectedContentSettings","selectedDesignSettings"],properties:{layoutId:{type:"string",description:"Unique identifier for the layout"},layoutIcon:{type:"string",description:"Icon identifier used in the layout selector",enum:["HEADER_LEFT","HEADER_CENTER_LOGO_BURGER","HEADER_CENTER_LOGO_COMPACT","HEADER_CENTER_LOGO_DETAILED","HEADER_LEFT_LOGO_BURGER","HEADER_LEFT_LOGO_COMPACT","HEADER_LEFT_LOGO_DETAILED","HEADER_LEFT_LOGO_SEARCH","HEADER_LEFT_LOGO_TEXT","TEXT_ONE_COLUMN","TEXT_TITLE_LEFT","TEXT_SUBTITLE_RIGHT","TEXT_TWO_COLUMNS","TEXT_CENTER","TEXT_DESCRIPTION_RIGHT","CTA_BANNER_LEFT","CTA_BANNER_RIGHT","CTA_BANNER_CENTER","CTA_BANNER_BOTTOM","CTA_PROMO_BAR_LEFT","CTA_PROMO_BAR_RIGHT","CTA_STORY_LEFT","CTA_STORY_RIGHT","CTA_FULLWIDTH_CENTER","CTA_FULLWIDTH_LEFT","COVER_FULLSCREEN_CENTER","COVER_FULLSCREEN_LEFT","COVER_FULLSCREEN_CENTER_LEFT","COVER_FULLSCREEN_RIGHT","COVER_FULLSCREEN_BOTTOM","COVER_FULLSCREEN_BOTTOM_RIGHT","COVER_FULLSCREEN_BOTTOM_LEFT","COVER_FULLSCREEN_TOP","COVER_SIDEBAR_RIGHT","COVER_SIDEBAR_LEFT","COVER_HALFSCREEN_LEFT","COVER_HALFSCREEN_CENTER","COVER_COLLAGE_BOTTOM","COVER_COLLAGE_LEFT","IMAGE_SUBTITLE_RIGHT","IMAGE_TITLE_LEFT","IMAGE_LEFT","IMAGE_RIGHT","IMAGE_CENTER","IMAGE_SIDE_TITLE","LOCATION_MAP_RIGHT","LOCATION_MAP_LEFT","LOCATION_IMAGE_RIGHT","LOCATION_IMAGE_LEFT","LOCATION_BACKGROUND_RIGHT","LOCATION_BACKGROUND_LEFT","LOCATION_FULL","LOCATION_SHORT","REVIEWS_MINIMAL","REVIEWS_CARDS","REVIEWS","REVIEWS_CLASSIC","REVIEWS_FULLSCREEN_BG","REVIEWS_FULLSCREEN_SIDEBAR_LEFT","REVIEWS_FULLSCREEN_SIDEBAR_RIGHT","REVIEWS_CARDS_PHOTO","REVIEWS_PHOTO_SPEECH_RIGHT","REVIEWS_PHOTO_SPEECH_LEFT","REVIEWS_SOCIAL_FEED","REVIEWS_ADAPTIVE","FEATURES_CLASSIC_CENTER","FEATURES_CLASSIC_LEFT","FEATURES_ACCORDION","FEATURES_MINIMAL","FEATURES_SMALL_ICONS","FEATURES_CAROUSEL","FEATURES_IMAGE_LEFT","FEATURES_IMAGE_RIGHT","ANNOUNCEMENT_CENTER","SLIDER_FULLSCREEN_CENTER","SLIDER_FULLSCREEN_LEFT"]},selectedContentSettings:{type:"array",description:"Array of selected content settings (field names only)",items:{type:"string"}},selectedDesignSettings:{type:"array",description:"Array of selected design settings with optional overrides",items:{$ref:"#/$defs/selectionItem"}}},additionalProperties:!1},bo={selectionItem:{type:"object",description:"Pick a design field by name; optionally override its defaults for this layout.",required:["fieldName"],properties:{fieldName:{type:"string"},type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]},defaults:{type:"object",description:"Design editor defaults; shape depends on the type property"}},allOf:[{if:{required:["type"],properties:{type:{const:"TEXT"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/TextDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"IMAGE"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ImageDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"BUTTON"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ButtonDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"BACKGROUND"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/BackgroundDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"TOGGLE"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ToggleDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"COLOR_PICKER"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ColorPickerDefaults"}}}},{if:{required:["type"],properties:{type:{const:"RATING"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/RatingDefaults"}}}},{if:{required:["type"],properties:{type:{const:"SELECTBOX"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/SelectboxDefaults"}}}},{if:{required:["type"],properties:{type:{const:"SOCIAL_PROFILES"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/SocialProfilesDefaults"}}}},{if:{required:["type"],properties:{type:{const:"LOGO"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/LogoDesignDefaults"}}}},{if:{required:["defaults"]},then:{required:["type"]}}],additionalProperties:!1}},da={$schema:ho,$id:mo,title:yo,description:go,type:$o,items:Eo,$defs:bo},_o={__proto__:null,$defs:bo,$id:mo,$schema:ho,default:da,description:go,items:Eo,title:yo,type:$o},So="https://json-schema.org/draft/2020-12/schema",To="https://lightspeedhq.com/sections/section-translation.schema.json",wo="Custom Section - Translations",Co="The translation of the section's labels",Ao="object",Ro={"^[a-z]{2}(_([a-z]{2}|[A-Z]{2}|[0-9]{3}))?$":{type:"object",patternProperties:{"^\\$.*$":{type:"string"}},additionalProperties:!1}},Oo=!1,ha={$schema:So,$id:To,title:wo,description:Co,type:Ao,patternProperties:Ro,additionalProperties:Oo},wt={__proto__:null,$id:To,$schema:So,additionalProperties:Oo,default:ha,description:Co,patternProperties:Ro,title:wo,type:Ao},vo="https://json-schema.org/draft/2020-12/schema",Io="https://lightspeedhq.com/section-design.schema.json",Lo="Custom Section - Design",jo="The design of a custom section",xo="object",No={"^.*$":{type:"object",properties:{type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"#/$defs/Text"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"#/$defs/Background"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"COLOR_PICKER"}}},then:{$ref:"#/$defs/Color"}},{if:{properties:{type:{const:"RATING"}}},then:{$ref:"#/$defs/Rating"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"SOCIAL_PROFILES"}}},then:{$ref:"#/$defs/SocialProfile"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}],additionalProperties:!0}},Po={Text:{type:"object",properties:{type:{const:"TEXT"},label:{$ref:"../common.schema.json#/$defs/label_type"},sizes:{type:"array",items:{type:"integer"}},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/TextDesignDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},static:{type:"boolean"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ImageDesignDefaults"}},required:["type","label"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAutoColor:{type:["boolean","null"]},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ButtonDesignDefaults"}},required:["type","label"]},Background:{type:"object",properties:{type:{const:"BACKGROUND"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/BackgroundDesignDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDesignDefaults"}},required:["type","label"]},Color:{type:"object",properties:{type:{const:"COLOR_PICKER"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ColorPickerDefaults"}},required:["type","label"]},Rating:{type:"object",properties:{type:{const:"RATING"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/RatingDefaults"}},required:["type","label"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label"]},SocialProfile:{type:"object",properties:{type:{const:"SOCIAL_PROFILES"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SocialProfilesDefaults"}},required:["type","label"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},sizes:{type:"array",items:{type:"integer"}},defaults:{$ref:"#/$defs/LogoDesignDefaults"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},text:{type:"string"},button:{type:"object",properties:{title:{type:"string"},link:{type:"string"}},additionalProperties:!0}},required:["type","text"],additionalProperties:!0},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},TextDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},ImageDesignDefaults:{type:"object",properties:{overlay:{type:"string"},visible:{type:"boolean"}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}},required:[]},ButtonDesignDefaults:{type:"object",properties:{appearance:{type:"string",enum:["SOLID","OUTLINE","TEXT"]},font:{type:"string"},size:{type:"string",enum:["SMALL","MEDIUM","LARGE"]},style:{type:"string",enum:["round-corner","rectangle","pill"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},BackgroundDesignDefaults:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},ToggleDesignDefaults:{type:"object",properties:{enabled:{type:"boolean"}},required:[]},ColorPickerDefaults:{type:"object",properties:{appearance:{$ref:"section-commons.schema.json#/$defs/Color"}},required:[]},RatingDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},style:{type:"string"}},required:[]},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}},required:[]},SocialProfilesDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},appearance:{type:"string"}},required:[]},LogoDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},SelectboxOption:{type:"object",properties:{value:{type:"string"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:[]}},ma={$schema:vo,$id:Io,title:Lo,description:jo,type:xo,patternProperties:No,$defs:Po},Do={__proto__:null,$defs:Po,$id:Io,$schema:vo,default:ma,description:jo,patternProperties:No,title:Lo,type:xo},ko="https://json-schema.org/draft/2020-12/schema",Fo="https://lightspeedhq.com/section-commons.schema.json",Ho="Custom Section - Content",Mo="The content of a custom section",Go="object",Bo={Image:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},MOBILE_WEBP_HI_RES:{$ref:"#/$defs/ImageInfo"},WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},WEBP_HI_2X_RES:{$ref:"#/$defs/ImageInfo"},ORIGINAL:{$ref:"#/$defs/ImageInfo"}},additionalProperties:!1,minProperties:1},borderInfo:{$ref:"#/$defs/BorderInfo"}},additionalProperties:!1,required:["set"]},ImageInfo:{type:"object",properties:{url:{type:"string"},width:{type:"integer",minimum:0},height:{type:"integer",minimum:0}}},BorderInfo:{type:"object",properties:{homogeneity:{type:"boolean"},color:{$ref:"#/$defs/RGBA"}}},RGBA:{type:"object",properties:{r:{type:"integer",minimum:0,maximum:255},g:{type:"integer",minimum:0,maximum:255},b:{type:"integer",minimum:0,maximum:255},a:{type:"number",format:"double",minimum:0,maximum:1}},required:["r","g","b","a"]},HSL:{type:"object",properties:{h:{type:"number",format:"double"},s:{type:"number",format:"double"},l:{type:"number",format:"double"},a:{type:"number",format:"double"}},required:["h","s","l","a"]},Overlay:{type:"object",properties:{type:{type:"string",enum:["solid","gradient","none"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Solid:{type:"object",properties:{color:{$ref:"#/$defs/Color"}}},Gradient:{type:"object",properties:{fromColor:{$ref:"#/$defs/Color"},toColor:{$ref:"#/$defs/Color"}}},Background:{type:"object",properties:{type:{type:"string",enum:["solid","gradient"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Color:{type:"object",properties:{raw:{type:"string"},hex:{type:"string"},auto:{type:"boolean"},rgba:{$ref:"#/$defs/RGBA"},hsl:{$ref:"#/$defs/HSL"}}}},qo=!1,ya={$schema:ko,$id:Fo,title:Ho,description:Mo,type:Go,$defs:Bo,additionalProperties:qo},Uo={__proto__:null,$defs:Bo,$id:Fo,$schema:ko,additionalProperties:qo,default:ya,description:Mo,title:Ho,type:Go},zo="https://json-schema.org/draft/2020-12/schema",Ko="https://lightspeedhq.com/section-showcase.schema.json",Xo="Custom Section - Showcase settings",Vo="The setting of a showcase",Wo="object",Yo=["showcaseId","previewImage"],Zo=[{properties:{showcaseId:{description:"Showcase id of the section",type:"string"},previewImage:{$ref:"section-commons.schema.json#/$defs/Image"}}},{$ref:"../showcase_overrides.schema.json"}],ga={$schema:zo,$id:Ko,title:Xo,description:Vo,type:Wo,required:Yo,allOf:Zo},Qo={__proto__:null,$id:Ko,$schema:zo,allOf:Zo,default:ga,description:Vo,required:Yo,title:Xo,type:Wo},Jo="https://json-schema.org/draft/2020-12/schema",es="https://lightspeedhq.com/template.schema.json",ts="Custom Template",ns="A custom template enclosing the necessary custom and default blocks",os="object",ss={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)?(company\\.site|ecwid\\.qa)($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1},categories:{description:"List of template categories for Template Market filtering",type:"array",items:{type:"string",enum:["apparel_footwear","vape_smoke","home_garden","sport_outdoor","jewelry_accessories","pet_animals","bikes","health_beauty","gift_shop","electronics","other"]},uniqueItems:!0}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},rs=["metadata","sections"],$a={$schema:Jo,$id:es,title:ts,description:ns,type:os,properties:ss,required:rs},is={__proto__:null,$id:es,$schema:Jo,default:$a,description:ns,properties:ss,required:rs,title:ts,type:os},as="https://json-schema.org/draft/2020-12/schema",cs="https://lightspeedhq.com/showcase_overrides.schema.json",ls="Showcase overrides",ps="Overrides for the showcase",us="object",fs={content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","LOGO","DECK","MENU","NAVIGATION_MENU","INFO","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-content.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"template-custom-content.schema.json#/$defs/deck"}},{if:{properties:{type:{const:"PRODUCT_SELECTOR"}}},then:{$ref:"template-custom-content.schema.json#/$defs/product_selector"}},{if:{properties:{type:{const:"CATEGORY_SELECTOR"}}},then:{$ref:"template-custom-content.schema.json#/$defs/category_selector"}}]}}},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/info"}}]}}},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",$ref:"common.schema.json#/$defs/label_type"}},Ea={$schema:as,$id:cs,title:ls,description:ps,type:us,properties:fs},ds={__proto__:null,$id:cs,$schema:as,default:Ea,description:ps,properties:fs,title:ls,type:us},hs="https://json-schema.org/draft/2020-12/schema",ms="https://lightspeedhq.com/common.schema.json",ys="Common Type Definitions",gs="Common type definitions, used throughout other schemas",$s="object",Es={label_type:{type:"string",pattern:"^\\$.+"}},ba={$schema:hs,$id:ms,title:ys,description:gs,type:$s,$defs:Es},bs={__proto__:null,$defs:Es,$id:ms,$schema:hs,default:ba,description:gs,title:ys,type:$s};function De(e){return re(`${ze}/${e}`)?ue.HEADER:re(`${Ke}/${e}`)?ue.FOOTER:ue.SECTION}function Ct(e){const t=De(e);return ce[t].dist}const _a={menu:{type:"NAVIGATION_MENU"},logo:{type:"LOGO"}},Sa={logo:{type:"LOGO",colors:["#FFFFFF66","#0000004D","#00000099","#64C7FF66","#F9947266","#C794CD66","#FFD17466"],sizes:[18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60],defaults:{font:"global.fontFamily.body",size:40,bold:!0,italic:!1,color:"#313131",visible:!0,spacing:2,capitalization:"all",frame:{visible:!0,width:3,color:"#313131"}}}};function _s(e){switch(e){case ue.HEADER:return _a;default:return{}}}function Ss(e){switch(e){case ue.HEADER:return Sa;default:return{}}}function Ta({validationType:e,sectionType:t}){switch(e){case Me.CONTENT:return _s(t);case Me.DESIGN:return Ss(t);default:return{}}}function wa({sectionSettings:e,mandatorySettings:t}){const n=[];return Object.entries(e).filter(([o])=>t[o]!==void 0).forEach(([o,s])=>{const i=t[o];s.type!==i.type&&n.push({instancePath:o,keyword:"type-mismatch",message:`Editor type "${s.type}" for reserved key "${o}" does not match the required type "${i.type}".`})}),n}function Ca({type:e,mandatorySettings:t}){return Object.keys(t).find(n=>t[n].type===e)}function Aa({sectionSettings:e,mandatorySettings:t}){const n=[];return Object.entries(e).forEach(([o,s])=>{const i=Ca({type:s.type,mandatorySettings:t});i&&o!==i&&n.push({instancePath:o,keyword:"key-mismatch",message:`Editor key "${o}" for overriden content type "${s.type}" does not match the required key name "${i}".`})}),n}function Ra({type:e,mandatorySettings:t}){return Object.keys(t).findLast(n=>t[n].type===e)}function Oa({sectionSettings:e,mandatorySettings:t}){const n=[],o=Object.values(t).map(({type:i})=>i),s=Object.values(e).map(({type:i})=>i);return new Set(s.filter(i=>o.includes(i))).forEach(i=>{if(s.filter(r=>r===i).length>1){const r=Ra({type:i,mandatorySettings:t});n.push({instancePath:r,keyword:"duplicate-type",message:`Editor type "${i}" can only be used once.`})}}),n}function va(e,t){const{sectionSettings:n,sectionType:o}=t,s=Ta({validationType:e,sectionType:o});return s===void 0||vn(s)?[]:[...wa({sectionSettings:n,mandatorySettings:s}),...Aa({sectionSettings:n,mandatorySettings:s}),...Oa({sectionSettings:n,mandatorySettings:s})]}function Ia(e,t){const n=[];if(!e.cards?.defaultCardContent)return n;const o=e.cards.defaultCardContent.settings;for(const[s,i]of Object.entries(o)){const r=i;r?.type==="IMAGE"&&n.push({key:s,editor:r,path:`${t}/cards/defaultCardContent/settings/${s}`})}return n}function La(e,t){const n=e[t];if(n?.type==="IMAGE")return n}function Ts(e,t,n,o,s){const i=La(n,e);if(i?.type!=="IMAGE")return;const r=t.static,a=i.static;(r??!1)!==(a??!1)&&s.push({instancePath:o,message:`Both "${e} content and design editor need to have same value for attribute static`,keyword:"image-editor-mismatch"})}function ja(e,t,n,o){for(const[s,i]of Object.entries(e)){const r=i,a=`/${s}`;if(r.type==="IMAGE")Ts(s,r,t,a,o);else if(r.type==="DECK"){const c=Ia(r,a);for(const{key:l,editor:f,path:E}of c)Ts(l,f,t,E,o)}}}async function xa(e,t,n){if(!e.sectionName||e.validationType!==Me.CONTENT)return[];const o=W.resolve(`${n}/${e.sectionName}/js/settings/design`),s=await xe(o,!1),i=[];return ja(t,s,"",i),i}const Ge=[Uo,Do,fo,_o,Qo,is,Dn,qn,Yn,oo,ds,bs];function ke(e,t){const n=new $i({allErrors:!0,schemas:e});return Ei(n),n.getSchema(t.$id)||n.compile(t)}function Na(){return ke(Ge,is)}function ut(e){return e.map(t=>({instancePath:t.instancePath,message:t.message??"",keyword:t.keyword}))}const Pa=e=>(()=>{const t=Ct(e.name),n=t.split("/").pop()?.toLowerCase();return[{source:`./${n}/${e.name}/settings/content.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/content`),ajv:ke(Ge,fo),validationType:Me.CONTENT,sectionName:e.name,type:e.type},{source:`./${n}/${e.name}/settings/design.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/design`),ajv:ke(Ge,Do),validationType:Me.DESIGN,sectionName:e.name,type:e.type},...V.existsSync(`./${n}/${e.name}/settings/layout.ts`)?[{source:`./${n}/${e.name}/settings/layout.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/layout`),ajv:ke(Ge,_o),sectionName:e.name,type:e.type}]:[],{source:`./${n}/${e.name}/settings/translations.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/translations`),ajv:ke(Ge,wt),type:e.type},...e.showcaseEntryPoints.map(o=>({source:`./${n}/${e.name}/showcases/${He(o).name}.ts`,dist:W.resolve(`${t}/${e.name}/js/showcases/${He(o).name}`),ajv:ke(Ge,o.indexOf("translations")===-1?Qo:wt),type:e.type,sectionName:e.name}))]})();function Da(e){const t=s=>{const i=(s??"").split("/").filter(r=>r.length>0);return i.length===0?"$":`$${i.map(r=>`.${r}`).join("")}`};let n=0,o=0;Object.keys(e).forEach(s=>{const i=e[s];n=Math.max(n,Math.max(...i.map(r=>t(r.instancePath).length))),o=Math.max(o,Math.max(...i.map(r=>r.message.length)))}),Object.keys(e).forEach(s=>{const i=e[s].filter((r,a,c)=>a===c.findIndex(l=>`${r.instancePath}${r.message}${r.keyword}`==`${l.instancePath}${l.message}${l.keyword}`));I.error(s),i.filter(r=>r.keyword!=="if").forEach(r=>{I.error(`${t(r.instancePath).padEnd(n," ")} | ${r.message.padEnd(o," ")} | ${r.keyword||"-"}`)})})}function ka(e,t){if(e.validationType===void 0||e.sectionName===void 0)return[];const{sectionName:n,validationType:o}=e,s=De(n);return[...va(o,{sectionSettings:t,sectionType:s})]}function ws(e,t){return Si({path:"$..set..url",json:t,resultType:"value"}).map(n=>{if(new RegExp(/^https?:\/\//).test(n))return null;const o=`${e}/assets/${n}`;return re(o)?null:{message:`Image ${n} is missing from assets folder`,keyword:"missing-asset"}}).filter(n=>n!==null)}function Fa(e,t,n,o){const s=[],i=t.cards?.defaultCardContent?.settings;if(!i)return s;const r=new Set(Object.keys(i));return e.cards.forEach((a,c)=>{const l=a.settings;l&&Object.keys(l).forEach(f=>{r.has(f)||s.push({instancePath:`showcases/${o}/content/${n}/cards/${c}/settings/${f}`,message:`Setting '${f}' is not defined in content.ts defaultCardContent.settings`,keyword:"invalid-deck-card-setting"})})}),s}async function Ha(e,t){const n=[];if(!e.source||!e.source.includes("/sections/")||e.validationType!==Me.CONTENT||!e.sectionName)return n;const o=Ct(e.sectionName),s=W.resolve(`${o}/${e.sectionName}/js/showcases`);if(!re(s))return n;const i=V.readdirSync(s).filter(a=>a.endsWith(".mjs")&&a!=="translations.mjs").map(async a=>{const c=W.resolve(`${s}/${a.replace(".mjs","")}`),l=await xe(c,!1);return{showcaseFile:a,showcaseData:l}}),r=await Promise.all(i);for(const{showcaseFile:a,showcaseData:c}of r){if(!c.content)continue;const l=c.content;Object.keys(l).forEach(f=>{const E=l[f],u=t[f];if(!u){n.push({instancePath:`showcases/${a.replace(".mjs","")}/content/${f}`,message:`Element '${f}' is not defined in content.ts`,keyword:"invalid-showcase-element"});return}if(E.type!==u.type){n.push({instancePath:`showcases/${a.replace(".mjs","")}/content/${f}`,message:`Element '${f}' type mismatch: showcase has type '${E.type}' but content.ts has type '${u.type}'`,keyword:"type-mismatch"});return}E.type==="DECK"&&u.type==="DECK"&&n.push(...Fa(E,u,f,a.replace(".mjs","")))})}return n}async function Ma(e){const t=await xe(e.dist,!1),n={},o=[],s=Ct(e.sectionName??""),i=s.split("/").pop()?.toLowerCase();if(e.ajv(t)||o.push(...ut(e.ajv.errors??[])),o.push(...ka(e,t),...ws(`${i}/${e.sectionName}`,t),...await xa(e,t,s)),e.source&&e.source.includes("/sections/")&&e.validationType===Me.CONTENT){const r=await Ha(e,t);o.push(...r)}return o.length>0&&(n[e.source]=o),n}async function Ga(e){const t=_i(bi.gunzip),n=await V.promises.readFile(e);return(await t(n)).length}async function Cs(e,t){const n=We[e],o=W.resolve(`${n.toPath(t)}${n.fileName}`),s=await Ga(o);if(s>Rn)throw I.error(`Size of individual server file must not exceed threshold [${Qe(Rn)}]!`),I.error(`${`File: ${o}`.padEnd(o.length+10)}| ${Qe(s)}`),new Error("Invalid server file size")}function As(e){const t=e.reduce((n,o)=>{const s=ni(o);return s.size>An&&(n[o]=Qe(s.size)),n},{});if(Object.keys(t).length!==0){const n=Math.max(...Object.keys(t).map(o=>o.length));I.error(`Size of individual assets must not exceed threshold [${Qe(An)}]!`);for(const o in t)I.error(`${`File: ${o}`.padEnd(n+10)}| ${t[o]}`);throw new Error("Invalid asset file size")}}function Ba(e,t,n,o){const s={};return e(t)&&o===void 0?pn(`${n}${je}.mjs`,`${n}.mjs`,()=>{}):(un(`${n}${je}.mjs`,()=>{}),s[W.resolve(`./templates/${He(n).name}.ts`)]=[...ut(e.errors??[]),...o??[]]),s}async function qa(){const e={},t="dist/shared/translation",n=W.resolve(process.cwd(),`${t}.mjs`);if(!re(n))return e;try{const o=await xe(t,!1),s=ke(Ge,wt);s(o)||(e[t]=ut(s.errors??[]))}catch(o){e[t]=[{instancePath:"shared/translation.ts",message:`Failed to load translation file: ${o.message}`,keyword:"import"}]}return e}const Rs={"process.env":{NODE_ENV:"production"}},Ua=[...$n,...$n.map(e=>`node:${e}`)],za=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],Os=e=>({pluginType:Ee.Server,define:Rs,ssr:!0,ssrOptions:{noExternal:!0},entryFileNames:"server.js",externalOption:[...Ua,...za],inlineDynamicImports:!0,...e,outDir:e.outDir}),vs=e=>({pluginType:Ee.Client,define:Rs,ssr:!1,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",chunkFileNames:"chunks/[name].js",inlineDynamicImports:!1,...e,outDir:e.outDir}),tt=e=>({pluginType:Ee.Misc,ssr:!1,...e,entryFileNames:e.entryFileNames,outDir:e.outDir}),Ka=e=>({pluginType:Ee.Layout,ssr:!1,entryFileNames:"index.mjs",...e,outDir:e.outDir}),At=e=>({pluginType:Ee.Asset,ssr:!1,assetFileNames:"[name].[ext]",...e,outDir:e.outDir}),Xa=()=>Ti({ext:".gz",algorithm:"gzip"}),Va="/* EXTERNAL_IMPORTS_START */",Wa="/* EXTERNAL_IMPORTS_END */",Ya=()=>({name:"external-imports-wrapper-plugin",enforce:"post",apply:"build",generateBundle(e,t){for(const n of Object.keys(t)){const o=t[n];if(o.type==="chunk"){const s=/import.*\?commonjs-external["'];/g,i=o.code.match(s);if(i!==null){const r=i.join(""),a=Va+r+Wa,c=o.code.replace(s,"");o.code=a+c}}}}}),Za=()=>({name:"disable-json-plugin",enforce:"pre",apply:"build",configResolved(e){const t=e.plugins?.findIndex(n=>n?.name==="vite:json");t!==-1&&(e.plugins[t]={name:"vite:json",load:()=>null,transform:()=>null})}}),Qa=()=>{const e=process.env.npm_lifecycle_event;return Ai({typescript:!0,vueTsc:!1,eslint:e==="test"?!1:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},Ae={VUE:wi(),TS_CONFIG_PATHS:Ci(),CHECKER:Qa()};class $t{constructor(t){this.bits=t instanceof $t?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}}class it{constructor(t,n,o){this.start=t,this.end=n,this.original=o,this.intro="",this.outro="",this.content=o,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){const t=new it(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,o){return this.content=t,o||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){const n=t-this.start,o=this.original.slice(0,n),s=this.original.slice(n);this.original=o;const i=new it(t,this.end,s);return i.outro=this.outro,this.outro="",this.end=t,this.edited?(i.edit("",!1),this.content=""):this.content=o,i.next=this.next,i.next&&(i.next.previous=i),i.previous=this,this.next=i,i}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;const n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;const n=this.content.replace(t,"");if(n.length){if(n!==this.content){const o=this.split(this.end-n.length);this.edited&&o.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}}function Ja(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}const ec=Ja();class tc{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=Ri(t.mappings),typeof t.x_google_ignoreList<"u"&&(this.x_google_ignoreList=t.x_google_ignoreList)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+ec(this.toString())}}function nc(e){const t=e.split(`
|
|
1
|
+
import*as ct from"fs";import V,{existsSync as re,statSync as ni,rename as pn,unlink as un,writeFileSync as fn,readFileSync as oi,promises as _t,createReadStream as si}from"fs";import*as Oe from"path";import W,{resolve as U,parse as He,dirname as dn,relative as ri,basename as ii,sep as hn}from"path";import ai from"cac";import{red as ci,yellow as li,green as Le}from"kolorist";import St from"prompts";import pi from"adm-zip";import{glob as z,globSync as mn}from"glob";import{normalizePath as ui,defineConfig as yn,build as qe,createServer as fi}from"vite";import{SectionTypeEnum as ue,ValidationTypeEnum as Me,PluginTypeEnum as Ee,ConfigTypeEnum as Y,BackgroundStyleEnum as Tt,ButtonAppearanceEnum as di,ButtonSizeEnum as hi,ButtonShapeEnum as mi,OverlayTypeEnum as lt,DesignEditorType as Pe,TemplatePageEnum as be,ReservedTemplatePageNameEnum as yi}from"@lightspeed/crane-api";import{pathToFileURL as gn,URL as gi}from"url";import $i from"ajv/dist/2020.js";import Ei from"ajv-formats";import bi from"node:zlib";import{promisify as _i}from"node:util";import{JSONPath as Si}from"jsonpath-plus";import{builtinModules as $n}from"module";import{viteExternalsPlugin as En}from"vite-plugin-externals";import Ti from"vite-plugin-compression";import wi from"@vitejs/plugin-vue";import Ci from"vite-tsconfig-paths";import Ai from"vite-plugin-checker";import{encode as Ri}from"@jridgewell/sourcemap-codec";import*as ie from"process";import Oi from"tinycolor2";import se from"node:fs";import ye from"node:path";import ae from"node:process";import bn from"util";import{fileURLToPath as vi}from"node:url";import{readFile as _n}from"fs/promises";import Ii,{AxiosError as Sn}from"axios";import{ConcurrencyManager as Li}from"axios-concurrency";import{inc as ji}from"semver";import xi from"cli-progress";const Ni="2.0.4",ce={[ue.SECTION]:{source:"sections",dist:"dist/sections"},[ue.HEADER]:{source:"headers",dist:"dist/headers"},[ue.FOOTER]:{source:"footers",dist:"dist/footers"}};var K=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.ClientChunks=2]="ClientChunks",e[e.ClientAsset=3]="ClientAsset",e[e.Asset=4]="Asset",e[e.TemplateAsset=5]="TemplateAsset",e[e.Dependency=6]="Dependency",e[e.SourceCode=7]="SourceCode",e[e.LayoutClient=8]="LayoutClient",e[e.LayoutAsset=9]="LayoutAsset",e[e.SlotServer=10]="SlotServer",e[e.SlotClient=11]="SlotClient",e[e.SlotClientChunks=12]="SlotClientChunks",e[e.SlotClientAsset=13]="SlotClientAsset",e))(K||{});const Pi="https://blockbuster.ecwid.com",Di="/api/v1/custom-apps/resources/sections/upload",ki="/api/v1/custom-apps/resources/templates/upload",Fi="/api/v1/custom-apps/manifests/sections",Hi="/api/v1/custom-apps/manifests/templates",Mi=5,Gi=3,Bi=[K.Server,K.Client,K.ClientChunks,K.ClientAsset,K.Asset],qi=[K.LayoutClient,K.LayoutAsset],Ui=[K.SlotServer,K.SlotClient,K.SlotClientChunks,K.SlotClientAsset],zi=[K.Dependency,K.TemplateAsset,K.SourceCode],Ue={DEFAULT:"Error while deploying:",ASSET_FILES_UPLOAD:"Error while uploading asset files:",MANIFEST_DEPLOYMENT:"Error while deploying manifest file:",DEPRECATED_VERSION_DEPLOYMENT:"You are using a non-supported version of crane. Please update to the latest crane version to continue.",INCORRECT_DISTRIBUTION_FOLDER:e=>`Distribution folder [${e}] is not found or has incorrect structure, please execute the build command first.`},Tn={catalog:"products",category:"category",product:"product"},Ki=e=>Tn[e],wn=e=>e in Tn;function Qe(e,t=2){if(!+e)return"0 Bytes";const n=1024,o=t<0?0:t,s=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**i).toFixed(o))} ${s[i]}`}const I={error:e=>console.log(ci(e)),warn:e=>console.log(li(e)),info:e=>console.log(Le(e))},je="_temp",Xi="dist",le="dist/sections",ze="dist/headers",Ke="dist/footers",Ce="dist/templates",Xe="layouts",Cn="preview",_e=`dist/${Xe}`,Vi=[le,ze,Ke,Ce,_e],An=2*1024*1024,Rn=500*1024;function pt(e){return!!e}function On(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}const Wi="Resource name can only contain alphanumeric characters, dashes, and underscores";function Yi(e){if(typeof e=="string"||typeof e=="number"){const t=/^[a-zA-Z0-9_-]+$/.test(e.toString());if(t)return{isValid:t,errorMessage:null}}return{isValid:!1,errorMessage:Wi}}function Zi(e){return e===!0?!0:typeof e=="string"&&e.trim().length===0}async function xe(e,t){try{const n=U(process.cwd(),t?`${e}${je}.mjs`:`${e}.mjs`),o=`?timestamp=${Date.now()}`;return(await import(gn(n).href+o)).default}catch(n){const o=`File [${e}${t?je:""}.mjs] is either invalid or undefined`,s=n instanceof Error?n.message:o;throw new Error(s)}}function vn(e){return Object.keys(e).length===0}function Qi(e){return W.parse(e).name}function Ji(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ea(e){return e.replace(/\\/g,"/")}function ta(e){return e.replace(/^dist\/layouts\//,"").replace(/^layouts\//,"")}function Je(e){return ta(ea(e))}function na(e){const t=Je(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[n,o]=t;if(!wn(n))throw new Error(`Layout cannot be placed in a non-storefront section: ${n}`);const s=Ki(n);return{id:o,sectionId:n,pageId:s}}const oa={catalog:"products",category:"category",product:"product"};async function sa(e){const t=Je(e).split("/");if(t.length<2)throw new Error(`Invalid layout path: ${e}. Expected format: [dist/]layouts/{sectionId}/{layoutId}/[...path]`);const[n,o]=t;return{id:o,sectionId:n}}async function ra(e){return Promise.all(e.map(async t=>{const n=t.sectionId,o=oa[n];return{id:t.id,sectionId:n,pageId:o}}))}async function ia(){const e=`${_e}/{product,catalog,category}/*`,t=await z(e,{ignore:["node_modules/**"]});return Promise.all(t.map(sa))}async function aa(){const e=await ia();return await ra(e)}function Ve(e,t,...n){if(!e||!t)throw new Error(`Cannot build layout path. Invalid parameters - sectionId: "${e}", layoutId: "${t}"`);return`${_e}/${e}/${t}/${n.join("/")}`}const et=(e=ue.SECTION)=>ce[e].dist,We={[K.Server]:{type:"server_js_compressed",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/server/`},[K.Client]:{type:"client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/`},[K.ClientChunks]:{type:"client_js_chunks",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/chunks/`,fileName:"*"},[K.ClientAsset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/js/main/client/assets/`},[K.Asset]:{type:"assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,sectionType:t})=>`${et(t)}/${e}/assets/`},[K.TemplateAsset]:{type:"template_assets",fileName:"*",isSingleton:!1,toPath:()=>`${Ce}/assets/`},[K.Dependency]:{type:"dependencies",fileName:"package.json",isSingleton:!0,toPath:()=>{}},[K.SourceCode]:{type:"source_code",fileName:"source-code.zip",isSingleton:!0,toPath:()=>{}},[K.LayoutClient]:{type:"layout_client_js",fileName:"index.mjs",isSingleton:!0,toPath:({sectionId:e,layoutId:t})=>Ve(e,t,"")},[K.LayoutAsset]:{type:"layout_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t})=>Ve(e,t,"assets/")},[K.SlotServer]:{type:"slot_server_js",fileName:"server.js.gz",isSingleton:!0,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/server/")},[K.SlotClient]:{type:"slot_client_js",fileName:"client.js",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/")},[K.SlotClientChunks]:{type:"slot_client_js_chunks",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/chunks/")},[K.SlotClientAsset]:{type:"slot_client_assets",fileName:"*",isSingleton:!1,toPath:({sectionId:e,layoutId:t,slotId:n})=>Ve(e,t,"slots",n,"js/main/client/assets/")}},In="https://json-schema.org/draft/2020-12/schema",Ln="https://lightspeedhq.com/template-default.schema.json",jn="Default Section",xn="Default section for a Custom Template",Nn="object",Pn={"default-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"default"},id:{description:"Identification of the section",type:"string",pattern:"^((header|cover|announcement_bar|slider|special_offer|customer_review|company_info|shipping_payment|location|store|footer)(_\\d{3})?)$"},showcase_id:{description:"Showcase id of the section",type:"string"}},required:["type","id"],additionalProperties:!1}},ca={$schema:In,$id:Ln,title:jn,description:xn,type:Nn,$defs:Pn},Dn={__proto__:null,$defs:Pn,$id:Ln,$schema:In,default:ca,description:xn,title:jn,type:Nn},kn="https://json-schema.org/draft/2020-12/schema",Fn="https://lightspeedhq.com/template-custom.schema.json",Hn="Custom Section",Mn="Custom section for a Custom Template",Gn="object",Bn={"custom-section":{type:"object",properties:{type:{description:"Type of the section",type:"string",const:"custom"},id:{description:"Identification of the section",type:"string"},showcase_id:{description:"Showcase id of the section",type:"string"},showcase_overrides:{$ref:"showcase_overrides.schema.json"}},required:["type","id"],additionalProperties:!1}},la={$schema:kn,$id:Fn,title:Hn,description:Mn,type:Gn,$defs:Bn},qn={__proto__:null,$defs:Bn,$id:Fn,$schema:kn,default:la,description:Mn,title:Hn,type:Gn},Un="https://json-schema.org/draft/2020-12/schema",zn="https://lightspeedhq.com/template-custom-content.schema.json",Kn="Custom Section :: Content Configuration",Xn="Content tab configuration of a Custom Section for a Custom Template",Vn="object",Wn={input_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"INPUTBOX"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},text_area:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TEXTAREA"},text:{$ref:"common.schema.json#/$defs/label_type"}},required:["type","text"],additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"BUTTON"},title:{$ref:"common.schema.json#/$defs/label_type"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["type","title","buttonType"],additionalProperties:!0},image:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"IMAGE"},static:{type:"boolean"},imageData:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{type:"object"},MOBILE_WEBP_HI_RES:{type:"object"},WEBP_LOW_RES:{type:"object"},WEBP_HI_2X_RES:{type:"object"},ORIGINAL:{type:"object"}},additionalProperties:!1,minProperties:1},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},toggle:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"TOGGLE"},enabled:{type:"boolean"}},required:["type"],additionalProperties:!0},select_box:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"SELECTBOX"},value:{type:"string"}},required:["type"],additionalProperties:!0},logo:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"LOGO"},logoType:{description:"Type of the logo content",type:"string",enum:["TEXT","IMAGE"]},text:{description:"Logo content text",$ref:"common.schema.json#/$defs/label_type"},imageData:{type:"object",properties:{set:{type:"object"},borderInfo:{type:"object"},bucket:{type:"string"}},required:["set"]}},required:["type"],additionalProperties:!1},menu:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"MENU"}},required:["type"],additionalProperties:!1},deck:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"DECK"},cards:{type:"array",items:{type:"object",properties:{settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}}]}},minProperties:1}},required:["settings"]}}},required:["type","cards"]},product_selector:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"PRODUCT_SELECTOR"},product:{type:"object",properties:{id:{type:"number"}}},products:{type:"object",properties:{productIds:{type:"array",items:{type:"number"}}}},categoryId:{type:"number"},maxProducts:{type:"number"}},required:["type"],additionalProperties:!1},category_selector:{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",const:"CATEGORY_SELECTOR"},categories:{type:"object",properties:{categoryIds:{type:"array",items:{type:"number"}}}},maxCategories:{type:"number"}},required:["type"],additionalProperties:!1}},pa={$schema:Un,$id:zn,title:Kn,description:Xn,type:Vn,$defs:Wn},Yn={__proto__:null,$defs:Wn,$id:zn,$schema:Un,default:pa,description:Xn,title:Kn,type:Vn},Zn="https://json-schema.org/draft/2020-12/schema",Qn="https://lightspeedhq.com/template-custom-design.schema.json",Jn="Custom Section :: Design Configuration",eo="Design tab configuration of a Custom Section for a Custom Template",to="object",no={text:{type:"object",properties:{type:{description:"Type of the text",type:"string",const:"TEXT"},font:{description:"Default font for the text",type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text",type:"boolean"},italic:{description:"Default italic style for the text",type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the text",type:"boolean"}},additionalProperties:!1},button:{type:"object",properties:{type:{description:"Type of the button",type:"string",const:"BUTTON"},font:{description:"Default font for the button",type:"string"},size:{description:"Default size for the button",type:"string",enum:["SMALL","MEDIUM","LARGE"]},appearance:{description:"Default appearance for the button",type:"string",enum:["SOLID","OUTLINE","TEXT"]},shape:{description:"Default shape for the button",type:"string",enum:["ROUND_CORNER","RECTANGLE","PILL"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the button",type:"boolean"}},additionalProperties:!1},image:{type:"object",properties:{type:{description:"Type of the image",type:"string",const:"IMAGE"},static:{type:"boolean"},overlay:{description:"Default overlay for the image",type:"string",enum:["COLOR","GRADIENT","NONE"]}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default color for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},toggle:{type:"object",properties:{type:{description:"Type of the toggle",type:"string",const:"TOGGLE"},enabled:{description:"Default enabled status for the toggle",type:"boolean"}},additionalProperties:!1},info:{type:"object",properties:{type:{description:"Type of the info",type:"string",const:"INFO"},font:{description:"Default font for the info",type:"string"},size:{description:"Default size for the info",type:"integer",minimum:1},bold:{description:"Default boldness for the info",type:"boolean"},italic:{description:"Default italic style for the info",type:"boolean"},color:{description:"Default color for the info",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},visible:{description:"Default visibility for the info",type:"boolean"}},required:["type"],additionalProperties:!1},select_box:{type:"object",properties:{type:{description:"Type of the checkbox",type:"string",const:"SELECTBOX"},value:{description:"Default option for the checkbox",type:"string"}},additionalProperties:!1},background:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},logo:{type:"object",properties:{type:{description:"Type of the logo",type:"string",const:"LOGO"},font:{description:"Default font for the text logo",type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{description:"Default boldness for the text logo",type:"boolean"},italic:{description:"Default italic style for the text logo",type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{description:"Default visibility for the logo",type:"boolean"},spacing:{description:"Default spacing size for the text logo",type:"integer",minimum:1,exclusiveMaximum:10},capitalization:{description:"Default capitalization style for the text logo",type:"string",enum:["none","all","small"]},frame:{description:"Default frame for the text logo",type:"object",properties:{visible:{description:"Default visibility for the frame on text logo",type:"boolean"},width:{description:"Default width size for the frame on text logo",type:"integer",minimum:1,exclusiveMaximum:50},color:{oneOf:[{description:"Default color for frame on logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for frame on logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}},required:["visible","width","color"],additionalProperties:!1}},additionalProperties:!1}},ua={$schema:Zn,$id:Qn,title:Jn,description:eo,type:to,$defs:no},oo={__proto__:null,$defs:no,$id:Qn,$schema:Zn,default:ua,description:eo,title:Jn,type:to},so="https://json-schema.org/draft/2020-12/schema",ro="https://lightspeedhq.com/section-content.schema.json",io="Custom Section - Content",ao="The content of a custom section",co="object",lo={"^.*$":{type:"object",properties:{type:{type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","INFO","DECK","MENU","NAVIGATION_MENU","LOGO","DIVIDER","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"#/$defs/Deck"}},{if:{properties:{type:{const:"MENU"}}},then:{$ref:"#/$defs/Menu"}},{if:{properties:{type:{const:"NAVIGATION_MENU"}}},then:{$ref:"#/$defs/NavigationMenu"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}},{if:{properties:{type:{const:"PRODUCT_SELECTOR"}}},then:{$ref:"#/$defs/ProductSelector"}},{if:{properties:{type:{const:"CATEGORY_SELECTOR"}}},then:{$ref:"#/$defs/CategorySelector"}}]}},po={Inputbox:{type:"object",properties:{type:{const:"INPUTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/InputboxDefaults"}},required:["type","label","placeholder"]},Textarea:{type:"object",properties:{type:{const:"TEXTAREA"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/TextareaDefaults"}},required:["type","label","placeholder"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ButtonDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},static:{type:"boolean"},defaults:{$ref:"#/$defs/ImageDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDefaults"}},required:["type","label","description"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},placeholder:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label","placeholder","description","options"]},Menu:{type:"object",properties:{type:{const:"MENU"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},NavigationMenu:{type:"object",properties:{type:{const:"NAVIGATION_MENU"}},required:["type"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoEditorButton"},defaults:{$ref:"#/$defs/InfoDefaults"}},required:["type","label","description"]},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},InputboxDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},TextareaDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"}},required:["text"]},ButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},buttonType:{type:"string",enum:["SCROLL_TO_TILE","HYPER_LINK","MAIL_LINK","TEL_LINK","GO_TO_STORE_LINK","GO_TO_PAGE"]},link:{type:"string",format:"uri"},linkTarget:{type:"string"},email:{type:"string"},phone:{type:"string"},tileId:{type:"string"}},required:["title"]},ImageDefaults:{type:"object",properties:{imageData:{$ref:"section-commons.schema.json#/$defs/Image"}}},ToggleDefaults:{type:"object",properties:{enabled:{type:"boolean"}}},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}}},InfoDefaults:{type:"object",properties:{text:{$ref:"../common.schema.json#/$defs/label_type"},button:{$ref:"#/$defs/InfoButtonDefaults"}}},SelectboxOption:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},value:{type:"string"}}},InfoEditorButton:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string"}}},InfoButtonDefaults:{type:"object",properties:{title:{$ref:"../common.schema.json#/$defs/label_type"},link:{type:"string",minLength:0}}},Deck:{type:"object",properties:{type:{const:"DECK"},cards:{description:"Cards of the content configuration element",type:"object",properties:{defaultCardContent:{type:"object",properties:{label:{$ref:"../common.schema.json#/$defs/label_type"},settings:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the settings configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},required:["type"],allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"#/$defs/Inputbox"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"#/$defs/Textarea"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/ButtonDefaults"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}}]}},minProperties:1}},required:["label","settings"]}},required:["defaultCardContent"]},label:{$ref:"../common.schema.json#/$defs/label_type"},addButtonLabel:{$ref:"../common.schema.json#/$defs/label_type"},maxCards:{type:"number"}},required:["cards","maxCards","label","addButtonLabel","type"]},ProductSelector:{type:"object",properties:{type:{const:"PRODUCT_SELECTOR"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ProductSelectorDefaults"}},required:["type","label"]},ProductSelectorDefaults:{type:"object",properties:{maxProducts:{type:"number"}}},CategorySelector:{type:"object",properties:{type:{const:"CATEGORY_SELECTOR"},label:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/CategorySelectorDefaults"}},required:["type","label"]},CategorySelectorDefaults:{type:"object",properties:{maxCategories:{type:"number"}}}},uo=!1,fa={$schema:so,$id:ro,title:io,description:ao,type:co,patternProperties:lo,$defs:po,additionalProperties:uo},fo={__proto__:null,$defs:po,$id:ro,$schema:so,additionalProperties:uo,default:fa,description:ao,patternProperties:lo,title:io,type:co},ho="https://json-schema.org/draft/2020-12/schema",mo="https://lightspeedhq.com/section-layout.schema.json",yo="Section Layout Schema",go="Schema for validating section layout configurations",$o="array",Eo={type:"object",required:["layoutId","selectedContentSettings","selectedDesignSettings"],properties:{layoutId:{type:"string",description:"Unique identifier for the layout"},layoutIcon:{type:"string",description:"Icon identifier used in the layout selector",enum:["HEADER_LEFT","HEADER_CENTER_LOGO_BURGER","HEADER_CENTER_LOGO_COMPACT","HEADER_CENTER_LOGO_DETAILED","HEADER_LEFT_LOGO_BURGER","HEADER_LEFT_LOGO_COMPACT","HEADER_LEFT_LOGO_DETAILED","HEADER_LEFT_LOGO_SEARCH","HEADER_LEFT_LOGO_TEXT","TEXT_ONE_COLUMN","TEXT_TITLE_LEFT","TEXT_SUBTITLE_RIGHT","TEXT_TWO_COLUMNS","TEXT_CENTER","TEXT_DESCRIPTION_RIGHT","CTA_BANNER_LEFT","CTA_BANNER_RIGHT","CTA_BANNER_CENTER","CTA_BANNER_BOTTOM","CTA_PROMO_BAR_LEFT","CTA_PROMO_BAR_RIGHT","CTA_STORY_LEFT","CTA_STORY_RIGHT","CTA_FULLWIDTH_CENTER","CTA_FULLWIDTH_LEFT","COVER_FULLSCREEN_CENTER","COVER_FULLSCREEN_LEFT","COVER_FULLSCREEN_CENTER_LEFT","COVER_FULLSCREEN_RIGHT","COVER_FULLSCREEN_BOTTOM","COVER_FULLSCREEN_BOTTOM_RIGHT","COVER_FULLSCREEN_BOTTOM_LEFT","COVER_FULLSCREEN_TOP","COVER_SIDEBAR_RIGHT","COVER_SIDEBAR_LEFT","COVER_HALFSCREEN_LEFT","COVER_HALFSCREEN_CENTER","COVER_COLLAGE_BOTTOM","COVER_COLLAGE_LEFT","IMAGE_SUBTITLE_RIGHT","IMAGE_TITLE_LEFT","IMAGE_LEFT","IMAGE_RIGHT","IMAGE_CENTER","IMAGE_SIDE_TITLE","LOCATION_MAP_RIGHT","LOCATION_MAP_LEFT","LOCATION_IMAGE_RIGHT","LOCATION_IMAGE_LEFT","LOCATION_BACKGROUND_RIGHT","LOCATION_BACKGROUND_LEFT","LOCATION_FULL","LOCATION_SHORT","REVIEWS_MINIMAL","REVIEWS_CARDS","REVIEWS","REVIEWS_CLASSIC","REVIEWS_FULLSCREEN_BG","REVIEWS_FULLSCREEN_SIDEBAR_LEFT","REVIEWS_FULLSCREEN_SIDEBAR_RIGHT","REVIEWS_CARDS_PHOTO","REVIEWS_PHOTO_SPEECH_RIGHT","REVIEWS_PHOTO_SPEECH_LEFT","REVIEWS_SOCIAL_FEED","REVIEWS_ADAPTIVE","FEATURES_CLASSIC_CENTER","FEATURES_CLASSIC_LEFT","FEATURES_ACCORDION","FEATURES_MINIMAL","FEATURES_SMALL_ICONS","FEATURES_CAROUSEL","FEATURES_IMAGE_LEFT","FEATURES_IMAGE_RIGHT","ANNOUNCEMENT_CENTER","SLIDER_FULLSCREEN_CENTER","SLIDER_FULLSCREEN_LEFT"]},selectedContentSettings:{type:"array",description:"Array of selected content settings (field names only)",items:{type:"string"}},selectedDesignSettings:{type:"array",description:"Array of selected design settings with optional overrides",items:{$ref:"#/$defs/selectionItem"}}},additionalProperties:!1},bo={selectionItem:{type:"object",description:"Pick a design field by name; optionally override its defaults for this layout.",required:["fieldName"],properties:{fieldName:{type:"string"},type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]},defaults:{type:"object",description:"Design editor defaults; shape depends on the type property"}},allOf:[{if:{required:["type"],properties:{type:{const:"TEXT"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/TextDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"IMAGE"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ImageDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"BUTTON"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ButtonDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"BACKGROUND"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/BackgroundDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"TOGGLE"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ToggleDesignDefaults"}}}},{if:{required:["type"],properties:{type:{const:"COLOR_PICKER"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/ColorPickerDefaults"}}}},{if:{required:["type"],properties:{type:{const:"RATING"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/RatingDefaults"}}}},{if:{required:["type"],properties:{type:{const:"SELECTBOX"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/SelectboxDefaults"}}}},{if:{required:["type"],properties:{type:{const:"SOCIAL_PROFILES"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/SocialProfilesDefaults"}}}},{if:{required:["type"],properties:{type:{const:"LOGO"}}},then:{required:["defaults"],properties:{defaults:{$ref:"./section-design.schema.json#/$defs/LogoDesignDefaults"}}}},{if:{required:["defaults"]},then:{required:["type"]}}],additionalProperties:!1}},da={$schema:ho,$id:mo,title:yo,description:go,type:$o,items:Eo,$defs:bo},_o={__proto__:null,$defs:bo,$id:mo,$schema:ho,default:da,description:go,items:Eo,title:yo,type:$o},So="https://json-schema.org/draft/2020-12/schema",To="https://lightspeedhq.com/sections/section-translation.schema.json",wo="Custom Section - Translations",Co="The translation of the section's labels",Ao="object",Ro={"^[a-z]{2}(_([a-z]{2}|[A-Z]{2}|[0-9]{3}))?$":{type:"object",patternProperties:{"^\\$.*$":{type:"string"}},additionalProperties:!1}},Oo=!1,ha={$schema:So,$id:To,title:wo,description:Co,type:Ao,patternProperties:Ro,additionalProperties:Oo},wt={__proto__:null,$id:To,$schema:So,additionalProperties:Oo,default:ha,description:Co,patternProperties:Ro,title:wo,type:Ao},vo="https://json-schema.org/draft/2020-12/schema",Io="https://lightspeedhq.com/section-design.schema.json",Lo="Custom Section - Design",jo="The design of a custom section",xo="object",No={"^.*$":{type:"object",properties:{type:{type:"string",enum:["TEXT","IMAGE","BUTTON","BACKGROUND","TOGGLE","COLOR_PICKER","RATING","SELECTBOX","SOCIAL_PROFILES","LOGO","INFO","DIVIDER"]}},required:["type"],allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"#/$defs/Text"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"#/$defs/Image"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"#/$defs/Button"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"#/$defs/Background"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"#/$defs/Toggle"}},{if:{properties:{type:{const:"COLOR_PICKER"}}},then:{$ref:"#/$defs/Color"}},{if:{properties:{type:{const:"RATING"}}},then:{$ref:"#/$defs/Rating"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"#/$defs/Selectbox"}},{if:{properties:{type:{const:"SOCIAL_PROFILES"}}},then:{$ref:"#/$defs/SocialProfile"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"#/$defs/Logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"#/$defs/Info"}},{if:{properties:{type:{const:"DIVIDER"}}},then:{$ref:"#/$defs/Divider"}}],additionalProperties:!0}},Po={Text:{type:"object",properties:{type:{const:"TEXT"},label:{$ref:"../common.schema.json#/$defs/label_type"},sizes:{type:"array",items:{type:"integer"}},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/TextDesignDefaults"}},required:["type","label"]},Image:{type:"object",properties:{type:{const:"IMAGE"},label:{$ref:"../common.schema.json#/$defs/label_type"},static:{type:"boolean"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ImageDesignDefaults"}},required:["type","label"]},Button:{type:"object",properties:{type:{const:"BUTTON"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAutoColor:{type:["boolean","null"]},enableAlphaColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},hideSize:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ButtonDesignDefaults"}},required:["type","label"]},Background:{type:"object",properties:{type:{const:"BACKGROUND"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/BackgroundDesignDefaults"}},required:["type","label"]},Toggle:{type:"object",properties:{type:{const:"TOGGLE"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},defaults:{$ref:"#/$defs/ToggleDesignDefaults"}},required:["type","label"]},Color:{type:"object",properties:{type:{const:"COLOR_PICKER"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},defaults:{$ref:"#/$defs/ColorPickerDefaults"}},required:["type","label"]},Rating:{type:"object",properties:{type:{const:"RATING"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},hideVisibleToggle:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/RatingDefaults"}},required:["type","label"]},Selectbox:{type:"object",properties:{type:{const:"SELECTBOX"},label:{$ref:"../common.schema.json#/$defs/label_type"},description:{$ref:"../common.schema.json#/$defs/label_type"},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SelectboxDefaults"}},required:["type","label"]},SocialProfile:{type:"object",properties:{type:{const:"SOCIAL_PROFILES"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},enableAlphaColor:{type:["boolean","null"]},enableAutoColor:{type:["boolean","null"]},options:{type:"array",items:{$ref:"#/$defs/SelectboxOption"}},defaults:{$ref:"#/$defs/SocialProfilesDefaults"}},required:["type","label"]},Logo:{type:"object",properties:{type:{const:"LOGO"},label:{$ref:"../common.schema.json#/$defs/label_type"},colors:{type:"array",items:{type:"string",pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$"}},sizes:{type:"array",items:{type:"integer"}},defaults:{$ref:"#/$defs/LogoDesignDefaults"}},required:["type"]},Info:{type:"object",properties:{type:{const:"INFO"},text:{type:"string"},button:{type:"object",properties:{title:{type:"string"},link:{type:"string"}},additionalProperties:!0}},required:["type","text"],additionalProperties:!0},Divider:{type:"object",properties:{type:{const:"DIVIDER"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:["type","label"]},TextDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the text",type:"integer",minimum:1},{description:"Default global size string for the text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},ImageDesignDefaults:{type:"object",properties:{overlay:{type:"string"},visible:{type:"boolean"}},if:{properties:{overlay:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the image overlay",type:"array",items:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the image overlay",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the image overlay",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}},required:[]},ButtonDesignDefaults:{type:"object",properties:{appearance:{type:"string",enum:["SOLID","OUTLINE","TEXT"]},font:{type:"string"},size:{type:"string",enum:["SMALL","MEDIUM","LARGE"]},style:{type:"string",enum:["round-corner","rectangle","pill"]},color:{oneOf:[{description:"Default color for the button",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the button",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},BackgroundDesignDefaults:{type:"object",properties:{type:{description:"Type of the background",type:"string",const:"BACKGROUND"},style:{description:"Style of the background",type:"string",enum:["COLOR","GRADIENT"]}},if:{properties:{style:{const:"GRADIENT"}}},then:{properties:{color:{description:"Default colors for the background",type:"array",items:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},minItems:2,maxItems:2}}},else:{properties:{color:{oneOf:[{description:"Default color for the background",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the background",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]}}}},ToggleDesignDefaults:{type:"object",properties:{enabled:{type:"boolean"}},required:[]},ColorPickerDefaults:{type:"object",properties:{appearance:{$ref:"section-commons.schema.json#/$defs/Color"}},required:[]},RatingDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},style:{type:"string"}},required:[]},SelectboxDefaults:{type:"object",properties:{value:{type:"string"}},required:[]},SocialProfilesDefaults:{type:"object",properties:{color:{$ref:"section-commons.schema.json#/$defs/Color"},visible:{type:"boolean"},appearance:{type:"string"}},required:[]},LogoDesignDefaults:{type:"object",properties:{font:{type:"string"},size:{oneOf:[{description:"Default size for the logo text",type:"integer",minimum:1},{description:"Default global size string for the logo text",type:"string",enum:["global.textSize.title","global.textSize.subtitle","global.textSize.body"]}]},bold:{type:"boolean"},italic:{type:"boolean"},color:{oneOf:[{description:"Default color for the logo text",type:"string",pattern:"^#([a-fA-F0-9]{8}|[a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},{description:"Default global color string for the logo text",type:"string",enum:["global.color.title","global.color.body","global.color.button","global.color.link","global.color.background"]}]},visible:{type:"boolean"}},required:[]},SelectboxOption:{type:"object",properties:{value:{type:"string"},label:{$ref:"../common.schema.json#/$defs/label_type"}},required:[]}},ma={$schema:vo,$id:Io,title:Lo,description:jo,type:xo,patternProperties:No,$defs:Po},Do={__proto__:null,$defs:Po,$id:Io,$schema:vo,default:ma,description:jo,patternProperties:No,title:Lo,type:xo},ko="https://json-schema.org/draft/2020-12/schema",Fo="https://lightspeedhq.com/section-commons.schema.json",Ho="Custom Section - Content",Mo="The content of a custom section",Go="object",Bo={Image:{type:"object",properties:{set:{type:"object",properties:{MOBILE_WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},MOBILE_WEBP_HI_RES:{$ref:"#/$defs/ImageInfo"},WEBP_LOW_RES:{$ref:"#/$defs/ImageInfo"},WEBP_HI_2X_RES:{$ref:"#/$defs/ImageInfo"},ORIGINAL:{$ref:"#/$defs/ImageInfo"}},additionalProperties:!1,minProperties:1},borderInfo:{$ref:"#/$defs/BorderInfo"}},additionalProperties:!1,required:["set"]},ImageInfo:{type:"object",properties:{url:{type:"string"},width:{type:"integer",minimum:0},height:{type:"integer",minimum:0}}},BorderInfo:{type:"object",properties:{homogeneity:{type:"boolean"},color:{$ref:"#/$defs/RGBA"}}},RGBA:{type:"object",properties:{r:{type:"integer",minimum:0,maximum:255},g:{type:"integer",minimum:0,maximum:255},b:{type:"integer",minimum:0,maximum:255},a:{type:"number",format:"double",minimum:0,maximum:1}},required:["r","g","b","a"]},HSL:{type:"object",properties:{h:{type:"number",format:"double"},s:{type:"number",format:"double"},l:{type:"number",format:"double"},a:{type:"number",format:"double"}},required:["h","s","l","a"]},Overlay:{type:"object",properties:{type:{type:"string",enum:["solid","gradient","none"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Solid:{type:"object",properties:{color:{$ref:"#/$defs/Color"}}},Gradient:{type:"object",properties:{fromColor:{$ref:"#/$defs/Color"},toColor:{$ref:"#/$defs/Color"}}},Background:{type:"object",properties:{type:{type:"string",enum:["solid","gradient"]},solid:{$ref:"#/$defs/Solid"},gradient:{$ref:"#/$defs/Gradient"}}},Color:{type:"object",properties:{raw:{type:"string"},hex:{type:"string"},auto:{type:"boolean"},rgba:{$ref:"#/$defs/RGBA"},hsl:{$ref:"#/$defs/HSL"}}}},qo=!1,ya={$schema:ko,$id:Fo,title:Ho,description:Mo,type:Go,$defs:Bo,additionalProperties:qo},Uo={__proto__:null,$defs:Bo,$id:Fo,$schema:ko,additionalProperties:qo,default:ya,description:Mo,title:Ho,type:Go},zo="https://json-schema.org/draft/2020-12/schema",Ko="https://lightspeedhq.com/section-showcase.schema.json",Xo="Custom Section - Showcase settings",Vo="The setting of a showcase",Wo="object",Yo=["showcaseId","previewImage"],Zo=[{properties:{showcaseId:{description:"Showcase id of the section",type:"string"},previewImage:{$ref:"section-commons.schema.json#/$defs/Image"}}},{$ref:"../showcase_overrides.schema.json"}],ga={$schema:zo,$id:Ko,title:Xo,description:Vo,type:Wo,required:Yo,allOf:Zo},Qo={__proto__:null,$id:Ko,$schema:zo,allOf:Zo,default:ga,description:Vo,required:Yo,title:Xo,type:Wo},Jo="https://json-schema.org/draft/2020-12/schema",es="https://lightspeedhq.com/template.schema.json",ts="Custom Template",ns="A custom template enclosing the necessary custom and default blocks",os="object",ss={metadata:{type:"object",properties:{name:{description:"Name of the template",type:"string",minLength:2,maxLength:60},description:{description:"Short description of the template",type:"string",minLength:2,maxLength:150},preview_url:{description:"Preview url of the demo website",type:"string",format:"uri",pattern:"^(https?)://([^.]+?\\.)?(company\\.site|ecwid\\.qa)($|/[A-Za-z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]*)?$"},cover_image:{type:"object",properties:{set:{description:"Name of the image set",type:"object",patternProperties:{".*":{type:"object",properties:{url:{description:"Path to the preview image relative to the 'assets' folder for a specific resolution",type:"string"}},required:["url"],additionalProperties:!1}}}},required:["set"],additionalProperties:!1},categories:{description:"List of template categories for Template Market filtering",type:"array",items:{type:"string",enum:["apparel_footwear","vape_smoke","home_garden","sport_outdoor","jewelry_accessories","pet_animals","bikes","health_beauty","gift_shop","electronics","other"]},uniqueItems:!0}},required:["name","description","cover_image"],additionalProperties:!1},sections:{description:"List of sections contained by this template",type:"array",items:{type:"object",properties:{type:{description:"Type of the section",type:"string",enum:["custom","default"]}},allOf:[{if:{properties:{type:{const:"default"}}},then:{$ref:"template-default.schema.json#/$defs/default-section"}},{if:{properties:{type:{const:"custom"}}},then:{$ref:"template-custom.schema.json#/$defs/custom-section"}}]},minItems:1,uniqueItems:!1}},rs=["metadata","sections"],$a={$schema:Jo,$id:es,title:ts,description:ns,type:os,properties:ss,required:rs},is={__proto__:null,$id:es,$schema:Jo,default:$a,description:ns,properties:ss,required:rs,title:ts,type:os},as="https://json-schema.org/draft/2020-12/schema",cs="https://lightspeedhq.com/showcase_overrides.schema.json",ls="Showcase overrides",ps="Overrides for the showcase",us="object",fs={content:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the content configuration element",type:"string",enum:["INPUTBOX","TEXTAREA","BUTTON","IMAGE","TOGGLE","SELECTBOX","LOGO","DECK","MENU","NAVIGATION_MENU","INFO","PRODUCT_SELECTOR","CATEGORY_SELECTOR"]}},allOf:[{if:{properties:{type:{const:"INPUTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/input_box"}},{if:{properties:{type:{const:"TEXTAREA"}}},then:{$ref:"template-custom-content.schema.json#/$defs/text_area"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-content.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-content.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-content.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-content.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"DECK"}}},then:{$ref:"template-custom-content.schema.json#/$defs/deck"}},{if:{properties:{type:{const:"PRODUCT_SELECTOR"}}},then:{$ref:"template-custom-content.schema.json#/$defs/product_selector"}},{if:{properties:{type:{const:"CATEGORY_SELECTOR"}}},then:{$ref:"template-custom-content.schema.json#/$defs/category_selector"}}]}}},design:{type:"object",patternProperties:{".*":{type:"object",properties:{type:{description:"Type of the design configuration element",type:"string",enum:["TEXT","BUTTON","IMAGE","TOGGLE","SELECTBOX","BACKGROUND","LOGO"]}},allOf:[{if:{properties:{type:{const:"TEXT"}}},then:{$ref:"template-custom-design.schema.json#/$defs/text"}},{if:{properties:{type:{const:"BUTTON"}}},then:{$ref:"template-custom-design.schema.json#/$defs/button"}},{if:{properties:{type:{const:"IMAGE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/image"}},{if:{properties:{type:{const:"TOGGLE"}}},then:{$ref:"template-custom-design.schema.json#/$defs/toggle"}},{if:{properties:{type:{const:"SELECTBOX"}}},then:{$ref:"template-custom-design.schema.json#/$defs/select_box"}},{if:{properties:{type:{const:"BACKGROUND"}}},then:{$ref:"template-custom-design.schema.json#/$defs/background"}},{if:{properties:{type:{const:"LOGO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/logo"}},{if:{properties:{type:{const:"INFO"}}},then:{$ref:"template-custom-design.schema.json#/$defs/info"}}]}}},layoutId:{description:"Layout ID for the showcase",type:"string"},blockName:{description:"Section name for the showcase",$ref:"common.schema.json#/$defs/label_type"}},Ea={$schema:as,$id:cs,title:ls,description:ps,type:us,properties:fs},ds={__proto__:null,$id:cs,$schema:as,default:Ea,description:ps,properties:fs,title:ls,type:us},hs="https://json-schema.org/draft/2020-12/schema",ms="https://lightspeedhq.com/common.schema.json",ys="Common Type Definitions",gs="Common type definitions, used throughout other schemas",$s="object",Es={label_type:{type:"string",pattern:"^\\$.+"}},ba={$schema:hs,$id:ms,title:ys,description:gs,type:$s,$defs:Es},bs={__proto__:null,$defs:Es,$id:ms,$schema:hs,default:ba,description:gs,title:ys,type:$s};function De(e){return re(`${ze}/${e}`)?ue.HEADER:re(`${Ke}/${e}`)?ue.FOOTER:ue.SECTION}function Ct(e){const t=De(e);return ce[t].dist}const _a={menu:{type:"NAVIGATION_MENU"},logo:{type:"LOGO"}},Sa={logo:{type:"LOGO",colors:["#FFFFFF66","#0000004D","#00000099","#64C7FF66","#F9947266","#C794CD66","#FFD17466"],sizes:[18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60],defaults:{font:"global.fontFamily.body",size:40,bold:!0,italic:!1,color:"#313131",visible:!0,spacing:2,capitalization:"all",frame:{visible:!0,width:3,color:"#313131"}}}};function _s(e){switch(e){case ue.HEADER:return _a;default:return{}}}function Ss(e){switch(e){case ue.HEADER:return Sa;default:return{}}}function Ta({validationType:e,sectionType:t}){switch(e){case Me.CONTENT:return _s(t);case Me.DESIGN:return Ss(t);default:return{}}}function wa({sectionSettings:e,mandatorySettings:t}){const n=[];return Object.entries(e).filter(([o])=>t[o]!==void 0).forEach(([o,s])=>{const i=t[o];s.type!==i.type&&n.push({instancePath:o,keyword:"type-mismatch",message:`Editor type "${s.type}" for reserved key "${o}" does not match the required type "${i.type}".`})}),n}function Ca({type:e,mandatorySettings:t}){return Object.keys(t).find(n=>t[n].type===e)}function Aa({sectionSettings:e,mandatorySettings:t}){const n=[];return Object.entries(e).forEach(([o,s])=>{const i=Ca({type:s.type,mandatorySettings:t});i&&o!==i&&n.push({instancePath:o,keyword:"key-mismatch",message:`Editor key "${o}" for overriden content type "${s.type}" does not match the required key name "${i}".`})}),n}function Ra({type:e,mandatorySettings:t}){return Object.keys(t).findLast(n=>t[n].type===e)}function Oa({sectionSettings:e,mandatorySettings:t}){const n=[],o=Object.values(t).map(({type:i})=>i),s=Object.values(e).map(({type:i})=>i);return new Set(s.filter(i=>o.includes(i))).forEach(i=>{if(s.filter(r=>r===i).length>1){const r=Ra({type:i,mandatorySettings:t});n.push({instancePath:r,keyword:"duplicate-type",message:`Editor type "${i}" can only be used once.`})}}),n}function va(e,t){const{sectionSettings:n,sectionType:o}=t,s=Ta({validationType:e,sectionType:o});return s===void 0||vn(s)?[]:[...wa({sectionSettings:n,mandatorySettings:s}),...Aa({sectionSettings:n,mandatorySettings:s}),...Oa({sectionSettings:n,mandatorySettings:s})]}function Ia(e,t){const n=[];if(!e.cards?.defaultCardContent)return n;const o=e.cards.defaultCardContent.settings;for(const[s,i]of Object.entries(o)){const r=i;r?.type==="IMAGE"&&n.push({key:s,editor:r,path:`${t}/cards/defaultCardContent/settings/${s}`})}return n}function La(e,t){const n=e[t];if(n?.type==="IMAGE")return n}function Ts(e,t,n,o,s){const i=La(n,e);if(i?.type!=="IMAGE")return;const r=t.static,a=i.static;(r??!1)!==(a??!1)&&s.push({instancePath:o,message:`Both "${e} content and design editor need to have same value for attribute static`,keyword:"image-editor-mismatch"})}function ja(e,t,n,o){for(const[s,i]of Object.entries(e)){const r=i,a=`/${s}`;if(r.type==="IMAGE")Ts(s,r,t,a,o);else if(r.type==="DECK"){const c=Ia(r,a);for(const{key:l,editor:f,path:E}of c)Ts(l,f,t,E,o)}}}async function xa(e,t,n){if(!e.sectionName||e.validationType!==Me.CONTENT)return[];const o=W.resolve(`${n}/${e.sectionName}/js/settings/design`),s=await xe(o,!1),i=[];return ja(t,s,"",i),i}const Ge=[Uo,Do,fo,_o,Qo,is,Dn,qn,Yn,oo,ds,bs];function ke(e,t){const n=new $i({allErrors:!0,schemas:e});return Ei(n),n.getSchema(t.$id)||n.compile(t)}function Na(){return ke(Ge,is)}function ut(e){return e.map(t=>({instancePath:t.instancePath,message:t.message??"",keyword:t.keyword}))}const Pa=e=>(()=>{const t=Ct(e.name),n=t.split("/").pop()?.toLowerCase();return[{source:`./${n}/${e.name}/settings/content.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/content`),ajv:ke(Ge,fo),validationType:Me.CONTENT,sectionName:e.name,type:e.type},{source:`./${n}/${e.name}/settings/design.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/design`),ajv:ke(Ge,Do),validationType:Me.DESIGN,sectionName:e.name,type:e.type},...V.existsSync(`./${n}/${e.name}/settings/layout.ts`)?[{source:`./${n}/${e.name}/settings/layout.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/layout`),ajv:ke(Ge,_o),sectionName:e.name,type:e.type}]:[],{source:`./${n}/${e.name}/settings/translations.ts`,dist:W.resolve(`${t}/${e.name}/js/settings/translations`),ajv:ke(Ge,wt),type:e.type},...e.showcaseEntryPoints.map(o=>({source:`./${n}/${e.name}/showcases/${He(o).name}.ts`,dist:W.resolve(`${t}/${e.name}/js/showcases/${He(o).name}`),ajv:ke(Ge,o.indexOf("translations")===-1?Qo:wt),type:e.type,sectionName:e.name}))]})();function Da(e){const t=s=>{const i=(s??"").split("/").filter(r=>r.length>0);return i.length===0?"$":`$${i.map(r=>`.${r}`).join("")}`};let n=0,o=0;Object.keys(e).forEach(s=>{const i=e[s];n=Math.max(n,Math.max(...i.map(r=>t(r.instancePath).length))),o=Math.max(o,Math.max(...i.map(r=>r.message.length)))}),Object.keys(e).forEach(s=>{const i=e[s].filter((r,a,c)=>a===c.findIndex(l=>`${r.instancePath}${r.message}${r.keyword}`==`${l.instancePath}${l.message}${l.keyword}`));I.error(s),i.filter(r=>r.keyword!=="if").forEach(r=>{I.error(`${t(r.instancePath).padEnd(n," ")} | ${r.message.padEnd(o," ")} | ${r.keyword||"-"}`)})})}function ka(e,t){if(e.validationType===void 0||e.sectionName===void 0)return[];const{sectionName:n,validationType:o}=e,s=De(n);return[...va(o,{sectionSettings:t,sectionType:s})]}function ws(e,t){return Si({path:"$..set..url",json:t,resultType:"value"}).map(n=>{if(new RegExp(/^https?:\/\//).test(n))return null;const o=`${e}/assets/${n}`;return re(o)?null:{message:`Image ${n} is missing from assets folder`,keyword:"missing-asset"}}).filter(n=>n!==null)}function Fa(e,t,n,o){const s=[],i=t.cards?.defaultCardContent?.settings;if(!i)return s;const r=new Set(Object.keys(i));return e.cards.forEach((a,c)=>{const l=a.settings;l&&Object.keys(l).forEach(f=>{r.has(f)||s.push({instancePath:`showcases/${o}/content/${n}/cards/${c}/settings/${f}`,message:`Setting '${f}' is not defined in content.ts defaultCardContent.settings`,keyword:"invalid-deck-card-setting"})})}),s}async function Ha(e,t){const n=[];if(!e.source||!e.source.includes("/sections/")||e.validationType!==Me.CONTENT||!e.sectionName)return n;const o=Ct(e.sectionName),s=W.resolve(`${o}/${e.sectionName}/js/showcases`);if(!re(s))return n;const i=V.readdirSync(s).filter(a=>a.endsWith(".mjs")&&a!=="translations.mjs").map(async a=>{const c=W.resolve(`${s}/${a.replace(".mjs","")}`),l=await xe(c,!1);return{showcaseFile:a,showcaseData:l}}),r=await Promise.all(i);for(const{showcaseFile:a,showcaseData:c}of r){if(!c.content)continue;const l=c.content;Object.keys(l).forEach(f=>{const E=l[f],u=t[f];if(!u){n.push({instancePath:`showcases/${a.replace(".mjs","")}/content/${f}`,message:`Element '${f}' is not defined in content.ts`,keyword:"invalid-showcase-element"});return}if(E.type!==u.type){n.push({instancePath:`showcases/${a.replace(".mjs","")}/content/${f}`,message:`Element '${f}' type mismatch: showcase has type '${E.type}' but content.ts has type '${u.type}'`,keyword:"type-mismatch"});return}E.type==="DECK"&&u.type==="DECK"&&n.push(...Fa(E,u,f,a.replace(".mjs","")))})}return n}async function Ma(e){const t=await xe(e.dist,!1),n={},o=[],s=Ct(e.sectionName??""),i=s.split("/").pop()?.toLowerCase();if(e.ajv(t)||o.push(...ut(e.ajv.errors??[])),o.push(...ka(e,t),...ws(`${i}/${e.sectionName}`,t),...await xa(e,t,s)),e.source&&e.source.includes("/sections/")&&e.validationType===Me.CONTENT){const r=await Ha(e,t);o.push(...r)}return o.length>0&&(n[e.source]=o),n}async function Ga(e){const t=_i(bi.gunzip),n=await V.promises.readFile(e);return(await t(n)).length}async function Cs(e,t){const n=We[e],o=W.resolve(`${n.toPath(t)}${n.fileName}`),s=await Ga(o);if(s>Rn)throw I.error(`Size of individual server file must not exceed threshold [${Qe(Rn)}]!`),I.error(`${`File: ${o}`.padEnd(o.length+10)}| ${Qe(s)}`),new Error("Invalid server file size")}function As(e){const t=e.reduce((n,o)=>{const s=ni(o);return s.size>An&&(n[o]=Qe(s.size)),n},{});if(Object.keys(t).length!==0){const n=Math.max(...Object.keys(t).map(o=>o.length));I.error(`Size of individual assets must not exceed threshold [${Qe(An)}]!`);for(const o in t)I.error(`${`File: ${o}`.padEnd(n+10)}| ${t[o]}`);throw new Error("Invalid asset file size")}}function Ba(e,t,n,o){const s={};return e(t)&&o===void 0?pn(`${n}${je}.mjs`,`${n}.mjs`,()=>{}):(un(`${n}${je}.mjs`,()=>{}),s[W.resolve(`./templates/${He(n).name}.ts`)]=[...ut(e.errors??[]),...o??[]]),s}async function qa(){const e={},t="dist/shared/translation",n=W.resolve(process.cwd(),`${t}.mjs`);if(!re(n))return e;try{const o=await xe(t,!1),s=ke(Ge,wt);s(o)||(e[t]=ut(s.errors??[]))}catch(o){e[t]=[{instancePath:"shared/translation.ts",message:`Failed to load translation file: ${o.message}`,keyword:"import"}]}return e}const Rs={"process.env":{NODE_ENV:"production"}},Ua=[...$n,...$n.map(e=>`node:${e}`)],za=[/@vue\/compiler-dom/,/@vue\/runtime-dom/,/@vue\/server-renderer/,/@vue\/compiler-ssr/,/@vue\/shared/],Os=e=>({pluginType:Ee.Server,define:Rs,ssr:!0,ssrOptions:{noExternal:!0},entryFileNames:"server.js",externalOption:[...Ua,...za],inlineDynamicImports:!0,...e,outDir:e.outDir}),vs=e=>({pluginType:Ee.Client,define:Rs,ssr:!1,entryFileNames:"client.js",assetFileNames:"assets/[name].[ext]",chunkFileNames:"chunks/[name].js",inlineDynamicImports:!1,...e,outDir:e.outDir}),tt=e=>({pluginType:Ee.Misc,ssr:!1,...e,entryFileNames:e.entryFileNames,outDir:e.outDir}),Ka=e=>({pluginType:Ee.Layout,ssr:!1,entryFileNames:"index.mjs",...e,outDir:e.outDir}),At=e=>({pluginType:Ee.Asset,ssr:!1,assetFileNames:"[name].[ext]",...e,outDir:e.outDir}),Xa=()=>Ti({ext:".gz",algorithm:"gzip"}),Va="/* EXTERNAL_IMPORTS_START */",Wa="/* EXTERNAL_IMPORTS_END */",Ya=()=>({name:"external-imports-wrapper-plugin",enforce:"post",apply:"build",generateBundle(e,t){for(const n of Object.keys(t)){const o=t[n];if(o.type==="chunk"){const s=/import.*\?commonjs-external["'];/g,i=o.code.match(s);if(i!==null){const r=i.join(""),a=Va+r+Wa,c=o.code.replace(s,"");o.code=a+c}}}}}),Za=()=>({name:"disable-json-plugin",enforce:"pre",apply:"build",configResolved(e){const t=e.plugins?.findIndex(n=>n?.name==="vite:json");t!==-1&&(e.plugins[t]={name:"vite:json",load:()=>null,transform:()=>null})}}),Qa=()=>{const e=process.env.npm_lifecycle_event;return Ai({typescript:!0,vueTsc:!1,eslint:e==="test"?!1:{lintCommand:`eslint --max-warnings=0 "./sections/**/*.{js,ts,vue}" --cache --cache-location "./build/eslintcache/${e}.json"`}})},Ae={VUE:wi(),TS_CONFIG_PATHS:Ci(),CHECKER:Qa()};class $t{constructor(t){this.bits=t instanceof $t?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}}class it{constructor(t,n,o){this.start=t,this.end=n,this.original=o,this.intro="",this.outro="",this.content=o,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){const t=new it(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,o){return this.content=t,o||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){const n=t-this.start,o=this.original.slice(0,n),s=this.original.slice(n);this.original=o;const i=new it(t,this.end,s);return i.outro=this.outro,this.outro="",this.end=t,this.edited?(i.edit("",!1),this.content=""):this.content=o,i.next=this.next,i.next&&(i.next.previous=i),i.previous=this,this.next=i,i}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;const n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;const n=this.content.replace(t,"");if(n.length){if(n!==this.content){const o=this.split(this.end-n.length);this.edited&&o.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}}function Ja(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}const ec=Ja();class tc{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=Ri(t.mappings),typeof t.x_google_ignoreList<"u"&&(this.x_google_ignoreList=t.x_google_ignoreList)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+ec(this.toString())}}function nc(e){const t=e.split(`
|
|
2
2
|
`),n=t.filter(i=>/^\t+/.test(i)),o=t.filter(i=>/^ {2,}/.test(i));if(n.length===0&&o.length===0)return null;if(n.length>=o.length)return" ";const s=o.reduce((i,r)=>{const a=/^ +/.exec(r)[0].length;return Math.min(a,i)},1/0);return new Array(s+1).join(" ")}function oc(e,t){const n=e.split(/[/\\]/),o=t.split(/[/\\]/);for(n.pop();n[0]===o[0];)n.shift(),o.shift();if(n.length){let s=n.length;for(;s--;)n[s]=".."}return n.concat(o).join("/")}const sc=Object.prototype.toString;function rc(e){return sc.call(e)==="[object Object]"}function Is(e){const t=e.split(`
|
|
3
3
|
`),n=[];for(let o=0,s=0;o<t.length;o++)n.push(s),s+=t[o].length+1;return function(s){let i=0,r=n.length;for(;i<r;){const l=i+r>>1;s<n[l]?r=l:i=l+1}const a=i-1,c=s-n[a];return{line:a,column:c}}}const ic=/\w/;class ac{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,n,o,s){if(n.length){const i=n.length-1;let r=n.indexOf(`
|
|
4
4
|
`,0),a=-1;for(;r>=0&&i>r;){const l=[this.generatedCodeColumn,t,o.line,o.column];s>=0&&l.push(s),this.rawSegments.push(l),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=r,r=n.indexOf(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightspeed/crane",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": "bin/crane.js",
|
|
6
6
|
"main": "./dist/app.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@jridgewell/sourcemap-codec": "^1.5.4",
|
|
67
|
-
"@lightspeed/crane-api": "1.1.
|
|
67
|
+
"@lightspeed/crane-api": "1.1.1",
|
|
68
68
|
"@lightspeed/eslint-config-crane": "1.1.3",
|
|
69
69
|
"@types/micromatch": "^4.0.8",
|
|
70
70
|
"@types/prompts": "^2.4.2",
|
|
@@ -4,6 +4,7 @@ import { loadModule, renderServerModule } from './utils';
|
|
|
4
4
|
|
|
5
5
|
let distFolderPath: string | null = null;
|
|
6
6
|
let currentApp: any = null;
|
|
7
|
+
let currentSectionName: string | null = null;
|
|
7
8
|
|
|
8
9
|
export function setDistFolderPath(path: string): void {
|
|
9
10
|
distFolderPath = path;
|
|
@@ -232,7 +233,7 @@ export function mergeDesign(
|
|
|
232
233
|
export function designTransformer(design: Record<string, any>, showCaseDesign: Record<string, any>): Record<string, any> {
|
|
233
234
|
const parsedDesign: Record<string, any> = {};
|
|
234
235
|
const parsedShowcaseDesign: Record<string, any> = {};
|
|
235
|
-
Object.entries(design).forEach(([key, comp]) => {
|
|
236
|
+
Object.entries(design || {}).forEach(([key, comp]) => {
|
|
236
237
|
// Skip DIVIDER elements - they're UI-only and don't have runtime data
|
|
237
238
|
if (comp?.type === 'DIVIDER') {
|
|
238
239
|
return;
|
|
@@ -245,7 +246,7 @@ export function designTransformer(design: Record<string, any>, showCaseDesign: R
|
|
|
245
246
|
parsedDesign[key] = comp?.defaults || {};
|
|
246
247
|
});
|
|
247
248
|
|
|
248
|
-
Object.entries(showCaseDesign).forEach(([key, comp]) => {
|
|
249
|
+
Object.entries(showCaseDesign || {}).forEach(([key, comp]) => {
|
|
249
250
|
// Skip DIVIDER elements - they're UI-only and don't have runtime data
|
|
250
251
|
if (comp?.type === 'DIVIDER') {
|
|
251
252
|
return;
|
|
@@ -259,33 +260,44 @@ export function designTransformer(design: Record<string, any>, showCaseDesign: R
|
|
|
259
260
|
});
|
|
260
261
|
|
|
261
262
|
let overridenDesign = mergeDesign(parsedDesign, parsedShowcaseDesign);
|
|
262
|
-
|
|
263
|
+
|
|
264
|
+
try {
|
|
265
|
+
overridenDesign = updateHexColors(overridenDesign);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error('[Preview] Failed to update hex colors:', error);
|
|
268
|
+
}
|
|
269
|
+
|
|
263
270
|
replaceGlobalFont(overridenDesign, 'Roboto');
|
|
264
271
|
return overridenDesign;
|
|
265
272
|
}
|
|
266
273
|
|
|
267
274
|
function processImage(component: any, sectionName: string, key: string, isApiRender: boolean = false): Record<string, any> {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
275
|
+
try {
|
|
276
|
+
const assetLocation = isApiRender ?
|
|
277
|
+
`http://${distFolderPath}/sections/${sectionName}/assets/` :
|
|
278
|
+
`${distFolderPath}/sections/${sectionName}/assets/`;
|
|
279
|
+
|
|
280
|
+
const set = component.defaults?.imageData?.set || component.imageData?.set;
|
|
281
|
+
const newSet = {
|
|
282
|
+
'cropped-webp-100x200': { url: assetLocation + set?.MOBILE_WEBP_LOW_RES.url },
|
|
283
|
+
'cropped-webp-1000x2000': { url: assetLocation + set?.MOBILE_WEBP_HI_RES.url },
|
|
284
|
+
'webp-200x200': { url: assetLocation + set?.WEBP_LOW_RES.url },
|
|
285
|
+
'webp-2000x2000': { url: assetLocation + set?.WEBP_HI_2X_RES.url },
|
|
286
|
+
};
|
|
287
|
+
return {
|
|
288
|
+
[key]: {
|
|
289
|
+
set: newSet,
|
|
290
|
+
...(component.imageData?.borderInfo && { borderInfo: component.imageData.borderInfo }),
|
|
291
|
+
...(component.imageData && { bucket: {} }),
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
} catch (error) {
|
|
295
|
+
console.error(`[Preview] Failed to process image "${key}":`, error);
|
|
296
|
+
return {};
|
|
297
|
+
}
|
|
286
298
|
}
|
|
287
299
|
|
|
288
|
-
function processComponent(key: string, component: any, translations: any, sectionName?: string,
|
|
300
|
+
export function processComponent(key: string, component: any, translations: any, sectionName?: string,
|
|
289
301
|
isApiRender: boolean = false, extraParams?: Record<string, any>): any {
|
|
290
302
|
if (!component?.type) return {};
|
|
291
303
|
switch (component.type) {
|
|
@@ -347,6 +359,11 @@ function processComponent(key: string, component: any, translations: any, sectio
|
|
|
347
359
|
},
|
|
348
360
|
},
|
|
349
361
|
};
|
|
362
|
+
// Leaving PRODUCT_SELECTOR and CATEGORY_SELECTOR references for future implementation
|
|
363
|
+
case 'PRODUCT_SELECTOR':
|
|
364
|
+
return {};
|
|
365
|
+
case 'CATEGORY_SELECTOR':
|
|
366
|
+
return {};
|
|
350
367
|
default:
|
|
351
368
|
return {};
|
|
352
369
|
}
|
|
@@ -361,7 +378,7 @@ function getContentToRender(
|
|
|
361
378
|
isApiRender: boolean = false,
|
|
362
379
|
): any {
|
|
363
380
|
let deckCardLabel: string | undefined = undefined;
|
|
364
|
-
const parsedContent = Object.entries(content).reduce((acc, [k, c]) => {
|
|
381
|
+
const parsedContent = Object.entries(content || {}).reduce((acc, [k, c]) => {
|
|
365
382
|
if ((c as any).type === 'DECK') {
|
|
366
383
|
deckCardLabel = contentTranslations[(c as any).cards?.defaultCardContent?.label];
|
|
367
384
|
}
|
|
@@ -369,7 +386,7 @@ function getContentToRender(
|
|
|
369
386
|
}, {});
|
|
370
387
|
|
|
371
388
|
|
|
372
|
-
const parsedShowcase = Object.entries(showcase).reduce((acc, [k, c]) => {
|
|
389
|
+
const parsedShowcase = Object.entries(showcase || {}).reduce((acc, [k, c]) => {
|
|
373
390
|
return { ...acc, ...processComponent(k, c, showcaseTranslations, sectionName, isApiRender, {deckCardLabel}) };
|
|
374
391
|
}, {});
|
|
375
392
|
|
|
@@ -388,9 +405,22 @@ export function dropdownOptions(showcaseModules: Record<string, any>): Array<{ v
|
|
|
388
405
|
}
|
|
389
406
|
|
|
390
407
|
export function loadSectionCss(sectionName: string): void {
|
|
408
|
+
const cssHref = `${distFolderPath}/sections/${sectionName}/js/main/client/assets/client.css`;
|
|
409
|
+
|
|
410
|
+
// Check if CSS for this section is already loaded
|
|
411
|
+
const existingLink = document.querySelector(`link[href="${cssHref}"]`);
|
|
412
|
+
if (existingLink) {
|
|
413
|
+
return; // CSS already loaded
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// Remove CSS from other sections (cleanup)
|
|
417
|
+
const oldLinks = document.querySelectorAll('link[data-section-css]');
|
|
418
|
+
oldLinks.forEach(link => link.remove());
|
|
419
|
+
|
|
391
420
|
const link = document.createElement('link');
|
|
392
421
|
link.rel = 'stylesheet';
|
|
393
422
|
link.href = `${distFolderPath}/sections/${sectionName}/js/main/client/assets/client.css`;
|
|
423
|
+
link.setAttribute('data-section-css', sectionName);
|
|
394
424
|
document.head.appendChild(link);
|
|
395
425
|
}
|
|
396
426
|
|
|
@@ -436,12 +466,27 @@ export async function renderShowcase(sectionName: string, showcaseId: string): P
|
|
|
436
466
|
},
|
|
437
467
|
};
|
|
438
468
|
|
|
469
|
+
// Check if we're switching to a different section
|
|
470
|
+
const isSameSection = currentSectionName === sectionName;
|
|
471
|
+
|
|
439
472
|
// Mount or update app
|
|
440
|
-
if (currentApp) {
|
|
473
|
+
if (currentApp && isSameSection) {
|
|
474
|
+
// Same section, just update with new showcase data
|
|
441
475
|
currentApp.update(state);
|
|
442
476
|
} else {
|
|
477
|
+
// Different section or first load - unmount old app and mount new one
|
|
478
|
+
if (currentApp) {
|
|
479
|
+
currentApp.unmount();
|
|
480
|
+
// Clear the app container
|
|
481
|
+
const appContainer = document.getElementById('app');
|
|
482
|
+
if (appContainer) {
|
|
483
|
+
appContainer.innerHTML = '';
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
443
487
|
const { mount, update, unmount } = (client as any).default.init();
|
|
444
488
|
currentApp = { update, unmount };
|
|
489
|
+
currentSectionName = sectionName;
|
|
445
490
|
mount('#app', state);
|
|
446
491
|
}
|
|
447
492
|
}
|
|
@@ -71,7 +71,7 @@ const isCaptionVisible = computed<boolean>(() => captionDesign.visible ?? false)
|
|
|
71
71
|
const valueStyle = computed<CSSProperties>(() => ({
|
|
72
72
|
fontSize: `${valueDesign.size}px`,
|
|
73
73
|
fontFamily: valueDesign.font,
|
|
74
|
-
color: (valueDesign.color as Color)
|
|
74
|
+
color: (valueDesign.color as Color)?.hex,
|
|
75
75
|
fontStyle: valueDesign.italic ? 'italic' : 'normal',
|
|
76
76
|
fontWeight: valueDesign.bold ? 'bold' : 'normal',
|
|
77
77
|
}));
|
|
@@ -79,7 +79,7 @@ const valueStyle = computed<CSSProperties>(() => ({
|
|
|
79
79
|
const captionStyle = computed<CSSProperties>(() => ({
|
|
80
80
|
fontSize: `${captionDesign.size}px`,
|
|
81
81
|
fontFamily: captionDesign.font,
|
|
82
|
-
color: (captionDesign.color as Color)
|
|
82
|
+
color: (captionDesign.color as Color)?.hex,
|
|
83
83
|
fontStyle: captionDesign.italic ? 'italic' : 'normal',
|
|
84
84
|
fontWeight: captionDesign.bold ? 'bold' : 'normal',
|
|
85
85
|
}));
|
|
@@ -79,7 +79,7 @@ const slideImageStyles = computed<CSSProperties>(() => {
|
|
|
79
79
|
const slideTextStyles = computed<CSSProperties>(() => ({
|
|
80
80
|
fontSize: `${slideTextDesign.size}px`,
|
|
81
81
|
fontFamily: slideTextDesign.font,
|
|
82
|
-
color: (slideTextDesign.color as Color)
|
|
82
|
+
color: (slideTextDesign.color as Color)?.hex,
|
|
83
83
|
fontStyle: slideTextDesign.italic ? 'italic' : 'normal',
|
|
84
84
|
fontWeight: slideTextDesign.bold ? 'bold' : 'normal',
|
|
85
85
|
}));
|
|
@@ -37,7 +37,7 @@ const titleClass = computed(() => [
|
|
|
37
37
|
const titleStyle = computed<CSSProperties>(() => ({
|
|
38
38
|
fontSize: `${titleDesign.size}px`,
|
|
39
39
|
fontFamily: titleDesign.font,
|
|
40
|
-
color: (titleDesign.color as Color)
|
|
40
|
+
color: (titleDesign.color as Color)?.hex,
|
|
41
41
|
fontStyle: titleDesign.italic ? 'italic' : 'normal',
|
|
42
42
|
fontWeight: titleDesign.bold ? 'bold' : 'normal',
|
|
43
43
|
}));
|
|
@@ -45,7 +45,7 @@ const titleStyle = computed<CSSProperties>(() => ({
|
|
|
45
45
|
const descriptionStyle = computed<CSSProperties>(() => ({
|
|
46
46
|
fontSize: `${descriptionDesign.size}px`,
|
|
47
47
|
fontFamily: descriptionDesign.font,
|
|
48
|
-
color: (descriptionDesign.color as Color)
|
|
48
|
+
color: (descriptionDesign.color as Color)?.hex,
|
|
49
49
|
fontStyle: descriptionDesign.italic ? 'italic' : 'normal',
|
|
50
50
|
fontWeight: descriptionDesign.bold ? 'bold' : 'normal',
|
|
51
51
|
}));
|
|
@@ -35,6 +35,23 @@ export default {
|
|
|
35
35
|
image_content: {
|
|
36
36
|
type: 'IMAGE',
|
|
37
37
|
label: '$label.slide_content.label',
|
|
38
|
+
imageData: {
|
|
39
|
+
set: {
|
|
40
|
+
MOBILE_WEBP_LOW_RES: {
|
|
41
|
+
url: 'category_4.jpg',
|
|
42
|
+
},
|
|
43
|
+
MOBILE_WEBP_HI_RES: {
|
|
44
|
+
url: 'category_4@2x.jpg',
|
|
45
|
+
},
|
|
46
|
+
WEBP_LOW_RES: {
|
|
47
|
+
url: 'category_4@2x.jpg',
|
|
48
|
+
},
|
|
49
|
+
WEBP_HI_2X_RES: {
|
|
50
|
+
url: 'category_4@2x.jpg',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
borderInfo: {},
|
|
54
|
+
},
|
|
38
55
|
},
|
|
39
56
|
image_text: {
|
|
40
57
|
type: 'TEXTAREA',
|
|
@@ -14,7 +14,7 @@ const props = defineProps<{
|
|
|
14
14
|
const textStyle = computed<CSSProperties>(() => ({
|
|
15
15
|
fontSize: props.design.size ? `${props.design.size}px` : undefined,
|
|
16
16
|
fontFamily: props.design.font,
|
|
17
|
-
color: props.design.color ? (props.design.color as Color)
|
|
17
|
+
color: props.design.color ? (props.design.color as Color)?.hex : undefined,
|
|
18
18
|
fontStyle: props.design.italic ? 'italic' : 'normal',
|
|
19
19
|
fontWeight: props.design.bold ? 'bold' : 'normal',
|
|
20
20
|
}));
|
|
@@ -18,7 +18,7 @@ const titleDesign = useTextElementDesign<Design>('section_title');
|
|
|
18
18
|
const titleStyle = computed<CSSProperties>(() => ({
|
|
19
19
|
fontSize: `${titleDesign.size}px`,
|
|
20
20
|
fontFamily: titleDesign.font,
|
|
21
|
-
color: (titleDesign.color as Color)
|
|
21
|
+
color: (titleDesign.color as Color)?.hex,
|
|
22
22
|
fontStyle: titleDesign.italic ? 'italic' : 'normal',
|
|
23
23
|
fontWeigh: titleDesign.bold ? 'bold' : 'normal',
|
|
24
24
|
}));
|
|
@@ -26,6 +26,23 @@ export default {
|
|
|
26
26
|
image_content: {
|
|
27
27
|
type: 'IMAGE',
|
|
28
28
|
label: '$label.content.deck.highlighted_text_image_on_hover.label',
|
|
29
|
+
imageData: {
|
|
30
|
+
set: {
|
|
31
|
+
MOBILE_WEBP_LOW_RES: {
|
|
32
|
+
url: 'fall_is_here.jpg',
|
|
33
|
+
},
|
|
34
|
+
MOBILE_WEBP_HI_RES: {
|
|
35
|
+
url: 'fall_is_here_preview.jpg',
|
|
36
|
+
},
|
|
37
|
+
WEBP_LOW_RES: {
|
|
38
|
+
url: 'fall_is_here.jpg',
|
|
39
|
+
},
|
|
40
|
+
WEBP_HI_2X_RES: {
|
|
41
|
+
url: 'fall_is_here_preview.jpg',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
borderInfo: {},
|
|
45
|
+
},
|
|
29
46
|
},
|
|
30
47
|
},
|
|
31
48
|
},
|
|
@@ -34,5 +51,22 @@ export default {
|
|
|
34
51
|
section_image: {
|
|
35
52
|
type: 'IMAGE',
|
|
36
53
|
label: '$label.content.image_title.label',
|
|
54
|
+
imageData: {
|
|
55
|
+
set: {
|
|
56
|
+
MOBILE_WEBP_LOW_RES: {
|
|
57
|
+
url: 'fall_is_here.jpg',
|
|
58
|
+
},
|
|
59
|
+
MOBILE_WEBP_HI_RES: {
|
|
60
|
+
url: 'fall_is_here.jpg',
|
|
61
|
+
},
|
|
62
|
+
WEBP_LOW_RES: {
|
|
63
|
+
url: 'fall_is_here.jpg',
|
|
64
|
+
},
|
|
65
|
+
WEBP_HI_2X_RES: {
|
|
66
|
+
url: 'fall_is_here.jpg',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
borderInfo: {},
|
|
70
|
+
},
|
|
37
71
|
},
|
|
38
72
|
} as const;
|
|
@@ -18,7 +18,7 @@ const titleDesign = useTextElementDesign<Design>('section_title');
|
|
|
18
18
|
const titleStyle = computed(() => ({
|
|
19
19
|
fontSize: `${titleDesign.size}px`,
|
|
20
20
|
fontFamily: titleDesign.font,
|
|
21
|
-
color: (titleDesign.color as Color)
|
|
21
|
+
color: (titleDesign.color as Color)?.hex,
|
|
22
22
|
'font-style': titleDesign.italic ? 'italic' : 'normal',
|
|
23
23
|
'font-weight': titleDesign.bold ? 'bold' : 'normal',
|
|
24
24
|
}));
|