@swell/apps-sdk 1.0.178 → 1.0.180

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
@@ -151,7 +151,8 @@ __export(index_exports, {
151
151
  scopeCustomCSS: () => scopeCustomCSS,
152
152
  stringifyQueryParams: () => stringifyQueryParams,
153
153
  systemFonts: () => systemFonts,
154
- toBase64: () => toBase64
154
+ toBase64: () => toBase64,
155
+ toBlockId: () => toBlockId
155
156
  });
156
157
  module.exports = __toCommonJS(index_exports);
157
158
 
@@ -3401,7 +3402,7 @@ function getSectionSettingsFromProps(props, sectionSchema) {
3401
3402
  (block) => block.type === blockType
3402
3403
  );
3403
3404
  return {
3404
- id,
3405
+ id: toBlockId(id),
3405
3406
  type: blockType,
3406
3407
  disabled: isDisabled,
3407
3408
  settings: blockSchema?.fields?.reduce(
@@ -3430,6 +3431,12 @@ function toSchemaFieldId(fieldId) {
3430
3431
  }
3431
3432
  return fieldId.replace(/·/g, ".");
3432
3433
  }
3434
+ function toBlockId(id) {
3435
+ if (!id) {
3436
+ return id;
3437
+ }
3438
+ return id.replace(/\./g, "_");
3439
+ }
3433
3440
 
3434
3441
  // src/utils/md5.ts
3435
3442
  function md5(inputString) {
@@ -13160,7 +13167,7 @@ function ShopifyCustomer(instance, account) {
13160
13167
  accepts_marketing: defer(() => account.email_optin),
13161
13168
  addresses: deferWith(
13162
13169
  account.addresses,
13163
- (addresses) => addresses.results.map(
13170
+ (addresses) => (addresses?.results || []).map(
13164
13171
  (address) => ShopifyAddress(instance, address)
13165
13172
  )
13166
13173
  ),
@@ -13196,7 +13203,9 @@ function ShopifyCustomer(instance, account) {
13196
13203
  name: defer(() => account.name),
13197
13204
  orders: deferWith(
13198
13205
  account.orders,
13199
- (orders) => orders.results.map((order) => ShopifyOrder(instance, order))
13206
+ (orders) => (orders?.results || []).map(
13207
+ (order) => ShopifyOrder(instance, order)
13208
+ )
13200
13209
  ),
13201
13210
  orders_count: defer(() => account.order_count),
13202
13211
  payment_methods: [],
@@ -16382,18 +16391,11 @@ function bind58(_liquidSwell) {
16382
16391
  }
16383
16392
 
16384
16393
  // src/liquid/filters/shopify/img_url.ts
16385
- function bind59(_liquidSwell) {
16386
- return function filterImgUrl(input, ...params) {
16387
- if (!input) return "";
16388
- let url;
16389
- if (typeof input === "object") {
16390
- if (input.url) {
16391
- url = input.url;
16392
- } else {
16393
- return "";
16394
- }
16395
- } else {
16396
- url = String(input);
16394
+ function bind59(liquidSwell) {
16395
+ return async function filterImgUrl(input, ...params) {
16396
+ const url = await getImageUrlFromInput(input, liquidSwell);
16397
+ if (typeof url !== "string" || url === "") {
16398
+ return "";
16397
16399
  }
16398
16400
  const query = [];
16399
16401
  params.forEach((param) => {
@@ -20193,6 +20195,7 @@ function getHtmlCache(env, cacheRules) {
20193
20195
  scopeCustomCSS,
20194
20196
  stringifyQueryParams,
20195
20197
  systemFonts,
20196
- toBase64
20198
+ toBase64,
20199
+ toBlockId
20197
20200
  });
20198
20201
  //# sourceMappingURL=index.cjs.map