@swell/apps-sdk 1.0.179 → 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.js CHANGED
@@ -3279,7 +3279,7 @@
3279
3279
  (block) => block.type === blockType
3280
3280
  );
3281
3281
  return {
3282
- id,
3282
+ id: toBlockId(id),
3283
3283
  type: blockType,
3284
3284
  disabled: isDisabled,
3285
3285
  settings: blockSchema?.fields?.reduce(
@@ -3308,6 +3308,12 @@
3308
3308
  }
3309
3309
  return fieldId.replace(/·/g, ".");
3310
3310
  }
3311
+ function toBlockId(id) {
3312
+ if (!id) {
3313
+ return id;
3314
+ }
3315
+ return id.replace(/\./g, "_");
3316
+ }
3311
3317
 
3312
3318
  // src/utils/md5.ts
3313
3319
  function md5(inputString) {
@@ -16262,18 +16268,11 @@ ${injects.join("\n")}<\/script>`;
16262
16268
  }
16263
16269
 
16264
16270
  // src/liquid/filters/shopify/img_url.ts
16265
- function bind59(_liquidSwell) {
16266
- return function filterImgUrl(input, ...params) {
16267
- if (!input) return "";
16268
- let url;
16269
- if (typeof input === "object") {
16270
- if (input.url) {
16271
- url = input.url;
16272
- } else {
16273
- return "";
16274
- }
16275
- } else {
16276
- url = String(input);
16271
+ function bind59(liquidSwell) {
16272
+ return async function filterImgUrl(input, ...params) {
16273
+ const url = await getImageUrlFromInput(input, liquidSwell);
16274
+ if (typeof url !== "string" || url === "") {
16275
+ return "";
16277
16276
  }
16278
16277
  const query = [];
16279
16278
  params.forEach((param) => {