pb-sxp-ui 1.4.2 → 1.4.3

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
@@ -9102,7 +9102,7 @@ var ExpandableText$1 = React.memo(ExpandableText);
9102
9102
 
9103
9103
  const FormatImage = React.forwardRef((props, ref) => {
9104
9104
  const { src, onLoad, style, className, loading, alt = 'image' } = props;
9105
- const [imgSrc, setImgSrc] = React.useState();
9105
+ const [imgSrc, setImgSrc] = React.useState(src);
9106
9106
  const imgRef = React.useRef(null);
9107
9107
  const [visible, setVisible] = React.useState(false);
9108
9108
  React.useImperativeHandle(ref, () => ({
@@ -9128,7 +9128,7 @@ const FormatImage = React.forwardRef((props, ref) => {
9128
9128
  };
9129
9129
  }, [src, visible]);
9130
9130
  return (React.createElement(React.Fragment, null,
9131
- !visible && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
9131
+ !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
9132
9132
  (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
9133
9133
  React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
9134
9134
  React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),