@shopify/shop-minis-cli 0.0.37 → 0.0.82
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/.eslintrc.cjs +78 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/launch.json +29 -0
- package/.vscode/settings.json +8 -0
- package/.vscode/shop-minis-cli.code-workspace +8 -0
- package/build/commands/cancel-submission/cancel-submission.d.ts +1 -0
- package/build/commands/cancel-submission/cancel-submission.js +57 -0
- package/build/commands/cancel-submission/cancel-submission.js.map +1 -0
- package/build/commands/cancel-submission/index.d.ts +2 -0
- package/build/commands/cancel-submission/index.js +18 -0
- package/build/commands/cancel-submission/index.js.map +1 -0
- package/build/commands/cancel-submission/types.d.ts +3 -0
- package/build/commands/cancel-submission/types.js +2 -0
- package/build/commands/cancel-submission/types.js.map +1 -0
- package/build/commands/check-submission/index.d.ts +2 -0
- package/build/commands/check-submission/index.js +55 -0
- package/build/commands/check-submission/index.js.map +1 -0
- package/build/commands/check-submission/types.d.ts +3 -0
- package/build/commands/check-submission/types.js +2 -0
- package/build/commands/check-submission/types.js.map +1 -0
- package/build/commands/codemod/index.d.ts +3 -0
- package/build/commands/codemod/index.js +47 -0
- package/build/commands/codemod/index.js.map +1 -0
- package/build/commands/codemod/releases/index.d.ts +7 -0
- package/build/commands/codemod/releases/index.js +58 -0
- package/build/commands/codemod/releases/index.js.map +1 -0
- package/build/commands/codemod/releases/types.d.ts +9 -0
- package/build/commands/codemod/releases/types.js +2 -0
- package/build/commands/codemod/releases/types.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-42/index.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-42/index.js +46 -0
- package/build/commands/codemod/releases/v0-0-42/index.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-42/reset-files.d.ts +7 -0
- package/build/commands/codemod/releases/v0-0-42/reset-files.js +83 -0
- package/build/commands/codemod/releases/v0-0-42/reset-files.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-43.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-43.js +32 -0
- package/build/commands/codemod/releases/v0-0-43.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-44.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-44.js +214 -0
- package/build/commands/codemod/releases/v0-0-44.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-45.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-45.js +23 -0
- package/build/commands/codemod/releases/v0-0-45.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-50.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-50.js +34 -0
- package/build/commands/codemod/releases/v0-0-50.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-54.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-54.js +70 -0
- package/build/commands/codemod/releases/v0-0-54.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-56.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-56.js +48 -0
- package/build/commands/codemod/releases/v0-0-56.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-57.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-57.js +41 -0
- package/build/commands/codemod/releases/v0-0-57.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-58.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-58.js +68 -0
- package/build/commands/codemod/releases/v0-0-58.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-61.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-61.js +30 -0
- package/build/commands/codemod/releases/v0-0-61.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-63.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-63.js +42 -0
- package/build/commands/codemod/releases/v0-0-63.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-64.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-64.js +47 -0
- package/build/commands/codemod/releases/v0-0-64.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-75.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-75.js +30 -0
- package/build/commands/codemod/releases/v0-0-75.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-76.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-76.js +32 -0
- package/build/commands/codemod/releases/v0-0-76.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-77.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-77.js +39 -0
- package/build/commands/codemod/releases/v0-0-77.js.map +1 -0
- package/build/commands/codemod/releases/v0-0-79.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-79.js +35 -0
- package/build/commands/codemod/releases/v0-0-79.js.map +1 -0
- package/build/commands/config.d.ts +14 -0
- package/build/commands/config.js +42 -0
- package/build/commands/config.js.map +1 -0
- package/build/commands/create-mini/index.js +84 -68
- package/build/commands/create-mini/index.js.map +1 -1
- package/build/commands/create-mini/utils/template-app.d.ts +1 -1
- package/build/commands/create-mini/utils/template-app.js +38 -38
- package/build/commands/create-mini/utils/template-app.js.map +1 -1
- package/build/commands/dev/index.d.ts +3 -0
- package/build/commands/dev/index.js +51 -22
- package/build/commands/dev/index.js.map +1 -1
- package/build/commands/dev/utils/android.d.ts +6 -4
- package/build/commands/dev/utils/android.js +55 -67
- package/build/commands/dev/utils/android.js.map +1 -1
- package/build/commands/dev/utils/binaries.d.ts +2 -80
- package/build/commands/dev/utils/binaries.js +10 -166
- package/build/commands/dev/utils/binaries.js.map +1 -1
- package/build/commands/dev/utils/build-type.d.ts +2 -0
- package/build/commands/dev/utils/build-type.js +14 -0
- package/build/commands/dev/utils/build-type.js.map +1 -0
- package/build/commands/dev/utils/deeplink.d.ts +3 -3
- package/build/commands/dev/utils/deeplink.js +13 -18
- package/build/commands/dev/utils/deeplink.js.map +1 -1
- package/build/commands/dev/utils/interactive-terminal.d.ts +4 -2
- package/build/commands/dev/utils/interactive-terminal.js +66 -107
- package/build/commands/dev/utils/interactive-terminal.js.map +1 -1
- package/build/commands/dev/utils/metro/metro-config.js +17 -20
- package/build/commands/dev/utils/metro/metro-config.js.map +1 -1
- package/build/commands/dev/utils/metro/metro-reporter.d.ts +3 -4
- package/build/commands/dev/utils/metro/metro-reporter.js +6 -13
- package/build/commands/dev/utils/metro/metro-reporter.js.map +1 -1
- package/build/commands/dev/utils/metro/metro-server-middleware.d.ts +1 -0
- package/build/commands/dev/utils/metro/metro-server-middleware.js +11 -12
- package/build/commands/dev/utils/metro/metro-server-middleware.js.map +1 -1
- package/build/commands/dev/utils/metro/metro-server.d.ts +2 -2
- package/build/commands/dev/utils/metro/metro-server.js +7 -14
- package/build/commands/dev/utils/metro/metro-server.js.map +1 -1
- package/build/commands/dev/utils/network.d.ts +20 -0
- package/build/commands/dev/utils/network.js +122 -0
- package/build/commands/dev/utils/network.js.map +1 -0
- package/build/commands/dev/utils/platform.d.ts +18 -0
- package/build/commands/dev/utils/platform.js +41 -0
- package/build/commands/dev/utils/platform.js.map +1 -0
- package/build/commands/dev/utils/prompt-binary-upgrade.d.ts +1 -0
- package/build/commands/dev/utils/prompt-binary-upgrade.js +12 -0
- package/build/commands/dev/utils/prompt-binary-upgrade.js.map +1 -0
- package/build/commands/dev/utils/qr-code.js +3 -10
- package/build/commands/dev/utils/qr-code.js.map +1 -1
- package/build/commands/dev/utils/simulator.d.ts +5 -2
- package/build/commands/dev/utils/simulator.js +43 -37
- package/build/commands/dev/utils/simulator.js.map +1 -1
- package/build/commands/dev/utils/start-app/config.d.ts +5 -0
- package/build/commands/dev/utils/start-app/config.js +25 -0
- package/build/commands/dev/utils/start-app/config.js.map +1 -0
- package/build/commands/dev/utils/start-app/start-app-with-options.d.ts +2 -0
- package/build/commands/dev/utils/start-app/start-app-with-options.js +94 -0
- package/build/commands/dev/utils/start-app/start-app-with-options.js.map +1 -0
- package/build/commands/dev/utils/start-app/start-app.d.ts +2 -0
- package/build/commands/dev/utils/start-app/start-app.js +10 -0
- package/build/commands/dev/utils/start-app/start-app.js.map +1 -0
- package/build/commands/dev/utils/start-app/types.d.ts +20 -0
- package/build/commands/dev/utils/start-app/types.js +2 -0
- package/build/commands/dev/utils/start-app/types.js.map +1 -0
- package/build/commands/dev/utils/types.d.ts +24 -0
- package/build/commands/dev/utils/types.js +7 -0
- package/build/commands/dev/utils/types.js.map +1 -0
- package/build/commands/dev/utils/version.d.ts +64 -0
- package/build/commands/dev/utils/version.js +101 -0
- package/build/commands/dev/utils/version.js.map +1 -0
- package/build/commands/dev/utils/with-retries.js +1 -5
- package/build/commands/dev/utils/with-retries.js.map +1 -1
- package/build/commands/doctor/index.d.ts +6 -0
- package/build/commands/doctor/index.js +21 -0
- package/build/commands/doctor/index.js.map +1 -0
- package/build/commands/doctor/utils/diagnose-dependencies.d.ts +7 -0
- package/build/commands/doctor/utils/diagnose-dependencies.js +108 -0
- package/build/commands/doctor/utils/diagnose-dependencies.js.map +1 -0
- package/build/commands/generate-graphql-types/index.d.ts +1 -0
- package/build/commands/generate-graphql-types/index.js +43 -27
- package/build/commands/generate-graphql-types/index.js.map +1 -1
- package/build/commands/info/index.d.ts +3 -0
- package/build/commands/info/index.js +42 -0
- package/build/commands/info/index.js.map +1 -0
- package/build/commands/setup/index.d.ts +2 -0
- package/build/commands/setup/index.js +81 -0
- package/build/commands/setup/index.js.map +1 -0
- package/build/commands/submit/config.d.ts +9 -0
- package/build/commands/submit/config.js +18 -0
- package/build/commands/submit/config.js.map +1 -0
- package/build/commands/submit/errors.d.ts +19 -0
- package/build/commands/submit/errors.js +87 -0
- package/build/commands/submit/errors.js.map +1 -0
- package/build/commands/submit/gcs.d.ts +6 -0
- package/build/commands/submit/gcs.js +10 -0
- package/build/commands/submit/gcs.js.map +1 -0
- package/build/commands/submit/index.d.ts +2 -0
- package/build/commands/submit/index.js +25 -0
- package/build/commands/submit/index.js.map +1 -0
- package/build/commands/submit/submit.d.ts +5 -0
- package/build/commands/submit/submit.js +222 -0
- package/build/commands/submit/submit.js.map +1 -0
- package/build/commands/submit/tasks.d.ts +37 -0
- package/build/commands/submit/tasks.js +91 -0
- package/build/commands/submit/tasks.js.map +1 -0
- package/build/commands/submit/types.d.ts +14 -0
- package/build/commands/submit/types.js +2 -0
- package/build/commands/submit/types.js.map +1 -0
- package/build/commands/submit/utils/assert-core-dependencies-version.d.ts +1 -0
- package/build/commands/submit/utils/assert-core-dependencies-version.js +58 -0
- package/build/commands/submit/utils/assert-core-dependencies-version.js.map +1 -0
- package/build/commands/submit/utils/request-entry-point-params.d.ts +1 -0
- package/build/commands/submit/utils/request-entry-point-params.js +41 -0
- package/build/commands/submit/utils/request-entry-point-params.js.map +1 -0
- package/build/commands/submit/validation.d.ts +1 -0
- package/build/commands/submit/validation.js +11 -0
- package/build/commands/submit/validation.js.map +1 -0
- package/build/commands/upgrade/index.d.ts +13 -0
- package/build/commands/upgrade/index.js +53 -0
- package/build/commands/upgrade/index.js.map +1 -0
- package/build/commands/upgrade/utils/cli.d.ts +1 -0
- package/build/commands/upgrade/utils/cli.js +15 -0
- package/build/commands/upgrade/utils/cli.js.map +1 -0
- package/build/commands/validate-manifest/index.d.ts +3 -0
- package/build/commands/validate-manifest/index.js +29 -0
- package/build/commands/validate-manifest/index.js.map +1 -0
- package/build/data/accept-invitation.d.ts +4 -0
- package/build/data/accept-invitation.js +16 -0
- package/build/data/accept-invitation.js.map +1 -0
- package/build/data/cancel-submission.d.ts +22 -0
- package/build/data/cancel-submission.js +26 -0
- package/build/data/cancel-submission.js.map +1 -0
- package/build/data/create-submission.d.ts +20 -0
- package/build/data/create-submission.js +27 -0
- package/build/data/create-submission.js.map +1 -0
- package/build/data/create-upload.d.ts +21 -0
- package/build/data/create-upload.js +40 -0
- package/build/data/create-upload.js.map +1 -0
- package/build/data/get-submissions.d.ts +27 -0
- package/build/data/get-submissions.js +33 -0
- package/build/data/get-submissions.js.map +1 -0
- package/build/data/gql-client.d.ts +8 -0
- package/build/data/gql-client.js +9 -0
- package/build/data/gql-client.js.map +1 -0
- package/build/data/mini.d.ts +5 -0
- package/build/data/mini.js +14 -0
- package/build/data/mini.js.map +1 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/fragment-masking.d.ts +13 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/fragment-masking.js +7 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/fragment-masking.js.map +1 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.d.ts +75 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.js +24 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/gql.js.map +1 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.d.ts +1570 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js +1062 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/graphql.js.map +1 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/index.d.ts +2 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/index.js +3 -0
- package/build/data/types/autogenerated/shop-minis-admin-api/index.js.map +1 -0
- package/build/dev-panel/asset-manifest.json +6 -9
- package/build/dev-panel/index.html +1 -1
- package/build/dev-panel/static/css/{main.31436fe3.css → main.7f1ee407.css} +2 -2
- package/build/dev-panel/static/css/main.7f1ee407.css.map +1 -0
- package/build/dev-panel/static/js/{main.27f47095.js → main.6625699c.js} +3 -3
- package/build/dev-panel/static/js/main.6625699c.js.map +1 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +30 -15
- package/build/index.js.map +1 -1
- package/build/schemas/manifest.schema.json +198 -0
- package/build/utils/archive.d.ts +30 -0
- package/build/utils/archive.js +38 -0
- package/build/utils/archive.js.map +1 -0
- package/build/utils/common-tasks.d.ts +1 -0
- package/build/utils/common-tasks.js +49 -0
- package/build/utils/common-tasks.js.map +1 -0
- package/build/utils/development-params.d.ts +13 -0
- package/build/utils/development-params.js +42 -0
- package/build/utils/development-params.js.map +1 -0
- package/build/{commands/utils → utils}/exec-async-child-process.d.ts +1 -1
- package/build/{commands/utils → utils}/exec-async-child-process.js +6 -13
- package/build/utils/exec-async-child-process.js.map +1 -0
- package/build/utils/file.d.ts +1 -0
- package/build/utils/file.js +7 -0
- package/build/utils/file.js.map +1 -0
- package/build/utils/minis-manifest.d.ts +6 -0
- package/build/utils/minis-manifest.js +56 -0
- package/build/utils/minis-manifest.js.map +1 -0
- package/build/utils/package-manager.d.ts +38 -0
- package/build/utils/package-manager.js +98 -0
- package/build/utils/package-manager.js.map +1 -0
- package/build/utils/patch-package.d.ts +5 -0
- package/build/utils/patch-package.js +76 -0
- package/build/utils/patch-package.js.map +1 -0
- package/build/utils/replace-strings-in-template.d.ts +1 -0
- package/build/utils/replace-strings-in-template.js +15 -0
- package/build/utils/replace-strings-in-template.js.map +1 -0
- package/build/utils/semver.d.ts +1 -0
- package/build/utils/semver.js +19 -0
- package/build/utils/semver.js.map +1 -0
- package/build/{commands/utils → utils}/wrap-with-loading-indicator.d.ts +1 -1
- package/build/utils/wrap-with-loading-indicator.js +16 -0
- package/build/utils/wrap-with-loading-indicator.js.map +1 -0
- package/package.json +35 -28
- package/scripts/graphql-codegen.ts +23 -0
- package/scripts/test-template.ts +63 -0
- package/shipit.alpha.yml +3 -0
- package/templates/__template_blank/src/index.tsx +5 -4
- package/templates/__template_blank/src/types.ts +1 -1
- package/templates/__template_common/.eslintrc.js +16 -0
- package/templates/__template_common/assets.d.ts +14 -0
- package/templates/__template_common/babel.config.js +3 -17
- package/templates/__template_common/gitignore +2 -0
- package/templates/__template_common/index.tsx +3 -6
- package/templates/__template_common/metro.config.js +4 -30
- package/templates/__template_common/package.json +17 -47
- package/templates/__template_common/src/manifest.json +1 -27
- package/templates/__template_hello_world/src/components/ComponentLink.ts +31 -19
- package/templates/__template_hello_world/src/components/ComponentListItem.tsx +1 -0
- package/templates/__template_hello_world/src/components/FeaturedComponents.tsx +4 -2
- package/templates/__template_hello_world/src/components/quiz/ImageCarouselSlide.tsx +54 -0
- package/templates/__template_hello_world/src/components/quiz/MultipleChoiceSlide.tsx +77 -0
- package/templates/__template_hello_world/src/components/quiz/QuizProvider.tsx +64 -0
- package/templates/__template_hello_world/src/components/quiz/QuizSlide.tsx +79 -0
- package/templates/__template_hello_world/src/components/quiz/QuizSlideCommander.tsx +35 -0
- package/templates/__template_hello_world/src/components/quiz/TextFieldSlide.tsx +84 -0
- package/templates/__template_hello_world/src/components/quiz/TextSlide.tsx +6 -0
- package/templates/__template_hello_world/src/components/quiz/types.ts +72 -0
- package/templates/__template_hello_world/src/data/Test.graphql.d.ts +69 -76
- package/templates/__template_hello_world/src/data/TestProducts.graphql +30 -0
- package/templates/__template_hello_world/src/data/TestProducts.graphql.d.ts +159 -81
- package/templates/__template_hello_world/src/fixtures/mocked-products-with-variants.ts +274 -0
- package/templates/__template_hello_world/src/hooks/useQuizData.ts +26 -0
- package/templates/__template_hello_world/src/hooks/useQuizState.ts +27 -0
- package/templates/__template_hello_world/src/index.tsx +6 -5
- package/templates/__template_hello_world/src/routes.tsx +46 -22
- package/templates/__template_hello_world/src/screens/AccordionScreen.tsx +73 -0
- package/templates/__template_hello_world/src/screens/BottomSheetScreen.tsx +6 -5
- package/templates/__template_hello_world/src/screens/HomeScreen.tsx +14 -3
- package/templates/__template_hello_world/src/screens/{ImageCarouselScreen.tsx → ImageMultipleChoiceScreen.tsx} +4 -6
- package/templates/__template_hello_world/src/screens/InputScreen.tsx +13 -70
- package/templates/__template_hello_world/src/screens/QuizResultScreen.tsx +82 -0
- package/templates/__template_hello_world/src/screens/QuizScreen.tsx +40 -0
- package/templates/__template_hello_world/src/screens/QuizSlideScreen.tsx +150 -0
- package/templates/__template_hello_world/src/screens/ShopActionsScreen.tsx +48 -0
- package/templates/__template_hello_world/src/screens/VariantPickerScreen.tsx +120 -0
- package/templates/__template_hello_world/src/types.ts +27 -24
- package/templates/__template_hello_world/src/utils/mockQuizData.ts +330 -0
- package/templates/__template_hello_world/src/utils/quizUtils.ts +75 -0
- package/templates/__template_snowboardz/src/components/SkillLevelIcon.tsx +1 -4
- package/templates/__template_snowboardz/src/components/SkillLevelPicker.tsx +7 -1
- package/templates/__template_snowboardz/src/data/TestProducts.graphql +1 -1
- package/templates/__template_snowboardz/src/data/TestProducts.graphql.d.ts +84 -74
- package/templates/__template_snowboardz/src/index.tsx +6 -5
- package/templates/__template_snowboardz/src/routes.tsx +2 -2
- package/templates/__template_snowboardz/src/types.ts +3 -3
- package/build/commands/check/index.d.ts +0 -5
- package/build/commands/check/index.js +0 -77
- package/build/commands/check/index.js.map +0 -1
- package/build/commands/check/utils/versions.d.ts +0 -1
- package/build/commands/check/utils/versions.js +0 -14
- package/build/commands/check/utils/versions.js.map +0 -1
- package/build/commands/dev/utils/binaries.test.d.ts +0 -1
- package/build/commands/dev/utils/binaries.test.js +0 -275
- package/build/commands/dev/utils/binaries.test.js.map +0 -1
- package/build/commands/dev/utils/minis-manifest.d.ts +0 -1
- package/build/commands/dev/utils/minis-manifest.js +0 -24
- package/build/commands/dev/utils/minis-manifest.js.map +0 -1
- package/build/commands/utils/exec-async-child-process.js.map +0 -1
- package/build/commands/utils/wrap-with-loading-indicator.js +0 -23
- package/build/commands/utils/wrap-with-loading-indicator.js.map +0 -1
- package/build/dev-panel/middleware.d.ts +0 -4
- package/build/dev-panel/middleware.js +0 -11
- package/build/dev-panel/middleware.js.map +0 -1
- package/build/dev-panel/static/css/main.31436fe3.css.map +0 -1
- package/build/dev-panel/static/js/main.27f47095.js.map +0 -1
- package/build/dev-panel/static/media/bottomsheet.fe525b8722f6d504a185.png +0 -0
- package/build/dev-panel/static/media/navigation.597434370a97c328a970.png +0 -0
- package/build/dev-panel/static/media/stories.a425b6972a5338fabdad.png +0 -0
- package/templates/__template_blank/src/custom.d.ts +0 -4
- package/templates/__template_common/.eslintrc.json +0 -132
- package/templates/__template_common/patches/react-native+0.68.5.patch +0 -173
- package/templates/__template_hello_world/src/utils/getFlagEmoji.spec.tsx +0 -19
- /package/build/dev-panel/static/js/{main.27f47095.js.LICENSE.txt → main.6625699c.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import {ImageCarouselSlideProps} from '../components/quiz/ImageCarouselSlide'
|
|
2
|
+
import {MultipleChoiceSlideProps} from '../components/quiz/MultipleChoiceSlide'
|
|
3
|
+
import {TextFieldSlideProps} from '../components/quiz/TextFieldSlide'
|
|
4
|
+
import {
|
|
5
|
+
QuizAnswerType,
|
|
6
|
+
QuizData,
|
|
7
|
+
SlideInformation,
|
|
8
|
+
TextSlideProps,
|
|
9
|
+
} from '../components/quiz/types'
|
|
10
|
+
|
|
11
|
+
const createChoices = (numberOfChoices: number) => {
|
|
12
|
+
return Array(numberOfChoices)
|
|
13
|
+
.fill(undefined)
|
|
14
|
+
.map((_, index) => ({
|
|
15
|
+
label: `Option ${index + 1}`,
|
|
16
|
+
value: `Value ${index + 1}`,
|
|
17
|
+
}))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const textWelcomeSlideProps: TextSlideProps = {
|
|
21
|
+
quizSlideProps: {
|
|
22
|
+
mainText: 'Welcome!',
|
|
23
|
+
subText:
|
|
24
|
+
'This is a Text Slide which demonstrates some text. Often used as a welcome of thankyou page',
|
|
25
|
+
ctaText: "Let's get started!",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const textThankYouSlideProps: TextSlideProps = {
|
|
30
|
+
quizSlideProps: {
|
|
31
|
+
mainText: 'Ready for your results?',
|
|
32
|
+
subText: 'Click below for product recommendations',
|
|
33
|
+
ctaText: 'Show Me Results',
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const multipleChoiceHairTypeSlideProps: MultipleChoiceSlideProps = {
|
|
38
|
+
quizSlideProps: {
|
|
39
|
+
mainText:
|
|
40
|
+
'So nice to meet you, {{userName}}. What is your current hair color?',
|
|
41
|
+
ctaText: 'Next Question',
|
|
42
|
+
ctaDisabled: true,
|
|
43
|
+
},
|
|
44
|
+
multipleChoiceProps: {
|
|
45
|
+
choices: [
|
|
46
|
+
{
|
|
47
|
+
label: 'Grey',
|
|
48
|
+
value: 'Grey',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'Blonde',
|
|
52
|
+
value: 'Blonde',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'Light/Med Brown',
|
|
56
|
+
value: 'Light/Med Brown',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'Brunette/Dark Brown',
|
|
60
|
+
value: 'Brunette/Dark Brown',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: 'Nearly Black/Jet Black',
|
|
64
|
+
value: 'Nearly Black/Jet Black',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Red',
|
|
68
|
+
value: 'Red',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
onChoiceSelected: () => null,
|
|
72
|
+
selectedIndexes: [],
|
|
73
|
+
},
|
|
74
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
75
|
+
(answer as [number]).length < 1,
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const multipleChoiceYesNoSlideProps: MultipleChoiceSlideProps = {
|
|
79
|
+
quizSlideProps: {
|
|
80
|
+
mainText: 'Are you Canadian?',
|
|
81
|
+
ctaText: 'Next Question',
|
|
82
|
+
ctaDisabled: true,
|
|
83
|
+
},
|
|
84
|
+
multipleChoiceProps: {
|
|
85
|
+
choices: [
|
|
86
|
+
{
|
|
87
|
+
label: 'Yes',
|
|
88
|
+
value: 'Yes',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'No',
|
|
92
|
+
value: 'No',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
onChoiceSelected: () => null,
|
|
96
|
+
selectedIndexes: [],
|
|
97
|
+
},
|
|
98
|
+
determineNextSlide: answer => {
|
|
99
|
+
return answer[0] === 0 ? 'canada' : 'choose-age'
|
|
100
|
+
},
|
|
101
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
102
|
+
(answer as [number]).length < 1,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const textCanadianSlideProps: TextSlideProps = {
|
|
106
|
+
quizSlideProps: {
|
|
107
|
+
mainText: 'You are Canadian!',
|
|
108
|
+
ctaText: 'Ja, eh',
|
|
109
|
+
},
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const ageChoices = [
|
|
113
|
+
{
|
|
114
|
+
label: '<18',
|
|
115
|
+
value: '<18',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: '19-25',
|
|
119
|
+
value: '19-25',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: '26-35',
|
|
123
|
+
value: '26-35',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: '36+',
|
|
127
|
+
value: '36+',
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
const textFieldPhoneSlideProps: TextFieldSlideProps = {
|
|
132
|
+
quizSlideProps: {
|
|
133
|
+
mainText: 'Can we get your phone number, please?',
|
|
134
|
+
ctaDisabled: true,
|
|
135
|
+
},
|
|
136
|
+
textFieldProps: {
|
|
137
|
+
placeholder: 'gemme dem digits',
|
|
138
|
+
},
|
|
139
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
140
|
+
(answer as string).length < 1,
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const textFieldSlideProps: TextFieldSlideProps = {
|
|
144
|
+
quizSlideProps: {
|
|
145
|
+
mainText: 'Well that was rude of us...we never got your name.',
|
|
146
|
+
ctaDisabled: true,
|
|
147
|
+
},
|
|
148
|
+
textFieldProps: {
|
|
149
|
+
placeholder: 'Enter your name',
|
|
150
|
+
},
|
|
151
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
152
|
+
(answer as string).length < 1,
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const textFieldMutliLineSlideProps: TextFieldSlideProps = {
|
|
156
|
+
quizSlideProps: {
|
|
157
|
+
mainText: 'Leave your comments!',
|
|
158
|
+
subText: 'Are there some other products you would like to see?',
|
|
159
|
+
ctaText: 'Submit',
|
|
160
|
+
ctaDisabled: true,
|
|
161
|
+
},
|
|
162
|
+
textFieldProps: {
|
|
163
|
+
multiline: true,
|
|
164
|
+
numberOfLines: 4,
|
|
165
|
+
helper: 'Must be at least 10 characters',
|
|
166
|
+
placeholder: 'It would be great if you Would....',
|
|
167
|
+
},
|
|
168
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
169
|
+
(answer as string).length < 10,
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const multipleChoiceSingleSelctionShortSlideProps: MultipleChoiceSlideProps = {
|
|
173
|
+
quizSlideProps: {
|
|
174
|
+
mainText: 'How old are you?',
|
|
175
|
+
ctaText: 'Next Question',
|
|
176
|
+
ctaDisabled: true,
|
|
177
|
+
},
|
|
178
|
+
multipleChoiceProps: {
|
|
179
|
+
choices: ageChoices,
|
|
180
|
+
onChoiceSelected: () => null,
|
|
181
|
+
selectedIndexes: [],
|
|
182
|
+
},
|
|
183
|
+
determineNextSlide: answer => `age-${ageChoices[answer[0]].value}`,
|
|
184
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
185
|
+
(answer as [number]).length < 1,
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const multipleChoiceMustAcceptSlideProps: MultipleChoiceSlideProps = {
|
|
189
|
+
quizSlideProps: {
|
|
190
|
+
mainText: 'Do You Agree To Share Your Information?',
|
|
191
|
+
subText: 'We will only use it to generate recommendations',
|
|
192
|
+
ctaText: 'On to the questions!',
|
|
193
|
+
ctaDisabled: true,
|
|
194
|
+
},
|
|
195
|
+
multipleChoiceProps: {
|
|
196
|
+
choices: [
|
|
197
|
+
{label: 'No I do not', value: 'no'},
|
|
198
|
+
{label: 'Yes I consent', value: 'yes'},
|
|
199
|
+
],
|
|
200
|
+
onChoiceSelected: () => null,
|
|
201
|
+
selectedIndexes: [],
|
|
202
|
+
},
|
|
203
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
204
|
+
(answer as [number])[0] !== 1,
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const generateAgeTextSlide = (age: string): SlideInformation => ({
|
|
208
|
+
id: `age-${age}`,
|
|
209
|
+
type: 'TextSlide',
|
|
210
|
+
props: {
|
|
211
|
+
quizSlideProps: {
|
|
212
|
+
mainText: `Screen just for being ${age}`,
|
|
213
|
+
subText: `The quiz jumped to this screen because you chose ${age} on the last slide`,
|
|
214
|
+
},
|
|
215
|
+
nextSlideId: 'lots-of-options',
|
|
216
|
+
},
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
const multipleChoiceSingleSelctionLongSlideProps: MultipleChoiceSlideProps = {
|
|
220
|
+
quizSlideProps: {
|
|
221
|
+
isTallSlide: true,
|
|
222
|
+
mainText: 'What are your favorite numbers under 30',
|
|
223
|
+
subText: 'Choose at least 3 numbers',
|
|
224
|
+
},
|
|
225
|
+
multipleChoiceProps: {
|
|
226
|
+
choices: createChoices(30),
|
|
227
|
+
onChoiceSelected: () => null,
|
|
228
|
+
selectedIndexes: [],
|
|
229
|
+
},
|
|
230
|
+
isMultiSelect: true,
|
|
231
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
232
|
+
(answer as [number]).length < 3,
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// This ensures that random images are selected each time the app is generated
|
|
236
|
+
const LOREM_PIXUM_OFFSET = Math.ceil(Math.random() * 100)
|
|
237
|
+
const multipleChoiceImageSingleSelctionProps: ImageCarouselSlideProps = {
|
|
238
|
+
quizSlideProps: {
|
|
239
|
+
mainText: 'Select an Image that you like',
|
|
240
|
+
},
|
|
241
|
+
imageCarouselProps: {
|
|
242
|
+
choices: createChoices(30).map((choice, i) => ({
|
|
243
|
+
...choice,
|
|
244
|
+
imageUrl: `https://picsum.photos/id/${LOREM_PIXUM_OFFSET + i}/160`,
|
|
245
|
+
})),
|
|
246
|
+
onChoiceSelected: () => null,
|
|
247
|
+
selectedIndexes: [],
|
|
248
|
+
imageSize: 160,
|
|
249
|
+
},
|
|
250
|
+
determineCtaDisabled: (answer: QuizAnswerType) =>
|
|
251
|
+
(answer as [number]).length < 1,
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const mockQuizData: QuizData = {
|
|
255
|
+
slides: [
|
|
256
|
+
{
|
|
257
|
+
id: 'welcome',
|
|
258
|
+
type: 'TextSlide',
|
|
259
|
+
props: textWelcomeSlideProps,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: 'consent',
|
|
263
|
+
type: 'MultipleChoiceSlide',
|
|
264
|
+
props: multipleChoiceMustAcceptSlideProps,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: 'enter-phone',
|
|
268
|
+
type: 'TextFieldSlide',
|
|
269
|
+
props: textFieldPhoneSlideProps,
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: 'enter-name',
|
|
273
|
+
type: 'TextFieldSlide',
|
|
274
|
+
props: textFieldSlideProps,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 'hair-type-personalized',
|
|
278
|
+
type: 'MultipleChoiceSlide',
|
|
279
|
+
props: multipleChoiceHairTypeSlideProps,
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: 'choose-canada',
|
|
283
|
+
type: 'MultipleChoiceSlide',
|
|
284
|
+
props: multipleChoiceYesNoSlideProps,
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
{
|
|
288
|
+
id: 'missing-products',
|
|
289
|
+
type: 'TextFieldSlide',
|
|
290
|
+
props: textFieldMutliLineSlideProps,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: 'choose-canada',
|
|
294
|
+
type: 'MultipleChoiceSlide',
|
|
295
|
+
props: multipleChoiceYesNoSlideProps,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: 'canada',
|
|
299
|
+
type: 'TextSlide',
|
|
300
|
+
props: textCanadianSlideProps,
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: 'choose-age',
|
|
304
|
+
type: 'MultipleChoiceSlide',
|
|
305
|
+
props: multipleChoiceSingleSelctionShortSlideProps,
|
|
306
|
+
},
|
|
307
|
+
generateAgeTextSlide('<18'),
|
|
308
|
+
generateAgeTextSlide('19-25'),
|
|
309
|
+
generateAgeTextSlide('26-35'),
|
|
310
|
+
generateAgeTextSlide('36+'),
|
|
311
|
+
{
|
|
312
|
+
id: 'lots-of-options',
|
|
313
|
+
type: 'MultipleChoiceSlide',
|
|
314
|
+
props: multipleChoiceSingleSelctionLongSlideProps,
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: 'pick an image',
|
|
318
|
+
type: 'ImageCarouselSlide',
|
|
319
|
+
props: multipleChoiceImageSingleSelctionProps,
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
id: 'thank-you',
|
|
323
|
+
type: 'TextSlide',
|
|
324
|
+
props: {
|
|
325
|
+
...textThankYouSlideProps,
|
|
326
|
+
nextSlideId: 'results',
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {ImageCarouselSlideProps} from '../components/quiz/ImageCarouselSlide'
|
|
2
|
+
import {MultipleChoiceSlideProps} from '../components/quiz/MultipleChoiceSlide'
|
|
3
|
+
import {QuizData} from '../components/quiz/types'
|
|
4
|
+
|
|
5
|
+
export const getQuizSlideDataByIndex = (
|
|
6
|
+
quizData: QuizData,
|
|
7
|
+
slideIndex: number
|
|
8
|
+
) => quizData.slides[slideIndex] ?? undefined
|
|
9
|
+
|
|
10
|
+
export const getQuizSlideDataById = (quizData: QuizData, id: string) =>
|
|
11
|
+
quizData.slides.find(slide => slide.id === id)
|
|
12
|
+
|
|
13
|
+
export const getQuizSlideIndexById = (quizData: QuizData, id: string) =>
|
|
14
|
+
quizData.slides.findIndex(slide => slide.id === id)
|
|
15
|
+
|
|
16
|
+
export const getQuestionById = (quizData: QuizData, questionId: string) => {
|
|
17
|
+
const slideWithQuestion = quizData.slides.find(
|
|
18
|
+
slide => slide.id === questionId
|
|
19
|
+
)
|
|
20
|
+
if (!slideWithQuestion) {
|
|
21
|
+
console.error('slide not founod')
|
|
22
|
+
return `text question not found for slide with id ${questionId}`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return slideWithQuestion.props.quizSlideProps.mainText
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const getMultilpleChoiceAnswerLabels = (
|
|
29
|
+
quizData: QuizData,
|
|
30
|
+
questionId: string,
|
|
31
|
+
selectedIndexes: number[]
|
|
32
|
+
) => {
|
|
33
|
+
const multipleChoiceSlide = quizData.slides.find(
|
|
34
|
+
slide => slide.id === questionId
|
|
35
|
+
)
|
|
36
|
+
if (
|
|
37
|
+
!multipleChoiceSlide ||
|
|
38
|
+
multipleChoiceSlide.type !== 'MultipleChoiceSlide'
|
|
39
|
+
) {
|
|
40
|
+
console.error('only works for multiple choice slides')
|
|
41
|
+
return []
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const answers = (
|
|
45
|
+
multipleChoiceSlide.props as MultipleChoiceSlideProps
|
|
46
|
+
).multipleChoiceProps.choices.map(({label}) => label)
|
|
47
|
+
|
|
48
|
+
return answers.filter((_, index) => selectedIndexes.includes(index))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const getImageCarouselAnswerUrls = (
|
|
52
|
+
quizData: QuizData,
|
|
53
|
+
questionId: string,
|
|
54
|
+
selectedIndexes: number[]
|
|
55
|
+
) => {
|
|
56
|
+
const imageCarouselSlide = quizData.slides.find(
|
|
57
|
+
slide => slide.id === questionId
|
|
58
|
+
)
|
|
59
|
+
if (!imageCarouselSlide || imageCarouselSlide.type !== 'ImageCarouselSlide') {
|
|
60
|
+
console.error('only works for ImageCarouselSlide')
|
|
61
|
+
return []
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const imageAnswers = (
|
|
65
|
+
imageCarouselSlide.props as ImageCarouselSlideProps
|
|
66
|
+
).imageCarouselProps.choices.map(({imageUrl}) => imageUrl)
|
|
67
|
+
|
|
68
|
+
return imageAnswers.filter((_, index) => selectedIndexes.includes(index))
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const addNameToText = (text: string, name?: string) => {
|
|
72
|
+
const regex = new RegExp('{{userName}}', 'g')
|
|
73
|
+
|
|
74
|
+
return text.replace(regex, name ? name : 'Anonymous')
|
|
75
|
+
}
|
|
@@ -10,7 +10,7 @@ interface LevelIconProps {
|
|
|
10
10
|
level: SkillLevel
|
|
11
11
|
}
|
|
12
12
|
export const SkillLevelIcon = ({level}: LevelIconProps) => {
|
|
13
|
-
let Icon
|
|
13
|
+
let Icon: typeof BeginnerIcon
|
|
14
14
|
|
|
15
15
|
switch (level) {
|
|
16
16
|
case 'Beginner':
|
|
@@ -22,9 +22,6 @@ export const SkillLevelIcon = ({level}: LevelIconProps) => {
|
|
|
22
22
|
case 'Advanced':
|
|
23
23
|
Icon = AdvancedIcon
|
|
24
24
|
break
|
|
25
|
-
default:
|
|
26
|
-
Icon = null
|
|
27
|
-
break
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
return (
|
|
@@ -63,10 +63,16 @@ export const SkillLevelPicker = ({
|
|
|
63
63
|
handleSelectedSkillLevel,
|
|
64
64
|
selectedSkillLevel,
|
|
65
65
|
}: SkillLevelPickerProps) => {
|
|
66
|
+
const theme = useTheme()
|
|
67
|
+
|
|
66
68
|
return (
|
|
67
69
|
<>
|
|
68
70
|
<Text marginBottom="xs">Select skill level</Text>
|
|
69
|
-
<ScrollView
|
|
71
|
+
<ScrollView
|
|
72
|
+
horizontal
|
|
73
|
+
showsHorizontalScrollIndicator={false}
|
|
74
|
+
style={{paddingHorizontal: -theme.spacing.s, overflow: 'visible'}}
|
|
75
|
+
>
|
|
70
76
|
<SkillLevelButton
|
|
71
77
|
selected={!selectedSkillLevel}
|
|
72
78
|
text="All"
|
|
@@ -1,108 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import {DocumentNode} from 'graphql-typed'
|
|
2
|
+
import {
|
|
3
|
+
URL,
|
|
4
|
+
Decimal,
|
|
5
|
+
CurrencyCode,
|
|
6
|
+
} from '../node_modules/@shopify/shop-minis-platform-sdk/src/api/types'
|
|
7
|
+
export namespace __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData {
|
|
4
8
|
export interface ShopProductsByIdsFeaturedImage {
|
|
5
|
-
__typename?:
|
|
6
|
-
id?: string | null
|
|
7
|
-
altText?: string | null
|
|
8
|
-
url?: URL | null
|
|
9
|
+
__typename?: 'Image' | null
|
|
10
|
+
id?: string | null
|
|
11
|
+
altText?: string | null
|
|
12
|
+
url?: URL | null
|
|
9
13
|
}
|
|
10
14
|
export interface ShopProductsByIdsDefaultVariantCompareAtPrice {
|
|
11
|
-
__typename?:
|
|
12
|
-
amount?: Decimal | null
|
|
13
|
-
currencyCode?: CurrencyCode | null
|
|
15
|
+
__typename?: 'Money' | null
|
|
16
|
+
amount?: Decimal | null
|
|
17
|
+
currencyCode?: CurrencyCode | null
|
|
14
18
|
}
|
|
15
19
|
export interface ShopProductsByIdsDefaultVariantPrice {
|
|
16
|
-
__typename?:
|
|
17
|
-
amount?: Decimal | null
|
|
18
|
-
currencyCode?: CurrencyCode | null
|
|
20
|
+
__typename?: 'Money' | null
|
|
21
|
+
amount?: Decimal | null
|
|
22
|
+
currencyCode?: CurrencyCode | null
|
|
19
23
|
}
|
|
20
24
|
export interface ShopProductsByIdsDefaultVariantImage {
|
|
21
|
-
__typename?:
|
|
22
|
-
id?: string | null
|
|
23
|
-
altText?: string | null
|
|
24
|
-
url?: URL | null
|
|
25
|
+
__typename?: 'Image' | null
|
|
26
|
+
id?: string | null
|
|
27
|
+
altText?: string | null
|
|
28
|
+
url?: URL | null
|
|
25
29
|
}
|
|
26
30
|
export interface ShopProductsByIdsDefaultVariant {
|
|
27
|
-
__typename?:
|
|
28
|
-
id?: string | null
|
|
29
|
-
title?: string | null
|
|
30
|
-
isFavorited?: boolean | null
|
|
31
|
-
compareAtPrice?:
|
|
32
|
-
price?:
|
|
33
|
-
image?:
|
|
31
|
+
__typename?: 'ProductVariant' | null
|
|
32
|
+
id?: string | null
|
|
33
|
+
title?: string | null
|
|
34
|
+
isFavorited?: boolean | null
|
|
35
|
+
compareAtPrice?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIdsDefaultVariantCompareAtPrice | null
|
|
36
|
+
price?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIdsDefaultVariantPrice | null
|
|
37
|
+
image?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIdsDefaultVariantImage | null
|
|
34
38
|
}
|
|
35
39
|
export interface ShopProductsByIds {
|
|
36
|
-
__typename?:
|
|
37
|
-
id?: string | null
|
|
38
|
-
title?: string | null
|
|
39
|
-
tags?: (string | null)[] | null
|
|
40
|
-
featuredImage?:
|
|
41
|
-
defaultVariant?:
|
|
40
|
+
__typename?: 'Product' | null
|
|
41
|
+
id?: string | null
|
|
42
|
+
title?: string | null
|
|
43
|
+
tags?: (string | null)[] | null
|
|
44
|
+
featuredImage?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIdsFeaturedImage | null
|
|
45
|
+
defaultVariant?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIdsDefaultVariant | null
|
|
42
46
|
}
|
|
43
47
|
export interface Shop {
|
|
44
|
-
__typename?:
|
|
45
|
-
id?: string | null
|
|
46
|
-
name?: string | null
|
|
47
|
-
productsByIds?:
|
|
48
|
+
__typename?: 'Shop' | null
|
|
49
|
+
id?: string | null
|
|
50
|
+
name?: string | null
|
|
51
|
+
productsByIds?:
|
|
52
|
+
| (__MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.ShopProductsByIds | null)[]
|
|
53
|
+
| null
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
export interface
|
|
51
|
-
shop?:
|
|
56
|
+
export interface __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData {
|
|
57
|
+
shop?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData.Shop | null
|
|
52
58
|
}
|
|
53
|
-
export namespace
|
|
59
|
+
export namespace __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData {
|
|
54
60
|
export interface Variables {
|
|
55
|
-
shopId: string
|
|
56
|
-
productIds: string[]
|
|
61
|
+
shopId: string
|
|
62
|
+
productIds: string[]
|
|
57
63
|
}
|
|
58
64
|
export interface ShopProductsByIdsFeaturedImage {
|
|
59
|
-
__typename:
|
|
60
|
-
id?: string | null
|
|
61
|
-
altText?: string | null
|
|
62
|
-
url: URL
|
|
65
|
+
__typename: 'Image'
|
|
66
|
+
id?: string | null
|
|
67
|
+
altText?: string | null
|
|
68
|
+
url: URL
|
|
63
69
|
}
|
|
64
70
|
export interface ShopProductsByIdsDefaultVariantCompareAtPrice {
|
|
65
|
-
__typename:
|
|
66
|
-
amount: Decimal
|
|
67
|
-
currencyCode: CurrencyCode
|
|
71
|
+
__typename: 'Money'
|
|
72
|
+
amount: Decimal
|
|
73
|
+
currencyCode: CurrencyCode
|
|
68
74
|
}
|
|
69
75
|
export interface ShopProductsByIdsDefaultVariantPrice {
|
|
70
|
-
__typename:
|
|
71
|
-
amount: Decimal
|
|
72
|
-
currencyCode: CurrencyCode
|
|
76
|
+
__typename: 'Money'
|
|
77
|
+
amount: Decimal
|
|
78
|
+
currencyCode: CurrencyCode
|
|
73
79
|
}
|
|
74
80
|
export interface ShopProductsByIdsDefaultVariantImage {
|
|
75
|
-
__typename:
|
|
76
|
-
id?: string | null
|
|
77
|
-
altText?: string | null
|
|
78
|
-
url: URL
|
|
81
|
+
__typename: 'Image'
|
|
82
|
+
id?: string | null
|
|
83
|
+
altText?: string | null
|
|
84
|
+
url: URL
|
|
79
85
|
}
|
|
80
86
|
export interface ShopProductsByIdsDefaultVariant {
|
|
81
|
-
__typename:
|
|
82
|
-
id: string
|
|
83
|
-
title: string
|
|
84
|
-
isFavorited: boolean
|
|
85
|
-
compareAtPrice?:
|
|
86
|
-
price:
|
|
87
|
-
image?:
|
|
87
|
+
__typename: 'ProductVariant'
|
|
88
|
+
id: string
|
|
89
|
+
title: string
|
|
90
|
+
isFavorited: boolean
|
|
91
|
+
compareAtPrice?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIdsDefaultVariantCompareAtPrice | null
|
|
92
|
+
price: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIdsDefaultVariantPrice
|
|
93
|
+
image?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIdsDefaultVariantImage | null
|
|
88
94
|
}
|
|
89
95
|
export interface ShopProductsByIds {
|
|
90
|
-
__typename:
|
|
91
|
-
id: string
|
|
92
|
-
title: string
|
|
93
|
-
tags: string[]
|
|
94
|
-
featuredImage?:
|
|
95
|
-
defaultVariant:
|
|
96
|
+
__typename: 'Product'
|
|
97
|
+
id: string
|
|
98
|
+
title: string
|
|
99
|
+
tags: string[]
|
|
100
|
+
featuredImage?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIdsFeaturedImage | null
|
|
101
|
+
defaultVariant: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIdsDefaultVariant
|
|
96
102
|
}
|
|
97
103
|
export interface Shop {
|
|
98
|
-
__typename:
|
|
99
|
-
id: string
|
|
100
|
-
name: string
|
|
101
|
-
productsByIds: (
|
|
104
|
+
__typename: 'Shop'
|
|
105
|
+
id: string
|
|
106
|
+
name: string
|
|
107
|
+
productsByIds: (__MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.ShopProductsByIds | null)[]
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
|
-
export interface
|
|
105
|
-
shop?:
|
|
110
|
+
export interface __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData {
|
|
111
|
+
shop?: __MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.Shop | null
|
|
106
112
|
}
|
|
107
|
-
declare const document: DocumentNode<
|
|
108
|
-
|
|
113
|
+
declare const document: DocumentNode<
|
|
114
|
+
__MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData,
|
|
115
|
+
__MINI_APP_NAME_PASCAL_CASE__TestProductsQueryData.Variables,
|
|
116
|
+
__MINI_APP_NAME_PASCAL_CASE__TestProductsQueryPartialData
|
|
117
|
+
>
|
|
118
|
+
export default document
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {MiniAppConfig} from '@shopify/shop-minis-platform-sdk'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {__MINI_APP_NAME_PASCAL_CASE__Navigator} from './routes'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const config: MiniAppConfig = {
|
|
6
|
+
name: '__MINI_APP_NAME__',
|
|
7
|
+
Root: __MINI_APP_NAME_PASCAL_CASE__Navigator,
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export default
|
|
10
|
+
export default config
|
|
@@ -4,11 +4,11 @@ import {HomeScreen} from './screens/HomeScreen'
|
|
|
4
4
|
|
|
5
5
|
const Stack = createNativeStackNavigator()
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const __MINI_APP_NAME_PASCAL_CASE__Navigator = () => {
|
|
8
8
|
return (
|
|
9
9
|
<Stack.Navigator>
|
|
10
10
|
<Stack.Screen
|
|
11
|
-
name="
|
|
11
|
+
name="__MINI_APP_NAME_PASCAL_CASE__.Home"
|
|
12
12
|
component={HomeScreen}
|
|
13
13
|
options={{title: 'Home', headerShown: false}}
|
|
14
14
|
/>
|