@tecof/theme-editor 0.0.25 → 0.0.26

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
@@ -507,8 +507,9 @@ var TecofPicture = memo(({
507
507
  const { apiClient } = useTecof();
508
508
  const cdnUrl = apiClient.cdnUrl;
509
509
  if (!data3) return null;
510
+ const buildPath = (fileName) => data3?.folder && data3.folder !== "/" ? `${data3.folder.replace(/^\//, "")}/${fileName}` : fileName;
510
511
  const isExternal = data3?.type === "external" || data3?.provider === "external";
511
- const fileURL = isExternal ? data3?.url || "" : `${cdnUrl}/${data3?.name}`;
512
+ const fileURL = isExternal ? data3?.url || "" : `${cdnUrl}/${buildPath(data3?.name)}`;
512
513
  const isImageType2 = isExternal ? true : isImage(data3?.type);
513
514
  const isVideoType = isExternal ? false : isVideo(data3?.type);
514
515
  if (!fileURL) return null;