denwa-web-shared 1.0.33 → 1.0.34

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.
@@ -6770,65 +6770,57 @@ const BasePicture = ({
6770
6770
  loading = "lazy",
6771
6771
  ...pictureProps
6772
6772
  }) => {
6773
- const {
6774
- image1x,
6775
- image2x,
6776
- image1xWebp,
6777
- image2xWebp,
6778
- image1xAvif,
6779
- image2xAvif,
6780
- mobileImage1x,
6781
- mobileImage2x,
6782
- mobileImage1xWebp,
6783
- mobileImage2xWebp,
6784
- mobileImage1xAvif,
6785
- mobileImage2xAvif
6786
- } = data;
6787
6773
  return /* @__PURE__ */ jsxRuntime.jsxs("picture", { ...pictureProps, children: [
6788
- !!mobileImage1xAvif && /* @__PURE__ */ jsxRuntime.jsx(
6774
+ !!(data == null ? void 0 : data.mobileImage1xAvif) && /* @__PURE__ */ jsxRuntime.jsx(
6789
6775
  "source",
6790
6776
  {
6791
- srcSet: `${mobileImage1xAvif} 1x${mobileImage2xAvif ? `, ${mobileImage2xAvif} 2x` : ""}`,
6777
+ srcSet: `${data == null ? void 0 : data.mobileImage1xAvif} 1x${(data == null ? void 0 : data.mobileImage2xAvif) ? `, ${data == null ? void 0 : data.mobileImage2xAvif} 2x` : ""}`,
6792
6778
  media: `(max-width: ${mobileMaxWidth}px)`,
6793
6779
  type: "image/avif"
6794
6780
  }
6795
6781
  ),
6796
- !!mobileImage1xWebp && /* @__PURE__ */ jsxRuntime.jsx(
6782
+ !!(data == null ? void 0 : data.mobileImage1xWebp) && /* @__PURE__ */ jsxRuntime.jsx(
6797
6783
  "source",
6798
6784
  {
6799
- srcSet: `${mobileImage1xWebp} 1x${mobileImage2xWebp ? `, ${mobileImage2xWebp} 2x` : ""}`,
6785
+ srcSet: `${data == null ? void 0 : data.mobileImage1xWebp} 1x${(data == null ? void 0 : data.mobileImage2xWebp) ? `, ${data == null ? void 0 : data.mobileImage2xWebp} 2x` : ""}`,
6800
6786
  media: `(max-width: ${mobileMaxWidth}px)`,
6801
6787
  type: "image/webp"
6802
6788
  }
6803
6789
  ),
6804
- !!mobileImage1x && /* @__PURE__ */ jsxRuntime.jsx(
6790
+ !!(data == null ? void 0 : data.mobileImage1x) && /* @__PURE__ */ jsxRuntime.jsx(
6805
6791
  "source",
6806
6792
  {
6807
- srcSet: `${mobileImage1x} 1x${mobileImage2x ? `, ${mobileImage2x} 2x` : ""}`,
6793
+ srcSet: `${data == null ? void 0 : data.mobileImage1x} 1x${(data == null ? void 0 : data.mobileImage2x) ? `, ${data == null ? void 0 : data.mobileImage2x} 2x` : ""}`,
6808
6794
  media: `(max-width: ${mobileMaxWidth}px)`,
6809
6795
  type
6810
6796
  }
6811
6797
  ),
6812
- !!image1xAvif && /* @__PURE__ */ jsxRuntime.jsx(
6798
+ !!(data == null ? void 0 : data.image1xAvif) && /* @__PURE__ */ jsxRuntime.jsx(
6813
6799
  "source",
6814
6800
  {
6815
- srcSet: `${image1xAvif} 1x${image2xAvif ? `, ${image2xAvif} 2x` : ""}`,
6801
+ srcSet: `${data == null ? void 0 : data.image1xAvif} 1x${(data == null ? void 0 : data.image2xAvif) ? `, ${data == null ? void 0 : data.image2xAvif} 2x` : ""}`,
6816
6802
  type: "image/avif"
6817
6803
  }
6818
6804
  ),
6819
- !!image1xWebp && /* @__PURE__ */ jsxRuntime.jsx(
6805
+ !!(data == null ? void 0 : data.image1xWebp) && /* @__PURE__ */ jsxRuntime.jsx(
6820
6806
  "source",
6821
6807
  {
6822
- srcSet: `${image1xWebp} 1x${image2xWebp ? `, ${image2xWebp} 2x` : ""}`,
6808
+ srcSet: `${data == null ? void 0 : data.image1xWebp} 1x${(data == null ? void 0 : data.image2xWebp) ? `, ${data == null ? void 0 : data.image2xWebp} 2x` : ""}`,
6823
6809
  type: "image/webp"
6824
6810
  }
6825
6811
  ),
6826
- !!image1x && /* @__PURE__ */ jsxRuntime.jsx("source", { srcSet: `${image1x} 1x${image2x ? `, ${image2x} 2x` : ""}`, type }),
6812
+ !!(data == null ? void 0 : data.image1x) && /* @__PURE__ */ jsxRuntime.jsx(
6813
+ "source",
6814
+ {
6815
+ srcSet: `${data == null ? void 0 : data.image1x} 1x${(data == null ? void 0 : data.image2x) ? `, ${data == null ? void 0 : data.image2x} 2x` : ""}`,
6816
+ type
6817
+ }
6818
+ ),
6827
6819
  /* @__PURE__ */ jsxRuntime.jsx(
6828
6820
  "img",
6829
6821
  {
6830
6822
  ...imgProps,
6831
- src: image1x,
6823
+ src: data == null ? void 0 : data.image1x,
6832
6824
  alt,
6833
6825
  loading,
6834
6826
  decoding: loading === "eager" ? "sync" : "async",
@@ -6768,65 +6768,57 @@ const BasePicture = ({
6768
6768
  loading = "lazy",
6769
6769
  ...pictureProps
6770
6770
  }) => {
6771
- const {
6772
- image1x,
6773
- image2x,
6774
- image1xWebp,
6775
- image2xWebp,
6776
- image1xAvif,
6777
- image2xAvif,
6778
- mobileImage1x,
6779
- mobileImage2x,
6780
- mobileImage1xWebp,
6781
- mobileImage2xWebp,
6782
- mobileImage1xAvif,
6783
- mobileImage2xAvif
6784
- } = data;
6785
6771
  return /* @__PURE__ */ jsxs("picture", { ...pictureProps, children: [
6786
- !!mobileImage1xAvif && /* @__PURE__ */ jsx(
6772
+ !!(data == null ? void 0 : data.mobileImage1xAvif) && /* @__PURE__ */ jsx(
6787
6773
  "source",
6788
6774
  {
6789
- srcSet: `${mobileImage1xAvif} 1x${mobileImage2xAvif ? `, ${mobileImage2xAvif} 2x` : ""}`,
6775
+ srcSet: `${data == null ? void 0 : data.mobileImage1xAvif} 1x${(data == null ? void 0 : data.mobileImage2xAvif) ? `, ${data == null ? void 0 : data.mobileImage2xAvif} 2x` : ""}`,
6790
6776
  media: `(max-width: ${mobileMaxWidth}px)`,
6791
6777
  type: "image/avif"
6792
6778
  }
6793
6779
  ),
6794
- !!mobileImage1xWebp && /* @__PURE__ */ jsx(
6780
+ !!(data == null ? void 0 : data.mobileImage1xWebp) && /* @__PURE__ */ jsx(
6795
6781
  "source",
6796
6782
  {
6797
- srcSet: `${mobileImage1xWebp} 1x${mobileImage2xWebp ? `, ${mobileImage2xWebp} 2x` : ""}`,
6783
+ srcSet: `${data == null ? void 0 : data.mobileImage1xWebp} 1x${(data == null ? void 0 : data.mobileImage2xWebp) ? `, ${data == null ? void 0 : data.mobileImage2xWebp} 2x` : ""}`,
6798
6784
  media: `(max-width: ${mobileMaxWidth}px)`,
6799
6785
  type: "image/webp"
6800
6786
  }
6801
6787
  ),
6802
- !!mobileImage1x && /* @__PURE__ */ jsx(
6788
+ !!(data == null ? void 0 : data.mobileImage1x) && /* @__PURE__ */ jsx(
6803
6789
  "source",
6804
6790
  {
6805
- srcSet: `${mobileImage1x} 1x${mobileImage2x ? `, ${mobileImage2x} 2x` : ""}`,
6791
+ srcSet: `${data == null ? void 0 : data.mobileImage1x} 1x${(data == null ? void 0 : data.mobileImage2x) ? `, ${data == null ? void 0 : data.mobileImage2x} 2x` : ""}`,
6806
6792
  media: `(max-width: ${mobileMaxWidth}px)`,
6807
6793
  type
6808
6794
  }
6809
6795
  ),
6810
- !!image1xAvif && /* @__PURE__ */ jsx(
6796
+ !!(data == null ? void 0 : data.image1xAvif) && /* @__PURE__ */ jsx(
6811
6797
  "source",
6812
6798
  {
6813
- srcSet: `${image1xAvif} 1x${image2xAvif ? `, ${image2xAvif} 2x` : ""}`,
6799
+ srcSet: `${data == null ? void 0 : data.image1xAvif} 1x${(data == null ? void 0 : data.image2xAvif) ? `, ${data == null ? void 0 : data.image2xAvif} 2x` : ""}`,
6814
6800
  type: "image/avif"
6815
6801
  }
6816
6802
  ),
6817
- !!image1xWebp && /* @__PURE__ */ jsx(
6803
+ !!(data == null ? void 0 : data.image1xWebp) && /* @__PURE__ */ jsx(
6818
6804
  "source",
6819
6805
  {
6820
- srcSet: `${image1xWebp} 1x${image2xWebp ? `, ${image2xWebp} 2x` : ""}`,
6806
+ srcSet: `${data == null ? void 0 : data.image1xWebp} 1x${(data == null ? void 0 : data.image2xWebp) ? `, ${data == null ? void 0 : data.image2xWebp} 2x` : ""}`,
6821
6807
  type: "image/webp"
6822
6808
  }
6823
6809
  ),
6824
- !!image1x && /* @__PURE__ */ jsx("source", { srcSet: `${image1x} 1x${image2x ? `, ${image2x} 2x` : ""}`, type }),
6810
+ !!(data == null ? void 0 : data.image1x) && /* @__PURE__ */ jsx(
6811
+ "source",
6812
+ {
6813
+ srcSet: `${data == null ? void 0 : data.image1x} 1x${(data == null ? void 0 : data.image2x) ? `, ${data == null ? void 0 : data.image2x} 2x` : ""}`,
6814
+ type
6815
+ }
6816
+ ),
6825
6817
  /* @__PURE__ */ jsx(
6826
6818
  "img",
6827
6819
  {
6828
6820
  ...imgProps,
6829
- src: image1x,
6821
+ src: data == null ? void 0 : data.image1x,
6830
6822
  alt,
6831
6823
  loading,
6832
6824
  decoding: loading === "eager" ? "sync" : "async",
@@ -2,8 +2,8 @@ import { DetailedHTMLProps, FC, HTMLAttributes, ImgHTMLAttributes } from 'react'
2
2
  import { ImageType } from '../types';
3
3
  export interface BasePictureProps extends DetailedHTMLProps<HTMLAttributes<HTMLPictureElement>, HTMLPictureElement> {
4
4
  imgProps?: DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
5
- data: PictureData;
6
- type: ImageType;
5
+ data: PictureData | undefined;
6
+ type: ImageType | undefined;
7
7
  alt: string;
8
8
  mobileMaxWidth?: number;
9
9
  loading?: 'eager' | 'lazy';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "denwa-web-shared",
3
3
  "private": false,
4
- "version": "1.0.33",
4
+ "version": "1.0.34",
5
5
  "type": "module",
6
6
  "author": "Denwa",
7
7
  "main": "dist/denwa-web-shared.cjs.js",