@shopify/shop-minis-cli 0.0.35
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/README.md +8 -0
- package/build/commands/create-mini/index.d.ts +2 -0
- package/build/commands/create-mini/index.js +116 -0
- package/build/commands/create-mini/index.js.map +1 -0
- package/build/commands/create-mini/utils/template-app.d.ts +1 -0
- package/build/commands/create-mini/utils/template-app.js +44 -0
- package/build/commands/create-mini/utils/template-app.js.map +1 -0
- package/build/commands/dev/index.d.ts +6 -0
- package/build/commands/dev/index.js +31 -0
- package/build/commands/dev/index.js.map +1 -0
- package/build/commands/dev/utils/android.d.ts +16 -0
- package/build/commands/dev/utils/android.js +165 -0
- package/build/commands/dev/utils/android.js.map +1 -0
- package/build/commands/dev/utils/binaries.d.ts +83 -0
- package/build/commands/dev/utils/binaries.js +173 -0
- package/build/commands/dev/utils/binaries.js.map +1 -0
- package/build/commands/dev/utils/binaries.test.d.ts +1 -0
- package/build/commands/dev/utils/binaries.test.js +275 -0
- package/build/commands/dev/utils/binaries.test.js.map +1 -0
- package/build/commands/dev/utils/deeplink.d.ts +3 -0
- package/build/commands/dev/utils/deeplink.js +30 -0
- package/build/commands/dev/utils/deeplink.js.map +1 -0
- package/build/commands/dev/utils/interactive-terminal.d.ts +23 -0
- package/build/commands/dev/utils/interactive-terminal.js +252 -0
- package/build/commands/dev/utils/interactive-terminal.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-config.d.ts +2 -0
- package/build/commands/dev/utils/metro/metro-config.js +31 -0
- package/build/commands/dev/utils/metro/metro-config.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-reporter.d.ts +14 -0
- package/build/commands/dev/utils/metro/metro-reporter.js +34 -0
- package/build/commands/dev/utils/metro/metro-reporter.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.d.ts +6 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.js +45 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.js.map +1 -0
- package/build/commands/dev/utils/metro/metro-server.d.ts +2 -0
- package/build/commands/dev/utils/metro/metro-server.js +24 -0
- package/build/commands/dev/utils/metro/metro-server.js.map +1 -0
- package/build/commands/dev/utils/minis-manifest.d.ts +1 -0
- package/build/commands/dev/utils/minis-manifest.js +24 -0
- package/build/commands/dev/utils/minis-manifest.js.map +1 -0
- package/build/commands/dev/utils/qr-code.d.ts +1 -0
- package/build/commands/dev/utils/qr-code.js +12 -0
- package/build/commands/dev/utils/qr-code.js.map +1 -0
- package/build/commands/dev/utils/simulator.d.ts +19 -0
- package/build/commands/dev/utils/simulator.js +89 -0
- package/build/commands/dev/utils/simulator.js.map +1 -0
- package/build/commands/dev/utils/with-retries.d.ts +4 -0
- package/build/commands/dev/utils/with-retries.js +28 -0
- package/build/commands/dev/utils/with-retries.js.map +1 -0
- package/build/commands/generate-graphql-types/index.d.ts +5 -0
- package/build/commands/generate-graphql-types/index.js +90 -0
- package/build/commands/generate-graphql-types/index.js.map +1 -0
- package/build/commands/utils/exec-async-child-process.d.ts +18 -0
- package/build/commands/utils/exec-async-child-process.js +48 -0
- package/build/commands/utils/exec-async-child-process.js.map +1 -0
- package/build/commands/utils/wrap-with-loading-indicator.d.ts +9 -0
- package/build/commands/utils/wrap-with-loading-indicator.js +23 -0
- package/build/commands/utils/wrap-with-loading-indicator.js.map +1 -0
- package/build/dev-panel/images/bottomsheet.png +0 -0
- package/build/dev-panel/images/checkmark.svg +3 -0
- package/build/dev-panel/images/chevron.svg +3 -0
- package/build/dev-panel/images/copy.svg +4 -0
- package/build/dev-panel/images/get-started.svg +3 -0
- package/build/dev-panel/images/how-to.svg +3 -0
- package/build/dev-panel/images/navigation.png +0 -0
- package/build/dev-panel/images/references.svg +3 -0
- package/build/dev-panel/images/shop-minis-logo-inverse.svg +5 -0
- package/build/dev-panel/images/shop-minis-logo.svg +5 -0
- package/build/dev-panel/images/stories.png +0 -0
- package/build/dev-panel/images/topics.svg +3 -0
- package/build/dev-panel/index.html +302 -0
- package/build/dev-panel/middleware.d.ts +4 -0
- package/build/dev-panel/middleware.js +11 -0
- package/build/dev-panel/middleware.js.map +1 -0
- package/build/dev-panel/middleware.ts +6 -0
- package/build/dev-panel/styles.css +507 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +26 -0
- package/build/index.js.map +1 -0
- package/package.json +83 -0
- package/templates/__template_blank/src/custom.d.ts +4 -0
- package/templates/__template_blank/src/index.tsx +9 -0
- package/templates/__template_blank/src/screens/HomeScreen.tsx +12 -0
- package/templates/__template_blank/src/types.ts +5 -0
- package/templates/__template_common/.eslintignore +1 -0
- package/templates/__template_common/.eslintrc.json +132 -0
- package/templates/__template_common/.prettierrc.json +8 -0
- package/templates/__template_common/babel.config.js +19 -0
- package/templates/__template_common/gitignore +3 -0
- package/templates/__template_common/index.tsx +43 -0
- package/templates/__template_common/metro.config.js +31 -0
- package/templates/__template_common/package.json +68 -0
- package/templates/__template_common/patches/react-native+0.68.5.patch +173 -0
- package/templates/__template_common/src/manifest.json +29 -0
- package/templates/__template_common/tsconfig.json +36 -0
- package/templates/__template_hello_world/src/assets/Modal-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/ProductCard-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/ProductLink-component-thumbnail.png +0 -0
- package/templates/__template_hello_world/src/assets/assets.d.ts +4 -0
- package/templates/__template_hello_world/src/assets/figma-logo.svg +14 -0
- package/templates/__template_hello_world/src/assets/shop-minis-logo.svg +7 -0
- package/templates/__template_hello_world/src/components/ButtonCTA.tsx +31 -0
- package/templates/__template_hello_world/src/components/ComponentLink.ts +70 -0
- package/templates/__template_hello_world/src/components/ComponentListItem.tsx +38 -0
- package/templates/__template_hello_world/src/components/FeaturedComponents.tsx +108 -0
- package/templates/__template_hello_world/src/components/Header.tsx +40 -0
- package/templates/__template_hello_world/src/data/Test.graphql +33 -0
- package/templates/__template_hello_world/src/data/Test.graphql.d.ts +114 -0
- package/templates/__template_hello_world/src/data/TestProducts.graphql +34 -0
- package/templates/__template_hello_world/src/data/TestProducts.graphql.d.ts +119 -0
- package/templates/__template_hello_world/src/index.tsx +9 -0
- package/templates/__template_hello_world/src/routes.tsx +107 -0
- package/templates/__template_hello_world/src/screens/AvatarScreen.tsx +95 -0
- package/templates/__template_hello_world/src/screens/BottomSheetScreen.tsx +711 -0
- package/templates/__template_hello_world/src/screens/ButtonsScreen.tsx +90 -0
- package/templates/__template_hello_world/src/screens/GridScreen.tsx +74 -0
- package/templates/__template_hello_world/src/screens/HomeScreen.tsx +70 -0
- package/templates/__template_hello_world/src/screens/IconsScreen.tsx +181 -0
- package/templates/__template_hello_world/src/screens/MediaScreen.tsx +130 -0
- package/templates/__template_hello_world/src/screens/ModalScreen.tsx +379 -0
- package/templates/__template_hello_world/src/screens/ProductCardGridScreen.tsx +68 -0
- package/templates/__template_hello_world/src/screens/ProductCardScreen.tsx +62 -0
- package/templates/__template_hello_world/src/screens/ProductLinkScreen.tsx +215 -0
- package/templates/__template_hello_world/src/screens/ProgressIndicatorScreen.tsx +77 -0
- package/templates/__template_hello_world/src/screens/QuantityPickerScreen.tsx +76 -0
- package/templates/__template_hello_world/src/screens/SpinnerScreen.tsx +63 -0
- package/templates/__template_hello_world/src/screens/TypographyScreen.tsx +274 -0
- package/templates/__template_hello_world/src/screens/WebViewScreen.tsx +42 -0
- package/templates/__template_hello_world/src/types.ts +25 -0
- package/templates/__template_snowboardz/src/assets/assets.d.ts +4 -0
- package/templates/__template_snowboardz/src/assets/circle-blue.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-green.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-purple.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-rainbow.svg +34 -0
- package/templates/__template_snowboardz/src/assets/circle-red.svg +9 -0
- package/templates/__template_snowboardz/src/assets/circle-yellow.svg +9 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-advanced.svg +3 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-beginner.svg +3 -0
- package/templates/__template_snowboardz/src/assets/skill-level-icon-intermediate.svg +3 -0
- package/templates/__template_snowboardz/src/components/ColorButton.tsx +79 -0
- package/templates/__template_snowboardz/src/components/ColorPicker.tsx +40 -0
- package/templates/__template_snowboardz/src/components/EmptyResult.tsx +52 -0
- package/templates/__template_snowboardz/src/components/SkillLevelIcon.tsx +44 -0
- package/templates/__template_snowboardz/src/components/SkillLevelPicker.tsx +86 -0
- package/templates/__template_snowboardz/src/data/TestProducts.graphql +34 -0
- package/templates/__template_snowboardz/src/data/TestProducts.graphql.d.ts +108 -0
- package/templates/__template_snowboardz/src/hooks/useSnowboardData.tsx +37 -0
- package/templates/__template_snowboardz/src/index.tsx +9 -0
- package/templates/__template_snowboardz/src/routes.tsx +17 -0
- package/templates/__template_snowboardz/src/screens/HomeScreen.tsx +126 -0
- package/templates/__template_snowboardz/src/types.ts +12 -0
- package/templates/__template_snowboardz/src/utils.ts +17 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {StackParamList} from '../types'
|
|
2
|
+
|
|
3
|
+
export interface ComponentLink {
|
|
4
|
+
name: string
|
|
5
|
+
screen: keyof StackParamList
|
|
6
|
+
thumbnail?: any
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const componentLinks: ComponentLink[] = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Avatar',
|
|
12
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Avatar',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'BottomSheet',
|
|
16
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.BottomSheet',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'Buttons',
|
|
20
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Buttons',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Grid',
|
|
24
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Grid',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Icon',
|
|
28
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Icons',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Media',
|
|
32
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Media',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Modal',
|
|
36
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Modal',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'ProductCard',
|
|
40
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProductCard',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'ProductCardGrid',
|
|
44
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProductCardGrid',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'ProductLink',
|
|
48
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProductLink',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'ProgressIndicator',
|
|
52
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.ProgressIndicator',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Spinner',
|
|
56
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Spinner',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Typography',
|
|
60
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.Typography',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'QuantityPicker',
|
|
64
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.QuantityPicker',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'WebView',
|
|
68
|
+
screen: '__MINI_APP_HANDLE_PASCAL_CASE__.WebView',
|
|
69
|
+
},
|
|
70
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {TouchableOpacity} from 'react-native'
|
|
2
|
+
import {useNavigation} from '@react-navigation/native'
|
|
3
|
+
import {NativeStackNavigationProp} from '@react-navigation/native-stack'
|
|
4
|
+
import {Box, Text, Icon} from '@shopify/shop-minis-platform-sdk'
|
|
5
|
+
|
|
6
|
+
import {StackParamList} from '../types'
|
|
7
|
+
|
|
8
|
+
export const ComponentListItem = ({
|
|
9
|
+
name,
|
|
10
|
+
screen,
|
|
11
|
+
}: {
|
|
12
|
+
name: string
|
|
13
|
+
screen: keyof StackParamList
|
|
14
|
+
}) => {
|
|
15
|
+
const navigation = useNavigation<NativeStackNavigationProp<StackParamList>>()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Box
|
|
19
|
+
width="100%"
|
|
20
|
+
paddingVertical="s"
|
|
21
|
+
borderBottomColor="borders-regular"
|
|
22
|
+
borderBottomWidth={1}
|
|
23
|
+
>
|
|
24
|
+
<TouchableOpacity onPress={() => navigation.navigate(screen)}>
|
|
25
|
+
<Box
|
|
26
|
+
justifyContent="space-between"
|
|
27
|
+
flexDirection="row"
|
|
28
|
+
alignItems="center"
|
|
29
|
+
>
|
|
30
|
+
<Text variant="buttonLarge" marginBottom="xxs">
|
|
31
|
+
{name}
|
|
32
|
+
</Text>
|
|
33
|
+
<Icon name="chevron-right" />
|
|
34
|
+
</Box>
|
|
35
|
+
</TouchableOpacity>
|
|
36
|
+
</Box>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {useCallback} from 'react'
|
|
2
|
+
import {
|
|
3
|
+
FlatList,
|
|
4
|
+
useWindowDimensions,
|
|
5
|
+
Image,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
} from 'react-native'
|
|
8
|
+
import {useNavigation} from '@react-navigation/native'
|
|
9
|
+
import {NativeStackNavigationProp} from '@react-navigation/native-stack'
|
|
10
|
+
import {Box, Icon, Text} from '@shopify/shop-minis-platform-sdk'
|
|
11
|
+
|
|
12
|
+
import {StackParamList} from '../types'
|
|
13
|
+
|
|
14
|
+
import {ComponentLink, componentLinks} from './ComponentLink'
|
|
15
|
+
|
|
16
|
+
export const FeaturedComponents = ({
|
|
17
|
+
components,
|
|
18
|
+
}: {
|
|
19
|
+
components: ComponentLink[]
|
|
20
|
+
}) => {
|
|
21
|
+
const navigation = useNavigation<NativeStackNavigationProp<StackParamList>>()
|
|
22
|
+
const {width} = useWindowDimensions()
|
|
23
|
+
const cardWidth = width * 0.6
|
|
24
|
+
const cardHeight = cardWidth * 0.8
|
|
25
|
+
const randomComponentCard = {
|
|
26
|
+
name: 'Surprise me',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const renderCard = useCallback(
|
|
30
|
+
({item, index}: {item: ComponentLink; index: number}) => {
|
|
31
|
+
const isLast = index === components.length
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
key={item.name}
|
|
36
|
+
onPress={() => {
|
|
37
|
+
if (item.name === 'Surprise me') {
|
|
38
|
+
const randomComponentLink =
|
|
39
|
+
componentLinks[
|
|
40
|
+
Math.floor(Math.random() * componentLinks.length)
|
|
41
|
+
]
|
|
42
|
+
navigation.navigate(randomComponentLink.screen)
|
|
43
|
+
} else {
|
|
44
|
+
navigation.navigate(item.screen)
|
|
45
|
+
}
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Box
|
|
49
|
+
width={cardWidth}
|
|
50
|
+
height={cardHeight}
|
|
51
|
+
backgroundColor="backgrounds-subdued"
|
|
52
|
+
borderRadius={16}
|
|
53
|
+
marginLeft="s"
|
|
54
|
+
marginRight={isLast ? 's' : 'none'}
|
|
55
|
+
flexDirection="column"
|
|
56
|
+
>
|
|
57
|
+
{item.thumbnail && !isLast && (
|
|
58
|
+
<Image
|
|
59
|
+
style={{
|
|
60
|
+
width: cardWidth,
|
|
61
|
+
height: cardHeight,
|
|
62
|
+
}}
|
|
63
|
+
source={item.thumbnail}
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
{isLast ? (
|
|
68
|
+
<Box
|
|
69
|
+
flexDirection="column"
|
|
70
|
+
alignItems="center"
|
|
71
|
+
justifyContent="center"
|
|
72
|
+
height={cardHeight}
|
|
73
|
+
>
|
|
74
|
+
<Icon name="network" size="m" />
|
|
75
|
+
<Text mt="xxs" variant="bodyLargeBold">
|
|
76
|
+
{item.name}
|
|
77
|
+
</Text>
|
|
78
|
+
</Box>
|
|
79
|
+
) : (
|
|
80
|
+
<Text
|
|
81
|
+
variant="bodyLargeBold"
|
|
82
|
+
mt="m"
|
|
83
|
+
ml="m"
|
|
84
|
+
style={{
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{item.name}
|
|
89
|
+
</Text>
|
|
90
|
+
)}
|
|
91
|
+
</Box>
|
|
92
|
+
</TouchableOpacity>
|
|
93
|
+
)
|
|
94
|
+
},
|
|
95
|
+
[components.length, cardWidth, cardHeight, navigation]
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<FlatList
|
|
100
|
+
horizontal
|
|
101
|
+
style={{flex: 1}}
|
|
102
|
+
data={[...components, randomComponentCard as ComponentLink]}
|
|
103
|
+
keyExtractor={item => item.name}
|
|
104
|
+
renderItem={renderCard}
|
|
105
|
+
showsHorizontalScrollIndicator={false}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {TouchableOpacity, Linking} from 'react-native'
|
|
2
|
+
import {useNavigation} from '@react-navigation/native'
|
|
3
|
+
import {NativeStackNavigationProp} from '@react-navigation/native-stack'
|
|
4
|
+
import {Box, Icon, Text} from '@shopify/shop-minis-platform-sdk'
|
|
5
|
+
|
|
6
|
+
import {StackParamList} from '../types'
|
|
7
|
+
|
|
8
|
+
const SHOP_MINIS_DOCS_URL = 'https://shop.app/minis/docs'
|
|
9
|
+
|
|
10
|
+
export const Header = () => {
|
|
11
|
+
const navigation = useNavigation<NativeStackNavigationProp<StackParamList>>()
|
|
12
|
+
return (
|
|
13
|
+
<Box
|
|
14
|
+
px="s"
|
|
15
|
+
py="s"
|
|
16
|
+
flexDirection="row"
|
|
17
|
+
justifyContent="space-between"
|
|
18
|
+
alignItems="center"
|
|
19
|
+
>
|
|
20
|
+
<Box>
|
|
21
|
+
<TouchableOpacity
|
|
22
|
+
onPress={() => navigation.goBack()}
|
|
23
|
+
accessibilityLabel="Navigate back"
|
|
24
|
+
>
|
|
25
|
+
<Box mt="xs">
|
|
26
|
+
<Icon name="back" />
|
|
27
|
+
</Box>
|
|
28
|
+
</TouchableOpacity>
|
|
29
|
+
</Box>
|
|
30
|
+
<TouchableOpacity onPress={() => Linking.openURL(SHOP_MINIS_DOCS_URL)}>
|
|
31
|
+
<Box mt="xs" flexDirection="row" alignItems="center">
|
|
32
|
+
<Text variant="bodySmall" mr="xs">
|
|
33
|
+
Read docs
|
|
34
|
+
</Text>
|
|
35
|
+
<Icon name="launch" />
|
|
36
|
+
</Box>
|
|
37
|
+
</TouchableOpacity>
|
|
38
|
+
</Box>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
query HelloWorldTest($shopId: ID!, $productId: ID!) {
|
|
2
|
+
shop(id: $shopId) {
|
|
3
|
+
id
|
|
4
|
+
name
|
|
5
|
+
product(id: $productId) {
|
|
6
|
+
id
|
|
7
|
+
title
|
|
8
|
+
featuredImage {
|
|
9
|
+
id
|
|
10
|
+
altText
|
|
11
|
+
url
|
|
12
|
+
}
|
|
13
|
+
defaultVariant {
|
|
14
|
+
id
|
|
15
|
+
title
|
|
16
|
+
isFavorited
|
|
17
|
+
compareAtPrice {
|
|
18
|
+
amount
|
|
19
|
+
currencyCode
|
|
20
|
+
}
|
|
21
|
+
price {
|
|
22
|
+
amount
|
|
23
|
+
currencyCode
|
|
24
|
+
}
|
|
25
|
+
image {
|
|
26
|
+
id
|
|
27
|
+
altText
|
|
28
|
+
url
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {DocumentNode} from 'graphql-typed'
|
|
2
|
+
import {
|
|
3
|
+
URL,
|
|
4
|
+
Decimal,
|
|
5
|
+
CurrencyCode,
|
|
6
|
+
} from '@shopify/shop-minis-platform-sdk/api/types'
|
|
7
|
+
export namespace HelloWorldTestQueryPartialData {
|
|
8
|
+
export interface ShopProductFeaturedImage {
|
|
9
|
+
__typename?: 'Image' | null
|
|
10
|
+
id?: string | null
|
|
11
|
+
altText?: string | null
|
|
12
|
+
url?: URL | null
|
|
13
|
+
}
|
|
14
|
+
export interface ShopProductDefaultVariantCompareAtPrice {
|
|
15
|
+
__typename?: 'Money' | null
|
|
16
|
+
amount?: Decimal | null
|
|
17
|
+
currencyCode?: CurrencyCode | null
|
|
18
|
+
}
|
|
19
|
+
export interface ShopProductDefaultVariantPrice {
|
|
20
|
+
__typename?: 'Money' | null
|
|
21
|
+
amount?: Decimal | null
|
|
22
|
+
currencyCode?: CurrencyCode | null
|
|
23
|
+
}
|
|
24
|
+
export interface ShopProductDefaultVariantImage {
|
|
25
|
+
__typename?: 'Image' | null
|
|
26
|
+
id?: string | null
|
|
27
|
+
altText?: string | null
|
|
28
|
+
url?: URL | null
|
|
29
|
+
}
|
|
30
|
+
export interface ShopProductDefaultVariant {
|
|
31
|
+
__typename?: 'ProductVariant' | null
|
|
32
|
+
id?: string | null
|
|
33
|
+
title?: string | null
|
|
34
|
+
isFavorited?: boolean | null
|
|
35
|
+
compareAtPrice?: HelloWorldTestQueryPartialData.ShopProductDefaultVariantCompareAtPrice | null
|
|
36
|
+
price?: HelloWorldTestQueryPartialData.ShopProductDefaultVariantPrice | null
|
|
37
|
+
image?: HelloWorldTestQueryPartialData.ShopProductDefaultVariantImage | null
|
|
38
|
+
}
|
|
39
|
+
export interface ShopProduct {
|
|
40
|
+
__typename?: 'Product' | null
|
|
41
|
+
id?: string | null
|
|
42
|
+
title?: string | null
|
|
43
|
+
featuredImage?: HelloWorldTestQueryPartialData.ShopProductFeaturedImage | null
|
|
44
|
+
defaultVariant?: HelloWorldTestQueryPartialData.ShopProductDefaultVariant | null
|
|
45
|
+
}
|
|
46
|
+
export interface Shop {
|
|
47
|
+
__typename?: 'Shop' | null
|
|
48
|
+
id?: string | null
|
|
49
|
+
name?: string | null
|
|
50
|
+
product?: HelloWorldTestQueryPartialData.ShopProduct | null
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export interface HelloWorldTestQueryPartialData {
|
|
54
|
+
shop?: HelloWorldTestQueryPartialData.Shop | null
|
|
55
|
+
}
|
|
56
|
+
export namespace HelloWorldTestQueryData {
|
|
57
|
+
export interface Variables {
|
|
58
|
+
shopId: string
|
|
59
|
+
productId: string
|
|
60
|
+
}
|
|
61
|
+
export interface ShopProductFeaturedImage {
|
|
62
|
+
__typename: 'Image'
|
|
63
|
+
id?: string | null
|
|
64
|
+
altText?: string | null
|
|
65
|
+
url: URL
|
|
66
|
+
}
|
|
67
|
+
export interface ShopProductDefaultVariantCompareAtPrice {
|
|
68
|
+
__typename: 'Money'
|
|
69
|
+
amount: Decimal
|
|
70
|
+
currencyCode: CurrencyCode
|
|
71
|
+
}
|
|
72
|
+
export interface ShopProductDefaultVariantPrice {
|
|
73
|
+
__typename: 'Money'
|
|
74
|
+
amount: Decimal
|
|
75
|
+
currencyCode: CurrencyCode
|
|
76
|
+
}
|
|
77
|
+
export interface ShopProductDefaultVariantImage {
|
|
78
|
+
__typename: 'Image'
|
|
79
|
+
id?: string | null
|
|
80
|
+
altText?: string | null
|
|
81
|
+
url: URL
|
|
82
|
+
}
|
|
83
|
+
export interface ShopProductDefaultVariant {
|
|
84
|
+
__typename: 'ProductVariant'
|
|
85
|
+
id: string
|
|
86
|
+
title: string
|
|
87
|
+
isFavorited: boolean
|
|
88
|
+
compareAtPrice?: HelloWorldTestQueryData.ShopProductDefaultVariantCompareAtPrice | null
|
|
89
|
+
price: HelloWorldTestQueryData.ShopProductDefaultVariantPrice
|
|
90
|
+
image?: HelloWorldTestQueryData.ShopProductDefaultVariantImage | null
|
|
91
|
+
}
|
|
92
|
+
export interface ShopProduct {
|
|
93
|
+
__typename: 'Product'
|
|
94
|
+
id: string
|
|
95
|
+
title: string
|
|
96
|
+
featuredImage?: HelloWorldTestQueryData.ShopProductFeaturedImage | null
|
|
97
|
+
defaultVariant: HelloWorldTestQueryData.ShopProductDefaultVariant
|
|
98
|
+
}
|
|
99
|
+
export interface Shop {
|
|
100
|
+
__typename: 'Shop'
|
|
101
|
+
id: string
|
|
102
|
+
name: string
|
|
103
|
+
product?: HelloWorldTestQueryData.ShopProduct | null
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export interface HelloWorldTestQueryData {
|
|
107
|
+
shop?: HelloWorldTestQueryData.Shop | null
|
|
108
|
+
}
|
|
109
|
+
declare const document: DocumentNode<
|
|
110
|
+
HelloWorldTestQueryData,
|
|
111
|
+
HelloWorldTestQueryData.Variables,
|
|
112
|
+
HelloWorldTestQueryPartialData
|
|
113
|
+
>
|
|
114
|
+
export default document
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
query HelloWorldTestProducts($shopId: ID!, $productIds: [ID!]!) {
|
|
2
|
+
shop(id: $shopId) {
|
|
3
|
+
id
|
|
4
|
+
name
|
|
5
|
+
productsByIds(ids: $productIds) {
|
|
6
|
+
id
|
|
7
|
+
title
|
|
8
|
+
tags
|
|
9
|
+
featuredImage {
|
|
10
|
+
id
|
|
11
|
+
altText
|
|
12
|
+
url
|
|
13
|
+
}
|
|
14
|
+
defaultVariant {
|
|
15
|
+
id
|
|
16
|
+
title
|
|
17
|
+
isFavorited
|
|
18
|
+
compareAtPrice {
|
|
19
|
+
amount
|
|
20
|
+
currencyCode
|
|
21
|
+
}
|
|
22
|
+
price {
|
|
23
|
+
amount
|
|
24
|
+
currencyCode
|
|
25
|
+
}
|
|
26
|
+
image {
|
|
27
|
+
id
|
|
28
|
+
altText
|
|
29
|
+
url
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {DocumentNode} from 'graphql-typed'
|
|
2
|
+
import {
|
|
3
|
+
URL,
|
|
4
|
+
Decimal,
|
|
5
|
+
CurrencyCode,
|
|
6
|
+
} from '@shopify/shop-minis-platform-sdk/api/types'
|
|
7
|
+
|
|
8
|
+
export namespace HelloWorldTestProductsQueryPartialData {
|
|
9
|
+
export interface ShopProductsByIdsFeaturedImage {
|
|
10
|
+
__typename?: 'Image' | null
|
|
11
|
+
id?: string | null
|
|
12
|
+
altText?: string | null
|
|
13
|
+
url?: URL | null
|
|
14
|
+
}
|
|
15
|
+
export interface ShopProductsByIdsDefaultVariantCompareAtPrice {
|
|
16
|
+
__typename?: 'Money' | null
|
|
17
|
+
amount?: Decimal | null
|
|
18
|
+
currencyCode?: CurrencyCode | null
|
|
19
|
+
}
|
|
20
|
+
export interface ShopProductsByIdsDefaultVariantPrice {
|
|
21
|
+
__typename?: 'Money' | null
|
|
22
|
+
amount?: Decimal | null
|
|
23
|
+
currencyCode?: CurrencyCode | null
|
|
24
|
+
}
|
|
25
|
+
export interface ShopProductsByIdsDefaultVariantImage {
|
|
26
|
+
__typename?: 'Image' | null
|
|
27
|
+
id?: string | null
|
|
28
|
+
altText?: string | null
|
|
29
|
+
url?: URL | null
|
|
30
|
+
}
|
|
31
|
+
export interface ShopProductsByIdsDefaultVariant {
|
|
32
|
+
__typename?: 'ProductVariant' | null
|
|
33
|
+
id?: string | null
|
|
34
|
+
title?: string | null
|
|
35
|
+
isFavorited?: boolean | null
|
|
36
|
+
compareAtPrice?: HelloWorldTestProductsQueryPartialData.ShopProductsByIdsDefaultVariantCompareAtPrice | null
|
|
37
|
+
price?: HelloWorldTestProductsQueryPartialData.ShopProductsByIdsDefaultVariantPrice | null
|
|
38
|
+
image?: HelloWorldTestProductsQueryPartialData.ShopProductsByIdsDefaultVariantImage | null
|
|
39
|
+
}
|
|
40
|
+
export interface ShopProductsByIds {
|
|
41
|
+
__typename?: 'Product' | null
|
|
42
|
+
id?: string | null
|
|
43
|
+
title?: string | null
|
|
44
|
+
tags?: (string | null)[] | null
|
|
45
|
+
featuredImage?: HelloWorldTestProductsQueryPartialData.ShopProductsByIdsFeaturedImage | null
|
|
46
|
+
defaultVariant?: HelloWorldTestProductsQueryPartialData.ShopProductsByIdsDefaultVariant | null
|
|
47
|
+
}
|
|
48
|
+
export interface Shop {
|
|
49
|
+
__typename?: 'Shop' | null
|
|
50
|
+
id?: string | null
|
|
51
|
+
name?: string | null
|
|
52
|
+
productsByIds?:
|
|
53
|
+
| (HelloWorldTestProductsQueryPartialData.ShopProductsByIds | null)[]
|
|
54
|
+
| null
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export interface HelloWorldTestProductsQueryPartialData {
|
|
58
|
+
shop?: HelloWorldTestProductsQueryPartialData.Shop | null
|
|
59
|
+
}
|
|
60
|
+
export namespace HelloWorldTestProductsQueryData {
|
|
61
|
+
export interface Variables {
|
|
62
|
+
shopId: string
|
|
63
|
+
productIds: string[]
|
|
64
|
+
}
|
|
65
|
+
export interface ShopProductsByIdsFeaturedImage {
|
|
66
|
+
__typename: 'Image'
|
|
67
|
+
id?: string | null
|
|
68
|
+
altText?: string | null
|
|
69
|
+
url: URL
|
|
70
|
+
}
|
|
71
|
+
export interface ShopProductsByIdsDefaultVariantCompareAtPrice {
|
|
72
|
+
__typename: 'Money'
|
|
73
|
+
amount: Decimal
|
|
74
|
+
currencyCode: CurrencyCode
|
|
75
|
+
}
|
|
76
|
+
export interface ShopProductsByIdsDefaultVariantPrice {
|
|
77
|
+
__typename: 'Money'
|
|
78
|
+
amount: Decimal
|
|
79
|
+
currencyCode: CurrencyCode
|
|
80
|
+
}
|
|
81
|
+
export interface ShopProductsByIdsDefaultVariantImage {
|
|
82
|
+
__typename: 'Image'
|
|
83
|
+
id?: string | null
|
|
84
|
+
altText?: string | null
|
|
85
|
+
url: URL
|
|
86
|
+
}
|
|
87
|
+
export interface ShopProductsByIdsDefaultVariant {
|
|
88
|
+
__typename: 'ProductVariant'
|
|
89
|
+
id: string
|
|
90
|
+
title: string
|
|
91
|
+
isFavorited: boolean
|
|
92
|
+
compareAtPrice?: HelloWorldTestProductsQueryData.ShopProductsByIdsDefaultVariantCompareAtPrice | null
|
|
93
|
+
price: HelloWorldTestProductsQueryData.ShopProductsByIdsDefaultVariantPrice
|
|
94
|
+
image?: HelloWorldTestProductsQueryData.ShopProductsByIdsDefaultVariantImage | null
|
|
95
|
+
}
|
|
96
|
+
export interface ShopProductsByIds {
|
|
97
|
+
__typename: 'Product'
|
|
98
|
+
id: string
|
|
99
|
+
title: string
|
|
100
|
+
tags: string[]
|
|
101
|
+
featuredImage?: HelloWorldTestProductsQueryData.ShopProductsByIdsFeaturedImage | null
|
|
102
|
+
defaultVariant: HelloWorldTestProductsQueryData.ShopProductsByIdsDefaultVariant
|
|
103
|
+
}
|
|
104
|
+
export interface Shop {
|
|
105
|
+
__typename: 'Shop'
|
|
106
|
+
id: string
|
|
107
|
+
name: string
|
|
108
|
+
productsByIds: (HelloWorldTestProductsQueryData.ShopProductsByIds | null)[]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export interface HelloWorldTestProductsQueryData {
|
|
112
|
+
shop?: HelloWorldTestProductsQueryData.Shop | null
|
|
113
|
+
}
|
|
114
|
+
declare const document: DocumentNode<
|
|
115
|
+
HelloWorldTestProductsQueryData,
|
|
116
|
+
HelloWorldTestProductsQueryData.Variables,
|
|
117
|
+
HelloWorldTestProductsQueryPartialData
|
|
118
|
+
>
|
|
119
|
+
export default document
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {theme as defaultTheme, Theme} from '@shopify/shop-minis-platform-sdk'
|
|
2
|
+
|
|
3
|
+
import {__MINI_APP_HANDLE_PASCAL_CASE__Navigator} from './routes'
|
|
4
|
+
|
|
5
|
+
export const theme: Theme = {
|
|
6
|
+
...defaultTheme,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default __MINI_APP_HANDLE_PASCAL_CASE__Navigator
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {createNativeStackNavigator} from '@react-navigation/native-stack'
|
|
2
|
+
|
|
3
|
+
import {HomeScreen} from './screens/HomeScreen'
|
|
4
|
+
import {AvatarScreen} from './screens/AvatarScreen'
|
|
5
|
+
import {BottomSheetScreen} from './screens/BottomSheetScreen'
|
|
6
|
+
import {ButtonsScreen} from './screens/ButtonsScreen'
|
|
7
|
+
import {GridScreen} from './screens/GridScreen'
|
|
8
|
+
import {IconsScreen} from './screens/IconsScreen'
|
|
9
|
+
import {MediaScreen} from './screens/MediaScreen'
|
|
10
|
+
import {ProgressIndicatorScreen} from './screens/ProgressIndicatorScreen'
|
|
11
|
+
import {SpinnerScreen} from './screens/SpinnerScreen'
|
|
12
|
+
import {TypographyScreen} from './screens/TypographyScreen'
|
|
13
|
+
import {QuantityPickerScreen} from './screens/QuantityPickerScreen'
|
|
14
|
+
import {WebViewScreen} from './screens/WebViewScreen'
|
|
15
|
+
import {ModalScreen} from './screens/ModalScreen'
|
|
16
|
+
import {ProductLinkScreen} from './screens/ProductLinkScreen'
|
|
17
|
+
import {ProductCardScreen} from './screens/ProductCardScreen'
|
|
18
|
+
import {ProductCardGridScreen} from './screens/ProductCardGridScreen'
|
|
19
|
+
|
|
20
|
+
const Stack = createNativeStackNavigator()
|
|
21
|
+
|
|
22
|
+
export const __MINI_APP_HANDLE_PASCAL_CASE__Navigator = () => {
|
|
23
|
+
return (
|
|
24
|
+
<Stack.Navigator>
|
|
25
|
+
<Stack.Screen
|
|
26
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Home"
|
|
27
|
+
component={HomeScreen}
|
|
28
|
+
options={{headerShown: false}}
|
|
29
|
+
/>
|
|
30
|
+
<Stack.Screen
|
|
31
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Avatar"
|
|
32
|
+
component={AvatarScreen}
|
|
33
|
+
options={{headerShown: false}}
|
|
34
|
+
/>
|
|
35
|
+
<Stack.Screen
|
|
36
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.BottomSheet"
|
|
37
|
+
component={BottomSheetScreen}
|
|
38
|
+
options={{headerShown: false}}
|
|
39
|
+
/>
|
|
40
|
+
<Stack.Screen
|
|
41
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Buttons"
|
|
42
|
+
component={ButtonsScreen}
|
|
43
|
+
options={{headerShown: false}}
|
|
44
|
+
/>
|
|
45
|
+
<Stack.Screen
|
|
46
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Grid"
|
|
47
|
+
component={GridScreen}
|
|
48
|
+
options={{headerShown: false}}
|
|
49
|
+
/>
|
|
50
|
+
<Stack.Screen
|
|
51
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Icons"
|
|
52
|
+
component={IconsScreen}
|
|
53
|
+
options={{headerShown: false}}
|
|
54
|
+
/>
|
|
55
|
+
<Stack.Screen
|
|
56
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Media"
|
|
57
|
+
component={MediaScreen}
|
|
58
|
+
options={{headerShown: false}}
|
|
59
|
+
/>
|
|
60
|
+
<Stack.Screen
|
|
61
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.ProgressIndicator"
|
|
62
|
+
component={ProgressIndicatorScreen}
|
|
63
|
+
options={{headerShown: false}}
|
|
64
|
+
/>
|
|
65
|
+
<Stack.Screen
|
|
66
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Spinner"
|
|
67
|
+
component={SpinnerScreen}
|
|
68
|
+
options={{headerShown: false}}
|
|
69
|
+
/>
|
|
70
|
+
<Stack.Screen
|
|
71
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Typography"
|
|
72
|
+
component={TypographyScreen}
|
|
73
|
+
options={{headerShown: false}}
|
|
74
|
+
/>
|
|
75
|
+
<Stack.Screen
|
|
76
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.QuantityPicker"
|
|
77
|
+
component={QuantityPickerScreen}
|
|
78
|
+
options={{headerShown: false}}
|
|
79
|
+
/>
|
|
80
|
+
<Stack.Screen
|
|
81
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.WebView"
|
|
82
|
+
component={WebViewScreen}
|
|
83
|
+
options={{headerShown: false}}
|
|
84
|
+
/>
|
|
85
|
+
<Stack.Screen
|
|
86
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.Modal"
|
|
87
|
+
component={ModalScreen}
|
|
88
|
+
options={{headerShown: false}}
|
|
89
|
+
/>
|
|
90
|
+
<Stack.Screen
|
|
91
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.ProductLink"
|
|
92
|
+
component={ProductLinkScreen}
|
|
93
|
+
options={{headerShown: false}}
|
|
94
|
+
/>
|
|
95
|
+
<Stack.Screen
|
|
96
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.ProductCard"
|
|
97
|
+
component={ProductCardScreen}
|
|
98
|
+
options={{headerShown: false}}
|
|
99
|
+
/>
|
|
100
|
+
<Stack.Screen
|
|
101
|
+
name="__MINI_APP_HANDLE_PASCAL_CASE__.ProductCardGrid"
|
|
102
|
+
component={ProductCardGridScreen}
|
|
103
|
+
options={{headerShown: false}}
|
|
104
|
+
/>
|
|
105
|
+
</Stack.Navigator>
|
|
106
|
+
)
|
|
107
|
+
}
|