@shopify/shop-minis-react 0.0.32 → 0.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.
- package/dist/_virtual/index2.js +4 -4
- package/dist/_virtual/index3.js +4 -4
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.js +3 -2
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -3
- package/dist/_virtual/index7.js.map +1 -1
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/components/atoms/image.js +52 -0
- package/dist/components/atoms/image.js.map +1 -0
- package/dist/components/commerce/merchant-card.js +188 -245
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/components/commerce/product-card.js +11 -11
- package/dist/components/commerce/product-card.js.map +1 -1
- package/dist/components/content/image-content-wrapper.js +29 -22
- package/dist/components/content/image-content-wrapper.js.map +1 -1
- package/dist/hooks/content/useCreateImageContent.js +16 -22
- package/dist/hooks/content/useCreateImageContent.js.map +1 -1
- package/dist/hooks/storage/useImageUpload.js +36 -37
- package/dist/hooks/storage/useImageUpload.js.map +1 -1
- package/dist/index.js +252 -246
- package/dist/shop-minis-platform/src/types/content.js.map +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/mpd-parser@1.3.1/node_modules/mpd-parser/dist/mpd-parser.es.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/image.js +45 -9
- package/dist/utils/image.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/{thumbhash-image.tsx → image.tsx} +14 -14
- package/src/components/commerce/merchant-card.tsx +224 -225
- package/src/components/commerce/product-card.tsx +2 -2
- package/src/components/content/image-content-wrapper.tsx +9 -2
- package/src/components/index.ts +1 -1
- package/src/hooks/content/useCreateImageContent.ts +1 -7
- package/src/hooks/storage/useImageUpload.ts +22 -20
- package/src/stories/MerchantCard.stories.tsx +0 -3
- package/src/utils/image.ts +72 -0
- package/src/utils/index.ts +1 -1
- package/dist/components/atoms/thumbhash-image.js +0 -54
- package/dist/components/atoms/thumbhash-image.js.map +0 -1
- package/dist/utils/imageToDataUri.js +0 -10
- package/dist/utils/imageToDataUri.js.map +0 -1
- package/src/utils/imageToDataUri.ts +0 -8
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as o } from "../shop-minis-react/node_modules/.pnpm
|
|
3
|
-
var t = o();
|
|
4
|
-
const
|
|
2
|
+
import { __require as o } from "../shop-minis-react/node_modules/.pnpm/color@4.2.3/node_modules/color/index.js";
|
|
3
|
+
var t = /* @__PURE__ */ o();
|
|
4
|
+
const l = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
l as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index2.js.map
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as o } from "../shop-minis-react/node_modules/.pnpm
|
|
3
|
-
var t =
|
|
4
|
-
const
|
|
2
|
+
import { __require as o } from "../shop-minis-react/node_modules/.pnpm/@videojs_xhr@2.7.0/node_modules/@videojs/xhr/lib/index.js";
|
|
3
|
+
var t = o();
|
|
4
|
+
const a = /* @__PURE__ */ r(t);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index3.js.map
|
package/dist/_virtual/index4.js
CHANGED
package/dist/_virtual/index5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __require as r } from "../shop-minis-react/node_modules/.pnpm
|
|
1
|
+
import { __require as r } from "../shop-minis-react/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/shim/index.js";
|
|
2
2
|
var i = r();
|
|
3
3
|
export {
|
|
4
|
-
i as
|
|
4
|
+
i as s
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=index6.js.map
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var i = r();
|
|
1
|
+
var r = {};
|
|
3
2
|
export {
|
|
4
|
-
|
|
3
|
+
r as __exports
|
|
5
4
|
};
|
|
6
5
|
//# sourceMappingURL=index7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index7.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index8.js
CHANGED
package/dist/_virtual/index9.js
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as f, useState as L, useMemo as r, useCallback as v } from "react";
|
|
3
|
+
import { cn as c } from "../../lib/utils.js";
|
|
4
|
+
import { getThumbhashDataURL as I, getResizedImageUrl as k } from "../../utils/image.js";
|
|
5
|
+
const U = f(function(m) {
|
|
6
|
+
const {
|
|
7
|
+
src: e,
|
|
8
|
+
thumbhash: o,
|
|
9
|
+
onLoad: a,
|
|
10
|
+
className: i,
|
|
11
|
+
style: n,
|
|
12
|
+
aspectRatio: d = "auto",
|
|
13
|
+
...l
|
|
14
|
+
} = m, [u, g] = L(!1), t = r(
|
|
15
|
+
() => I(o ?? void 0),
|
|
16
|
+
[o]
|
|
17
|
+
), h = v(
|
|
18
|
+
(p) => {
|
|
19
|
+
g(!0), a?.(p);
|
|
20
|
+
},
|
|
21
|
+
[a]
|
|
22
|
+
), b = r(() => k(e), [e]);
|
|
23
|
+
return /* @__PURE__ */ s(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: c("relative w-full ", i),
|
|
27
|
+
style: {
|
|
28
|
+
...n,
|
|
29
|
+
aspectRatio: d,
|
|
30
|
+
backgroundImage: t ? `url(${t})` : void 0,
|
|
31
|
+
backgroundSize: "cover",
|
|
32
|
+
backgroundPosition: "center"
|
|
33
|
+
},
|
|
34
|
+
children: /* @__PURE__ */ s(
|
|
35
|
+
"img",
|
|
36
|
+
{
|
|
37
|
+
className: c(
|
|
38
|
+
"absolute inset-0 opacity-0 object-cover",
|
|
39
|
+
u && "opacity-100"
|
|
40
|
+
),
|
|
41
|
+
src: b,
|
|
42
|
+
onLoad: h,
|
|
43
|
+
...l
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
U as Image
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sources":["../../../src/components/atoms/image.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/alt-text */\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport {ImgHTMLAttributes, useCallback, useMemo, memo, useState} from 'react'\n\nimport {cn} from '../../lib/utils'\nimport {getThumbhashDataURL, getResizedImageUrl} from '../../utils'\n\ntype ImageProps = ImgHTMLAttributes<HTMLImageElement> & {\n src?: string\n thumbhash?: string | null\n aspectRatio?: number | string\n}\n\nexport const Image = memo(function Image(props: ImageProps) {\n const {\n src,\n thumbhash,\n onLoad,\n className,\n style,\n aspectRatio = 'auto',\n ...restProps\n } = props\n\n const [isLoaded, setIsLoaded] = useState(false)\n\n const thumbhashDataURL = useMemo(\n () => getThumbhashDataURL(thumbhash ?? undefined),\n [thumbhash]\n )\n\n const handleLoad = useCallback(\n (event: React.SyntheticEvent<HTMLImageElement, Event>) => {\n setIsLoaded(true)\n onLoad?.(event)\n },\n [onLoad]\n )\n\n const resizedImageSrc = useMemo(() => getResizedImageUrl(src), [src])\n\n return (\n <div\n className={cn('relative w-full ', className)}\n style={{\n ...style,\n aspectRatio,\n backgroundImage: thumbhashDataURL\n ? `url(${thumbhashDataURL})`\n : undefined,\n backgroundSize: 'cover',\n backgroundPosition: 'center',\n }}\n >\n <img\n className={cn(\n 'absolute inset-0 opacity-0 object-cover',\n isLoaded && 'opacity-100'\n )}\n src={resizedImageSrc}\n onLoad={handleLoad}\n {...restProps}\n />\n </div>\n )\n})\n"],"names":["Image","memo","props","src","thumbhash","onLoad","className","style","aspectRatio","restProps","isLoaded","setIsLoaded","useState","thumbhashDataURL","useMemo","getThumbhashDataURL","handleLoad","useCallback","event","resizedImageSrc","getResizedImageUrl","jsx","cn"],"mappings":";;;;AAaO,MAAMA,IAAQC,EAAK,SAAeC,GAAmB;AACpD,QAAA;AAAA,IACJ,KAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,GAAGC;AAAA,EAAA,IACDP,GAEE,CAACQ,GAAUC,CAAW,IAAIC,EAAS,EAAK,GAExCC,IAAmBC;AAAA,IACvB,MAAMC,EAAoBX,KAAa,MAAS;AAAA,IAChD,CAACA,CAAS;AAAA,EACZ,GAEMY,IAAaC;AAAA,IACjB,CAACC,MAAyD;AACxD,MAAAP,EAAY,EAAI,GAChBN,IAASa,CAAK;AAAA,IAChB;AAAA,IACA,CAACb,CAAM;AAAA,EACT,GAEMc,IAAkBL,EAAQ,MAAMM,EAAmBjB,CAAG,GAAG,CAACA,CAAG,CAAC;AAGlE,SAAA,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAG,oBAAoBhB,CAAS;AAAA,MAC3C,OAAO;AAAA,QACL,GAAGC;AAAA,QACH,aAAAC;AAAA,QACA,iBAAiBK,IACb,OAAOA,CAAgB,MACvB;AAAA,QACJ,gBAAgB;AAAA,QAChB,oBAAoB;AAAA,MACtB;AAAA,MAEA,UAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWC;AAAA,YACT;AAAA,YACAZ,KAAY;AAAA,UACd;AAAA,UACA,KAAKS;AAAA,UACL,QAAQH;AAAA,UACP,GAAGP;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EACF;AAEJ,CAAC;"}
|