@gem-sdk/components 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/article/components/ArticleList.js +1 -1
- package/dist/cjs/article/components/ArticleList.liquid.js +11 -10
- package/dist/cjs/header/components/kind/basic/DesktopMenuItem.js +1 -1
- package/dist/cjs/header/components/kind/basic/MenuMobileItem.js +1 -1
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/article/components/ArticleList.liquid.js +11 -10
- package/dist/esm/header/components/kind/basic/DesktopMenuItem.js +1 -1
- package/dist/esm/header/components/kind/basic/MenuMobileItem.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),React=require("react"),ArticleNotFound=require("./ArticleNotFound.js");const ArticleList=e=>{let t=core.useEditorMode(),{styles:i,setting:r,className:l,children:o,builderProps:a,advanced:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),React=require("react"),ArticleNotFound=require("./ArticleNotFound.js");const ArticleList=e=>{let t=core.useEditorMode(),{styles:i,setting:r,className:l,children:o,builderProps:a,advanced:s,builderAttrs:n,style:d}=e??{},{articleSetting:c,numberOfArticle:u}=r??{},{articleIds:m,articlePickType:g}=c??{},{border:p,rounded:h,hasBoxShadow:b,boxShadow:y}=s??{},[x]=core.splitStyle(["pos","top","left","bottom","right","z","d"],d),j=core.composeAdvanceStyle({border:p,rounded:h,hasBoxShadow:b,boxShadow:y,"spacing-setting":s?.["spacing-setting"]}),v={first:m?.length||50,where:{baseIDIn:[...c?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},f={first:1,where:{baseID:c?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[R,S]=React.useState(!0),A=core.useBlogsQuery("latest"===g?f:null,{revalidateOnMount:!0}),D=core.useArticlesQuery("manually"===g?v:null,{revalidateOnMount:!0}),w=A.data?.blogs?.edges?.[0]?.node,T="manually"===g?D.isLoading:A.isLoading,k="manually"===g?D.isValidating:A.isValidating,B="manually"===g?D.error:A.error,P=A?.data?.blogs?.edges?.[0]?.node,L="latest"===g?core.flattenConnection(P?.articles):core.flattenConnection(D?.data?.articles),C=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),O="latest"===g?L?.filter((e,t)=>t<+(u||4)).map(e=>C(e,P)):"manually"===g&&c?.articleIds?.length?m?.map(e=>{let t=L?.find(t=>t?.baseID===e);return C(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):L.filter((e,t)=>t<(c?.numOfSelectedArticles||4)).map(e=>C(e,e?.blogs?.edges?.[0]?.node));return O?.length||T||"edit"!=t?jsxRuntime.jsxs("div",{...n,className:a?.builderData?.uid,style:x,children:[k||T?jsxRuntime.jsx(Loading.default,{}):B?jsxRuntime.jsxs("div",{children:["Error: ",B?.message]}):O?.length?jsxRuntime.jsx(core.ArticleListProvider,{styles:{horizontalGutter:i?.horizontalGutter,verticalGutter:i?.verticalGutter,spacing:i?.spacing,width:i?.width,height:i?.height},settings:{slidesToShow:r?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:O,children:jsxRuntime.jsx("div",{"data-id":a?.uid,className:"gp-relative",children:jsxRuntime.jsx("div",{style:{...j,...core.makeStyleWithDefault("w",core.makeWidth(i?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...core.makeStyleResponsive("rg",i?.horizontalGutter),...core.makeStyleResponsive("cg",i?.verticalGutter),...core.getStyleBackgroundByDevice(r?.background),...core.getGradientBgrStyleByDevice(r?.background),...core.makeStyleResponsive("gtc",{desktop:`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:r?.slideToShow?.tablet&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:r?.slideToShow?.mobile&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:core.cls(l,"gp-m-auto gp-grid gp-w-full"),children:O.map(e=>jsxRuntime.jsx(core.ArticleProvider,{article:e,readOnly:!0,children:jsxRuntime.jsx("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:core.isEmptyChildren(o)?jsxRuntime.jsx(ChildrenDroppable.default,{}):o})},e?.id))})})}):jsxRuntime.jsx("div",{children:"Articles not found"}),core.filterToolbarPreview(o,!0)]}):R?jsxRuntime.jsxs("div",{...n,className:a?.builderData?.uid,children:[jsxRuntime.jsx(ArticleNotFound.default,{blogHandle:w?.handle,onClose:()=>S(!1),articlePickType:g??"manually",children:o}),core.filterToolbarPreview(o,!0)]}):null};exports.default=ArticleList;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../common/helpers.js"),helpers=require("../../helpers.js");const ArticleList=e=>{let{styles:l,setting:t,className:i,children:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../common/helpers.js"),helpers=require("../../helpers.js");const ArticleList=e=>{let{styles:l,setting:t,className:i,children:r,builderProps:a,advanced:s,style:o}=e??{},{border:c,rounded:n,hasBoxShadow:g,boxShadow:d}=s??{},[p]=core.splitStyle(["pos","top","left","bottom","right","z","d"],o),m=core.composeAdvanceStyle({border:c,rounded:n,hasBoxShadow:g,boxShadow:d,"spacing-setting":s?.["spacing-setting"]}),u=t?.articleSetting,y=t?.articleOrderBy??"UPDATED_AT_REVERSE",b=u?.articlePickType??"manually",h="manually"===b&&u?.articleHandles?.length?u?.articleHandles:[],S="manually"===b&&u?.articleBlogTitles?.length?u?.articleBlogTitles:[],_=u?.blogHandle??"",v=helpers.convertUnitToNumber(t?.numberOfArticle,4);return core.template`
|
|
3
3
|
<div
|
|
4
|
-
|
|
4
|
+
style="${p}"
|
|
5
|
+
data-id="${a?.uid}"
|
|
5
6
|
items-repeat
|
|
6
7
|
>
|
|
7
|
-
<div style="${{...
|
|
8
|
+
<div style="${{...m,...core.makeStyleWithDefault("w",core.makeWidth(l?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...core.makeStyleResponsive("rg",l?.horizontalGutter),...core.makeStyleResponsive("cg",l?.verticalGutter),...core.getStyleBackgroundByDevice(t?.background),...core.getGradientBgrStyleByDevice(t?.background),...core.makeStyleResponsive("gtc",{desktop:`repeat(${core.getResponsiveValueByScreen(t?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:t?.slideToShow?.tablet&&`repeat(${core.getResponsiveValueByScreen(t?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:t?.slideToShow?.mobile&&`repeat(${core.getResponsiveValueByScreen(t?.slideToShow,"mobile")}, minmax(0, 1fr))`})}}"
|
|
8
9
|
class="${core.cls(i,"gp-grid !gp-m-auto gp-w-full",s?.cssClass)}"
|
|
9
10
|
>
|
|
10
11
|
{% liquid
|
|
11
|
-
assign articlePickType = '${
|
|
12
|
-
assign articleHandles = '${
|
|
13
|
-
assign articleBlogTitle = "${helpers$1.convertSpecialCharacter(
|
|
14
|
-
assign limit = "${"manually"===u
|
|
12
|
+
assign articlePickType = '${b}'
|
|
13
|
+
assign articleHandles = '${h.toString()}'| split: ","
|
|
14
|
+
assign articleBlogTitle = "${helpers$1.convertSpecialCharacter(S.toString())}" | split: ","
|
|
15
|
+
assign limit = "${"manually"===b?u?.articleIds?.length:v}"
|
|
15
16
|
assign blogTitle = ''
|
|
16
17
|
assign all_articles = null | sort
|
|
17
18
|
|
|
@@ -21,11 +22,11 @@
|
|
|
21
22
|
assign all_articles = all_articles | concat: articleByHandle
|
|
22
23
|
endfor
|
|
23
24
|
else
|
|
24
|
-
assign current_blog_handle = blogs['${
|
|
25
|
+
assign current_blog_handle = blogs['${_}']
|
|
25
26
|
if gp_enable_custom_dynamic_blog == true
|
|
26
27
|
assign current_blog_handle = blogs[blog.handle]
|
|
27
28
|
endif
|
|
28
|
-
assign all_articles = current_blog_handle.articles | limit: limit | sort: "${
|
|
29
|
+
assign all_articles = current_blog_handle.articles | limit: limit | sort: "${y.replace("_REVERSE","").toLowerCase()}" ${y.includes("_REVERSE")?"| reverse":""}
|
|
29
30
|
assign blogTitle = current_blog_handle.title
|
|
30
31
|
endif
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
{% if articlePickType == 'manually' %}
|
|
35
36
|
{% assign blogTitle = articleBlogTitle[forloop.index0] %}
|
|
36
37
|
{% endif %}
|
|
37
|
-
<div>${
|
|
38
|
+
<div>${r??""}</div>
|
|
38
39
|
{% endfor %}
|
|
39
40
|
</div>
|
|
40
41
|
</div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link");const DesktopMenuItem=({id:e,menu:t,arrow:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link");const DesktopMenuItem=({id:e,menu:t,arrow:l,textColor:r,menuTextColor:p,depth:s=0,maxDepth:i=2,menuBg:o,typo:n,typography:g,enableHoverEffect:a,enableDropdownHoverEffect:c})=>{let u=t?.[e];if(!u||s>i)return null;let m=s===i,x=core.composeTypographyStyle(n,g),d=!!u?.childrens?.length&&!m,h=d&&!!l,f=core.getGlobalColorStateStyle("c",0===s?r:p),v=0===s&&a||0!==s&&c?f:core.filterHoverVariables(f);return jsxRuntime.jsxs("li",{className:core.cls("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===s,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":s>0}),style:{...x,...v},children:[u?.link?jsxRuntime.jsx(Link,{href:u.link,title:u.title,className:"gp-w-full",children:u.title}):jsxRuntime.jsx("span",{children:u?.title}),h&&jsxRuntime.jsx("span",{dangerouslySetInnerHTML:{__html:l},className:core.cls("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===s})}),d&&jsxRuntime.jsx("div",{className:core.cls("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===s,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===s}),children:jsxRuntime.jsx("ul",{className:core.cls("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===s}),style:{...core.getGlobalColorResponsiveStyle("bgc",o)},children:u?.childrens?.map(e=>jsxRuntime.jsx(DesktopMenuItem,{id:e,menu:t,depth:s+1,maxDepth:i,arrow:l,menuTextColor:p,menuBg:o,typo:n,typography:g,enableHoverEffect:a,enableDropdownHoverEffect:c},e))})})]})};exports.default=DesktopMenuItem;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link"),React=require("react"),reactTransitionGroup=require("react-transition-group"),ChevronLeft=require("../../icons/ChevronLeft.js"),Dismiss=require("../../icons/Dismiss.js");const duration=300,defaultStyle={transitionDuration:"300ms",opacity:0},transitionStyles={entering:{opacity:1,transform:"translateX(0)"},entered:{opacity:1,transform:"translateX(0)"},exiting:{opacity:0,transform:"translateX(50px)"},exited:{opacity:0,transform:"translateX(50px)"},unmounted:{opacity:0}},MenuMobileItem=({id:e,menu:t,arrow:s,menuBg:l,menuTextColor:r,closeMenu:
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Link=require("next/link"),React=require("react"),reactTransitionGroup=require("react-transition-group"),ChevronLeft=require("../../icons/ChevronLeft.js"),Dismiss=require("../../icons/Dismiss.js");const duration=300,defaultStyle={transitionDuration:"300ms",opacity:0},transitionStyles={entering:{opacity:1,transform:"translateX(0)"},entered:{opacity:1,transform:"translateX(0)"},exiting:{opacity:0,transform:"translateX(50px)"},exited:{opacity:0,transform:"translateX(50px)"},unmounted:{opacity:0}},MenuMobileItem=({id:e,menu:t,arrow:s,menuBg:l,menuTextColor:r,closeMenu:n,depth:i=0,maxDepth:a=2,typo:o,typography:p,enableHoverEffect:c})=>{let[u,g]=React.useState(!1),m=React.useRef(null),x=core.composeTypographyStyle(o,p),d=t?.[e];if(!d||i>a)return null;let f=i===a,j=!!d?.childrens?.length&&!f,y=j&&!!s,h=e=>{e.preventDefault(),e.stopPropagation(),g(e=>!e)},b=core.getGlobalColorStateStyle("c",r),R=c?b:core.filterHoverVariables(b);return jsxRuntime.jsxs("li",{className:core.cls("gp-group gp-flex gp-cursor-pointer gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2",{"gp-flex-col gp-border-b last:gp-border-b-transparent":i>0}),style:{...R,...core.getGlobalColorResponsiveStyle("bgc",l)},children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-w-full gp-items-center gp-justify-between","aria-hidden":!0,onClick:!d?.link&&y?h:void 0,children:[d?.link?jsxRuntime.jsx(Link,{href:d.link,title:d.title,className:"gp-w-full",children:d.title}):jsxRuntime.jsx("span",{style:{...x},children:d?.title}),y&&jsxRuntime.jsx("span",{role:"button",tabIndex:0,"aria-expanded":u,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&h(e)},onClick:h,dangerouslySetInnerHTML:{__html:s},className:core.cls("gp-ml-auto gp-transition-all gp-duration-200 [&>svg]:gp-w-5",{"gp-rotate-0":i>0&&!u,"gp-rotate-180":i>0&&u,"-gp-rotate-90":0===i}),style:{...x}})]}),j&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:u,timeout:300,nodeRef:m,unmountOnExit:!0,children:e=>jsxRuntime.jsxs("div",{ref:m,className:core.cls("gp-z-10 gp-flex gp-cursor-default gp-flex-col gp-transition-all",{"gp-absolute gp-left-0 gp-top-0 gp-h-full gp-w-full":0===i}),style:{...core.getGlobalColorResponsiveStyle("bgc",l),...defaultStyle,...transitionStyles[e]},children:[0===i&&jsxRuntime.jsxs("div",{className:"gp-relative gp-flex gp-h-10 gp-w-full gp-items-center gp-justify-between gp-border-b",children:[jsxRuntime.jsx("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),g(!1)},className:"gp-relative gp-z-1 gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:jsxRuntime.jsx(ChevronLeft.default,{className:"gp-w-5"})}),jsxRuntime.jsx("div",{"aria-hidden":!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),g(!1)},className:"gp-absolute gp-inset-0 gp-flex gp-items-center gp-justify-center",children:jsxRuntime.jsx("span",{className:"gp-font-semibold",children:d.title})}),jsxRuntime.jsx("button",{onClick:n,"aria-label":"Close menu",className:"gp-relative gp-z-1 gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",style:{...core.getGlobalColorStateStyle("c",r)},children:jsxRuntime.jsx(Dismiss.default,{className:"gp-w-5"})})]}),jsxRuntime.jsx("ul",{className:core.cls("gp-flex gp-flex-col"),children:d?.childrens?.map(e=>jsxRuntime.jsx(MenuMobileItem,{id:e,menu:t,depth:i+1,maxDepth:a,arrow:s,menuBg:l,menuTextColor:r},e))})]})})]})};exports.default=MenuMobileItem;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as i,
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as i,splitStyle as l,composeAdvanceStyle as a,useBlogsQuery as r,useArticlesQuery as o,flattenConnection as d,filterToolbarPreview as n,ArticleListProvider as s,makeStyleWithDefault as c,makeWidth as m,makeStyleResponsive as g,getStyleBackgroundByDevice as p,getGradientBgrStyleByDevice as h,getResponsiveValueByScreen as u,cls as b,ArticleProvider as f,isEmptyChildren as w}from"@gem-sdk/core";import A from"../../grid/components/ChildrenDroppable.js";import T from"../../common/components/Loading.js";import{useState as y}from"react";import D from"./ArticleNotFound.js";let ArticleList=v=>{let S=i(),{styles:O,setting:k,className:I,children:L,builderProps:E,advanced:P,builderAttrs:G,style:_}=v??{},{articleSetting:x,numberOfArticle:C}=k??{},{articleIds:M,articlePickType:N}=x??{},{border:j,rounded:z,hasBoxShadow:B,boxShadow:F}=P??{},[R]=l(["pos","top","left","bottom","right","z","d"],_),U=a({border:j,rounded:z,hasBoxShadow:B,boxShadow:F,"spacing-setting":P?.["spacing-setting"]}),$={first:M?.length||50,where:{baseIDIn:[...x?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},V={first:1,where:{baseID:x?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[H,q]=y(!0),J=r("latest"===N?V:null,{revalidateOnMount:!0}),K=o("manually"===N?$:null,{revalidateOnMount:!0}),Q=J.data?.blogs?.edges?.[0]?.node,W="manually"===N?K.isLoading:J.isLoading,X="manually"===N?K.isValidating:J.isValidating,Y="manually"===N?K.error:J.error,Z=J?.data?.blogs?.edges?.[0]?.node,ee="latest"===N?d(Z?.articles):d(K?.data?.articles),et=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),ei="latest"===N?ee?.filter((e,t)=>t<+(C||4)).map(e=>et(e,Z)):"manually"===N&&x?.articleIds?.length?M?.map(e=>{let t=ee?.find(t=>t?.baseID===e);return et(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):ee.filter((e,t)=>t<(x?.numOfSelectedArticles||4)).map(e=>et(e,e?.blogs?.edges?.[0]?.node));return ei?.length||W||"edit"!=S?e("div",{...G,className:E?.builderData?.uid,style:R,children:[X||W?t(T,{}):Y?e("div",{children:["Error: ",Y?.message]}):ei?.length?t(s,{styles:{horizontalGutter:O?.horizontalGutter,verticalGutter:O?.verticalGutter,spacing:O?.spacing,width:O?.width,height:O?.height},settings:{slidesToShow:k?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:ei,children:t("div",{"data-id":E?.uid,className:"gp-relative",children:t("div",{style:{...U,...c("w",m(O?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...g("rg",O?.horizontalGutter),...g("cg",O?.verticalGutter),...p(k?.background),...h(k?.background),...g("gtc",{desktop:`repeat(${u(k?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:k?.slideToShow?.tablet&&`repeat(${u(k?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:k?.slideToShow?.mobile&&`repeat(${u(k?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:b(I,"gp-m-auto gp-grid gp-w-full"),children:ei.map(e=>t(f,{article:e,readOnly:!0,children:t("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:w(L)?t(A,{}):L})},e?.id))})})}):t("div",{children:"Articles not found"}),n(L,!0)]}):H?e("div",{...G,className:E?.builderData?.uid,children:[t(D,{blogHandle:Q?.handle,onClose:()=>q(!1),articlePickType:N??"manually",children:L}),n(L,!0)]}):null};export{ArticleList as default};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{
|
|
2
|
+
import{splitStyle as l,composeAdvanceStyle as e,template as i,makeStyleWithDefault as t,makeWidth as a,makeStyleResponsive as r,getStyleBackgroundByDevice as s,getGradientBgrStyleByDevice as n,getResponsiveValueByScreen as o,cls as c}from"@gem-sdk/core";import{convertSpecialCharacter as g}from"../common/helpers.js";import{convertUnitToNumber as d}from"../../helpers.js";let ArticleList=m=>{let{styles:p,setting:b,className:u,children:f,builderProps:_,advanced:h,style:T}=m??{},{border:y,rounded:$,hasBoxShadow:w,boxShadow:S}=h??{},[k]=l(["pos","top","left","bottom","right","z","d"],T),E=e({border:y,rounded:$,hasBoxShadow:w,boxShadow:S,"spacing-setting":h?.["spacing-setting"]}),v=b?.articleSetting,B=b?.articleOrderBy??"UPDATED_AT_REVERSE",H=v?.articlePickType??"manually",R="manually"===H&&v?.articleHandles?.length?v?.articleHandles:[],x="manually"===H&&v?.articleBlogTitles?.length?v?.articleBlogTitles:[],A=v?.blogHandle??"",P=d(b?.numberOfArticle,4);return i`
|
|
3
3
|
<div
|
|
4
|
+
style="${k}"
|
|
4
5
|
data-id="${_?.uid}"
|
|
5
6
|
items-repeat
|
|
6
7
|
>
|
|
7
|
-
<div style="${{...
|
|
8
|
-
class="${
|
|
8
|
+
<div style="${{...E,...t("w",a(p?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...r("rg",p?.horizontalGutter),...r("cg",p?.verticalGutter),...s(b?.background),...n(b?.background),...r("gtc",{desktop:`repeat(${o(b?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:b?.slideToShow?.tablet&&`repeat(${o(b?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:b?.slideToShow?.mobile&&`repeat(${o(b?.slideToShow,"mobile")}, minmax(0, 1fr))`})}}"
|
|
9
|
+
class="${c(u,"gp-grid !gp-m-auto gp-w-full",h?.cssClass)}"
|
|
9
10
|
>
|
|
10
11
|
{% liquid
|
|
11
|
-
assign articlePickType = '${
|
|
12
|
-
assign articleHandles = '${
|
|
13
|
-
assign articleBlogTitle = "${
|
|
14
|
-
assign limit = "${"manually"===
|
|
12
|
+
assign articlePickType = '${H}'
|
|
13
|
+
assign articleHandles = '${R.toString()}'| split: ","
|
|
14
|
+
assign articleBlogTitle = "${g(x.toString())}" | split: ","
|
|
15
|
+
assign limit = "${"manually"===H?v?.articleIds?.length:P}"
|
|
15
16
|
assign blogTitle = ''
|
|
16
17
|
assign all_articles = null | sort
|
|
17
18
|
|
|
@@ -21,11 +22,11 @@ import{composeAdvanceStyle as l,template as e,makeStyleWithDefault as i,makeWidt
|
|
|
21
22
|
assign all_articles = all_articles | concat: articleByHandle
|
|
22
23
|
endfor
|
|
23
24
|
else
|
|
24
|
-
assign current_blog_handle = blogs['${
|
|
25
|
+
assign current_blog_handle = blogs['${A}']
|
|
25
26
|
if gp_enable_custom_dynamic_blog == true
|
|
26
27
|
assign current_blog_handle = blogs[blog.handle]
|
|
27
28
|
endif
|
|
28
|
-
assign all_articles = current_blog_handle.articles | limit: limit | sort: "${
|
|
29
|
+
assign all_articles = current_blog_handle.articles | limit: limit | sort: "${B.replace("_REVERSE","").toLowerCase()}" ${B.includes("_REVERSE")?"| reverse":""}
|
|
29
30
|
assign blogTitle = current_blog_handle.title
|
|
30
31
|
endif
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@ import{composeAdvanceStyle as l,template as e,makeStyleWithDefault as i,makeWidt
|
|
|
34
35
|
{% if articlePickType == 'manually' %}
|
|
35
36
|
{% assign blogTitle = articleBlogTitle[forloop.index0] %}
|
|
36
37
|
{% endif %}
|
|
37
|
-
<div>${
|
|
38
|
+
<div>${f??""}</div>
|
|
38
39
|
{% endfor %}
|
|
39
40
|
</div>
|
|
40
41
|
</div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as
|
|
2
|
+
import{jsxs as e,jsx as p}from"react/jsx-runtime";import{composeTypographyStyle as t,getGlobalColorStateStyle as l,filterHoverVariables as r,cls as g,getGlobalColorResponsiveStyle as i}from"@gem-sdk/core";import n from"next/link";let DesktopMenuItem=({id:a,menu:o,arrow:s,textColor:m,menuTextColor:c,depth:u=0,maxDepth:d=2,menuBg:f,typo:h,typography:v,enableHoverEffect:x,enableDropdownHoverEffect:y})=>{let b=o?.[a];if(!b||u>d)return null;let w=u===d,k=t(h,v),D=!!b?.childrens?.length&&!w,N=D&&!!s,I=l("c",0===u?m:c),M=0===u&&x||0!==u&&y?I:r(I);return e("li",{className:g("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===u,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":u>0}),style:{...k,...M},children:[b?.link?p(n,{href:b.link,title:b.title,className:"gp-w-full",children:b.title}):p("span",{children:b?.title}),N&&p("span",{dangerouslySetInnerHTML:{__html:s},className:g("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===u})}),D&&p("div",{className:g("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===u,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===u}),children:p("ul",{className:g("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===u}),style:{...i("bgc",f)},children:b?.childrens?.map(e=>p(DesktopMenuItem,{id:e,menu:o,depth:u+1,maxDepth:d,arrow:s,menuTextColor:c,menuBg:f,typo:h,typography:v,enableHoverEffect:x,enableDropdownHoverEffect:y},e))})})]})};export{DesktopMenuItem as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{composeTypographyStyle as l,getGlobalColorStateStyle as r,filterHoverVariables as n,cls as
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{composeTypographyStyle as l,getGlobalColorStateStyle as r,filterHoverVariables as n,cls as a,getGlobalColorResponsiveStyle as p}from"@gem-sdk/core";import i from"next/link";import{useState as o,useRef as s}from"react";import{Transition as g}from"react-transition-group";import c from"../../icons/ChevronLeft.js";import m from"../../icons/Dismiss.js";let duration=300,defaultStyle={transitionDuration:"300ms",opacity:0},transitionStyles={entering:{opacity:1,transform:"translateX(0)"},entered:{opacity:1,transform:"translateX(0)"},exiting:{opacity:0,transform:"translateX(50px)"},exited:{opacity:0,transform:"translateX(50px)"},unmounted:{opacity:0}},MenuMobileItem=({id:u,menu:f,arrow:d,menuBg:h,menuTextColor:y,closeMenu:x,depth:b=0,maxDepth:v=2,typo:w,typography:N,enableHoverEffect:k})=>{let[j,C]=o(!1),D=s(null),M=l(w,N),I=f?.[u];if(!I||b>v)return null;let S=b===v,X=!!I?.childrens?.length&&!S,z=X&&!!d,P=e=>{e.preventDefault(),e.stopPropagation(),C(e=>!e)},q=r("c",y),E=k?q:n(q);return e("li",{className:a("gp-group gp-flex gp-cursor-pointer gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2",{"gp-flex-col gp-border-b last:gp-border-b-transparent":b>0}),style:{...E,...p("bgc",h)},children:[e("div",{className:"gp-flex gp-w-full gp-items-center gp-justify-between","aria-hidden":!0,onClick:!I?.link&&z?P:void 0,children:[I?.link?t(i,{href:I.link,title:I.title,className:"gp-w-full",children:I.title}):t("span",{style:{...M},children:I?.title}),z&&t("span",{role:"button",tabIndex:0,"aria-expanded":j,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&P(e)},onClick:P,dangerouslySetInnerHTML:{__html:d},className:a("gp-ml-auto gp-transition-all gp-duration-200 [&>svg]:gp-w-5",{"gp-rotate-0":b>0&&!j,"gp-rotate-180":b>0&&j,"-gp-rotate-90":0===b}),style:{...M}})]}),X&&t(g,{in:j,timeout:300,nodeRef:D,unmountOnExit:!0,children:l=>e("div",{ref:D,className:a("gp-z-10 gp-flex gp-cursor-default gp-flex-col gp-transition-all",{"gp-absolute gp-left-0 gp-top-0 gp-h-full gp-w-full":0===b}),style:{...p("bgc",h),...defaultStyle,...transitionStyles[l]},children:[0===b&&e("div",{className:"gp-relative gp-flex gp-h-10 gp-w-full gp-items-center gp-justify-between gp-border-b",children:[t("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),C(!1)},className:"gp-relative gp-z-1 gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",children:t(c,{className:"gp-w-5"})}),t("div",{"aria-hidden":!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),C(!1)},className:"gp-absolute gp-inset-0 gp-flex gp-items-center gp-justify-center",children:t("span",{className:"gp-font-semibold",children:I.title})}),t("button",{onClick:x,"aria-label":"Close menu",className:"gp-relative gp-z-1 gp-flex gp-aspect-square gp-h-full gp-items-center gp-justify-center",style:{...r("c",y)},children:t(m,{className:"gp-w-5"})})]}),t("ul",{className:a("gp-flex gp-flex-col"),children:I?.childrens?.map(e=>t(MenuMobileItem,{id:e,menu:f,depth:b+1,maxDepth:v,arrow:d,menuBg:h,menuTextColor:y},e))})]})})]})};export{MenuMobileItem as default};
|