@gem-sdk/components 16.0.2 → 16.1.0-dev.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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),ProductListCarouselLayout_liquid=require("./ProductListCarouselLayout.liquid.js"),ProductListGridLayout_liquid=require("./ProductListGridLayout.liquid.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js");const ProductList=e=>{let{setting:s,styles:t,pageContext:i}=e,r=i?.pageType==="GP_FUNNEL_PAGE";if(r)return"";let{hasRelatedExclude:d,relatedExcludeTrim:a,collectionID:o,isLatestProducts:c,isGrid:l,numberOfProducts:n,productListId:u,productListHandles:g,sortedBy:p,isReverse:f,productSrc:m,productNumber:P,isSorted:$,relatedTag:h,collectionHandle:y}=helpers.getDataLiquid(e),_=()=>core.template`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),ProductListCarouselLayout_liquid=require("./ProductListCarouselLayout.liquid.js"),ProductListGridLayout_liquid=require("./ProductListGridLayout.liquid.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js");const ProductList=e=>{let{setting:s,styles:t,pageContext:i}=e,r=i?.pageType==="GP_FUNNEL_PAGE";if(r)return"";let{hasRelatedExclude:d,relatedExcludeTrim:o,collectionID:a,isLatestProducts:c,isGrid:l,numberOfProducts:n,productListId:u,productListHandles:g,sortedBy:p,isReverse:f,productSrc:m,productNumber:$,isSorted:P,relatedTag:h,collectionHandle:_}=helpers.getDataLiquid(e),y=()=>core.template`
2
2
  ${core.RenderIf("RelatedProduct"===m,`
3
3
  assign relatedTag = '${h}'
4
4
  assign assignProduct = product
@@ -11,7 +11,7 @@
11
11
  when 'collection'
12
12
  assign hasRelatedExclude = ${d}
13
13
  if hasRelatedExclude
14
- assign relatedExclude = '${a}'
14
+ assign relatedExclude = '${o}'
15
15
  else
16
16
  assign relatedExclude = ''
17
17
  endif
@@ -65,7 +65,7 @@
65
65
  assign tagsAssignProduct = assignProduct.tags
66
66
  assign hasRelatedExclude = ${d}
67
67
  if hasRelatedExclude
68
- assign relatedExclude = '${a}'
68
+ assign relatedExclude = '${o}'
69
69
  else
70
70
  assign relatedExclude = ''
71
71
  endif
@@ -95,11 +95,11 @@
95
95
  assign products = products
96
96
  endpaginate
97
97
  `)}
98
- `,L=()=>{let e=y?`
99
- assign target_collection = collections['${y}']
98
+ `,L=()=>{let e=_?`
99
+ assign target_collection = collections['${_}']
100
100
  if target_collection == empty
101
101
  for collection in collections
102
- if collection.id == ${o}
102
+ if collection.id == ${a}
103
103
  assign target_collection = collection
104
104
  break
105
105
  endif
@@ -107,7 +107,7 @@
107
107
  endif
108
108
  `:`
109
109
  for collection in collections
110
- if collection.id == ${o}
110
+ if collection.id == ${a}
111
111
  assign target_collection = collection
112
112
  break
113
113
  endif
@@ -115,27 +115,30 @@
115
115
  `;return core.template`
116
116
  {%- liquid
117
117
  assign productHandles = '${g.toString()}'| split: ','
118
+ assign collection_handle = ${_}
118
119
  assign products = null
119
120
  assign target_collection = null
120
121
  assign productSrc = '${m}'
121
122
  assign c = 0
122
- assign limit = ${P??4}
123
+ assign limit = ${$??4}
123
124
 
124
125
  if request.page_type == 'collection' or preview_page_type == 'collection'
125
126
  assign target_collection = collection
126
- if target_collection == empty or target_collection == null
127
- if '${o.toLowerCase()}' == 'latest'
127
+ if productSrc == 'Collection' and collection_handle != empty
128
+ ${e}
129
+ elsif target_collection == empty or target_collection == null
130
+ if '${a.toLowerCase()}' == 'latest'
128
131
  assign target_collection = collections | sort: 'updated_at' ${f?"| reverse":""} | first
129
132
  else
130
133
  ${e}
131
134
  endif
132
135
  endif
133
136
  paginate target_collection.products by ${n||4}
134
- assign products = target_collection.products ${$?p:""} ${f?"| reverse":""}
137
+ assign products = target_collection.products ${P?p:""} ${f?"| reverse":""}
135
138
  endpaginate
136
139
  else
137
140
  if productSrc == 'RelatedProduct'
138
- ${_()}
141
+ ${y()}
139
142
  elsif productSrc == 'PickProduct'
140
143
  unless ${c}
141
144
  assign products = null | sort
@@ -152,13 +155,13 @@
152
155
  endif
153
156
  endunless
154
157
  else
155
- if '${o.toLowerCase()}' == 'latest'
158
+ if '${a.toLowerCase()}' == 'latest'
156
159
  assign target_collection = collections | sort: 'updated_at' ${f?"| reverse":""} | first
157
160
  else
158
161
  ${e}
159
162
  endif
160
163
  paginate target_collection.products by ${n||4}
161
- assign products = target_collection.products ${$?p:""} ${f?"| reverse":""}
164
+ assign products = target_collection.products ${P?p:""} ${f?"| reverse":""}
162
165
  endpaginate
163
166
  endif
164
167
  endif
@@ -1,4 +1,4 @@
1
- import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import a from"./ProductListCarouselLayout.liquid.js";import n from"./ProductListGridLayout.liquid.js";import{getStyle as c}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let ProductList=g=>{let{setting:p,styles:f,pageContext:m}=g,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:x,sortedBy:S,isReverse:b,productSrc:L,productNumber:A,isSorted:R,relatedTag:I,collectionHandle:F}=u(g),j=()=>e`
1
+ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as d,getStaticLocale as o}from"../../../helpers.js";import{If as r}from"@gem-sdk/system";import n from"./ProductListCarouselLayout.liquid.js";import c from"./ProductListGridLayout.liquid.js";import{getStyle as a}from"./common/styles.js";import{getClass as l}from"./common/classes.js";import{getDataLiquid as u}from"./common/helpers.js";let ProductList=g=>{let{setting:p,styles:f,pageContext:m}=g,$=m?.pageType==="GP_FUNNEL_PAGE";if($)return"";let{hasRelatedExclude:P,relatedExcludeTrim:h,collectionID:_,isLatestProducts:y,isGrid:v,numberOfProducts:E,productListId:k,productListHandles:x,sortedBy:S,isReverse:b,productSrc:L,productNumber:A,isSorted:R,relatedTag:I,collectionHandle:F}=u(g),j=()=>e`
2
2
  ${s("RelatedProduct"===L,`
3
3
  assign relatedTag = '${I}'
4
4
  assign assignProduct = product
@@ -115,6 +115,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
115
115
  `;return e`
116
116
  {%- liquid
117
117
  assign productHandles = '${x.toString()}'| split: ','
118
+ assign collection_handle = ${F}
118
119
  assign products = null
119
120
  assign target_collection = null
120
121
  assign productSrc = '${L}'
@@ -123,7 +124,9 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
123
124
 
124
125
  if request.page_type == 'collection' or preview_page_type == 'collection'
125
126
  assign target_collection = collection
126
- if target_collection == empty or target_collection == null
127
+ if productSrc == 'Collection' and collection_handle != empty
128
+ ${s}
129
+ elsif target_collection == empty or target_collection == null
127
130
  if '${_.toLowerCase()}' == 'latest'
128
131
  assign target_collection = collections | sort: 'updated_at' ${b?"| reverse":""} | first
129
132
  else
@@ -163,7 +166,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
163
166
  endif
164
167
  endif
165
168
  -%}
166
- `},{productListWrapStyle:H,productListContentStyle:q,productListWrapAlignStyle:G}=c(g),{productListWrapClass:B}=l(g),T=()=>e`
169
+ `},{productListWrapStyle:H,productListContentStyle:q,productListWrapAlignStyle:G}=a(g),{productListWrapClass:B}=l(g),C=()=>e`
167
170
  {%- if products == null -%}
168
171
  {%- if count == 0 and ${k.length} == 0 -%}
169
172
  {% if '${L}' == 'RelatedProduct' -%}
@@ -173,7 +176,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
173
176
  {%- endif -%}
174
177
  {%- endif -%}
175
178
  {%-else-%}
176
- ${r(v,e`${n({...g,productListId:k,productSrc:L})}`,e`${a({...g,productListId:k,productSrc:L})}`)}
179
+ ${r(v,e`${c({...g,productListId:k,productSrc:L})}`,e`${n({...g,productListId:k,productSrc:L})}`)}
177
180
  {%- endif -%}
178
181
  `;return e`
179
182
  ${s(t,`
@@ -196,7 +199,7 @@ import{template as e,RenderIf as s,isLocalEnv as t,baseAssetURL as i}from"@gem-s
196
199
  {%- assign gpBkProduct = product -%}
197
200
  {%- assign gpBkProducts = products -%}
198
201
  ${w()}
199
- ${T()}
202
+ ${C()}
200
203
  {%- assign product = gpBkProduct -%}
201
204
  {%- assign products = gpBkProducts -%}
202
205
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "16.0.2",
3
+ "version": "16.1.0-dev.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,9 +26,9 @@
26
26
  "i18n:extract": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/translate/extract-texts-to-locales.js && node ./scripts/translate/en-keys-usage.js"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "16.0.0",
30
- "@gem-sdk/styles": "16.0.0",
31
- "@gem-sdk/system": "16.0.0",
29
+ "@gem-sdk/core": "16.1.0-dev.0",
30
+ "@gem-sdk/styles": "16.1.0-dev.0",
31
+ "@gem-sdk/system": "16.1.0-dev.0",
32
32
  "@types/react-transition-group": "^4.4.12",
33
33
  "tsup": "8.5.1",
34
34
  "postcss-import": "16.1.1",