@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.mjs CHANGED
@@ -3252,7 +3252,7 @@ function getSectionSettingsFromProps(props, sectionSchema) {
3252
3252
  (block) => block.type === blockType
3253
3253
  );
3254
3254
  return {
3255
- id,
3255
+ id: toBlockId(id),
3256
3256
  type: blockType,
3257
3257
  disabled: isDisabled,
3258
3258
  settings: blockSchema?.fields?.reduce(
@@ -3281,6 +3281,12 @@ function toSchemaFieldId(fieldId) {
3281
3281
  }
3282
3282
  return fieldId.replace(/·/g, ".");
3283
3283
  }
3284
+ function toBlockId(id) {
3285
+ if (!id) {
3286
+ return id;
3287
+ }
3288
+ return id.replace(/\./g, "_");
3289
+ }
3284
3290
 
3285
3291
  // src/utils/md5.ts
3286
3292
  function md5(inputString) {
@@ -16243,18 +16249,11 @@ function bind58(_liquidSwell) {
16243
16249
  }
16244
16250
 
16245
16251
  // src/liquid/filters/shopify/img_url.ts
16246
- function bind59(_liquidSwell) {
16247
- return function filterImgUrl(input, ...params) {
16248
- if (!input) return "";
16249
- let url;
16250
- if (typeof input === "object") {
16251
- if (input.url) {
16252
- url = input.url;
16253
- } else {
16254
- return "";
16255
- }
16256
- } else {
16257
- url = String(input);
16252
+ function bind59(liquidSwell) {
16253
+ return async function filterImgUrl(input, ...params) {
16254
+ const url = await getImageUrlFromInput(input, liquidSwell);
16255
+ if (typeof url !== "string" || url === "") {
16256
+ return "";
16258
16257
  }
16259
16258
  const query = [];
16260
16259
  params.forEach((param) => {
@@ -20053,6 +20052,7 @@ export {
20053
20052
  scopeCustomCSS,
20054
20053
  stringifyQueryParams,
20055
20054
  systemFonts,
20056
- toBase64
20055
+ toBase64,
20056
+ toBlockId
20057
20057
  };
20058
20058
  //# sourceMappingURL=index.mjs.map