@lightspeed/crane-api 1.0.0 → 1.0.1
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 +10 -0
- package/dist/index.d.mts +620 -620
- package/dist/index.d.ts +620 -620
- package/dist/index.mjs +1 -1
- package/package.json +2 -3
- package/types.d.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getCurrentInstance as ae,ref as O,computed as o,reactive as g,createSSRApp as re}from"vue";import{renderToString as ie}from"vue/server-renderer";const R=new Map;function d(){const e=(r,i,l,v,c,s,u)=>{R.set(r._uid,{context:O(i),content:O(l),design:O(v),defaults:O(c),site:O(s?.site??{}),category:O(s?.category),storeData:O(s?.storeData),globalDesign:O(u)})},t=(r,i,l,v,c,s)=>{const u=R.get(r._uid);u!==void 0&&(u.content.value=i,u.design.value=l,u.defaults.value=v,u.site.value=c.site??{},u.category.value=c.category,u.globalDesign.value=s,u.storeData.value=c.storeData)},n=ae()?.appContext.app._uid??-1,a=R.get(n);return{init:e,update:t,context:a?.context,content:a?.content,design:a?.design,defaults:a?.defaults,site:a?.site,category:a?.category,storeData:a?.storeData,globalDesign:a?.globalDesign}}function y(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return le(a,e)}function le(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not inputbox`)}}),a=o(()=>n.value!==void 0&&n.value.length>0),r=o(()=>n.value);return g({hasContent:a,value:r})}function A(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return ue(a,e)}function ue(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not textarea`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value);return g({hasContent:a,value:r})}const p={HYPER_LINK:"HYPER_LINK",SCROLL_TO_TILE:"SCROLL_TO_TILE",MAIL_LINK:"MAIL_LINK",TEL_LINK:"TEL_LINK",GO_TO_STORE:"GO_TO_STORE",GO_TO_STORE_LINK:"GO_TO_STORE_LINK",GO_TO_PAGE:"GO_TO_PAGE",GO_TO_CATEGORY:"GO_TO_CATEGORY",GO_TO_CATEGORY_LINK:"GO_TO_CATEGORY_LINK"};function se(e){if("tileId"in e)return e.tileId;if("tileIdForScroll"in e)return e.tileIdForScroll}function ce(e){if("pageId"in e)return e.pageId;if("pageIdForNavigate"in e)return e.pageIdForNavigate}function ve(e){if("pageUrl"in e)return e.pageUrl;switch(ce(e)){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}}function de(e){if("categoryId"in e)return e.categoryId}const G=(e,t,n)=>{if(!e||t)return;const{type:a,link:r,email:i,phone:l}=e,v=ve(e),c=de(e);switch(a){case p.HYPER_LINK:if(r)return()=>window.open(r,"_blank");break;case p.GO_TO_STORE:case p.GO_TO_STORE_LINK:return()=>window.open("/products","_self");case p.GO_TO_CATEGORY:case p.GO_TO_CATEGORY_LINK:const s=n?.find(u=>u.id===c)?.url;return s===void 0?()=>window.open("/404","_self"):()=>window.open(s,"_self");case p.MAIL_LINK:if(i)return()=>window.open(`mailto:${i}`,"_self");break;case p.TEL_LINK:if(l)return()=>window.open(`tel:${l}`,"_self");break;case p.SCROLL_TO_TILE:if(typeof document<"u")return()=>{const u=se(e);document.getElementById(`tile-${u}`)?.scrollIntoView()};break;case p.GO_TO_PAGE:if(v)return()=>window.open(v,"_self");break;default:console.error(`Unknown type of ActionLink: ${a}`)}};function Ee(e){return"title"in e&&"type"in e}function ge(e,t,n,a){const r=o(()=>{const b=e.value[t];if(b!==void 0){if(Ee(b))return b;throw new Error(`Element ${t} is not action link`)}}),i=o(()=>r.value?.title),l=o(()=>r.value?.type),v=o(()=>r.value?.link),c=o(()=>r.value?.email),s=o(()=>r.value?.phone),u=o(()=>r.value?.tileId?`tile-${r.value?.tileId}`:null),E=o(()=>r.value?.type==="GO_TO_STORE_LINK"?"products":r.value?.pageId),T=o(()=>r.value?.pageUrl),I=o(()=>!!i.value),m=o(()=>!!v.value),oe=G(r.value,n,a);return g({title:i,type:l,link:v,email:c,phone:s,tileDivId:u,pageId:E,pageUrl:T,hasTitle:I,hasLink:m,performAction:oe})}function N(e,t){const n=d(),a=o(()=>!!n.site?.value?.isPreviewMode),r=o(()=>n.category?.value?.categories??[]),i=o(()=>t!==void 0?t:n.content.value!==void 0?n.content.value:{});return ge(i,e,a.value,r.value)}function Te(e){return"bucket"in e&&"borderInfo"in e&&"set"in e}function L(e,t){const n=new RegExp(/^https?:\/\//);return e!=null&&n.test(e)?e:`${t}/${e}`}function D(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return fe(a,e)}function fe(e,t){const n=o(()=>{const s=e.value[t];if(s!==void 0){if(Te(s))return s;throw new Error(`Element ${t} is not image`)}}),a=o(()=>n.value===void 0?"":d().context.value.imageBuckets?.[n.value?.bucket]),r=o(()=>n.value!==void 0),i=o(()=>L(n.value?.set?.["cropped-webp-100x200"]?.url,a.value)),l=o(()=>L(n.value?.set?.["cropped-webp-1000x2000"]?.url,a.value)),v=o(()=>L(n.value?.set?.["webp-200x200"]?.url,a.value)),c=o(()=>L(n.value?.set?.["webp-2000x2000"]?.url,a.value));return g({hasContent:r,lowResolutionMobileImage:i,highResolutionMobileImage:l,lowResolutionDesktopImage:v,highResolutionDesktopImage:c})}function pe(e){return"enabled"in e}function h(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return Oe(a,e)}function Oe(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(pe(i))return i;throw new Error(`Element ${t} is not toggle`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value?.enabled);return g({hasContent:a,value:r})}function w(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return Ie(a,e)}function Ie(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not selectbox`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value);return g({hasContent:a,value:r})}function me(e){return e!==null&&"items"in e}function M(e){const t=d(),n=o(()=>{const l=t.content.value[e];if(l!==void 0){if(me(l))return l;throw new Error(`Element ${e} is not an menu`)}}),a=o(()=>!!t.site?.value?.isPreviewMode),r=o(()=>n.value!==void 0),i=o(()=>n.value?.items?n.value.items.map(l=>({...l,performAction:G(l,a.value)})):[]);return g({hasContent:r,items:i})}const Le="menu";function _e(){return M(Le)}var B=(e=>(e.INPUTBOX="INPUTBOX",e.TEXTAREA="TEXTAREA",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e))(B||{});function Ce(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.cards)&&t.cards.every(n=>typeof n.settings=="object"&&n.settings!==null)}function be(e){const t=d(),n=o(()=>{const i=t.content.value[e];if(i!==void 0){if(Ce(i))return i;throw new Error(`Element ${e} is not of DECK type`)}}),a=o(()=>n.value!==void 0&&n.value.cards.length>0),r=o(()=>n.value?.cards);return g({hasContent:a,cards:r,getReactiveRef:Re})}function Re(e,t,n){if(e==null)throw Error("Could not get a reactive ref for undefined Card");const a=e.settings[n];if(a===void 0)return a;switch(t){case"TEXTAREA":return A(n,e.settings);case"INPUTBOX":return y(n,e.settings);case"SELECTBOX":return w(n,e.settings);case"IMAGE":return D(n,e.settings);case"TOGGLE":return h(n,e.settings);case"BUTTON":return N(n,e.settings);default:return}}function Se(e){return"type"in e&&("text"in e||"image"in e)}function _(e,t){const n=new RegExp(/^https?:\/\//);return e!==void 0&&n.test(e)?e:`${t}/${e}`}function ye(){const e=d(),t=o(()=>{const l=e.content.value.logo;if(l!==void 0){if(Se(l))return l;throw new Error("Element logo is not LOGO")}}),n=o(()=>t.value?.type),a=o(()=>t.value?.text),r=o(()=>t.value?.image===void 0?"":e.context.value.imageBuckets?.[t.value.image.bucket]),i=o(()=>({lowResolutionMobileImage:_(t.value?.image?.set?.["cropped-webp-100x200"]?.url,r.value),highResolutionMobileImage:_(t.value?.image?.set?.["cropped-webp-1000x2000"]?.url,r.value),lowResolutionDesktopImage:_(t.value?.image?.set?.["webp-200x200"]?.url,r.value),highResolutionDesktopImage:_(t.value?.image?.set?.["webp-2000x2000"]?.url,r.value)}));return g({type:n,text:a,image:i})}function U({content:e,elementName:t,errorMessage:n,validatorFn:a}){return o(()=>{const r=e.value?.[t];if(r!==void 0){if(a(r))return r;throw new Error(n)}})}function Ae(e){return typeof e=="object"&&e!==null&&"categories"in e}function Ge(e){return o(()=>e.value.reduce((t,n)=>(t[n.id]=n,t),{}))}function Ne(e){return e!==void 0}function De(e){return!!e?.trim()}function he({name:e,customName:t,selectionType:n}){return n==="ROOT"?e:De(t)?t:e}function we(e,t){return Ne(e)&&t}function P({itemId:e,id:t,alt:n,name:a,nameTranslated:r,customName:i,enabled:l,productsCount:v,url:c,imageUrl:s,thumbnailImageUrl:u,imageBorderInfo:E,selectionType:T}){return{itemId:e||t.toString(),id:t,alt:n,name:he({name:a,customName:i,selectionType:T}),nameTranslated:r,label:a,enabled:l,url:c,productsCount:v,imageUrl:s,thumbnailImageUrl:u,imageBorderInfo:E,showCategory:we(t,l)}}function Me(e){const t=d(),n=o(()=>t.content.value),a=U({content:n,elementName:e,errorMessage:`Element ${e} is not a category selector type`,validatorFn:Ae}),r=o(()=>t.storeData?.value),i=o(()=>a.value?.categories.selectionType??"ROOT"),l=o(()=>r.value?.categories??[]),v=o(()=>a.value?.categories?.categoryIds??[]),c=o(()=>{const E=Ge(l);return i.value==="MANUAL"?a.value?.categories?.items?.map(T=>{const I=E.value[T.id];return P({...T,...I,selectionType:i.value})})??[]:r?.value?.categories.map(T=>P({...T,selectionType:i.value}))??[]}),s=o(()=>a.value!==void 0),u=o(()=>c.value!==void 0&&c.value.length>0);return g({categories:c,categoryIds:v,hasContent:s,hasCategories:u})}function Be(e){return typeof e=="object"&&e!==null&&("products"in e||"product"in e)}function Ue(e){const t=d(),n=o(()=>t.content.value),a=U({content:n,elementName:e,errorMessage:`Element ${e} is not a product selector type`,validatorFn:Be}),r=o(()=>t.storeData?.value),i=o(()=>a.value?.products?.selectionType??"MANUAL"),l=o(()=>a.value?.products?.productIds??[]),v=o(()=>a.value?.product?.id),c=o(()=>a.value?.categoryId),s=o(()=>{if(l.value&&c.value&&i.value==="CATEGORY")return r?.value?.products.filter(m=>m?.defaultCategoryId===c.value)??[];if(typeof c.value=="number"&&c.value===0&&i.value==="CATEGORY")return r?.value?.products??[];const I=v.value?[v.value]:l.value??[];return r?.value?.products.filter(m=>I.includes(m.id))??[]}),u=o(()=>r?.value?.categories.filter(I=>I.id===c?.value)??[]),E=o(()=>a.value!==void 0),T=o(()=>s.value!==void 0&&s.value.length>0);return g({products:s,categories:u,categoryId:c,hasContent:E,hasProducts:T})}function Pe(){return globalThis.craneSharedTranslation??{}}function xe(){const e=d(),t=o(()=>e.site?.value),n=o(()=>Pe()),a=o(()=>{const r=t.value?.languages;return r?r.find(i=>i.selected)?.code??r.find(i=>i.main)?.code??"en":"en"});return{t:r=>{const i=n.value;if(!i||Object.keys(i).length===0)return r;const l=a.value,v=i[l]?.[r];if(v!==void 0)return v;if(l!=="en"){const c=i.en?.[r];if(c!==void 0)return c}return r},currentLanguageCode:a}}function x(e,t){if(t===void 0)return;if(!t.startsWith("global."))return t.replaceAll("_"," ");const n=t.split(".").at(2);if(n!==void 0)return e.fontFamily?e.fontFamily[n].replaceAll("_"," "):void 0}function C(e,t,n){return t?x(e,t):x(e,n)}function k(e,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const n=t.split(".").at(2);if(n!==void 0)return e.textSize?e.textSize[n]:void 0}function S(e,t,n){return t?k(e,t):k(e,n)}function K(e,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const n=t.split(".").at(2);if(n!==void 0)return e.color?e.color[n]:void 0}function f(e,t,n){return t?K(e,t):K(e,n)}function ke(e,t,n){return{visible:t?.visible??n?.visible??!1,width:t?.width??n?.width??1,color:f(e,t?.color,n?.color)}}function Ke(e){const t=d(),n=o(()=>{const s=t.design.value[e],u=t.defaults.value[e],E=t.globalDesign.value;return{font:C(E,s?.font,u?.font),size:S(E,s?.size,u?.size),bold:s?.bold??u?.bold,italic:s?.italic??u?.italic,color:f(E,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),a=o(()=>n.value?.font),r=o(()=>n.value?.size),i=o(()=>n.value?.bold),l=o(()=>n.value?.italic),v=o(()=>n.value?.color),c=o(()=>n.value?.visible);return g({font:a,size:r,bold:i,italic:l,color:v,visible:c})}function $e(e){const t=d(),n=o(()=>{const u=t.design.value[e],E=t.defaults.value[e],T=t.globalDesign.value;return{font:C(T,u?.font,E?.font),size:S(T,u?.size,E?.size),bold:u?.bold??E?.bold,italic:u?.italic??E?.italic,color:f(T,u?.color,E?.color),visible:u?.visible??E?.visible??!1,whiteSpace:"pre-wrap"}}),a=o(()=>n.value?.font),r=o(()=>n.value?.size),i=o(()=>n.value?.bold),l=o(()=>n.value?.italic),v=o(()=>n.value?.color),c=o(()=>n.value?.visible),s=o(()=>n.value?.whiteSpace);return g({font:a,size:r,bold:i,italic:l,color:v,visible:c,whiteSpace:s})}function ze(e){const t=d(),n=o(()=>{const s=t.design.value[e],u=t.defaults.value[e],E=t.globalDesign.value;return{appearance:s?.appearance??u?.appearance,font:C(E,s?.font,u?.font),size:s?.size??u?.size,style:s?.style??u?.style,color:f(E,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),a=o(()=>n.value?.appearance),r=o(()=>n.value?.font),i=o(()=>n.value?.size),l=o(()=>n.value?.style),v=o(()=>n.value?.color),c=o(()=>n.value?.visible);return g({appearance:a,font:r,size:i,style:l,color:v,visible:c})}function Xe(e){const t=d(),n=o(()=>{const i=t.design.value[e],l=t.defaults.value[e],v=t.globalDesign.value;return{overlay:{type:i?.overlay?.type??l?.overlay?.type,solid:{color:f(v,i?.overlay?.solid?.color,l?.overlay?.solid?.color)},gradient:{fromColor:f(v,i?.overlay?.gradient?.fromColor,l?.overlay?.gradient?.fromColor),toColor:f(v,i?.overlay?.gradient?.toColor,l?.overlay?.gradient?.toColor)}},visible:i?.visible??l?.visible??!1}}),a=o(()=>n.value?.overlay),r=o(()=>n.value?.visible);return g({overlay:a,visible:r})}function Fe(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e];return{enabled:r?.enabled??i?.enabled}}),a=o(()=>n.value?.enabled);return g({enabled:a})}function Ye(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e];return{value:r?.value??i?.value}}),a=o(()=>n.value?.value);return g({value:a})}function We(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e],l=t.globalDesign.value;return{background:{type:r?.background?.type??i?.background?.type,solid:{color:f(l,r?.background?.solid?.color,i?.background?.solid?.color)},gradient:{fromColor:f(l,r?.background?.gradient?.fromColor,i?.background?.gradient?.fromColor),toColor:f(l,r?.background?.gradient?.toColor,i?.background?.gradient?.toColor)}}}}),a=o(()=>n.value?.background);return g({background:a})}function Ve(){const e=d(),t=o(()=>e.design.value.layout),n=o(()=>t.value);return g({layout:n})}function He(){const e=d();return o(()=>{const t=e.design.value.logo,n=e.defaults.value.logo,a=e.globalDesign.value;return{font:C(a,t?.font,n?.font),size:S(a,t?.size,n?.size),bold:t?.bold??n?.bold,italic:t?.italic??n?.italic,color:f(a,t?.color,n?.color),visible:t?.visible??n?.visible??!1,spacing:t?.spacing??n?.spacing??0,capitalization:t?.capitalization??n?.capitalization??"none",frame:ke(a,t?.frame,n?.frame)}})}function $(e){return{app:re(e)}}function je(e,t){return{init:()=>{const{app:n}=$(e);return t?.init?.(n),{render:async(a,r)=>(d().init(n,a,r.content,r.design,r.defaults,r.externalContent,a.globalDesign),t?.render?.(n,a,r),{html:await ie(n,{context:a}),state:{context:a,data:r}})}}}}function Je(e,t){return{init:()=>{const{app:n}=$(e);return t?.init?.(n),{mount:(a,r)=>{d().init(n,r.context,r.data.content,r.data.design,r.data.defaults,r.data.externalContent,r.context.globalDesign),t?.mount?.(n,a,r),n.mount(a)},update:a=>{d().update(n,a.data.content,a.data.design,a.data.defaults,a.data.externalContent,a.context.globalDesign),t?.update?.(n,a)},unmount:()=>{t?.unmount?.(n),n.unmount()}}}}}function qe(){return globalThis.window.instantsite}var z=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(z||{}),X=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e.NONE="NONE",e))(X||{}),F=(e=>(e.SOLID="SOLID",e.OUTLINE="OUTLINE",e.TEXT="TEXT",e))(F||{}),Y=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(Y||{}),W=(e=>(e.ROUND_CORNER="ROUND_CORNER",e.RECTANGLE="RECTANGLE",e.PILL="PILL",e))(W||{}),V=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e))(V||{}),H=(e=>(e.SECTION="SECTION",e.HEADER="HEADER",e.FOOTER="FOOTER",e))(H||{}),j=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e[e.Layout=3]="Layout",e[e.Asset=4]="Asset",e[e.SharedFiles=5]="SharedFiles",e))(j||{}),J=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.PageTemplateDescriptor=6]="PageTemplateDescriptor",e[e.TemplateAsset=7]="TemplateAsset",e[e.Layout=8]="Layout",e[e.LayoutSettings=9]="LayoutSettings",e[e.LayoutAsset=10]="LayoutAsset",e[e.SlotServer=11]="SlotServer",e[e.SlotClient=12]="SlotClient",e[e.SharedTranslation=13]="SharedTranslation",e))(J||{}),q=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE="GO_TO_STORE",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(q||{}),Qe=(e=>(e.TEXTAREA="TEXTAREA",e.INPUTBOX="INPUTBOX",e.SELECTBOX="SELECTBOX",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.BUTTON="BUTTON",e.DECK="DECK",e.MENU="MENU",e.NAVIGATION_MENU="NAVIGATION_MENU",e.LOGO="LOGO",e.INFO="INFO",e.DIVIDER="DIVIDER",e))(Qe||{}),Q=(e=>(e.TEXT="TEXT",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e.BACKGROUND="BACKGROUND",e.COLOR_PICKER="COLOR_PICKER",e.LOGO="LOGO",e.DIVIDER="DIVIDER",e))(Q||{}),Z=(e=>(e.PRODUCT="PRODUCT",e.CATALOG="CATALOG",e.CATEGORY="CATEGORY",e.HOME="HOME",e.CUSTOM="CUSTOM",e))(Z||{}),ee=(e=>(e.CONTENT="Content",e.DESIGN="Design",e))(ee||{}),te=(e=>(e.ORIGINAL="original",e.WEBP_LOW_RES="webp-200x200",e.WEBP_HI_2X_RES="webp-2000x2000",e.MOBILE_WEBP_LOW_RES="cropped-webp-100x200",e.MOBILE_WEBP_HI_RES="cropped-webp-1000x2000",e))(te||{}),ne=(e=>(e.TILE_LOADED="tile-loaded",e.TILE_UNLOADED="tile-unloaded",e))(ne||{});const Ze={PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"},et={CATEGORY_TITLE:"MAIN_TITLE",PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"},tt={TOP_BAR:"TOP_BAR",GALLERY:"GALLERY",SIDEBAR:"SIDEBAR",DESCRIPTION:"DESCRIPTION",REVIEW_LIST:"REVIEW_LIST",RELATED_PRODUCTS:"RELATED_PRODUCTS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"};export{q as ActionLinkTypeEnum,V as BackgroundStyleEnum,F as ButtonAppearanceEnum,W as ButtonShapeEnum,Y as ButtonSizeEnum,z as ButtonTypeEnum,Ze as CatalogLayoutSlot,et as CategoryLayoutSlot,J as ConfigTypeEnum,Q as DesignEditorType,B as EditorTypes,te as ImageSet,ne as InstantsiteJsEvent,X as OverlayTypeEnum,j as PluginTypeEnum,tt as ProductLayoutSlot,H as SectionTypeEnum,Z as TemplatePageEnum,ee as ValidationTypeEnum,Je as createVueClientApp,je as createVueServerApp,We as useBackgroundElementDesign,N as useButtonElementContent,ze as useButtonElementDesign,Me as useCategorySelectorElementContent,be as useDeckElementContent,D as useImageElementContent,Xe as useImageElementDesign,y as useInputboxElementContent,qe as useInstantsiteJsApi,Ve as useLayoutElementDesign,ye as useLogoElementContent,He as useLogoElementDesign,M as useMenuElementContent,_e as useNavigationMenuElementContent,Ue as useProductSelectorElementContent,w as useSelectboxElementContent,Ye as useSelectboxElementDesign,Ke as useTextElementDesign,A as useTextareaElementContent,$e as useTextareaElementDesign,h as useToggleElementContent,Fe as useToggleElementDesign,xe as useTranslation,d as useVueBaseProps};
|
|
1
|
+
import{getCurrentInstance as ae,ref as O,computed as o,reactive as E,createSSRApp as re}from"vue";import{renderToString as ie}from"vue/server-renderer";const p={HYPER_LINK:"HYPER_LINK",SCROLL_TO_TILE:"SCROLL_TO_TILE",MAIL_LINK:"MAIL_LINK",TEL_LINK:"TEL_LINK",GO_TO_STORE:"GO_TO_STORE",GO_TO_STORE_LINK:"GO_TO_STORE_LINK",GO_TO_PAGE:"GO_TO_PAGE",GO_TO_CATEGORY:"GO_TO_CATEGORY",GO_TO_CATEGORY_LINK:"GO_TO_CATEGORY_LINK"};function le(e){if("tileId"in e)return e.tileId;if("tileIdForScroll"in e)return e.tileIdForScroll}function ue(e){if("pageId"in e)return e.pageId;if("pageIdForNavigate"in e)return e.pageIdForNavigate}function se(e){if("pageUrl"in e)return e.pageUrl;switch(ue(e)){case"products":return"/products";case"cart":return"/cart";case"account":return"/account";case"search":return"/search";case"home":default:return"/"}}function ce(e){if("categoryId"in e)return e.categoryId}const y=(e,t,n)=>{if(!e||t)return;const{type:a,link:r,email:i,phone:l}=e,v=se(e),c=ce(e);switch(a){case p.HYPER_LINK:if(r)return()=>window.open(r,"_blank");break;case p.GO_TO_STORE:case p.GO_TO_STORE_LINK:return()=>window.open("/products","_self");case p.GO_TO_CATEGORY:case p.GO_TO_CATEGORY_LINK:const s=n?.find(u=>u.id===c)?.url;return s===void 0?()=>window.open("/404","_self"):()=>window.open(s,"_self");case p.MAIL_LINK:if(i)return()=>window.open(`mailto:${i}`,"_self");break;case p.TEL_LINK:if(l)return()=>window.open(`tel:${l}`,"_self");break;case p.SCROLL_TO_TILE:if(typeof document<"u")return()=>{const u=le(e);document.getElementById(`tile-${u}`)?.scrollIntoView()};break;case p.GO_TO_PAGE:if(v)return()=>window.open(v,"_self");break;default:console.error(`Unknown type of ActionLink: ${a}`)}},R=new Map;function d(){const e=(r,i,l,v,c,s,u)=>{R.set(r._uid,{context:O(i),content:O(l),design:O(v),defaults:O(c),site:O(s?.site??{}),category:O(s?.category),storeData:O(s?.storeData),globalDesign:O(u)})},t=(r,i,l,v,c,s)=>{const u=R.get(r._uid);u!==void 0&&(u.content.value=i,u.design.value=l,u.defaults.value=v,u.site.value=c.site??{},u.category.value=c.category,u.globalDesign.value=s,u.storeData.value=c.storeData)},n=ae()?.appContext.app._uid??-1,a=R.get(n);return{init:e,update:t,context:a?.context,content:a?.content,design:a?.design,defaults:a?.defaults,site:a?.site,category:a?.category,storeData:a?.storeData,globalDesign:a?.globalDesign}}function ve(e){return"title"in e&&"type"in e}function de(e,t,n,a){const r=o(()=>{const b=e.value[t];if(b!==void 0){if(ve(b))return b;throw new Error(`Element ${t} is not action link`)}}),i=o(()=>r.value?.title),l=o(()=>r.value?.type),v=o(()=>r.value?.link),c=o(()=>r.value?.email),s=o(()=>r.value?.phone),u=o(()=>r.value?.tileId?`tile-${r.value?.tileId}`:null),g=o(()=>r.value?.type==="GO_TO_STORE_LINK"?"products":r.value?.pageId),T=o(()=>r.value?.pageUrl),I=o(()=>!!i.value),L=o(()=>!!v.value),oe=y(r.value,n,a);return E({title:i,type:l,link:v,email:c,phone:s,tileDivId:u,pageId:g,pageUrl:T,hasTitle:I,hasLink:L,performAction:oe})}function A(e,t){const n=d(),a=o(()=>!!n.site?.value?.isPreviewMode),r=o(()=>n.category?.value?.categories??[]),i=o(()=>t!==void 0?t:n.content.value!==void 0?n.content.value:{});return de(i,e,a.value,r.value)}function G({content:e,elementName:t,errorMessage:n,validatorFn:a}){return o(()=>{const r=e.value?.[t];if(r!==void 0){if(a(r))return r;throw new Error(n)}})}function ge(e){return typeof e=="object"&&e!==null&&"categories"in e}function Ee(e){return o(()=>e.value.reduce((t,n)=>(t[n.id]=n,t),{}))}function Te(e){return e!==void 0}function fe(e){return!!e?.trim()}function pe({name:e,customName:t,selectionType:n}){return n==="ROOT"?e:fe(t)?t:e}function Oe(e,t){return Te(e)&&t}function N({itemId:e,id:t,alt:n,name:a,nameTranslated:r,customName:i,enabled:l,productsCount:v,url:c,imageUrl:s,thumbnailImageUrl:u,imageBorderInfo:g,selectionType:T}){return{itemId:e||t.toString(),id:t,alt:n,name:pe({name:a,customName:i,selectionType:T}),nameTranslated:r,label:a,enabled:l,url:c,productsCount:v,imageUrl:s,thumbnailImageUrl:u,imageBorderInfo:g,showCategory:Oe(t,l)}}function Ie(e){const t=d(),n=o(()=>t.content.value),a=G({content:n,elementName:e,errorMessage:`Element ${e} is not a category selector type`,validatorFn:ge}),r=o(()=>t.storeData?.value),i=o(()=>a.value?.categories.selectionType??"ROOT"),l=o(()=>r.value?.categories??[]),v=o(()=>a.value?.categories?.categoryIds??[]),c=o(()=>{const g=Ee(l);return i.value==="MANUAL"?a.value?.categories?.items?.map(T=>{const I=g.value[T.id];return N({...T,...I,selectionType:i.value})})??[]:r?.value?.categories.map(T=>N({...T,selectionType:i.value}))??[]}),s=o(()=>a.value!==void 0),u=o(()=>c.value!==void 0&&c.value.length>0);return E({categories:c,categoryIds:v,hasContent:s,hasCategories:u})}function Le(e){return"bucket"in e&&"borderInfo"in e&&"set"in e}function m(e,t){const n=new RegExp(/^https?:\/\//);return e!=null&&n.test(e)?e:`${t}/${e}`}function D(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return me(a,e)}function me(e,t){const n=o(()=>{const s=e.value[t];if(s!==void 0){if(Le(s))return s;throw new Error(`Element ${t} is not image`)}}),a=o(()=>n.value===void 0?"":d().context.value.imageBuckets?.[n.value?.bucket]),r=o(()=>n.value!==void 0),i=o(()=>m(n.value?.set?.["cropped-webp-100x200"]?.url,a.value)),l=o(()=>m(n.value?.set?.["cropped-webp-1000x2000"]?.url,a.value)),v=o(()=>m(n.value?.set?.["webp-200x200"]?.url,a.value)),c=o(()=>m(n.value?.set?.["webp-2000x2000"]?.url,a.value));return E({hasContent:r,lowResolutionMobileImage:i,highResolutionMobileImage:l,lowResolutionDesktopImage:v,highResolutionDesktopImage:c})}function h(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return _e(a,e)}function _e(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not inputbox`)}}),a=o(()=>n.value!==void 0&&n.value.length>0),r=o(()=>n.value);return E({hasContent:a,value:r})}function w(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return Ce(a,e)}function Ce(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not selectbox`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value);return E({hasContent:a,value:r})}function M(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return be(a,e)}function be(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(typeof i=="string")return i;throw new Error(`Element ${t} is not textarea`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value);return E({hasContent:a,value:r})}function Re(e){return"enabled"in e}function B(e,t){const n=d(),a=o(()=>t!==void 0?t:n.content.value);return Se(a,e)}function Se(e,t){const n=o(()=>{const i=e.value[t];if(i!==void 0){if(Re(i))return i;throw new Error(`Element ${t} is not toggle`)}}),a=o(()=>n.value!==void 0),r=o(()=>n.value?.enabled);return E({hasContent:a,value:r})}var U=(e=>(e.INPUTBOX="INPUTBOX",e.TEXTAREA="TEXTAREA",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e))(U||{});function ye(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.cards)&&t.cards.every(n=>typeof n.settings=="object"&&n.settings!==null)}function Ae(e){const t=d(),n=o(()=>{const i=t.content.value[e];if(i!==void 0){if(ye(i))return i;throw new Error(`Element ${e} is not of DECK type`)}}),a=o(()=>n.value!==void 0&&n.value.cards.length>0),r=o(()=>n.value?.cards);return E({hasContent:a,cards:r,getReactiveRef:Ge})}function Ge(e,t,n){if(e==null)throw Error("Could not get a reactive ref for undefined Card");const a=e.settings[n];if(a===void 0)return a;switch(t){case"TEXTAREA":return M(n,e.settings);case"INPUTBOX":return h(n,e.settings);case"SELECTBOX":return w(n,e.settings);case"IMAGE":return D(n,e.settings);case"TOGGLE":return B(n,e.settings);case"BUTTON":return A(n,e.settings);default:return}}function Ne(e){return"type"in e&&("text"in e||"image"in e)}function _(e,t){const n=new RegExp(/^https?:\/\//);return e!==void 0&&n.test(e)?e:`${t}/${e}`}function De(){const e=d(),t=o(()=>{const l=e.content.value.logo;if(l!==void 0){if(Ne(l))return l;throw new Error("Element logo is not LOGO")}}),n=o(()=>t.value?.type),a=o(()=>t.value?.text),r=o(()=>t.value?.image===void 0?"":e.context.value.imageBuckets?.[t.value.image.bucket]),i=o(()=>({lowResolutionMobileImage:_(t.value?.image?.set?.["cropped-webp-100x200"]?.url,r.value),highResolutionMobileImage:_(t.value?.image?.set?.["cropped-webp-1000x2000"]?.url,r.value),lowResolutionDesktopImage:_(t.value?.image?.set?.["webp-200x200"]?.url,r.value),highResolutionDesktopImage:_(t.value?.image?.set?.["webp-2000x2000"]?.url,r.value)}));return E({type:n,text:a,image:i})}function he(e){return e!==null&&"items"in e}function P(e){const t=d(),n=o(()=>{const l=t.content.value[e];if(l!==void 0){if(he(l))return l;throw new Error(`Element ${e} is not an menu`)}}),a=o(()=>!!t.site?.value?.isPreviewMode),r=o(()=>n.value!==void 0),i=o(()=>n.value?.items?n.value.items.map(l=>({...l,performAction:y(l,a.value)})):[]);return E({hasContent:r,items:i})}const we="menu";function Me(){return P(we)}function Be(e){return typeof e=="object"&&e!==null&&("products"in e||"product"in e)}function Ue(e){const t=d(),n=o(()=>t.content.value),a=G({content:n,elementName:e,errorMessage:`Element ${e} is not a product selector type`,validatorFn:Be}),r=o(()=>t.storeData?.value),i=o(()=>a.value?.products?.selectionType??"MANUAL"),l=o(()=>a.value?.products?.productIds??[]),v=o(()=>a.value?.product?.id),c=o(()=>a.value?.categoryId?parseInt(a.value.categoryId,10):void 0),s=o(()=>{if(l.value&&c.value&&i.value==="CATEGORY")return r?.value?.products.filter(L=>L?.defaultCategoryId===c.value)??[];if(typeof c.value=="number"&&c.value===0&&i.value==="CATEGORY")return r?.value?.products??[];const I=v.value?[v.value]:l.value??[];return r?.value?.products.filter(L=>I.includes(L.id))??[]}),u=o(()=>r?.value?.categories.filter(I=>I.id===c?.value)??[]),g=o(()=>a.value!==void 0),T=o(()=>s.value!==void 0&&s.value.length>0);return E({products:s,categories:u,categoryId:c,hasContent:g,hasProducts:T})}function Pe(){return globalThis.craneSharedTranslation??{}}function xe(){const e=d(),t=o(()=>e.site?.value),n=o(()=>Pe()),a=o(()=>{const r=t.value?.languages;return r?r.find(i=>i.selected)?.code??r.find(i=>i.main)?.code??"en":"en"});return{t:r=>{const i=n.value;if(!i||Object.keys(i).length===0)return r;const l=a.value,v=i[l]?.[r];if(v!==void 0)return v;if(l!=="en"){const c=i.en?.[r];if(c!==void 0)return c}return r},currentLanguageCode:a}}function x(e,t){if(t===void 0)return;if(!t.startsWith("global."))return t.replaceAll("_"," ");const n=t.split(".").at(2);if(n!==void 0)return e.fontFamily?e.fontFamily[n].replaceAll("_"," "):void 0}function C(e,t,n){return t?x(e,t):x(e,n)}function k(e,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const n=t.split(".").at(2);if(n!==void 0)return e.textSize?e.textSize[n]:void 0}function S(e,t,n){return t?k(e,t):k(e,n)}function K(e,t){if(t===void 0)return;if(typeof t!="string"||!t.startsWith("global."))return t;const n=t.split(".").at(2);if(n!==void 0)return e.color?e.color[n]:void 0}function f(e,t,n){return t?K(e,t):K(e,n)}function ke(e,t,n){return{visible:t?.visible??n?.visible??!1,width:t?.width??n?.width??1,color:f(e,t?.color,n?.color)}}function Ke(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e],l=t.globalDesign.value;return{background:{type:r?.background?.type??i?.background?.type,solid:{color:f(l,r?.background?.solid?.color,i?.background?.solid?.color)},gradient:{fromColor:f(l,r?.background?.gradient?.fromColor,i?.background?.gradient?.fromColor),toColor:f(l,r?.background?.gradient?.toColor,i?.background?.gradient?.toColor)}}}}),a=o(()=>n.value?.background);return E({background:a})}function $e(e){const t=d(),n=o(()=>{const s=t.design.value[e],u=t.defaults.value[e],g=t.globalDesign.value;return{appearance:s?.appearance??u?.appearance,font:C(g,s?.font,u?.font),size:s?.size??u?.size,style:s?.style??u?.style,color:f(g,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),a=o(()=>n.value?.appearance),r=o(()=>n.value?.font),i=o(()=>n.value?.size),l=o(()=>n.value?.style),v=o(()=>n.value?.color),c=o(()=>n.value?.visible);return E({appearance:a,font:r,size:i,style:l,color:v,visible:c})}function ze(e){const t=d(),n=o(()=>{const i=t.design.value[e],l=t.defaults.value[e],v=t.globalDesign.value;return{overlay:{type:i?.overlay?.type??l?.overlay?.type,solid:{color:f(v,i?.overlay?.solid?.color,l?.overlay?.solid?.color)},gradient:{fromColor:f(v,i?.overlay?.gradient?.fromColor,l?.overlay?.gradient?.fromColor),toColor:f(v,i?.overlay?.gradient?.toColor,l?.overlay?.gradient?.toColor)}},visible:i?.visible??l?.visible??!1}}),a=o(()=>n.value?.overlay),r=o(()=>n.value?.visible);return E({overlay:a,visible:r})}function Xe(){const e=d(),t=o(()=>e.design.value.layout),n=o(()=>t.value);return E({layout:n})}function Fe(){const e=d();return o(()=>{const t=e.design.value.logo,n=e.defaults.value.logo,a=e.globalDesign.value;return{font:C(a,t?.font,n?.font),size:S(a,t?.size,n?.size),bold:t?.bold??n?.bold,italic:t?.italic??n?.italic,color:f(a,t?.color,n?.color),visible:t?.visible??n?.visible??!1,spacing:t?.spacing??n?.spacing??0,capitalization:t?.capitalization??n?.capitalization??"none",frame:ke(a,t?.frame,n?.frame)}})}function Ye(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e];return{value:r?.value??i?.value}}),a=o(()=>n.value?.value);return E({value:a})}function We(e){const t=d(),n=o(()=>{const s=t.design.value[e],u=t.defaults.value[e],g=t.globalDesign.value;return{font:C(g,s?.font,u?.font),size:S(g,s?.size,u?.size),bold:s?.bold??u?.bold,italic:s?.italic??u?.italic,color:f(g,s?.color,u?.color),visible:s?.visible??u?.visible??!1}}),a=o(()=>n.value?.font),r=o(()=>n.value?.size),i=o(()=>n.value?.bold),l=o(()=>n.value?.italic),v=o(()=>n.value?.color),c=o(()=>n.value?.visible);return E({font:a,size:r,bold:i,italic:l,color:v,visible:c})}function Ve(e){const t=d(),n=o(()=>{const u=t.design.value[e],g=t.defaults.value[e],T=t.globalDesign.value;return{font:C(T,u?.font,g?.font),size:S(T,u?.size,g?.size),bold:u?.bold??g?.bold,italic:u?.italic??g?.italic,color:f(T,u?.color,g?.color),visible:u?.visible??g?.visible??!1,whiteSpace:"pre-wrap"}}),a=o(()=>n.value?.font),r=o(()=>n.value?.size),i=o(()=>n.value?.bold),l=o(()=>n.value?.italic),v=o(()=>n.value?.color),c=o(()=>n.value?.visible),s=o(()=>n.value?.whiteSpace);return E({font:a,size:r,bold:i,italic:l,color:v,visible:c,whiteSpace:s})}function He(e){const t=d(),n=o(()=>{const r=t.design.value[e],i=t.defaults.value[e];return{enabled:r?.enabled??i?.enabled}}),a=o(()=>n.value?.enabled);return E({enabled:a})}function $(e){return{app:re(e)}}function je(e,t){return{init:()=>{const{app:n}=$(e);return t?.init?.(n),{mount:(a,r)=>{d().init(n,r.context,r.data.content,r.data.design,r.data.defaults,r.data.externalContent,r.context.globalDesign),t?.mount?.(n,a,r),n.mount(a)},update:a=>{d().update(n,a.data.content,a.data.design,a.data.defaults,a.data.externalContent,a.context.globalDesign),t?.update?.(n,a)},unmount:()=>{t?.unmount?.(n),n.unmount()}}}}}function Je(){return globalThis.window.instantsite}function qe(e,t){return{init:()=>{const{app:n}=$(e);return t?.init?.(n),{render:async(a,r)=>(d().init(n,a,r.content,r.design,r.defaults,r.externalContent,a.globalDesign),t?.render?.(n,a,r),{html:await ie(n,{context:a}),state:{context:a,data:r}})}}}}var z=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(z||{}),X=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e.NONE="NONE",e))(X||{}),F=(e=>(e.SOLID="SOLID",e.OUTLINE="OUTLINE",e.TEXT="TEXT",e))(F||{}),Y=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(Y||{}),W=(e=>(e.ROUND_CORNER="ROUND_CORNER",e.RECTANGLE="RECTANGLE",e.PILL="PILL",e))(W||{}),V=(e=>(e.COLOR="COLOR",e.GRADIENT="GRADIENT",e))(V||{}),H=(e=>(e.SECTION="SECTION",e.HEADER="HEADER",e.FOOTER="FOOTER",e))(H||{}),j=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.Misc=2]="Misc",e[e.Layout=3]="Layout",e[e.Asset=4]="Asset",e[e.SharedFiles=5]="SharedFiles",e))(j||{}),J=(e=>(e[e.Server=0]="Server",e[e.Client=1]="Client",e[e.SectionSetting=2]="SectionSetting",e[e.SectionShowcase=3]="SectionShowcase",e[e.SectionAsset=4]="SectionAsset",e[e.TemplateDescriptor=5]="TemplateDescriptor",e[e.PageTemplateDescriptor=6]="PageTemplateDescriptor",e[e.TemplateAsset=7]="TemplateAsset",e[e.Layout=8]="Layout",e[e.LayoutSettings=9]="LayoutSettings",e[e.LayoutAsset=10]="LayoutAsset",e[e.SlotServer=11]="SlotServer",e[e.SlotClient=12]="SlotClient",e[e.SharedTranslation=13]="SharedTranslation",e))(J||{}),q=(e=>(e.SCROLL_TO_TILE="SCROLL_TO_TILE",e.HYPER_LINK="HYPER_LINK",e.MAIL_LINK="MAIL_LINK",e.TEL_LINK="TEL_LINK",e.GO_TO_STORE="GO_TO_STORE",e.GO_TO_STORE_LINK="GO_TO_STORE_LINK",e.GO_TO_PAGE="GO_TO_PAGE",e))(q||{}),Qe=(e=>(e.TEXTAREA="TEXTAREA",e.INPUTBOX="INPUTBOX",e.SELECTBOX="SELECTBOX",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.BUTTON="BUTTON",e.DECK="DECK",e.MENU="MENU",e.NAVIGATION_MENU="NAVIGATION_MENU",e.LOGO="LOGO",e.INFO="INFO",e.DIVIDER="DIVIDER",e))(Qe||{}),Q=(e=>(e.TEXT="TEXT",e.BUTTON="BUTTON",e.IMAGE="IMAGE",e.TOGGLE="TOGGLE",e.SELECTBOX="SELECTBOX",e.BACKGROUND="BACKGROUND",e.COLOR_PICKER="COLOR_PICKER",e.LOGO="LOGO",e.DIVIDER="DIVIDER",e))(Q||{}),Z=(e=>(e.PRODUCT="PRODUCT",e.CATALOG="CATALOG",e.CATEGORY="CATEGORY",e.HOME="HOME",e.CUSTOM="CUSTOM",e))(Z||{}),ee=(e=>(e.CONTENT="Content",e.DESIGN="Design",e))(ee||{}),te=(e=>(e.ORIGINAL="original",e.WEBP_LOW_RES="webp-200x200",e.WEBP_HI_2X_RES="webp-2000x2000",e.MOBILE_WEBP_LOW_RES="cropped-webp-100x200",e.MOBILE_WEBP_HI_RES="cropped-webp-1000x2000",e))(te||{}),ne=(e=>(e.TILE_LOADED="tile-loaded",e.TILE_UNLOADED="tile-unloaded",e))(ne||{});const Ze={PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"},et={CATEGORY_TITLE:"MAIN_TITLE",PRODUCT_LIST:"CONTROLS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"},tt={TOP_BAR:"TOP_BAR",GALLERY:"GALLERY",SIDEBAR:"SIDEBAR",DESCRIPTION:"DESCRIPTION",REVIEW_LIST:"REVIEW_LIST",RELATED_PRODUCTS:"RELATED_PRODUCTS",BOTTOM_BAR:"FOOTER",CUSTOM_SLOT:"CUSTOM_SLOT"};export{q as ActionLinkTypeEnum,V as BackgroundStyleEnum,F as ButtonAppearanceEnum,W as ButtonShapeEnum,Y as ButtonSizeEnum,z as ButtonTypeEnum,Ze as CatalogLayoutSlot,et as CategoryLayoutSlot,J as ConfigTypeEnum,Q as DesignEditorType,U as EditorTypes,te as ImageSet,ne as InstantsiteJsEvent,X as OverlayTypeEnum,j as PluginTypeEnum,tt as ProductLayoutSlot,H as SectionTypeEnum,Z as TemplatePageEnum,ee as ValidationTypeEnum,je as createVueClientApp,qe as createVueServerApp,Ke as useBackgroundElementDesign,A as useButtonElementContent,$e as useButtonElementDesign,Ie as useCategorySelectorElementContent,Ae as useDeckElementContent,D as useImageElementContent,ze as useImageElementDesign,h as useInputboxElementContent,Je as useInstantsiteJsApi,Xe as useLayoutElementDesign,De as useLogoElementContent,Fe as useLogoElementDesign,P as useMenuElementContent,Me as useNavigationMenuElementContent,Ue as useProductSelectorElementContent,w as useSelectboxElementContent,Ye as useSelectboxElementDesign,We as useTextElementDesign,M as useTextareaElementContent,Ve as useTextareaElementDesign,B as useToggleElementContent,He as useToggleElementDesign,xe as useTranslation,d as useVueBaseProps};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightspeed/crane-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@jest/globals": "^30.0.4",
|
|
38
|
-
"@lightspeed/eslint-config
|
|
39
|
-
"@stylistic/eslint-plugin": "^5.1.0",
|
|
38
|
+
"@lightspeed/eslint-config": "workspace:*",
|
|
40
39
|
"@types/jest": "^30.0.0",
|
|
41
40
|
"@types/node": "^20.17.0",
|
|
42
41
|
"eslint": "^9.33.0",
|
package/types.d.ts
CHANGED