@swell/apps-sdk 1.0.184 → 1.0.186
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 +117 -92
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +117 -92
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +52 -27
- package/dist/index.mjs.map +4 -4
- package/dist/src/compatibility/shopify-objects/content.d.ts +12 -0
- package/dist/types/shopify.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2903,7 +2903,7 @@ var LANG_TO_COUNTRY_CODES = {
|
|
|
2903
2903
|
var CURRENCY_COUNTRIES = Object.freeze({
|
|
2904
2904
|
USD: { name: "United States", iso: "US" },
|
|
2905
2905
|
EUR: { name: "Europe", iso: "EU" },
|
|
2906
|
-
GBP: { name: "United Kingdom", iso: "
|
|
2906
|
+
GBP: { name: "United Kingdom", iso: "GB" },
|
|
2907
2907
|
JPY: { name: "Japan", iso: "JP" },
|
|
2908
2908
|
CAD: { name: "Canada", iso: "CA" },
|
|
2909
2909
|
AUD: { name: "Australia", iso: "AU" },
|
|
@@ -4629,7 +4629,7 @@ function getSelectedSubscriptionPurchaseOptionPlan(selectedPurchaseOptionType, s
|
|
|
4629
4629
|
return selectedPlan || subscriptionPurchaseOption.plans[0];
|
|
4630
4630
|
}
|
|
4631
4631
|
var SORT_OPTIONS = Object.freeze([
|
|
4632
|
-
{ value: "", name: "Featured" },
|
|
4632
|
+
{ value: "manual", name: "Featured" },
|
|
4633
4633
|
{ value: "popularity", name: "Popularity", query: "popularity desc" },
|
|
4634
4634
|
{ value: "price_asc", name: "Price, low to high", query: "price asc" },
|
|
4635
4635
|
{ value: "price_desc", name: "Price, high to low", query: "price desc" },
|
|
@@ -4639,7 +4639,7 @@ var SORT_OPTIONS = Object.freeze([
|
|
|
4639
4639
|
{ value: "name_desc", name: "Product name, Z-A", query: "name desc" }
|
|
4640
4640
|
]);
|
|
4641
4641
|
async function getProductFilters(swell, productQuery) {
|
|
4642
|
-
const sortBy = swell.queryParams.sort || "";
|
|
4642
|
+
const sortBy = swell.queryParams.sort || "manual";
|
|
4643
4643
|
const filterQuery = productQueryWithFilters(swell, productQuery);
|
|
4644
4644
|
return {
|
|
4645
4645
|
filter_options: await getProductFiltersByQuery(swell, filterQuery),
|
|
@@ -4686,7 +4686,7 @@ function productQueryWithFilters(swell, query) {
|
|
|
4686
4686
|
},
|
|
4687
4687
|
{}
|
|
4688
4688
|
);
|
|
4689
|
-
const sortBy = swell.queryParams.sort || "";
|
|
4689
|
+
const sortBy = swell.queryParams.sort || "manual";
|
|
4690
4690
|
return {
|
|
4691
4691
|
sort: SORT_OPTIONS.find((option) => option.value === sortBy)?.query || void 0,
|
|
4692
4692
|
$filters: filters2,
|
|
@@ -12062,6 +12062,31 @@ function makeProductsCollectionResolve(instance, object, mapper) {
|
|
|
12062
12062
|
return resolveProducts;
|
|
12063
12063
|
}
|
|
12064
12064
|
|
|
12065
|
+
// src/compatibility/shopify-objects/content.ts
|
|
12066
|
+
import { Drop as Drop6 } from "liquidjs";
|
|
12067
|
+
var ShopifySwellContent = class extends Drop6 {
|
|
12068
|
+
content;
|
|
12069
|
+
description;
|
|
12070
|
+
constructor(product) {
|
|
12071
|
+
super();
|
|
12072
|
+
this.content = product?.content || {};
|
|
12073
|
+
this.description = product?.description || "";
|
|
12074
|
+
}
|
|
12075
|
+
toString() {
|
|
12076
|
+
return this.description;
|
|
12077
|
+
}
|
|
12078
|
+
toObject() {
|
|
12079
|
+
const combined = Object.assign({}, this.content);
|
|
12080
|
+
return combined;
|
|
12081
|
+
}
|
|
12082
|
+
toJSON() {
|
|
12083
|
+
return this.toObject();
|
|
12084
|
+
}
|
|
12085
|
+
toLiquid() {
|
|
12086
|
+
return this.toObject();
|
|
12087
|
+
}
|
|
12088
|
+
};
|
|
12089
|
+
|
|
12065
12090
|
// src/compatibility/shopify-objects/product.ts
|
|
12066
12091
|
function ShopifyProduct(instance, product, depth = 0) {
|
|
12067
12092
|
if (product instanceof ShopifyResource) {
|
|
@@ -12095,7 +12120,7 @@ function ShopifyProduct(instance, product, depth = 0) {
|
|
|
12095
12120
|
compare_at_price_max: compareAtPrice,
|
|
12096
12121
|
compare_at_price_min: compareAtPrice,
|
|
12097
12122
|
compare_at_price_varies: false,
|
|
12098
|
-
content: defer(() => product
|
|
12123
|
+
content: defer(() => new ShopifySwellContent(product)),
|
|
12099
12124
|
created_at: defer(() => product.date_created),
|
|
12100
12125
|
description: defer(() => product.description),
|
|
12101
12126
|
featured_image: deferWith(product, (product2) => {
|
|
@@ -12973,8 +12998,8 @@ function ShopifyShippingMethod(instance, order) {
|
|
|
12973
12998
|
}
|
|
12974
12999
|
|
|
12975
13000
|
// src/compatibility/drops/money.ts
|
|
12976
|
-
import { Drop as
|
|
12977
|
-
var MoneyDrop = class extends
|
|
13001
|
+
import { Drop as Drop7 } from "liquidjs";
|
|
13002
|
+
var MoneyDrop = class extends Drop7 {
|
|
12978
13003
|
constructor(value, decimals, currency) {
|
|
12979
13004
|
super();
|
|
12980
13005
|
this.value = value;
|
|
@@ -13575,8 +13600,8 @@ function ShopifyShop(instance, store) {
|
|
|
13575
13600
|
}
|
|
13576
13601
|
|
|
13577
13602
|
// src/compatibility/drops/all_products.ts
|
|
13578
|
-
import { Drop as
|
|
13579
|
-
var AllProductsDrop = class extends
|
|
13603
|
+
import { Drop as Drop8 } from "liquidjs";
|
|
13604
|
+
var AllProductsDrop = class extends Drop8 {
|
|
13580
13605
|
#instance;
|
|
13581
13606
|
#map;
|
|
13582
13607
|
constructor(instance) {
|
|
@@ -13618,8 +13643,8 @@ var AllProductsDrop = class extends Drop7 {
|
|
|
13618
13643
|
};
|
|
13619
13644
|
|
|
13620
13645
|
// src/compatibility/drops/articles.ts
|
|
13621
|
-
import { Drop as
|
|
13622
|
-
var ArticlesDrop = class extends
|
|
13646
|
+
import { Drop as Drop9 } from "liquidjs";
|
|
13647
|
+
var ArticlesDrop = class extends Drop9 {
|
|
13623
13648
|
#instance;
|
|
13624
13649
|
#map;
|
|
13625
13650
|
constructor(instance) {
|
|
@@ -13661,8 +13686,8 @@ var ArticlesDrop = class extends Drop8 {
|
|
|
13661
13686
|
};
|
|
13662
13687
|
|
|
13663
13688
|
// src/compatibility/drops/blogs.ts
|
|
13664
|
-
import { Drop as
|
|
13665
|
-
var BlogsDrop = class extends
|
|
13689
|
+
import { Drop as Drop10 } from "liquidjs";
|
|
13690
|
+
var BlogsDrop = class extends Drop10 {
|
|
13666
13691
|
#instance;
|
|
13667
13692
|
#map;
|
|
13668
13693
|
constructor(instance) {
|
|
@@ -13708,7 +13733,7 @@ var BlogsDrop = class extends Drop9 {
|
|
|
13708
13733
|
};
|
|
13709
13734
|
|
|
13710
13735
|
// src/compatibility/drops/collections.ts
|
|
13711
|
-
import { Drop as
|
|
13736
|
+
import { Drop as Drop11 } from "liquidjs";
|
|
13712
13737
|
var AllCategoryResource = class extends StorefrontResource {
|
|
13713
13738
|
constructor(instance) {
|
|
13714
13739
|
super(() => {
|
|
@@ -13722,7 +13747,7 @@ var AllCategoryResource = class extends StorefrontResource {
|
|
|
13722
13747
|
});
|
|
13723
13748
|
}
|
|
13724
13749
|
};
|
|
13725
|
-
var CollectionsDrop = class extends
|
|
13750
|
+
var CollectionsDrop = class extends Drop11 {
|
|
13726
13751
|
#instance;
|
|
13727
13752
|
#map;
|
|
13728
13753
|
constructor(instance) {
|
|
@@ -13849,8 +13874,8 @@ var SwellStorefrontProducts = class extends SwellStorefrontCollection {
|
|
|
13849
13874
|
};
|
|
13850
13875
|
|
|
13851
13876
|
// src/compatibility/drops/images.ts
|
|
13852
|
-
import { Drop as
|
|
13853
|
-
var ImagesDrop = class extends
|
|
13877
|
+
import { Drop as Drop12 } from "liquidjs";
|
|
13878
|
+
var ImagesDrop = class extends Drop12 {
|
|
13854
13879
|
#instance;
|
|
13855
13880
|
#map;
|
|
13856
13881
|
constructor(instance) {
|
|
@@ -13904,8 +13929,8 @@ var SwellImage = class extends StorefrontResource {
|
|
|
13904
13929
|
};
|
|
13905
13930
|
|
|
13906
13931
|
// src/compatibility/drops/object-handles.ts
|
|
13907
|
-
import { Drop as
|
|
13908
|
-
var ObjectHandlesDrop = class extends
|
|
13932
|
+
import { Drop as Drop13 } from "liquidjs";
|
|
13933
|
+
var ObjectHandlesDrop = class extends Drop13 {
|
|
13909
13934
|
#map;
|
|
13910
13935
|
constructor(map) {
|
|
13911
13936
|
super();
|
|
@@ -13945,8 +13970,8 @@ var ObjectHandlesDrop = class extends Drop12 {
|
|
|
13945
13970
|
};
|
|
13946
13971
|
|
|
13947
13972
|
// src/compatibility/drops/pages.ts
|
|
13948
|
-
import { Drop as
|
|
13949
|
-
var PagesDrop = class extends
|
|
13973
|
+
import { Drop as Drop14 } from "liquidjs";
|
|
13974
|
+
var PagesDrop = class extends Drop14 {
|
|
13950
13975
|
#instance;
|
|
13951
13976
|
#map;
|
|
13952
13977
|
constructor(instance) {
|
|
@@ -14666,9 +14691,9 @@ ${injects.join("\n")}</script>`;
|
|
|
14666
14691
|
};
|
|
14667
14692
|
|
|
14668
14693
|
// src/liquid/drops/render.ts
|
|
14669
|
-
import { Drop as
|
|
14694
|
+
import { Drop as Drop15 } from "liquidjs";
|
|
14670
14695
|
import { noop as noop2 } from "lodash-es";
|
|
14671
|
-
var RenderDrop = class extends
|
|
14696
|
+
var RenderDrop = class extends Drop15 {
|
|
14672
14697
|
#result;
|
|
14673
14698
|
#handler;
|
|
14674
14699
|
constructor(handler) {
|
|
@@ -16708,8 +16733,8 @@ function arrayEqual(lhs, rhs) {
|
|
|
16708
16733
|
|
|
16709
16734
|
// src/liquid/color.ts
|
|
16710
16735
|
import Color from "color";
|
|
16711
|
-
import { Drop as
|
|
16712
|
-
var ThemeColor = class _ThemeColor extends
|
|
16736
|
+
import { Drop as Drop16 } from "liquidjs";
|
|
16737
|
+
var ThemeColor = class _ThemeColor extends Drop16 {
|
|
16713
16738
|
color;
|
|
16714
16739
|
colorValues;
|
|
16715
16740
|
red;
|
|
@@ -17331,8 +17356,8 @@ var ThemeLoader = class _ThemeLoader {
|
|
|
17331
17356
|
import { trimEnd } from "lodash-es";
|
|
17332
17357
|
|
|
17333
17358
|
// src/compatibility/drops/robots-rule.ts
|
|
17334
|
-
import { Drop as
|
|
17335
|
-
var RobotsRule = class _RobotsRule extends
|
|
17359
|
+
import { Drop as Drop17 } from "liquidjs";
|
|
17360
|
+
var RobotsRule = class _RobotsRule extends Drop17 {
|
|
17336
17361
|
constructor(directive, value) {
|
|
17337
17362
|
super();
|
|
17338
17363
|
this.directive = directive;
|