@gem-sdk/core 1.14.0-dev.584 → 1.14.0-dev.587
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.
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
} catch(err){}
|
|
14
14
|
</script>
|
|
15
15
|
`);return{cssCode:d,jsCode:a}},appendAnimation=(e,t)=>{let{advanced:r,tag:n}=e,{animation:i}=r??{},s=i?.desktop?.enabled||i?.tablet?.enabled||i?.mobile?.enabled;if(!s||!i?.desktop?.triggerConfig)return t;let d=(e,t)=>e?.triggerConfig?.[t]?.animation??"none",a=e=>{if("desktop"===e);else if("tablet"===e)return i?.tablet??i?.desktop;else if("mobile"===e)return i?.mobile??i?.tablet??i?.desktop;return i?.desktop},l=e=>+!(a(e)?.enabled&&!["shake","none"].includes(d(a(e),"appear"))),o={desktop:l("desktop"),tablet:l("tablet"),mobile:l("mobile")},c={all:"Section"===n?"":"inherit"};return render.template`
|
|
16
|
-
${render.RenderIf(convert.isLocalEnv,'<script src="{{ \'gp-animation.js\' | asset_url }}" defer="defer"></script>',`<script src="${convert.baseAssetURL}/assets/gp-animation.js" defer="defer"></script>`)}
|
|
16
|
+
${render.RenderIf(convert.isLocalEnv,'<script src="{{ \'gp-animation.js\' | asset_url }}" defer="defer"></script>',`<script src="${convert.baseAssetURL}/assets-v2/gp-animation.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
17
17
|
<gp-animation
|
|
18
18
|
gp-data='${JSON.stringify({config:i,tag:n})}'
|
|
19
19
|
style="${{...c}}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import{makeStyleResponsive as e}from"../helpers/make-style.js";import"react";import"react/jsx-runtime";import"zustand";import"swr";import"@gem-sdk/adapter-shopify";import"swr/mutation";import"vanilla-lazyload";import"../hooks/useCartUI.js";import"react-transition-group";import"@gem-sdk/core";import{RenderIf as t,template as r}from"../helpers/render.js";import{baseAssetURL as n,isLocalEnv as i}from"../helpers/convert.js";import{composeAdvanceStyle as s}from"../helpers/compose-advance-style.js";import{disableWrap as d,customRenderChildren as a}from"./constant.js";let componentsRenderWithParentId=["CarouselItem"],componentTexts=["Text","Heading"],componentIconList=["IconListV2","IconList"],componentUsingAdvanced=["IconList"],Render=({uid:e,builder:n,components:i,parentId:l,extraFiles:o={},pageContext:c,...p})=>{let u=n[e],m=i[u?.tag];if(!m)return console.log("Miss component: ",u),{liquid:"",extraFiles:o};if(!u||u?.type==="section")return{liquid:"",extraFiles:o};{let o={extraFiles:{}},g=s(u.advanced,u.tag),h="";h=d.includes(u.tag)?t(u?.childrens?.length,()=>m({builderProps:{uid:e,builderData:u},styles:u.styles,setting:u.settings,style:g,advanced:u.advanced,parentId:componentsRenderWithParentId.includes(u.tag)?l:null,pageContext:c,...p,rawChildren:u.childrens.map(e=>({...n[e],uid:e,builder:n,components:i,customProps:o,pageContext:c})),children:a.includes(u.tag)?"":WrapRenderChildren({uid:e,customProps:o},u.childrens.map(e=>RenderChildren({uid:e,builder:n,components:i,customProps:o,parentTag:u.tag,pageContext:c})))}),()=>m({builderProps:{uid:e,builderData:u},styles:u.styles,setting:u.settings,advanced:u.advanced,style:g,isText:!!componentTexts.includes(u.tag)||null,parentId:componentsRenderWithParentId.includes(u.tag)?l:null,pageContext:c,...p})):r`<div style="${componentIconList.includes(u.tag)?"":g}" class="${u.uid} ${u?.childrens?.length||"IconListItemHoz"!==u.tag?"":"hidden"}">
|
|
2
2
|
${t(u?.childrens?.length,()=>m({builderProps:{uid:e,builderData:u},styles:u.styles,setting:u.settings,advanced:{...componentUsingAdvanced.includes(u.tag)?u?.advanced:{},cssClass:u?.advanced?.cssClass},pageContext:c,...p,rawChildren:u.childrens.map(e=>({...n[e],uid:e,builder:n,components:i,customProps:o,pageContext:c})),children:a.includes(u.tag)?"":WrapRenderChildren({uid:e,customProps:o},u.childrens.map(e=>RenderChildren({uid:e,builder:n,components:i,customProps:o,parentTag:u.tag,pageContext:c})))}),()=>m({builderProps:{uid:e,builderData:u},styles:u.styles,setting:u.settings,advanced:{cssClass:u?.advanced?.cssClass},pageContext:c,isText:!!componentTexts.includes(u.tag)||null,style:componentIconList.includes(u.tag)?g:null,...p}))}
|
|
3
|
-
</div>`;let{cssCode:f,jsCode:
|
|
3
|
+
</div>`;let{cssCode:f,jsCode:v}=RenderCustomCode(u);return f&&(h+=f),v&&(h+=v),{liquid:h=appendAnimation(u,h),extraFiles:o.extraFiles}}},RenderCustomCode=e=>{let{css:n,javascript:i,rootClassName:s}=e.advanced?.editorData||{},d=n?.replaceAll(s,e.uid),a=i?.replaceAll(s,e.uid),l=t(!!n,r`
|
|
4
4
|
<style
|
|
5
5
|
id="${`custom-css-${e?.uid}`}"
|
|
6
6
|
>${d}</style>
|
|
@@ -13,7 +13,7 @@ import{makeStyleResponsive as e}from"../helpers/make-style.js";import"react";imp
|
|
|
13
13
|
} catch(err){}
|
|
14
14
|
</script>
|
|
15
15
|
`);return{cssCode:l,jsCode:o}},appendAnimation=(s,d)=>{let{advanced:a,tag:l}=s,{animation:o}=a??{},c=o?.desktop?.enabled||o?.tablet?.enabled||o?.mobile?.enabled;if(!c||!o?.desktop?.triggerConfig)return d;let p=(e,t)=>e?.triggerConfig?.[t]?.animation??"none",u=e=>{if("desktop"===e);else if("tablet"===e)return o?.tablet??o?.desktop;else if("mobile"===e)return o?.mobile??o?.tablet??o?.desktop;return o?.desktop},m=e=>+!(u(e)?.enabled&&!["shake","none"].includes(p(u(e),"appear"))),g={desktop:m("desktop"),tablet:m("tablet"),mobile:m("mobile")},h={all:"Section"===l?"":"inherit"};return r`
|
|
16
|
-
${t(i,'<script src="{{ \'gp-animation.js\' | asset_url }}" defer="defer"></script>',`<script src="${n}/assets/gp-animation.js" defer="defer"></script>`)}
|
|
16
|
+
${t(i,'<script src="{{ \'gp-animation.js\' | asset_url }}" defer="defer"></script>',`<script src="${n}/assets-v2/gp-animation.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
17
17
|
<gp-animation
|
|
18
18
|
gp-data='${JSON.stringify({config:o,tag:l})}'
|
|
19
19
|
style="${{...h}}"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1032,6 +1032,7 @@ type SizeSetting$1<T> = SharedControlType<T> & {
|
|
|
1032
1032
|
hiddenSettings?: SettingID[];
|
|
1033
1033
|
settingConfig?: Partial<Record<SettingID, SettingConfig>>;
|
|
1034
1034
|
hiddenShowMore?: boolean;
|
|
1035
|
+
sizePaddingInput?: 'normal' | 'small';
|
|
1035
1036
|
};
|
|
1036
1037
|
|
|
1037
1038
|
type ChildIconType<T> = SharedControlType<T> & {
|