@shopify/shop-minis-cli 0.0.176 → 0.0.178
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/build/commands/create/examples/default/src/App.tsx +22 -7
- package/build/commands/dev/utils/deeplink.js +3 -1
- package/build/commands/dev/utils/deeplink.js.map +1 -1
- package/build/commands/dev/utils/web-server.js +1 -1
- package/build/commands/dev/utils/web-server.js.map +1 -1
- package/build/schemas/manifest.schema.json +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {usePopularProducts, ProductCard} from '@shopify/shop-minis-react'
|
|
1
|
+
import {usePopularProducts, ProductCard, List} from '@shopify/shop-minis-react'
|
|
2
2
|
|
|
3
3
|
export function App() {
|
|
4
|
-
const {products} = usePopularProducts()
|
|
4
|
+
const {products, fetchMore} = usePopularProducts()
|
|
5
|
+
|
|
6
|
+
const productRows = products
|
|
7
|
+
? Array.from({length: Math.ceil(products.length / 2)}, (_, i) =>
|
|
8
|
+
products.slice(i * 2, i * 2 + 2)
|
|
9
|
+
)
|
|
10
|
+
: []
|
|
5
11
|
|
|
6
12
|
return (
|
|
7
13
|
<div className="pt-12 px-4 pb-6">
|
|
@@ -15,11 +21,20 @@ export function App() {
|
|
|
15
21
|
<p className="text-base text-gray-600 mb-6 text-center">
|
|
16
22
|
These are the popular products today
|
|
17
23
|
</p>
|
|
18
|
-
<
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
24
|
+
<List
|
|
25
|
+
items={productRows}
|
|
26
|
+
height={600}
|
|
27
|
+
itemSizeForRow={() => 220}
|
|
28
|
+
showScrollbar={true}
|
|
29
|
+
fetchMore={fetchMore}
|
|
30
|
+
renderItem={productRow => (
|
|
31
|
+
<div className="grid grid-cols-2 gap-4 p-4">
|
|
32
|
+
{productRow.map(product => (
|
|
33
|
+
<ProductCard key={product.id} product={product} />
|
|
34
|
+
))}
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
37
|
+
/>
|
|
23
38
|
</div>
|
|
24
39
|
)
|
|
25
40
|
}
|
|
@@ -4,7 +4,7 @@ export function getDevWebUrl(host, tunnelListener) {
|
|
|
4
4
|
if (tunnelListener) {
|
|
5
5
|
return `${tunnelListener.url()}`;
|
|
6
6
|
}
|
|
7
|
-
const port = process.env.
|
|
7
|
+
const port = process.env.SHOP_MINIS_PORT || 5173;
|
|
8
8
|
return `http://${host}:${port}`;
|
|
9
9
|
}
|
|
10
10
|
export function getDevWebMiniDeeplink({ miniHandle, options, universalLink = false, tunnelListener, }) {
|
|
@@ -12,6 +12,8 @@ export function getDevWebMiniDeeplink({ miniHandle, options, universalLink = fal
|
|
|
12
12
|
const devParams = {
|
|
13
13
|
devServerUrl,
|
|
14
14
|
features: getMiniManifest()?.features ?? undefined,
|
|
15
|
+
trustedDomains: getMiniManifest()?.trusted_domains ?? undefined,
|
|
16
|
+
permissions: getMiniManifest()?.permissions ?? undefined,
|
|
15
17
|
};
|
|
16
18
|
const encodedDevParams = Buffer.from(JSON.stringify(devParams)).toString('base64');
|
|
17
19
|
const deeplink = universalLink
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deeplink.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/deeplink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AAGxD,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAGhE,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,cAA+B;IACxE,IAAI,cAAc,EAAE;QAClB,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,EAAE,CAAA;KACjC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"deeplink.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/deeplink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8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CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;IACxC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC;QAC9B,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,0BAA0B;YAC1B,YAAY,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;SAChD;KACF,CAAC,CAAA;IAEF,MAAM,IAAI,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"web-server.js","sourceRoot":"","sources":["../../../../src/commands/dev/utils/web-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAA;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;IACxC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC;QAC9B,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE;YACN,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;YAChB,0BAA0B;YAC1B,YAAY,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;SAChD;KACF,CAAC,CAAA;IAEF,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,eAAqC,CAAC,CAAA;IAEpE,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|