@swell/apps-sdk 1.0.169 → 1.0.170

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/index.cjs CHANGED
@@ -15932,7 +15932,10 @@ function ShopifyCollection(instance, category) {
15932
15932
  tags: [],
15933
15933
  template_suffix: defer(() => category.theme_template),
15934
15934
  title: defer(() => category.name),
15935
- url: deferWith(category, (category2) => `/collections/${category2.slug}`)
15935
+ url: deferWith(
15936
+ category,
15937
+ (category2) => category2.slug ? `/collections/${category2.slug}` : ""
15938
+ )
15936
15939
  });
15937
15940
  }
15938
15941
  function getFirstImage(category) {
@@ -15961,9 +15964,7 @@ function convertToShopifySorting(value) {
15961
15964
  function getProducts(instance, object, mapper) {
15962
15965
  return deferWith(object, (object2) => {
15963
15966
  const { page, limit: limit2 } = instance.swell.queryParams;
15964
- const productQuery = {
15965
- $variants: true
15966
- };
15967
+ const productQuery = { $variants: true };
15967
15968
  if (typeof object2.id === "string" && object2.id !== "all") {
15968
15969
  productQuery.category = object2.id;
15969
15970
  }
@@ -15974,11 +15975,7 @@ function getProducts(instance, object, mapper) {
15974
15975
  const products = new SwellStorefrontCollection(
15975
15976
  instance.swell,
15976
15977
  "products",
15977
- {
15978
- page,
15979
- limit: limit2,
15980
- ...filterQuery
15981
- },
15978
+ { page, limit: limit2, ...filterQuery },
15982
15979
  async function() {
15983
15980
  return this._defaultGetter().call(this);
15984
15981
  }
@@ -17485,10 +17482,9 @@ var ShopifyCompatibility2 = class {
17485
17482
  ({ from }) => from === key || from.startsWith(keyObject)
17486
17483
  );
17487
17484
  if (resourceMap && value instanceof StorefrontResource) {
17488
- const resource = resourceMap.object(this, value);
17489
- const composed = Object.assign({}, value.toObject(), resource);
17490
- Object.setPrototypeOf(composed, Object.getPrototypeOf(resource));
17491
- pageData[resourceMap.to] = composed;
17485
+ const resourceProps = resourceMap.object(this, value);
17486
+ value.setCompatibilityProps(resourceProps);
17487
+ pageData[resourceMap.to] = value;
17492
17488
  }
17493
17489
  }
17494
17490
  }