@linguanahq/cli 0.1.0
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/index.js +1543 -0
- package/dist/templates/blog/react/.env.example +15 -0
- package/dist/templates/blog/react/ASSETS.md +1 -0
- package/dist/templates/blog/react/DEPLOY.md +23 -0
- package/dist/templates/blog/react/LICENSE +21 -0
- package/dist/templates/blog/react/README.md +36 -0
- package/dist/templates/blog/react/_gitignore +11 -0
- package/dist/templates/blog/react/index.html +2 -0
- package/dist/templates/blog/react/linguana.json +10 -0
- package/dist/templates/blog/react/package.json +34 -0
- package/dist/templates/blog/react/public/assets/scene-1.svg +1 -0
- package/dist/templates/blog/react/public/assets/scene-2.svg +1 -0
- package/dist/templates/blog/react/public/assets/scene-3.svg +1 -0
- package/dist/templates/blog/react/public/assets/scene-4.svg +1 -0
- package/dist/templates/blog/react/public/assets/scene-5.svg +1 -0
- package/dist/templates/blog/react/public/assets/scene-6.svg +1 -0
- package/dist/templates/blog/react/src/App.tsx +465 -0
- package/dist/templates/blog/react/src/Copy.tsx +322 -0
- package/dist/templates/blog/react/src/demo-messages.ts +221 -0
- package/dist/templates/blog/react/src/i18n.ts +62 -0
- package/dist/templates/blog/react/src/main.tsx +11 -0
- package/dist/templates/blog/react/src/messages.ts +71 -0
- package/dist/templates/blog/react/src/model.ts +128 -0
- package/dist/templates/blog/react/src/styles.css +1159 -0
- package/dist/templates/blog/react/src/vite-env.d.ts +1 -0
- package/dist/templates/blog/react/tsconfig.json +23 -0
- package/dist/templates/blog/react/vite.config.ts +36 -0
- package/dist/templates/blog/react/wrangler.jsonc +8 -0
- package/dist/templates/blog/solidjs/.env.example +15 -0
- package/dist/templates/blog/solidjs/ASSETS.md +1 -0
- package/dist/templates/blog/solidjs/DEPLOY.md +23 -0
- package/dist/templates/blog/solidjs/LICENSE +21 -0
- package/dist/templates/blog/solidjs/README.md +36 -0
- package/dist/templates/blog/solidjs/_gitignore +11 -0
- package/dist/templates/blog/solidjs/index.html +2 -0
- package/dist/templates/blog/solidjs/linguana.json +10 -0
- package/dist/templates/blog/solidjs/package.json +31 -0
- package/dist/templates/blog/solidjs/public/assets/scene-1.svg +1 -0
- package/dist/templates/blog/solidjs/public/assets/scene-2.svg +1 -0
- package/dist/templates/blog/solidjs/public/assets/scene-3.svg +1 -0
- package/dist/templates/blog/solidjs/public/assets/scene-4.svg +1 -0
- package/dist/templates/blog/solidjs/public/assets/scene-5.svg +1 -0
- package/dist/templates/blog/solidjs/public/assets/scene-6.svg +1 -0
- package/dist/templates/blog/solidjs/src/App.tsx +457 -0
- package/dist/templates/blog/solidjs/src/Copy.tsx +322 -0
- package/dist/templates/blog/solidjs/src/demo-messages.ts +221 -0
- package/dist/templates/blog/solidjs/src/i18n.ts +62 -0
- package/dist/templates/blog/solidjs/src/main.tsx +14 -0
- package/dist/templates/blog/solidjs/src/messages.ts +71 -0
- package/dist/templates/blog/solidjs/src/model.ts +128 -0
- package/dist/templates/blog/solidjs/src/styles.css +1159 -0
- package/dist/templates/blog/solidjs/src/vite-env.d.ts +1 -0
- package/dist/templates/blog/solidjs/tsconfig.json +24 -0
- package/dist/templates/blog/solidjs/vite.config.ts +36 -0
- package/dist/templates/blog/solidjs/wrangler.jsonc +8 -0
- package/dist/templates/blog/svelte/.env.example +15 -0
- package/dist/templates/blog/svelte/ASSETS.md +1 -0
- package/dist/templates/blog/svelte/DEPLOY.md +23 -0
- package/dist/templates/blog/svelte/LICENSE +21 -0
- package/dist/templates/blog/svelte/README.md +36 -0
- package/dist/templates/blog/svelte/_gitignore +11 -0
- package/dist/templates/blog/svelte/index.html +2 -0
- package/dist/templates/blog/svelte/linguana.json +10 -0
- package/dist/templates/blog/svelte/package.json +32 -0
- package/dist/templates/blog/svelte/public/assets/scene-1.svg +1 -0
- package/dist/templates/blog/svelte/public/assets/scene-2.svg +1 -0
- package/dist/templates/blog/svelte/public/assets/scene-3.svg +1 -0
- package/dist/templates/blog/svelte/public/assets/scene-4.svg +1 -0
- package/dist/templates/blog/svelte/public/assets/scene-5.svg +1 -0
- package/dist/templates/blog/svelte/public/assets/scene-6.svg +1 -0
- package/dist/templates/blog/svelte/src/App.svelte +196 -0
- package/dist/templates/blog/svelte/src/Copy.svelte +60 -0
- package/dist/templates/blog/svelte/src/Root.svelte +11 -0
- package/dist/templates/blog/svelte/src/demo-messages.ts +221 -0
- package/dist/templates/blog/svelte/src/i18n.ts +62 -0
- package/dist/templates/blog/svelte/src/main.ts +5 -0
- package/dist/templates/blog/svelte/src/messages.ts +71 -0
- package/dist/templates/blog/svelte/src/model.ts +128 -0
- package/dist/templates/blog/svelte/src/styles.css +1159 -0
- package/dist/templates/blog/svelte/src/vite-env.d.ts +1 -0
- package/dist/templates/blog/svelte/svelte.config.js +2 -0
- package/dist/templates/blog/svelte/tsconfig.json +23 -0
- package/dist/templates/blog/svelte/vite.config.ts +36 -0
- package/dist/templates/blog/svelte/wrangler.jsonc +8 -0
- package/dist/templates/blog/tanstack-start/.env.example +15 -0
- package/dist/templates/blog/tanstack-start/ASSETS.md +1 -0
- package/dist/templates/blog/tanstack-start/DEPLOY.md +23 -0
- package/dist/templates/blog/tanstack-start/LICENSE +21 -0
- package/dist/templates/blog/tanstack-start/README.md +36 -0
- package/dist/templates/blog/tanstack-start/_gitignore +11 -0
- package/dist/templates/blog/tanstack-start/linguana.json +10 -0
- package/dist/templates/blog/tanstack-start/nitro.config.ts +2 -0
- package/dist/templates/blog/tanstack-start/package.json +42 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-1.svg +1 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-2.svg +1 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-3.svg +1 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-4.svg +1 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-5.svg +1 -0
- package/dist/templates/blog/tanstack-start/public/assets/scene-6.svg +1 -0
- package/dist/templates/blog/tanstack-start/src/App.tsx +450 -0
- package/dist/templates/blog/tanstack-start/src/Copy.tsx +322 -0
- package/dist/templates/blog/tanstack-start/src/demo-messages.ts +221 -0
- package/dist/templates/blog/tanstack-start/src/i18n.ts +62 -0
- package/dist/templates/blog/tanstack-start/src/locale-server.ts +54 -0
- package/dist/templates/blog/tanstack-start/src/messages.ts +71 -0
- package/dist/templates/blog/tanstack-start/src/model.ts +128 -0
- package/dist/templates/blog/tanstack-start/src/router.tsx +10 -0
- package/dist/templates/blog/tanstack-start/src/routes/$.tsx +7 -0
- package/dist/templates/blog/tanstack-start/src/routes/__root.tsx +50 -0
- package/dist/templates/blog/tanstack-start/src/routes/index.tsx +5 -0
- package/dist/templates/blog/tanstack-start/src/styles.css +1159 -0
- package/dist/templates/blog/tanstack-start/src/vite-env.d.ts +1 -0
- package/dist/templates/blog/tanstack-start/tsconfig.json +23 -0
- package/dist/templates/blog/tanstack-start/vite.config.ts +50 -0
- package/dist/templates/blog/tanstack-start/wrangler.jsonc +12 -0
- package/dist/templates/blog/vue/.env.example +15 -0
- package/dist/templates/blog/vue/ASSETS.md +1 -0
- package/dist/templates/blog/vue/DEPLOY.md +23 -0
- package/dist/templates/blog/vue/LICENSE +21 -0
- package/dist/templates/blog/vue/README.md +36 -0
- package/dist/templates/blog/vue/_gitignore +11 -0
- package/dist/templates/blog/vue/index.html +2 -0
- package/dist/templates/blog/vue/linguana.json +10 -0
- package/dist/templates/blog/vue/package.json +34 -0
- package/dist/templates/blog/vue/public/assets/scene-1.svg +1 -0
- package/dist/templates/blog/vue/public/assets/scene-2.svg +1 -0
- package/dist/templates/blog/vue/public/assets/scene-3.svg +1 -0
- package/dist/templates/blog/vue/public/assets/scene-4.svg +1 -0
- package/dist/templates/blog/vue/public/assets/scene-5.svg +1 -0
- package/dist/templates/blog/vue/public/assets/scene-6.svg +1 -0
- package/dist/templates/blog/vue/src/App.vue +188 -0
- package/dist/templates/blog/vue/src/Copy.vue +59 -0
- package/dist/templates/blog/vue/src/demo-messages.ts +221 -0
- package/dist/templates/blog/vue/src/i18n.ts +62 -0
- package/dist/templates/blog/vue/src/main.ts +7 -0
- package/dist/templates/blog/vue/src/messages.ts +71 -0
- package/dist/templates/blog/vue/src/model.ts +128 -0
- package/dist/templates/blog/vue/src/styles.css +1159 -0
- package/dist/templates/blog/vue/src/vite-env.d.ts +1 -0
- package/dist/templates/blog/vue/tsconfig.json +23 -0
- package/dist/templates/blog/vue/vite.config.ts +36 -0
- package/dist/templates/blog/vue/wrangler.jsonc +8 -0
- package/dist/templates/saas/react/.env.example +15 -0
- package/dist/templates/saas/react/ASSETS.md +1 -0
- package/dist/templates/saas/react/DEPLOY.md +23 -0
- package/dist/templates/saas/react/LICENSE +21 -0
- package/dist/templates/saas/react/README.md +36 -0
- package/dist/templates/saas/react/_gitignore +11 -0
- package/dist/templates/saas/react/index.html +2 -0
- package/dist/templates/saas/react/linguana.json +10 -0
- package/dist/templates/saas/react/package.json +34 -0
- package/dist/templates/saas/react/src/App.tsx +631 -0
- package/dist/templates/saas/react/src/Copy.tsx +380 -0
- package/dist/templates/saas/react/src/demo-messages.ts +228 -0
- package/dist/templates/saas/react/src/i18n.ts +62 -0
- package/dist/templates/saas/react/src/main.tsx +11 -0
- package/dist/templates/saas/react/src/messages.ts +77 -0
- package/dist/templates/saas/react/src/model.ts +73 -0
- package/dist/templates/saas/react/src/styles.css +1159 -0
- package/dist/templates/saas/react/src/vite-env.d.ts +1 -0
- package/dist/templates/saas/react/tsconfig.json +23 -0
- package/dist/templates/saas/react/vite.config.ts +36 -0
- package/dist/templates/saas/react/wrangler.jsonc +8 -0
- package/dist/templates/saas/solidjs/.env.example +15 -0
- package/dist/templates/saas/solidjs/ASSETS.md +1 -0
- package/dist/templates/saas/solidjs/DEPLOY.md +23 -0
- package/dist/templates/saas/solidjs/LICENSE +21 -0
- package/dist/templates/saas/solidjs/README.md +36 -0
- package/dist/templates/saas/solidjs/_gitignore +11 -0
- package/dist/templates/saas/solidjs/index.html +2 -0
- package/dist/templates/saas/solidjs/linguana.json +10 -0
- package/dist/templates/saas/solidjs/package.json +31 -0
- package/dist/templates/saas/solidjs/src/App.tsx +629 -0
- package/dist/templates/saas/solidjs/src/Copy.tsx +380 -0
- package/dist/templates/saas/solidjs/src/demo-messages.ts +228 -0
- package/dist/templates/saas/solidjs/src/i18n.ts +62 -0
- package/dist/templates/saas/solidjs/src/main.tsx +14 -0
- package/dist/templates/saas/solidjs/src/messages.ts +77 -0
- package/dist/templates/saas/solidjs/src/model.ts +73 -0
- package/dist/templates/saas/solidjs/src/styles.css +1159 -0
- package/dist/templates/saas/solidjs/src/vite-env.d.ts +1 -0
- package/dist/templates/saas/solidjs/tsconfig.json +24 -0
- package/dist/templates/saas/solidjs/vite.config.ts +36 -0
- package/dist/templates/saas/solidjs/wrangler.jsonc +8 -0
- package/dist/templates/saas/svelte/.env.example +15 -0
- package/dist/templates/saas/svelte/ASSETS.md +1 -0
- package/dist/templates/saas/svelte/DEPLOY.md +23 -0
- package/dist/templates/saas/svelte/LICENSE +21 -0
- package/dist/templates/saas/svelte/README.md +36 -0
- package/dist/templates/saas/svelte/_gitignore +11 -0
- package/dist/templates/saas/svelte/index.html +2 -0
- package/dist/templates/saas/svelte/linguana.json +10 -0
- package/dist/templates/saas/svelte/package.json +32 -0
- package/dist/templates/saas/svelte/src/App.svelte +252 -0
- package/dist/templates/saas/svelte/src/Copy.svelte +74 -0
- package/dist/templates/saas/svelte/src/Root.svelte +11 -0
- package/dist/templates/saas/svelte/src/demo-messages.ts +228 -0
- package/dist/templates/saas/svelte/src/i18n.ts +62 -0
- package/dist/templates/saas/svelte/src/main.ts +5 -0
- package/dist/templates/saas/svelte/src/messages.ts +77 -0
- package/dist/templates/saas/svelte/src/model.ts +73 -0
- package/dist/templates/saas/svelte/src/styles.css +1159 -0
- package/dist/templates/saas/svelte/src/vite-env.d.ts +1 -0
- package/dist/templates/saas/svelte/svelte.config.js +2 -0
- package/dist/templates/saas/svelte/tsconfig.json +23 -0
- package/dist/templates/saas/svelte/vite.config.ts +36 -0
- package/dist/templates/saas/svelte/wrangler.jsonc +8 -0
- package/dist/templates/saas/tanstack-start/.env.example +15 -0
- package/dist/templates/saas/tanstack-start/ASSETS.md +1 -0
- package/dist/templates/saas/tanstack-start/DEPLOY.md +23 -0
- package/dist/templates/saas/tanstack-start/LICENSE +21 -0
- package/dist/templates/saas/tanstack-start/README.md +36 -0
- package/dist/templates/saas/tanstack-start/_gitignore +11 -0
- package/dist/templates/saas/tanstack-start/linguana.json +10 -0
- package/dist/templates/saas/tanstack-start/nitro.config.ts +2 -0
- package/dist/templates/saas/tanstack-start/package.json +42 -0
- package/dist/templates/saas/tanstack-start/src/App.tsx +616 -0
- package/dist/templates/saas/tanstack-start/src/Copy.tsx +380 -0
- package/dist/templates/saas/tanstack-start/src/demo-messages.ts +228 -0
- package/dist/templates/saas/tanstack-start/src/i18n.ts +62 -0
- package/dist/templates/saas/tanstack-start/src/locale-server.ts +54 -0
- package/dist/templates/saas/tanstack-start/src/messages.ts +77 -0
- package/dist/templates/saas/tanstack-start/src/model.ts +73 -0
- package/dist/templates/saas/tanstack-start/src/router.tsx +10 -0
- package/dist/templates/saas/tanstack-start/src/routes/$.tsx +7 -0
- package/dist/templates/saas/tanstack-start/src/routes/__root.tsx +50 -0
- package/dist/templates/saas/tanstack-start/src/routes/index.tsx +5 -0
- package/dist/templates/saas/tanstack-start/src/styles.css +1159 -0
- package/dist/templates/saas/tanstack-start/src/vite-env.d.ts +1 -0
- package/dist/templates/saas/tanstack-start/tsconfig.json +23 -0
- package/dist/templates/saas/tanstack-start/vite.config.ts +50 -0
- package/dist/templates/saas/tanstack-start/wrangler.jsonc +12 -0
- package/dist/templates/saas/vue/.env.example +15 -0
- package/dist/templates/saas/vue/ASSETS.md +1 -0
- package/dist/templates/saas/vue/DEPLOY.md +23 -0
- package/dist/templates/saas/vue/LICENSE +21 -0
- package/dist/templates/saas/vue/README.md +36 -0
- package/dist/templates/saas/vue/_gitignore +11 -0
- package/dist/templates/saas/vue/index.html +2 -0
- package/dist/templates/saas/vue/linguana.json +10 -0
- package/dist/templates/saas/vue/package.json +34 -0
- package/dist/templates/saas/vue/src/App.vue +244 -0
- package/dist/templates/saas/vue/src/Copy.vue +73 -0
- package/dist/templates/saas/vue/src/demo-messages.ts +228 -0
- package/dist/templates/saas/vue/src/i18n.ts +62 -0
- package/dist/templates/saas/vue/src/main.ts +7 -0
- package/dist/templates/saas/vue/src/messages.ts +77 -0
- package/dist/templates/saas/vue/src/model.ts +73 -0
- package/dist/templates/saas/vue/src/styles.css +1159 -0
- package/dist/templates/saas/vue/src/vite-env.d.ts +1 -0
- package/dist/templates/saas/vue/tsconfig.json +23 -0
- package/dist/templates/saas/vue/vite.config.ts +36 -0
- package/dist/templates/saas/vue/wrangler.jsonc +8 -0
- package/dist/templates/storefront/react/.env.example +15 -0
- package/dist/templates/storefront/react/ASSETS.md +1 -0
- package/dist/templates/storefront/react/DEPLOY.md +23 -0
- package/dist/templates/storefront/react/LICENSE +21 -0
- package/dist/templates/storefront/react/README.md +36 -0
- package/dist/templates/storefront/react/_gitignore +11 -0
- package/dist/templates/storefront/react/index.html +2 -0
- package/dist/templates/storefront/react/linguana.json +10 -0
- package/dist/templates/storefront/react/package.json +34 -0
- package/dist/templates/storefront/react/public/assets/collection.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-1.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-2.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-3.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-4.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-5.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-6.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-7.svg +1 -0
- package/dist/templates/storefront/react/public/assets/product-8.svg +1 -0
- package/dist/templates/storefront/react/src/App.tsx +616 -0
- package/dist/templates/storefront/react/src/Copy.tsx +304 -0
- package/dist/templates/storefront/react/src/demo-messages.ts +205 -0
- package/dist/templates/storefront/react/src/i18n.ts +64 -0
- package/dist/templates/storefront/react/src/main.tsx +11 -0
- package/dist/templates/storefront/react/src/messages.ts +71 -0
- package/dist/templates/storefront/react/src/model.ts +146 -0
- package/dist/templates/storefront/react/src/styles.css +1159 -0
- package/dist/templates/storefront/react/src/vite-env.d.ts +1 -0
- package/dist/templates/storefront/react/tsconfig.json +23 -0
- package/dist/templates/storefront/react/vite.config.ts +36 -0
- package/dist/templates/storefront/react/wrangler.jsonc +8 -0
- package/dist/templates/storefront/solidjs/.env.example +15 -0
- package/dist/templates/storefront/solidjs/ASSETS.md +1 -0
- package/dist/templates/storefront/solidjs/DEPLOY.md +23 -0
- package/dist/templates/storefront/solidjs/LICENSE +21 -0
- package/dist/templates/storefront/solidjs/README.md +36 -0
- package/dist/templates/storefront/solidjs/_gitignore +11 -0
- package/dist/templates/storefront/solidjs/index.html +2 -0
- package/dist/templates/storefront/solidjs/linguana.json +10 -0
- package/dist/templates/storefront/solidjs/package.json +31 -0
- package/dist/templates/storefront/solidjs/public/assets/collection.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-1.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-2.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-3.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-4.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-5.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-6.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-7.svg +1 -0
- package/dist/templates/storefront/solidjs/public/assets/product-8.svg +1 -0
- package/dist/templates/storefront/solidjs/src/App.tsx +612 -0
- package/dist/templates/storefront/solidjs/src/Copy.tsx +304 -0
- package/dist/templates/storefront/solidjs/src/demo-messages.ts +205 -0
- package/dist/templates/storefront/solidjs/src/i18n.ts +64 -0
- package/dist/templates/storefront/solidjs/src/main.tsx +14 -0
- package/dist/templates/storefront/solidjs/src/messages.ts +71 -0
- package/dist/templates/storefront/solidjs/src/model.ts +146 -0
- package/dist/templates/storefront/solidjs/src/styles.css +1159 -0
- package/dist/templates/storefront/solidjs/src/vite-env.d.ts +1 -0
- package/dist/templates/storefront/solidjs/tsconfig.json +24 -0
- package/dist/templates/storefront/solidjs/vite.config.ts +36 -0
- package/dist/templates/storefront/solidjs/wrangler.jsonc +8 -0
- package/dist/templates/storefront/svelte/.env.example +15 -0
- package/dist/templates/storefront/svelte/ASSETS.md +1 -0
- package/dist/templates/storefront/svelte/DEPLOY.md +23 -0
- package/dist/templates/storefront/svelte/LICENSE +21 -0
- package/dist/templates/storefront/svelte/README.md +36 -0
- package/dist/templates/storefront/svelte/_gitignore +11 -0
- package/dist/templates/storefront/svelte/index.html +2 -0
- package/dist/templates/storefront/svelte/linguana.json +10 -0
- package/dist/templates/storefront/svelte/package.json +32 -0
- package/dist/templates/storefront/svelte/public/assets/collection.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-1.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-2.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-3.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-4.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-5.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-6.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-7.svg +1 -0
- package/dist/templates/storefront/svelte/public/assets/product-8.svg +1 -0
- package/dist/templates/storefront/svelte/src/App.svelte +218 -0
- package/dist/templates/storefront/svelte/src/Copy.svelte +66 -0
- package/dist/templates/storefront/svelte/src/Root.svelte +11 -0
- package/dist/templates/storefront/svelte/src/demo-messages.ts +205 -0
- package/dist/templates/storefront/svelte/src/i18n.ts +64 -0
- package/dist/templates/storefront/svelte/src/main.ts +5 -0
- package/dist/templates/storefront/svelte/src/messages.ts +71 -0
- package/dist/templates/storefront/svelte/src/model.ts +146 -0
- package/dist/templates/storefront/svelte/src/styles.css +1159 -0
- package/dist/templates/storefront/svelte/src/vite-env.d.ts +1 -0
- package/dist/templates/storefront/svelte/svelte.config.js +2 -0
- package/dist/templates/storefront/svelte/tsconfig.json +23 -0
- package/dist/templates/storefront/svelte/vite.config.ts +36 -0
- package/dist/templates/storefront/svelte/wrangler.jsonc +8 -0
- package/dist/templates/storefront/tanstack-start/.env.example +15 -0
- package/dist/templates/storefront/tanstack-start/ASSETS.md +1 -0
- package/dist/templates/storefront/tanstack-start/DEPLOY.md +23 -0
- package/dist/templates/storefront/tanstack-start/LICENSE +21 -0
- package/dist/templates/storefront/tanstack-start/README.md +36 -0
- package/dist/templates/storefront/tanstack-start/_gitignore +11 -0
- package/dist/templates/storefront/tanstack-start/linguana.json +10 -0
- package/dist/templates/storefront/tanstack-start/nitro.config.ts +2 -0
- package/dist/templates/storefront/tanstack-start/package.json +42 -0
- package/dist/templates/storefront/tanstack-start/public/assets/collection.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-1.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-2.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-3.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-4.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-5.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-6.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-7.svg +1 -0
- package/dist/templates/storefront/tanstack-start/public/assets/product-8.svg +1 -0
- package/dist/templates/storefront/tanstack-start/src/App.tsx +601 -0
- package/dist/templates/storefront/tanstack-start/src/Copy.tsx +304 -0
- package/dist/templates/storefront/tanstack-start/src/demo-messages.ts +205 -0
- package/dist/templates/storefront/tanstack-start/src/i18n.ts +64 -0
- package/dist/templates/storefront/tanstack-start/src/locale-server.ts +54 -0
- package/dist/templates/storefront/tanstack-start/src/messages.ts +71 -0
- package/dist/templates/storefront/tanstack-start/src/model.ts +146 -0
- package/dist/templates/storefront/tanstack-start/src/router.tsx +10 -0
- package/dist/templates/storefront/tanstack-start/src/routes/$.tsx +7 -0
- package/dist/templates/storefront/tanstack-start/src/routes/__root.tsx +50 -0
- package/dist/templates/storefront/tanstack-start/src/routes/index.tsx +5 -0
- package/dist/templates/storefront/tanstack-start/src/styles.css +1159 -0
- package/dist/templates/storefront/tanstack-start/src/vite-env.d.ts +1 -0
- package/dist/templates/storefront/tanstack-start/tsconfig.json +23 -0
- package/dist/templates/storefront/tanstack-start/vite.config.ts +50 -0
- package/dist/templates/storefront/tanstack-start/wrangler.jsonc +12 -0
- package/dist/templates/storefront/vue/.env.example +15 -0
- package/dist/templates/storefront/vue/ASSETS.md +1 -0
- package/dist/templates/storefront/vue/DEPLOY.md +23 -0
- package/dist/templates/storefront/vue/LICENSE +21 -0
- package/dist/templates/storefront/vue/README.md +36 -0
- package/dist/templates/storefront/vue/_gitignore +11 -0
- package/dist/templates/storefront/vue/index.html +2 -0
- package/dist/templates/storefront/vue/linguana.json +10 -0
- package/dist/templates/storefront/vue/package.json +34 -0
- package/dist/templates/storefront/vue/public/assets/collection.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-1.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-2.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-3.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-4.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-5.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-6.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-7.svg +1 -0
- package/dist/templates/storefront/vue/public/assets/product-8.svg +1 -0
- package/dist/templates/storefront/vue/src/App.vue +210 -0
- package/dist/templates/storefront/vue/src/Copy.vue +65 -0
- package/dist/templates/storefront/vue/src/demo-messages.ts +205 -0
- package/dist/templates/storefront/vue/src/i18n.ts +64 -0
- package/dist/templates/storefront/vue/src/main.ts +7 -0
- package/dist/templates/storefront/vue/src/messages.ts +71 -0
- package/dist/templates/storefront/vue/src/model.ts +146 -0
- package/dist/templates/storefront/vue/src/styles.css +1159 -0
- package/dist/templates/storefront/vue/src/vite-env.d.ts +1 -0
- package/dist/templates/storefront/vue/tsconfig.json +23 -0
- package/dist/templates/storefront/vue/vite.config.ts +36 -0
- package/dist/templates/storefront/vue/wrangler.jsonc +8 -0
- package/package.json +38 -0
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { useTranslation } from "@linguanahq/solid";
|
|
2
|
+
import { createEffect, For, onCleanup, onMount } from "solid-js";
|
|
3
|
+
import { createStore, reconcile } from "solid-js/store";
|
|
4
|
+
import Copy from "./Copy.tsx";
|
|
5
|
+
import { demoLocales } from "./i18n";
|
|
6
|
+
import { messages } from "./messages";
|
|
7
|
+
import {
|
|
8
|
+
initialState,
|
|
9
|
+
items,
|
|
10
|
+
quantity,
|
|
11
|
+
readCart,
|
|
12
|
+
type State,
|
|
13
|
+
saveCart,
|
|
14
|
+
} from "./model";
|
|
15
|
+
|
|
16
|
+
export default function App() {
|
|
17
|
+
const runtime = useTranslation();
|
|
18
|
+
const locale = runtime.locale;
|
|
19
|
+
const translate = runtime.translate;
|
|
20
|
+
const locales = () =>
|
|
21
|
+
runtime.availableLocales().length
|
|
22
|
+
? runtime.availableLocales()
|
|
23
|
+
: demoLocales.filter((item) => item.code === "en");
|
|
24
|
+
const changeLocale = (value: string) => void runtime.setLocale(value);
|
|
25
|
+
const [state, setState] = createStore(initialState());
|
|
26
|
+
const set = <K extends keyof State>(key: K, value: State[K]) =>
|
|
27
|
+
setState(reconcile({ ...state, [key]: value }));
|
|
28
|
+
onMount(() => {
|
|
29
|
+
set("cart", readCart());
|
|
30
|
+
const pop = () => set("path", window.location.pathname);
|
|
31
|
+
window.addEventListener("popstate", pop);
|
|
32
|
+
onCleanup(() => window.removeEventListener("popstate", pop));
|
|
33
|
+
});
|
|
34
|
+
createEffect(() => {
|
|
35
|
+
document.documentElement.lang = locale();
|
|
36
|
+
document.documentElement.dir = locale().startsWith("ar") ? "rtl" : "ltr";
|
|
37
|
+
});
|
|
38
|
+
const msg = (id: string, values?: Record<string, string | number>) =>
|
|
39
|
+
String(translate(id, messages[id] ?? id, values));
|
|
40
|
+
const value = (event: Event | { currentTarget: EventTarget | null }) =>
|
|
41
|
+
(event.currentTarget as HTMLInputElement).value;
|
|
42
|
+
const money = (amount: number) =>
|
|
43
|
+
new Intl.NumberFormat(locale(), {
|
|
44
|
+
style: "currency",
|
|
45
|
+
currency: "USD",
|
|
46
|
+
maximumFractionDigits: 2,
|
|
47
|
+
}).format(amount);
|
|
48
|
+
const _date = (input: string) =>
|
|
49
|
+
new Intl.DateTimeFormat(locale(), {
|
|
50
|
+
dateStyle: "medium",
|
|
51
|
+
timeZone: "UTC",
|
|
52
|
+
}).format(new Date(input));
|
|
53
|
+
const visible = () =>
|
|
54
|
+
items
|
|
55
|
+
.filter(
|
|
56
|
+
(item) =>
|
|
57
|
+
(state.category === "all" || item.category === state.category) &&
|
|
58
|
+
`${msg(`${item.id}Title`)} ${msg(`${item.id}Summary`)}`
|
|
59
|
+
.toLocaleLowerCase(locale())
|
|
60
|
+
.includes(state.query.toLocaleLowerCase(locale()).trim()),
|
|
61
|
+
)
|
|
62
|
+
.sort((a, b) =>
|
|
63
|
+
state.sort === "low"
|
|
64
|
+
? a.price - b.price
|
|
65
|
+
: state.sort === "high"
|
|
66
|
+
? b.price - a.price
|
|
67
|
+
: 0,
|
|
68
|
+
);
|
|
69
|
+
const detailHref = (id: string) =>
|
|
70
|
+
`/products/${items.find((item) => item.id === id)!.slug}`;
|
|
71
|
+
const detail = () => items.find((item) => detailHref(item.id) === state.path);
|
|
72
|
+
const notFound = () =>
|
|
73
|
+
state.path !== "/" && state.path !== "/cart" && detail() === undefined;
|
|
74
|
+
const clearFilters = () => {
|
|
75
|
+
set("query", "");
|
|
76
|
+
set("category", "all");
|
|
77
|
+
};
|
|
78
|
+
const count = () =>
|
|
79
|
+
Object.values(state.cart).reduce((total, count) => total + count, 0);
|
|
80
|
+
const cartItems = () =>
|
|
81
|
+
items.filter((item) => (state.cart[item.id] ?? 0) > 0);
|
|
82
|
+
const total = () =>
|
|
83
|
+
cartItems().reduce(
|
|
84
|
+
(total, item) => total + item.price * state.cart[item.id]!,
|
|
85
|
+
0,
|
|
86
|
+
);
|
|
87
|
+
const updateCart = (id: string, count: number) => {
|
|
88
|
+
const cart = { ...state.cart };
|
|
89
|
+
if (count <= 0) delete cart[id];
|
|
90
|
+
else cart[id] = quantity(count);
|
|
91
|
+
set("cart", cart);
|
|
92
|
+
saveCart(cart);
|
|
93
|
+
};
|
|
94
|
+
const add = (id: string, count: number) => {
|
|
95
|
+
updateCart(id, (state.cart[id] ?? 0) + count);
|
|
96
|
+
set("added", true);
|
|
97
|
+
set("checkout", false);
|
|
98
|
+
};
|
|
99
|
+
const checkout = () => {
|
|
100
|
+
set("cart", {});
|
|
101
|
+
saveCart({});
|
|
102
|
+
set("checkout", true);
|
|
103
|
+
set("added", false);
|
|
104
|
+
};
|
|
105
|
+
const _submit = (event: { preventDefault(): void }) => {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
const valid = Boolean(
|
|
108
|
+
state.name.trim() && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(state.email),
|
|
109
|
+
);
|
|
110
|
+
set("error", !valid);
|
|
111
|
+
set("sent", valid);
|
|
112
|
+
};
|
|
113
|
+
const navigate = (event: {
|
|
114
|
+
currentTarget: EventTarget | null;
|
|
115
|
+
preventDefault(): void;
|
|
116
|
+
metaKey: boolean;
|
|
117
|
+
ctrlKey: boolean;
|
|
118
|
+
shiftKey: boolean;
|
|
119
|
+
altKey: boolean;
|
|
120
|
+
button: number;
|
|
121
|
+
}) => {
|
|
122
|
+
if (
|
|
123
|
+
event.metaKey ||
|
|
124
|
+
event.ctrlKey ||
|
|
125
|
+
event.shiftKey ||
|
|
126
|
+
event.altKey ||
|
|
127
|
+
event.button !== 0
|
|
128
|
+
)
|
|
129
|
+
return;
|
|
130
|
+
const target = new URL((event.currentTarget as HTMLAnchorElement).href);
|
|
131
|
+
if (target.origin !== window.location.origin) return;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
window.history.pushState({}, "", target.pathname);
|
|
134
|
+
set("path", target.pathname);
|
|
135
|
+
set("quantity", 1);
|
|
136
|
+
set("added", false);
|
|
137
|
+
window.scrollTo(0, 0);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<div class="site storefront">
|
|
142
|
+
<a href="#main" class="skip-link">
|
|
143
|
+
<Copy name="skip" />
|
|
144
|
+
</a>
|
|
145
|
+
<header class="site-header">
|
|
146
|
+
<a
|
|
147
|
+
href="/"
|
|
148
|
+
class="brand"
|
|
149
|
+
onClick={(event) => {
|
|
150
|
+
navigate(event);
|
|
151
|
+
}}
|
|
152
|
+
aria-label={`Common Goods — ${msg("home")}`}
|
|
153
|
+
>
|
|
154
|
+
<span class="brand-mark" aria-hidden="true">
|
|
155
|
+
{"◒"}
|
|
156
|
+
</span>
|
|
157
|
+
{"Common Goods"}
|
|
158
|
+
</a>
|
|
159
|
+
<nav aria-label={msg("home")}>
|
|
160
|
+
<a
|
|
161
|
+
href="/"
|
|
162
|
+
onClick={(event) => {
|
|
163
|
+
navigate(event);
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<Copy name="collection" />
|
|
167
|
+
</a>
|
|
168
|
+
<a
|
|
169
|
+
href="/cart"
|
|
170
|
+
onClick={(event) => {
|
|
171
|
+
navigate(event);
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
<Copy name="cart" />
|
|
175
|
+
<span class="cart-count">{count()}</span>
|
|
176
|
+
</a>
|
|
177
|
+
<label class="locale-picker">
|
|
178
|
+
<span class="sr-only">
|
|
179
|
+
<Copy name="language" />
|
|
180
|
+
</span>
|
|
181
|
+
<select
|
|
182
|
+
value={locale()}
|
|
183
|
+
aria-label={msg("language")}
|
|
184
|
+
onChange={(event) => {
|
|
185
|
+
changeLocale(value(event));
|
|
186
|
+
}}
|
|
187
|
+
>
|
|
188
|
+
<For each={locales()}>
|
|
189
|
+
{(language) => (
|
|
190
|
+
<>
|
|
191
|
+
<option value={language.code}>{language.nativeName}</option>
|
|
192
|
+
</>
|
|
193
|
+
)}
|
|
194
|
+
</For>
|
|
195
|
+
</select>
|
|
196
|
+
</label>
|
|
197
|
+
</nav>
|
|
198
|
+
</header>
|
|
199
|
+
<main id="main">
|
|
200
|
+
{state.path === "/" && (
|
|
201
|
+
<>
|
|
202
|
+
<section class="hero store-hero">
|
|
203
|
+
<div class="hero-copy">
|
|
204
|
+
<p class="eyebrow">
|
|
205
|
+
<Copy name="eyebrow" />
|
|
206
|
+
</p>
|
|
207
|
+
<h1>
|
|
208
|
+
<Copy name="headline" />
|
|
209
|
+
</h1>
|
|
210
|
+
<p class="intro">
|
|
211
|
+
<Copy name="intro" />
|
|
212
|
+
</p>
|
|
213
|
+
<a href="#collection" class="button">
|
|
214
|
+
<Copy name="shop" />
|
|
215
|
+
{" ↗"}
|
|
216
|
+
</a>
|
|
217
|
+
</div>
|
|
218
|
+
<img
|
|
219
|
+
src="/assets/collection.svg"
|
|
220
|
+
alt={msg("collection")}
|
|
221
|
+
class="hero-image"
|
|
222
|
+
width={800}
|
|
223
|
+
height={600}
|
|
224
|
+
loading="lazy"
|
|
225
|
+
/>
|
|
226
|
+
</section>
|
|
227
|
+
<section class="section" id="collection">
|
|
228
|
+
<div class="section-heading">
|
|
229
|
+
<h2>
|
|
230
|
+
<Copy name="collection" />
|
|
231
|
+
</h2>
|
|
232
|
+
<Copy name="count" values={{ count: visible().length }} />
|
|
233
|
+
</div>
|
|
234
|
+
<div class="filters">
|
|
235
|
+
<fieldset
|
|
236
|
+
class="filter-buttons"
|
|
237
|
+
aria-label={msg(
|
|
238
|
+
"collection" in messages ? "collection" : "latest",
|
|
239
|
+
)}
|
|
240
|
+
>
|
|
241
|
+
<button
|
|
242
|
+
type="button"
|
|
243
|
+
class={state.category === "all" ? "chip active" : "chip"}
|
|
244
|
+
aria-pressed={state.category === "all"}
|
|
245
|
+
onClick={(_event) => {
|
|
246
|
+
set("category", "all");
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
<Copy name="all" />
|
|
250
|
+
</button>
|
|
251
|
+
<button
|
|
252
|
+
type="button"
|
|
253
|
+
class={
|
|
254
|
+
state.category === "homeware" ? "chip active" : "chip"
|
|
255
|
+
}
|
|
256
|
+
aria-pressed={state.category === "homeware"}
|
|
257
|
+
onClick={(_event) => {
|
|
258
|
+
set("category", "homeware");
|
|
259
|
+
}}
|
|
260
|
+
>
|
|
261
|
+
<Copy name="homeware" />
|
|
262
|
+
</button>
|
|
263
|
+
<button
|
|
264
|
+
type="button"
|
|
265
|
+
class={state.category === "carry" ? "chip active" : "chip"}
|
|
266
|
+
aria-pressed={state.category === "carry"}
|
|
267
|
+
onClick={(_event) => {
|
|
268
|
+
set("category", "carry");
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
<Copy name="carry" />
|
|
272
|
+
</button>
|
|
273
|
+
<button
|
|
274
|
+
type="button"
|
|
275
|
+
class={state.category === "desk" ? "chip active" : "chip"}
|
|
276
|
+
aria-pressed={state.category === "desk"}
|
|
277
|
+
onClick={(_event) => {
|
|
278
|
+
set("category", "desk");
|
|
279
|
+
}}
|
|
280
|
+
>
|
|
281
|
+
<Copy name="desk" />
|
|
282
|
+
</button>
|
|
283
|
+
</fieldset>
|
|
284
|
+
<label class="search">
|
|
285
|
+
<span class="sr-only">
|
|
286
|
+
<Copy name="search" />
|
|
287
|
+
</span>
|
|
288
|
+
<input
|
|
289
|
+
type="search"
|
|
290
|
+
placeholder={msg("search")}
|
|
291
|
+
value={state.query}
|
|
292
|
+
onInput={(event) => {
|
|
293
|
+
set("query", value(event));
|
|
294
|
+
}}
|
|
295
|
+
/>
|
|
296
|
+
</label>
|
|
297
|
+
<label class="sort">
|
|
298
|
+
<span class="sr-only">
|
|
299
|
+
<Copy name="sort" />
|
|
300
|
+
</span>
|
|
301
|
+
<select
|
|
302
|
+
value={state.sort}
|
|
303
|
+
onChange={(event) => {
|
|
304
|
+
set("sort", value(event));
|
|
305
|
+
}}
|
|
306
|
+
>
|
|
307
|
+
<option value="featured">
|
|
308
|
+
<Copy name="featured" />
|
|
309
|
+
</option>
|
|
310
|
+
<option value="low">
|
|
311
|
+
<Copy name="low" />
|
|
312
|
+
</option>
|
|
313
|
+
<option value="high">
|
|
314
|
+
<Copy name="high" />
|
|
315
|
+
</option>
|
|
316
|
+
</select>
|
|
317
|
+
</label>
|
|
318
|
+
</div>
|
|
319
|
+
<div class="product-grid">
|
|
320
|
+
<For each={visible()}>
|
|
321
|
+
{(item) => (
|
|
322
|
+
<>
|
|
323
|
+
<article class="product-card">
|
|
324
|
+
<a
|
|
325
|
+
href={detailHref(item.id)}
|
|
326
|
+
onClick={(event) => {
|
|
327
|
+
navigate(event);
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<img
|
|
331
|
+
src={item.image}
|
|
332
|
+
alt={msg(`${item.id}Title`)}
|
|
333
|
+
class=""
|
|
334
|
+
width={800}
|
|
335
|
+
height={600}
|
|
336
|
+
loading="lazy"
|
|
337
|
+
/>
|
|
338
|
+
</a>
|
|
339
|
+
<div class="product-heading">
|
|
340
|
+
<h3>
|
|
341
|
+
<a
|
|
342
|
+
href={detailHref(item.id)}
|
|
343
|
+
onClick={(event) => {
|
|
344
|
+
navigate(event);
|
|
345
|
+
}}
|
|
346
|
+
>
|
|
347
|
+
<Copy name={`${item.id}Title`} />
|
|
348
|
+
</a>
|
|
349
|
+
</h3>
|
|
350
|
+
<span>{money(item.price)}</span>
|
|
351
|
+
</div>
|
|
352
|
+
<p class="muted">
|
|
353
|
+
<Copy name={item.category} />
|
|
354
|
+
</p>
|
|
355
|
+
<button
|
|
356
|
+
type="button"
|
|
357
|
+
class="add-button"
|
|
358
|
+
onClick={(_event) => {
|
|
359
|
+
add(item.id, 1);
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
362
|
+
<Copy name="add" />
|
|
363
|
+
</button>
|
|
364
|
+
</article>
|
|
365
|
+
</>
|
|
366
|
+
)}
|
|
367
|
+
</For>
|
|
368
|
+
</div>
|
|
369
|
+
{visible().length === 0 && (
|
|
370
|
+
<div class="empty" role="status">
|
|
371
|
+
<h3>
|
|
372
|
+
<Copy name="empty" />
|
|
373
|
+
</h3>
|
|
374
|
+
<p>
|
|
375
|
+
<Copy name="emptyHint" />
|
|
376
|
+
</p>
|
|
377
|
+
<button
|
|
378
|
+
type="button"
|
|
379
|
+
class="button"
|
|
380
|
+
onClick={(_event) => {
|
|
381
|
+
clearFilters();
|
|
382
|
+
}}
|
|
383
|
+
>
|
|
384
|
+
<Copy name="clear" />
|
|
385
|
+
</button>
|
|
386
|
+
</div>
|
|
387
|
+
)}
|
|
388
|
+
</section>
|
|
389
|
+
</>
|
|
390
|
+
)}
|
|
391
|
+
{detail() !== undefined && (
|
|
392
|
+
<section class="product-detail section">
|
|
393
|
+
<img
|
|
394
|
+
src={detail()!.image}
|
|
395
|
+
alt={msg(`${detail()!.id}Title`)}
|
|
396
|
+
class="detail-image"
|
|
397
|
+
width={800}
|
|
398
|
+
height={600}
|
|
399
|
+
loading="lazy"
|
|
400
|
+
/>
|
|
401
|
+
<div>
|
|
402
|
+
<a
|
|
403
|
+
href="/"
|
|
404
|
+
onClick={(event) => {
|
|
405
|
+
navigate(event);
|
|
406
|
+
}}
|
|
407
|
+
>
|
|
408
|
+
<Copy name="back" />
|
|
409
|
+
</a>
|
|
410
|
+
<p class="eyebrow">
|
|
411
|
+
<Copy name={detail()!.category} />
|
|
412
|
+
</p>
|
|
413
|
+
<h1>
|
|
414
|
+
<Copy name={`${detail()!.id}Title`} />
|
|
415
|
+
</h1>
|
|
416
|
+
<p class="price">{money(detail()!.price)}</p>
|
|
417
|
+
<p class="intro">
|
|
418
|
+
<Copy name={`${detail()!.id}Summary`} />
|
|
419
|
+
</p>
|
|
420
|
+
<label class="quantity">
|
|
421
|
+
<Copy name="qty" />
|
|
422
|
+
<input
|
|
423
|
+
type="number"
|
|
424
|
+
min={1}
|
|
425
|
+
max={99}
|
|
426
|
+
value={state.quantity}
|
|
427
|
+
onInput={(event) => {
|
|
428
|
+
set("quantity", quantity(value(event)));
|
|
429
|
+
}}
|
|
430
|
+
/>
|
|
431
|
+
</label>
|
|
432
|
+
<button
|
|
433
|
+
type="button"
|
|
434
|
+
class="button"
|
|
435
|
+
onClick={(_event) => {
|
|
436
|
+
add(detail()!.id, state.quantity);
|
|
437
|
+
}}
|
|
438
|
+
>
|
|
439
|
+
<Copy name="add" />
|
|
440
|
+
</button>
|
|
441
|
+
<p class="muted fine">
|
|
442
|
+
<Copy name="shipping" />
|
|
443
|
+
</p>
|
|
444
|
+
</div>
|
|
445
|
+
</section>
|
|
446
|
+
)}
|
|
447
|
+
{state.path === "/cart" && (
|
|
448
|
+
<section class="section basket">
|
|
449
|
+
<p class="eyebrow">
|
|
450
|
+
<Copy name="count" values={{ count: count() }} />
|
|
451
|
+
</p>
|
|
452
|
+
<h1>
|
|
453
|
+
<Copy name="cart" />
|
|
454
|
+
</h1>
|
|
455
|
+
{count() === 0 && (
|
|
456
|
+
<div class="empty">
|
|
457
|
+
<p>
|
|
458
|
+
<Copy name="emptyCart" />
|
|
459
|
+
</p>
|
|
460
|
+
<a
|
|
461
|
+
href="/"
|
|
462
|
+
onClick={(event) => {
|
|
463
|
+
navigate(event);
|
|
464
|
+
}}
|
|
465
|
+
>
|
|
466
|
+
<Copy name="shop" />
|
|
467
|
+
</a>
|
|
468
|
+
</div>
|
|
469
|
+
)}
|
|
470
|
+
<For each={cartItems()}>
|
|
471
|
+
{(item) => (
|
|
472
|
+
<>
|
|
473
|
+
<div class="cart-row">
|
|
474
|
+
<img
|
|
475
|
+
src={item.image}
|
|
476
|
+
alt={msg(`${item.id}Title`)}
|
|
477
|
+
class=""
|
|
478
|
+
width={800}
|
|
479
|
+
height={600}
|
|
480
|
+
loading="lazy"
|
|
481
|
+
/>
|
|
482
|
+
<div>
|
|
483
|
+
<h2>
|
|
484
|
+
<a
|
|
485
|
+
href={detailHref(item.id)}
|
|
486
|
+
onClick={(event) => {
|
|
487
|
+
navigate(event);
|
|
488
|
+
}}
|
|
489
|
+
>
|
|
490
|
+
<Copy name={`${item.id}Title`} />
|
|
491
|
+
</a>
|
|
492
|
+
</h2>
|
|
493
|
+
<span>{money(item.price)}</span>
|
|
494
|
+
</div>
|
|
495
|
+
<label class="quantity">
|
|
496
|
+
<span class="sr-only">
|
|
497
|
+
<Copy name="qty" />
|
|
498
|
+
</span>
|
|
499
|
+
<input
|
|
500
|
+
type="number"
|
|
501
|
+
min={1}
|
|
502
|
+
max={99}
|
|
503
|
+
value={state.cart[item.id]}
|
|
504
|
+
onInput={(event) => {
|
|
505
|
+
updateCart(item.id, quantity(value(event)));
|
|
506
|
+
}}
|
|
507
|
+
aria-label={`${msg("qty")}: ${msg(`${item.id}Title`)}`}
|
|
508
|
+
/>
|
|
509
|
+
</label>
|
|
510
|
+
<button
|
|
511
|
+
type="button"
|
|
512
|
+
class="text-button"
|
|
513
|
+
onClick={(_event) => {
|
|
514
|
+
updateCart(item.id, 0);
|
|
515
|
+
}}
|
|
516
|
+
>
|
|
517
|
+
<Copy name="remove" />
|
|
518
|
+
</button>
|
|
519
|
+
</div>
|
|
520
|
+
</>
|
|
521
|
+
)}
|
|
522
|
+
</For>
|
|
523
|
+
{count() > 0 && (
|
|
524
|
+
<>
|
|
525
|
+
<div class="cart-total">
|
|
526
|
+
<strong>
|
|
527
|
+
<Copy name="total" />
|
|
528
|
+
</strong>
|
|
529
|
+
<strong>{money(total())}</strong>
|
|
530
|
+
</div>
|
|
531
|
+
<button
|
|
532
|
+
type="button"
|
|
533
|
+
class="button"
|
|
534
|
+
onClick={(_event) => {
|
|
535
|
+
checkout();
|
|
536
|
+
}}
|
|
537
|
+
>
|
|
538
|
+
<Copy name="checkout" />
|
|
539
|
+
</button>
|
|
540
|
+
</>
|
|
541
|
+
)}
|
|
542
|
+
<p class="muted">
|
|
543
|
+
<Copy name="checkoutNote" />
|
|
544
|
+
</p>
|
|
545
|
+
<p class="muted fine">
|
|
546
|
+
<Copy name="shipping" />
|
|
547
|
+
</p>
|
|
548
|
+
{state.checkout && (
|
|
549
|
+
<p role="status" class="success">
|
|
550
|
+
<Copy name="checkoutDone" />
|
|
551
|
+
</p>
|
|
552
|
+
)}
|
|
553
|
+
</section>
|
|
554
|
+
)}
|
|
555
|
+
{state.added && (
|
|
556
|
+
<div role="status" class="toast">
|
|
557
|
+
<Copy name="added" />
|
|
558
|
+
<a
|
|
559
|
+
href="/cart"
|
|
560
|
+
onClick={(event) => {
|
|
561
|
+
navigate(event);
|
|
562
|
+
}}
|
|
563
|
+
>
|
|
564
|
+
<Copy name="cart" />
|
|
565
|
+
</a>
|
|
566
|
+
</div>
|
|
567
|
+
)}
|
|
568
|
+
{notFound() && (
|
|
569
|
+
<section class="section empty">
|
|
570
|
+
<p class="eyebrow">{"404"}</p>
|
|
571
|
+
<h1>
|
|
572
|
+
<Copy name="missing" />
|
|
573
|
+
</h1>
|
|
574
|
+
<p>
|
|
575
|
+
<Copy name="missingHint" />
|
|
576
|
+
</p>
|
|
577
|
+
<a
|
|
578
|
+
href="/"
|
|
579
|
+
onClick={(event) => {
|
|
580
|
+
navigate(event);
|
|
581
|
+
}}
|
|
582
|
+
>
|
|
583
|
+
<Copy name="back" />
|
|
584
|
+
</a>
|
|
585
|
+
</section>
|
|
586
|
+
)}
|
|
587
|
+
</main>
|
|
588
|
+
<footer class="site-footer">
|
|
589
|
+
<div>
|
|
590
|
+
<a
|
|
591
|
+
href="/"
|
|
592
|
+
class="brand"
|
|
593
|
+
onClick={(event) => {
|
|
594
|
+
navigate(event);
|
|
595
|
+
}}
|
|
596
|
+
>
|
|
597
|
+
{"Common Goods"}
|
|
598
|
+
</a>
|
|
599
|
+
<p>
|
|
600
|
+
<Copy name="about" />
|
|
601
|
+
</p>
|
|
602
|
+
</div>
|
|
603
|
+
<p class="fine">
|
|
604
|
+
<Copy name="demo" />
|
|
605
|
+
<a href="https://linguana.mohammedibrahim.dev" rel="noreferrer">
|
|
606
|
+
{"Linguana ↗"}
|
|
607
|
+
</a>
|
|
608
|
+
</p>
|
|
609
|
+
</footer>
|
|
610
|
+
</div>
|
|
611
|
+
);
|
|
612
|
+
}
|