@wix/agent-skills 1.26.0 → 1.28.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/README.md +1 -0
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +8 -6
- package/skills/wix-app/references/APP_VALIDATION.md +5 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/SDK_MODULE_MAP.md +1 -1
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +14 -2
- package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +4 -5
- package/skills/wix-app/references/stores/GET_PRODUCT.md +9 -1
- package/skills/wix-app/references/stores/INVENTORY.md +2 -0
- package/skills/wix-app/references/stores/QUERY.md +2 -2
- package/skills/wix-app/references/stores/WRITE.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +35 -14
- package/skills/wix-headless-kit/guides/existing-site.md +12 -5
- package/skills/wix-headless-kit/guides/no-machine.md +115 -0
- package/skills/wix-headless-kit/install/attach.mjs +60 -13
- package/skills/wix-headless-kit/install/bootstrap.mjs +3 -1
- package/skills/wix-headless-kit/install/check.mjs +5 -5
- package/skills/wix-headless-kit/install/context.mjs +4 -2
- package/skills/wix-headless-kit/install/deploy.mjs +11 -5
- package/skills/wix-headless-kit/install/pins.json +8 -0
- package/skills/wix-headless-kit/install/setup.mjs +10 -8
- package/skills/wix-headless-kit/install/templates.mjs +39 -25
- package/skills/wix-headless-templates/SKILL.md +43 -0
- package/skills/wix-headless-templates/blank/project/README.md +15 -0
- package/skills/wix-headless-templates/blank/project/astro.config.mjs +20 -0
- package/skills/wix-headless-templates/blank/project/package.json +34 -0
- package/skills/wix-headless-templates/blank/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blank/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blank/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blank/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blank/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blank/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blank/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blank/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/INSTRUCTIONS.md +418 -0
- package/skills/wix-headless-templates/blog/app/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/app/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/app/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/app/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/app/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/app-astro/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/app-astro/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/README.md +15 -0
- package/skills/wix-headless-templates/blog/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/blog/project/package-lock.json +14699 -0
- package/skills/wix-headless-templates/blog/project/package.json +39 -0
- package/skills/wix-headless-templates/blog/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/blog/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/blog/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/blog/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/blog/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/BlogFeedView.tsx +191 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/CommentsView.tsx +206 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostLikeButton.tsx +62 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/PostView.tsx +139 -0
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +42 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useBlogFeed.ts +31 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/useComments.ts +26 -0
- package/skills/wix-headless-templates/blog/project/src/hooks/blog/usePost.ts +25 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/blog/project/src/layouts/SiteLayout.astro +44 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/[...slug].astro +148 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/category/[slug].astro +97 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog/tag/[slug].astro +51 -0
- package/skills/wix-headless-templates/blog/project/src/pages/blog.astro +34 -0
- package/skills/wix-headless-templates/blog/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/blog/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors-core.ts +51 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/authors.ts +50 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/blog-feed-store.ts +156 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-core.ts +189 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments-store.ts +214 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/comments.ts +84 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-likes.ts +42 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/post-store.ts +158 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts-core.ts +347 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/posts.ts +132 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy-core.ts +80 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/taxonomy.ts +78 -0
- package/skills/wix-headless-templates/blog/project/src/wix/blog/types.ts +161 -0
- package/skills/wix-headless-templates/blog/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/blog/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/blog/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/blog/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/blog/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/blog/rest/authors.ts +39 -0
- package/skills/wix-headless-templates/blog/rest/comments.ts +64 -0
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +37 -0
- package/skills/wix-headless-templates/blog/rest/posts.ts +123 -0
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +79 -0
- package/skills/wix-headless-templates/blog/seed/SEED.md +81 -0
- package/skills/wix-headless-templates/blog/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +337 -0
- package/skills/wix-headless-templates/bookings/INSTRUCTIONS.md +356 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/app/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/app/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/app/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/app-astro/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/README.md +15 -0
- package/skills/wix-headless-templates/bookings/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/bookings/project/package-lock.json +10546 -0
- package/skills/wix-headless-templates/bookings/project/package.json +41 -0
- package/skills/wix-headless-templates/bookings/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/bookings/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/bookings/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServiceBookingView.tsx +369 -0
- package/skills/wix-headless-templates/bookings/project/src/components/bookings/ServicesView.tsx +193 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useBookingFlow.ts +56 -0
- package/skills/wix-headless-templates/bookings/project/src/hooks/bookings/useServices.ts +23 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/bookings/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services/[slug].astro +81 -0
- package/skills/wix-headless-templates/bookings/project/src/pages/services.astro +40 -0
- package/skills/wix-headless-templates/bookings/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-core.ts +614 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking-flow-store.ts +410 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-core.ts +366 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services-store.ts +213 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/services.ts +100 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/bookings/types.ts +236 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/bookings/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/bookings/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/bookings/rest/booking.ts +227 -0
- package/skills/wix-headless-templates/bookings/rest/services.ts +94 -0
- package/skills/wix-headless-templates/bookings/seed/SEED.md +109 -0
- package/skills/wix-headless-templates/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +407 -0
- package/skills/wix-headless-templates/cms/INSTRUCTIONS.md +399 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/app/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/app/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/README.md +15 -0
- package/skills/wix-headless-templates/cms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/cms/project/package-lock.json +9798 -0
- package/skills/wix-headless-templates/cms/project/package.json +37 -0
- package/skills/wix-headless-templates/cms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/cms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/cms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/cms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/cms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useCollection.ts +82 -0
- package/skills/wix-headless-templates/cms/project/src/hooks/cms/useItem.ts +37 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/cms/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/cms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/cms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collection-store.ts +220 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections-core.ts +41 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/collections.ts +28 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items-core.ts +259 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/items.ts +182 -0
- package/skills/wix-headless-templates/cms/project/src/wix/cms/types.ts +138 -0
- package/skills/wix-headless-templates/cms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/cms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/cms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/cms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/cms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/cms/rest/collections.ts +25 -0
- package/skills/wix-headless-templates/cms/rest/items.ts +189 -0
- package/skills/wix-headless-templates/cms/seed/SEED.md +116 -0
- package/skills/wix-headless-templates/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +321 -0
- package/skills/wix-headless-templates/compose.mjs +83 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +348 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/app/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/app/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/app-astro/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/app-astro/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/app-astro/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/README.md +15 -0
- package/skills/wix-headless-templates/donations/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/donations/project/package-lock.json +10266 -0
- package/skills/wix-headless-templates/donations/project/package.json +39 -0
- package/skills/wix-headless-templates/donations/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/donations/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/donations/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/donations/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/donations/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/CampaignPage.astro +43 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +155 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +46 -0
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +49 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useCampaigns.ts +21 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonation.ts +27 -0
- package/skills/wix-headless-templates/donations/project/src/hooks/donations/useDonationReceipt.ts +19 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/donations/project/src/layouts/SiteLayout.astro +45 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/[id].astro +28 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/index.astro +51 -0
- package/skills/wix-headless-templates/donations/project/src/pages/donate/thank-you.astro +13 -0
- package/skills/wix-headless-templates/donations/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/donations/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/donations/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns-store.ts +59 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +83 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +68 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +163 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +465 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/receipt-store.ts +55 -0
- package/skills/wix-headless-templates/donations/project/src/wix/donations/types.ts +121 -0
- package/skills/wix-headless-templates/donations/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/donations/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/donations/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/donations/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +76 -0
- package/skills/wix-headless-templates/donations/rest/donate.ts +64 -0
- package/skills/wix-headless-templates/donations/seed/SEED.md +90 -0
- package/skills/wix-headless-templates/donations/seed/read-site.mjs +33 -0
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +250 -0
- package/skills/wix-headless-templates/events/INSTRUCTIONS.md +387 -0
- package/skills/wix-headless-templates/events/app/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/app/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/app/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/app/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/app/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/app/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/app/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/app/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/app/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/app/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/app-astro/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/app-astro/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/README.md +15 -0
- package/skills/wix-headless-templates/events/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/events/project/package-lock.json +10497 -0
- package/skills/wix-headless-templates/events/project/package.json +39 -0
- package/skills/wix-headless-templates/events/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/events/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/events/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/events/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/events/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventConfirmationView.tsx +139 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventRegistrationView.tsx +375 -0
- package/skills/wix-headless-templates/events/project/src/components/events/EventsView.tsx +134 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventConfirmation.ts +21 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEventRegistration.ts +40 -0
- package/skills/wix-headless-templates/events/project/src/hooks/events/useEvents.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/events/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/events/project/src/pages/event-confirmation.astro +12 -0
- package/skills/wix-headless-templates/events/project/src/pages/events/[slug].astro +104 -0
- package/skills/wix-headless-templates/events/project/src/pages/events.astro +23 -0
- package/skills/wix-headless-templates/events/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/events/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/events/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-core.ts +379 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events-store.ts +175 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/events.ts +124 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/order-store.ts +143 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders-core.ts +86 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/orders.ts +30 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-core.ts +415 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration-store.ts +237 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/registration.ts +109 -0
- package/skills/wix-headless-templates/events/project/src/wix/events/types.ts +249 -0
- package/skills/wix-headless-templates/events/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/events/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/events/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/events/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/events/rest/events.ts +112 -0
- package/skills/wix-headless-templates/events/rest/orders.ts +28 -0
- package/skills/wix-headless-templates/events/rest/registration.ts +96 -0
- package/skills/wix-headless-templates/events/seed/SEED.md +115 -0
- package/skills/wix-headless-templates/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +322 -0
- package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +317 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/app/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/app/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/app/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/app-astro/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/README.md +15 -0
- package/skills/wix-headless-templates/faq/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/faq/project/package-lock.json +8837 -0
- package/skills/wix-headless-templates/faq/project/package.json +37 -0
- package/skills/wix-headless-templates/faq/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/faq/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/faq/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/faq/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/faq/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqAccordion.tsx +159 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqCategoryNav.tsx +46 -0
- package/skills/wix-headless-templates/faq/project/src/components/faq/FaqSearch.tsx +56 -0
- package/skills/wix-headless-templates/faq/project/src/hooks/faq/useFaq.ts +53 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/faq/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/faq/project/src/pages/faq.astro +39 -0
- package/skills/wix-headless-templates/faq/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/faq/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/faq/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-core.ts +428 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq-store.ts +212 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +72 -0
- package/skills/wix-headless-templates/faq/project/src/wix/faq/types.ts +63 -0
- package/skills/wix-headless-templates/faq/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/faq/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/faq/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/faq/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/faq/rest/faq.ts +71 -0
- package/skills/wix-headless-templates/faq/seed/SEED.md +104 -0
- package/skills/wix-headless-templates/faq/seed/read-site.mjs +23 -0
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +302 -0
- package/skills/wix-headless-templates/forms/INSTRUCTIONS.md +417 -0
- package/skills/wix-headless-templates/forms/app/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/app/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/README.md +15 -0
- package/skills/wix-headless-templates/forms/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/forms/project/package-lock.json +9102 -0
- package/skills/wix-headless-templates/forms/project/package.json +37 -0
- package/skills/wix-headless-templates/forms/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/forms/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/forms/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/forms/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/forms/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/forms/project/src/hooks/forms/useWixForm.ts +108 -0
- package/skills/wix-headless-templates/forms/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/forms/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/forms/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/address-templates.generated.ts +13 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/form-store.ts +533 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms-core.ts +671 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +57 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions-core.ts +423 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +95 -0
- package/skills/wix-headless-templates/forms/project/src/wix/forms/types.ts +284 -0
- package/skills/wix-headless-templates/forms/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/forms/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/forms/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/forms/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/forms/rest/forms.ts +37 -0
- package/skills/wix-headless-templates/forms/rest/submissions.ts +83 -0
- package/skills/wix-headless-templates/forms/seed/SEED.md +225 -0
- package/skills/wix-headless-templates/forms/seed/read-site.mjs +53 -0
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +574 -0
- package/skills/wix-headless-templates/forms/tooling/address-templates.mjs +96 -0
- package/skills/wix-headless-templates/members/INSTRUCTIONS.md +345 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/app/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/app/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/app/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/app/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/app/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/app/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/app/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/app/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/app/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/app/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/app-astro/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/app-astro/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/app-astro/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/README.md +15 -0
- package/skills/wix-headless-templates/members/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/members/project/package-lock.json +8892 -0
- package/skills/wix-headless-templates/members/project/package.json +37 -0
- package/skills/wix-headless-templates/members/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/members/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/members/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/members/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/members/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountPage.tsx +16 -0
- package/skills/wix-headless-templates/members/project/src/components/members/AccountView.tsx +60 -0
- package/skills/wix-headless-templates/members/project/src/components/members/LoginForm.tsx +165 -0
- package/skills/wix-headless-templates/members/project/src/components/members/MemberMenu.tsx +78 -0
- package/skills/wix-headless-templates/members/project/src/components/members/RequireAuth.tsx +47 -0
- package/skills/wix-headless-templates/members/project/src/hooks/members/useMember.ts +67 -0
- package/skills/wix-headless-templates/members/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/members/project/src/layouts/SiteLayout.astro +42 -0
- package/skills/wix-headless-templates/members/project/src/pages/account.astro +9 -0
- package/skills/wix-headless-templates/members/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/members/project/src/pages/login.astro +11 -0
- package/skills/wix-headless-templates/members/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/members/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/members/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth-core.ts +160 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/auth.ts +117 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/client.ts +27 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/member-store.ts +133 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/members.ts +29 -0
- package/skills/wix-headless-templates/members/project/src/wix/members/types.ts +21 -0
- package/skills/wix-headless-templates/members/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/members/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/members/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/members/rest/auth.ts +224 -0
- package/skills/wix-headless-templates/members/rest/members.ts +26 -0
- package/skills/wix-headless-templates/members/seed/SEED.md +39 -0
- package/skills/wix-headless-templates/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +91 -0
- package/skills/wix-headless-templates/portfolio/INSTRUCTIONS.md +315 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/app/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/app/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/app/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/app-astro/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/README.md +15 -0
- package/skills/wix-headless-templates/portfolio/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/portfolio/project/package-lock.json +8760 -0
- package/skills/wix-headless-templates/portfolio/project/package.json +37 -0
- package/skills/wix-headless-templates/portfolio/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/portfolio/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionProjectsView.tsx +110 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/CollectionsView.tsx +90 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-templates/portfolio/project/src/components/portfolio/ProjectDetailView.tsx +85 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollectionProjects.ts +32 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useCollections.ts +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/hooks/portfolio/useProjectDetail.ts +31 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/portfolio/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio/[slug].astro +30 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/portfolio.astro +21 -0
- package/skills/wix-headless-templates/portfolio/project/src/pages/projects/[slug].astro +29 -0
- package/skills/wix-headless-templates/portfolio/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/portfolio.ts +78 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/portfolio/types.ts +55 -0
- package/skills/wix-headless-templates/portfolio/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/portfolio/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +86 -0
- package/skills/wix-headless-templates/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +253 -0
- package/skills/wix-headless-templates/pricing-plans/INSTRUCTIONS.md +378 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/app/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/app-astro/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/README.md +15 -0
- package/skills/wix-headless-templates/pricing-plans/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/package-lock.json +9799 -0
- package/skills/wix-headless-templates/pricing-plans/project/package.json +38 -0
- package/skills/wix-headless-templates/pricing-plans/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlanDetailView.tsx +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/PlansView.tsx +108 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/RequirePlan.tsx +87 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanAccess.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlanPurchase.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/hooks/pricing-plans/usePlans.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/layouts/SiteLayout.astro +41 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans/[slug].astro +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/pages/plans.astro +21 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-core.ts +29 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access-store.ts +92 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +37 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-core.ts +212 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plans.ts +54 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/purchase.ts +22 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/types.ts +52 -0
- package/skills/wix-headless-templates/pricing-plans/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/pricing-plans/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +31 -0
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +58 -0
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-templates/pricing-plans/seed/SEED.md +93 -0
- package/skills/wix-headless-templates/pricing-plans/seed/read-site.mjs +22 -0
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +301 -0
- package/skills/wix-headless-templates/rentals/INSTRUCTIONS.md +309 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/app/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/app/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/app/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/app-astro/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/README.md +15 -0
- package/skills/wix-headless-templates/rentals/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/rentals/project/package-lock.json +10545 -0
- package/skills/wix-headless-templates/rentals/project/package.json +40 -0
- package/skills/wix-headless-templates/rentals/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/rentals/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/rentals/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalBookingView.tsx +195 -0
- package/skills/wix-headless-templates/rentals/project/src/components/rentals/RentalsView.tsx +89 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentalFlow.ts +31 -0
- package/skills/wix-headless-templates/rentals/project/src/hooks/rentals/useRentals.ts +23 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/rentals/project/src/layouts/SiteLayout.astro +40 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals/[slug].astro +81 -0
- package/skills/wix-headless-templates/rentals/project/src/pages/rentals.astro +24 -0
- package/skills/wix-headless-templates/rentals/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rental-flow-store.ts +283 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-core.ts +435 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals-store.ts +112 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/rentals.ts +173 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/rentals/types.ts +113 -0
- package/skills/wix-headless-templates/rentals/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/rentals/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +153 -0
- package/skills/wix-headless-templates/rentals/seed/SEED.md +95 -0
- package/skills/wix-headless-templates/rentals/seed/read-site.mjs +34 -0
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +321 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +468 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/app-astro/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/app-astro/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/README.md +15 -0
- package/skills/wix-headless-templates/restaurants/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/restaurants/project/package-lock.json +11038 -0
- package/skills/wix-headless-templates/restaurants/project/package.json +40 -0
- package/skills/wix-headless-templates/restaurants/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/restaurants/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/MenuView.tsx +257 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartButton.tsx +26 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +121 -0
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/ReservationView.tsx +212 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useMenus.ts +34 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +52 -0
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useReservation.ts +49 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/layouts/SiteLayout.astro +47 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/menu.astro +22 -0
- package/skills/wix-headless-templates/restaurants/project/src/pages/reservations.astro +12 -0
- package/skills/wix-headless-templates/restaurants/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-core.ts +333 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +141 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +287 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +237 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservation-store.ts +279 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations-core.ts +218 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/reservations.ts +109 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/time-core.ts +118 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +337 -0
- package/skills/wix-headless-templates/restaurants/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/restaurants/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +96 -0
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +222 -0
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +102 -0
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +118 -0
- package/skills/wix-headless-templates/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +577 -0
- package/skills/wix-headless-templates/shared/CONTENT.md +22 -0
- package/skills/wix-headless-templates/shared/CUSTOM_OPERATIONS.md +100 -0
- package/skills/wix-headless-templates/shared/DESIGN.md +37 -0
- package/skills/wix-headless-templates/shared/SUPPLIED-CONTENT.md +27 -0
- package/skills/wix-headless-templates/shared/app/styles/global.css +57 -0
- package/skills/wix-headless-templates/shared/app/wix/config.ts +16 -0
- package/skills/wix-headless-templates/shared/app/wix/media.ts +106 -0
- package/skills/wix-headless-templates/shared/app/wix/money.ts +24 -0
- package/skills/wix-headless-templates/shared/app/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app/wix/media-upload/client.ts +46 -0
- package/skills/wix-headless-templates/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +69 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/INSTRUCTIONS.md +194 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchBox.tsx +136 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchHit.tsx +50 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/components/site-search/SearchResults.tsx +300 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSearch.ts +31 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/hooks/site-search/useSuggest.ts +26 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-core.ts +520 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search-store.ts +235 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/search.ts +80 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/suggest-store.ts +178 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app/wix/site-search/types.ts +158 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/app-astro/pages/search.astro +33 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +82 -0
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +43 -0
- package/skills/wix-headless-templates/shared/rest/client.ts +155 -0
- package/skills/wix-headless-templates/shared/rest/config.ts +4 -0
- package/skills/wix-headless-templates/shared/rest/media.ts +92 -0
- package/skills/wix-headless-templates/shared/seed/images.mjs +183 -0
- package/skills/wix-headless-templates/shared/seed/read-site.mjs +97 -0
- package/skills/wix-headless-templates/shared/seed/site-context.mjs +70 -0
- package/skills/wix-headless-templates/shared/seed/site.mjs +48 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +47 -0
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +685 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/app/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/app/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/app/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/app-astro/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/README.md +15 -0
- package/skills/wix-headless-templates/storefront/project/astro.config.mjs +22 -0
- package/skills/wix-headless-templates/storefront/project/package-lock.json +10786 -0
- package/skills/wix-headless-templates/storefront/project/package.json +41 -0
- package/skills/wix-headless-templates/storefront/project/public/favicon.svg +9 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/astro.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/background.svg +1 -0
- package/skills/wix-headless-templates/storefront/project/src/assets/wix.svg +18 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Hero.astro +77 -0
- package/skills/wix-headless-templates/storefront/project/src/components/Welcome.astro +95 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartButton.tsx +26 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/CartDrawer.tsx +239 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/FilterPanel.tsx +267 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/OptionPicker.tsx +171 -0
- package/skills/wix-headless-templates/storefront/project/src/components/storefront/QuickAdd.tsx +148 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useCart.ts +59 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useProductDetail.ts +42 -0
- package/skills/wix-headless-templates/storefront/project/src/hooks/storefront/useShop.ts +34 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/Layout.astro +22 -0
- package/skills/wix-headless-templates/storefront/project/src/layouts/SiteLayout.astro +65 -0
- package/skills/wix-headless-templates/storefront/project/src/pages/index.astro +8 -0
- package/skills/wix-headless-templates/storefront/project/src/styles/global.css +57 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/config.ts +16 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/media.ts +106 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/money.ts +24 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/sdk.ts +89 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-core.ts +220 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart-store.ts +134 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/cart.ts +186 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog-core.ts +698 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/catalog.ts +260 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/product-detail-store.ts +280 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/shop-store.ts +341 -0
- package/skills/wix-headless-templates/storefront/project/src/wix/storefront/types.ts +305 -0
- package/skills/wix-headless-templates/storefront/project/tsconfig.json +5 -0
- package/skills/wix-headless-templates/storefront/rest/cart.ts +183 -0
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +267 -0
- package/skills/wix-headless-templates/storefront/seed/SEED.md +169 -0
- package/skills/wix-headless-templates/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +839 -0
- package/skills/wix-manage/SKILL.md +11 -7
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +1 -1
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +206 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +17 -24
- package/skills/wix-manage/references/sites/create-headless-site.md +2 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +281 -171
- package/skills/wix-manage/references/stores/update-product-with-options.md +1 -1
- package/skills/wix-headless/entry/bootstrap.mjs +0 -156
- package/skills/wix-headless/entry/skill.md +0 -78
- package/skills/wix-headless-kit/cold-start/bootstrap.mjs +0 -156
- package/skills/wix-headless-kit/cold-start/cold-start.md +0 -111
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +0 -423
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
// Registration rules and DTO mapping — transport-agnostic, imported by both ./registration.ts
|
|
2
|
+
// (SDK) and the REST twin in templates/events/rest/registration.ts (fetch). Tier mapping (pricing
|
|
3
|
+
// methods, availability, sale period, tax + fee lines), the picker's totals, the reservation line
|
|
4
|
+
// items, error copy, the checkout callbacks, and the RSVP body built from the organizer's form
|
|
5
|
+
// live HERE, once. Raw ticket definitions carry `_id` (SDK) or `id` (REST). Types are imported
|
|
6
|
+
// type-only; the money/date formatters come from ./events-core (the same file both transports ship).
|
|
7
|
+
import type { EventDetail, RegistrationResult, RsvpForm, RsvpFormInput, SelectionTotals, TaxSettings, TicketSelection, TicketTier } from "./types";
|
|
8
|
+
import { formatAmount, formatInZone, formatMoney, type Raw } from "./events-core";
|
|
9
|
+
|
|
10
|
+
const tierId = (raw: Raw | undefined | null): string => raw?._id ?? raw?.id ?? "";
|
|
11
|
+
|
|
12
|
+
/** Wix's ticket service fee, added at checkout when a tier's `feeType` is FEE_ADDED_AT_CHECKOUT. */
|
|
13
|
+
export const WIX_FEE_RATE = 2.5;
|
|
14
|
+
const round2 = (n: number): number => Number(n.toFixed(2));
|
|
15
|
+
|
|
16
|
+
/** What the tier mapper needs from the event: the zone for sale dates, the tax the checkout applies. */
|
|
17
|
+
export type TierEvent = Pick<EventDetail, "id" | "timeZoneId" | "taxSettings">;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Query Available Ticket Definitions (V3) body: this event's tiers in the organizer's order. The
|
|
21
|
+
* endpoint is visitor-callable and already excludes hidden tiers; no paging needed (default 100).
|
|
22
|
+
*/
|
|
23
|
+
export function availableTiersQuery(eventId: string): Raw {
|
|
24
|
+
return { filter: { eventId }, sort: [{ fieldName: "sortIndex", order: "ASC" }] };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Formatted price of a Money (`value` first; the deprecated `amount` as the v1 fallback). */
|
|
28
|
+
export function formatTierPrice(price: Raw | undefined): string {
|
|
29
|
+
return formatMoney(price);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Tax on one ticket at `price` (Wix's getTicketDefinitionTax): INCLUDED_IN_PRICE backs the tax out
|
|
34
|
+
* of the price; ADDED_AT_CHECKOUT adds `rate%` on top.
|
|
35
|
+
*/
|
|
36
|
+
export function tierTax(tax: TaxSettings, price: number): { taxableValue: number; taxValue: number } {
|
|
37
|
+
if (tax.includedInPrice) {
|
|
38
|
+
const taxableValue = round2((price * 100) / (100 + tax.ratePercent));
|
|
39
|
+
return { taxableValue, taxValue: round2(price - taxableValue) };
|
|
40
|
+
}
|
|
41
|
+
return { taxableValue: price, taxValue: round2(price * (tax.ratePercent / 100)) };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The Wix fee on one ticket (getTicketDefinitionFee): 2.5% of the price plus any tax added at checkout. */
|
|
45
|
+
export function tierFee(tax: TaxSettings | null, price: number, guestPricing: boolean): number {
|
|
46
|
+
const addedTax = tax && !tax.includedInPrice && (!guestPricing || tax.appliedToDonations) ? tierTax(tax, price).taxValue : 0;
|
|
47
|
+
return round2((price + addedTax) * (WIX_FEE_RATE / 100));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The lines under a price that say what checkout adds (Wix's TicketDefinition Tax/Fee): tax is
|
|
52
|
+
* hidden for free tiers and for a guest price unless `appliedToDonations`; the fee only when the
|
|
53
|
+
* organizer passes it on (FEE_ADDED_AT_CHECKOUT) and the tier isn't free.
|
|
54
|
+
*/
|
|
55
|
+
export function priceNotes(
|
|
56
|
+
price: number,
|
|
57
|
+
currency: string,
|
|
58
|
+
tax: TaxSettings | null,
|
|
59
|
+
feeType: TicketTier["feeType"],
|
|
60
|
+
{ free, guestPricing }: { free: boolean; guestPricing: boolean },
|
|
61
|
+
): string[] {
|
|
62
|
+
const notes: string[] = [];
|
|
63
|
+
if (free) return notes;
|
|
64
|
+
if (tax && (!guestPricing || tax.appliedToDonations)) {
|
|
65
|
+
const { taxValue } = tierTax(tax, price);
|
|
66
|
+
notes.push(tax.includedInPrice ? `${tax.name} included` : `+${formatAmount(taxValue, currency)} ${tax.name}`);
|
|
67
|
+
}
|
|
68
|
+
if (feeType === "FEE_ADDED_AT_CHECKOUT") notes.push(`+${formatAmount(tierFee(tax, price, guestPricing), currency)} ticket service fee`);
|
|
69
|
+
return notes;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const FEE_TYPES = new Set(["FEE_INCLUDED", "FEE_ADDED_AT_CHECKOUT", "NO_FEE"]);
|
|
73
|
+
const SALE_STATUSES = new Set(["SALE_SCHEDULED", "SALE_STARTED", "SALE_ENDED"]);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* One raw ticket definition (V3 `pricingMethod`, or the v1 `price` shape) → tier DTO. Sold out is
|
|
77
|
+
* `limitPerCheckout === 0` (Wix lowers the per-checkout limit to the unsold count); a missing field
|
|
78
|
+
* means the API didn't say, never 0.
|
|
79
|
+
*/
|
|
80
|
+
export function toTier(raw: Raw, event: TierEvent): TicketTier {
|
|
81
|
+
const pm: Raw = raw.pricingMethod ?? {};
|
|
82
|
+
const fixed: Raw | undefined = pm.fixedPrice ?? raw.price;
|
|
83
|
+
const guest: Raw | undefined = pm.guestPrice;
|
|
84
|
+
const optionDetails: Raw[] = pm.pricingOptions?.optionDetails ?? [];
|
|
85
|
+
const currency: string = fixed?.currency ?? guest?.currency ?? optionDetails[0]?.price?.currency ?? "";
|
|
86
|
+
const tax = event.taxSettings;
|
|
87
|
+
const feeType = (FEE_TYPES.has(raw.feeType) ? raw.feeType : "") as TicketTier["feeType"];
|
|
88
|
+
const free = pm.free === true || raw.free === true || (fixed && Number(fixed.value ?? fixed.amount ?? 0) === 0 && !guest && !optionDetails.length);
|
|
89
|
+
const pricingType: TicketTier["pricingType"] = free ? "FREE" : guest ? "GUEST" : optionDetails.length ? "OPTIONS" : "FIXED";
|
|
90
|
+
const limit = Number(raw.limitPerCheckout);
|
|
91
|
+
const limitPerCheckout = Number.isInteger(limit) && limit >= 0 ? limit : 20;
|
|
92
|
+
const saleStatus = (SALE_STATUSES.has(raw.saleStatus) ? raw.saleStatus : "SALE_STARTED") as TicketTier["saleStatus"];
|
|
93
|
+
const options = optionDetails
|
|
94
|
+
.filter((o) => o.optionId)
|
|
95
|
+
.map((o) => ({
|
|
96
|
+
id: String(o.optionId),
|
|
97
|
+
name: o.name ?? "",
|
|
98
|
+
price: formatMoney(o.price),
|
|
99
|
+
value: String(o.price?.value ?? o.price?.amount ?? "0"),
|
|
100
|
+
notes: priceNotes(Number(o.price?.value ?? o.price?.amount ?? 0), currency, tax, feeType, { free: false, guestPricing: false }),
|
|
101
|
+
}));
|
|
102
|
+
const optionValues = optionDetails.map((o) => Number(o.price?.value ?? o.price?.amount ?? 0)).filter((n) => Number.isFinite(n));
|
|
103
|
+
const fixedValue = Number(fixed?.value ?? fixed?.amount ?? 0);
|
|
104
|
+
const price =
|
|
105
|
+
pricingType === "FREE"
|
|
106
|
+
? "Free"
|
|
107
|
+
: pricingType === "FIXED"
|
|
108
|
+
? formatMoney(fixed)
|
|
109
|
+
: pricingType === "OPTIONS" && optionValues.length
|
|
110
|
+
? `${formatAmount(Math.min(...optionValues), currency)} – ${formatAmount(Math.max(...optionValues), currency)}`
|
|
111
|
+
: "";
|
|
112
|
+
// Sale dates read in the EVENT's zone: "goes on sale" only while scheduled; "ends" once the sale started (Wix).
|
|
113
|
+
const salePeriod: Raw | undefined = raw.salePeriod;
|
|
114
|
+
return {
|
|
115
|
+
id: tierId(raw),
|
|
116
|
+
name: raw.name ?? "",
|
|
117
|
+
description: raw.description ?? "",
|
|
118
|
+
pricingType,
|
|
119
|
+
price,
|
|
120
|
+
priceValue: pricingType === "FIXED" ? String(fixed?.value ?? fixed?.amount ?? "0") : "0",
|
|
121
|
+
free: pricingType === "FREE",
|
|
122
|
+
minPrice: pricingType === "GUEST" ? formatMoney(guest) : "",
|
|
123
|
+
minPriceValue: pricingType === "GUEST" ? String(guest?.value ?? guest?.amount ?? "0") : "",
|
|
124
|
+
currency,
|
|
125
|
+
options: pricingType === "OPTIONS" ? options : [],
|
|
126
|
+
notes: pricingType === "OPTIONS" ? [] : priceNotes(fixedValue, currency, tax, feeType, { free: pricingType === "FREE", guestPricing: pricingType === "GUEST" }),
|
|
127
|
+
limitPerCheckout,
|
|
128
|
+
soldOut: limitPerCheckout === 0,
|
|
129
|
+
saleStatus,
|
|
130
|
+
available: limitPerCheckout > 0 && saleStatus === "SALE_STARTED",
|
|
131
|
+
saleStartsLabel: saleStatus === "SALE_SCHEDULED" ? formatInZone(salePeriod?.startDate, event.timeZoneId) : "",
|
|
132
|
+
saleEndsLabel: saleStatus !== "SALE_SCHEDULED" && salePeriod?.endDate ? formatInZone(salePeriod.endDate, event.timeZoneId) : "",
|
|
133
|
+
feeType,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Tiers in display order (V3 `sortIndex`, v1 `orderIndex`), skipping any without an id and the
|
|
139
|
+
* ones the organizer hides while not on sale (`salePeriod.displayNotOnSale === false`; v1 `hideNotOnSale`).
|
|
140
|
+
*/
|
|
141
|
+
export function toTiers(definitions: Raw[] | undefined, event: TierEvent): TicketTier[] {
|
|
142
|
+
return (definitions ?? [])
|
|
143
|
+
.filter((d) => d.hidden !== true)
|
|
144
|
+
.filter((d) => {
|
|
145
|
+
const onSale = (d.saleStatus ?? "SALE_STARTED") === "SALE_STARTED";
|
|
146
|
+
const hideWhenNotOnSale = d.salePeriod?.displayNotOnSale === false || d.hideNotOnSale === true;
|
|
147
|
+
return onSale || !hideWhenNotOnSale;
|
|
148
|
+
})
|
|
149
|
+
.slice()
|
|
150
|
+
.sort((a, b) => (a.sortIndex ?? a.orderIndex ?? 0) - (b.sortIndex ?? b.orderIndex ?? 0))
|
|
151
|
+
.map((d) => toTier(d, event))
|
|
152
|
+
.filter((t) => t.id);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** The store keys a selection by tier, or tier + pricing option. */
|
|
156
|
+
export function selectionKey(tierId: string, optionId?: string): string {
|
|
157
|
+
return optionId ? `${tierId}:${optionId}` : tierId;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Wix's clamp: 0..limitPerCheckout, where a limit of 0 (sold out) allows nothing — never a default of 20. */
|
|
161
|
+
export function clampQuantity(tier: TicketTier, quantity: number): number {
|
|
162
|
+
return Math.max(0, Math.min(Math.trunc(quantity) || 0, tier.limitPerCheckout || 0));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** A guest-priced tier needs a decimal at or above its minimum before it can be reserved. */
|
|
166
|
+
export function guestPriceValid(tier: TicketTier, value: string | undefined): boolean {
|
|
167
|
+
if (tier.pricingType !== "GUEST") return true;
|
|
168
|
+
const n = Number(value);
|
|
169
|
+
return value != null && value.trim() !== "" && Number.isFinite(n) && n >= Number(tier.minPriceValue || 0);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function ticketCount(selections: TicketSelection[]): number {
|
|
173
|
+
return selections.reduce((sum, s) => sum + (s.quantity > 0 ? s.quantity : 0), 0);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The picker's running totals — Wix's getTicketReservationTotals verbatim, returned formatted:
|
|
178
|
+
* subtotal = Σ price × qty (minus tax when INCLUDED_IN_PRICE), tax per the settings (skipped for
|
|
179
|
+
* free tiers and for donations unless appliedToDonations), fee per tier with FEE_ADDED_AT_CHECKOUT,
|
|
180
|
+
* total = subtotal + added tax + fee. Null with no selection. The hosted checkout is authoritative.
|
|
181
|
+
*/
|
|
182
|
+
export function selectionTotals(tiers: TicketTier[], selections: TicketSelection[], tax: TaxSettings | null): SelectionTotals | null {
|
|
183
|
+
const picked = selections.filter((s) => s.quantity > 0);
|
|
184
|
+
if (!picked.length) return null;
|
|
185
|
+
const currency = tiers.find((t) => t.currency)?.currency ?? "";
|
|
186
|
+
let subtotal = 0, taxTotal = 0, fee = 0, total = 0;
|
|
187
|
+
for (const s of picked) {
|
|
188
|
+
const tier = tiers.find((t) => t.id === s.tierId);
|
|
189
|
+
if (!tier) continue;
|
|
190
|
+
const guestPricing = tier.pricingType === "GUEST";
|
|
191
|
+
const price = guestPricing
|
|
192
|
+
? Number(s.guestPrice || "0")
|
|
193
|
+
: s.optionId
|
|
194
|
+
? Number(tier.options.find((o) => o.id === s.optionId)?.value ?? 0)
|
|
195
|
+
: Number(tier.priceValue || 0);
|
|
196
|
+
const unit = Number.isFinite(price) ? price : 0;
|
|
197
|
+
subtotal = round2(subtotal + unit * s.quantity);
|
|
198
|
+
total = round2(total + unit * s.quantity);
|
|
199
|
+
if (tax && !tier.free && (!guestPricing || tax.appliedToDonations)) taxTotal = round2(taxTotal + tierTax(tax, unit).taxValue * s.quantity);
|
|
200
|
+
if (tier.feeType === "FEE_ADDED_AT_CHECKOUT" && !tier.free) fee = round2(fee + tierFee(tax, unit, guestPricing) * s.quantity);
|
|
201
|
+
}
|
|
202
|
+
if (tax && !tax.includedInPrice) total = round2(total + taxTotal);
|
|
203
|
+
else if (tax && tax.includedInPrice) subtotal = round2(subtotal - taxTotal);
|
|
204
|
+
total = round2(total + fee);
|
|
205
|
+
return {
|
|
206
|
+
subtotal: formatAmount(subtotal, currency),
|
|
207
|
+
tax: formatAmount(taxTotal, currency),
|
|
208
|
+
fee: formatAmount(fee, currency),
|
|
209
|
+
total: formatAmount(total, currency),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The reservation's line items (Create Ticket Reservation): one per selection with `eventId`,
|
|
215
|
+
* `ticketDefinitionId`, `quantity` (1..50) and, where the tier needs it, `ticketInfo` — the
|
|
216
|
+
* `pricingOptionId` of an OPTIONS tier or the `guestPrice` of a GUEST tier. Throws when nothing is
|
|
217
|
+
* picked or a guest price is missing/below the minimum.
|
|
218
|
+
*/
|
|
219
|
+
export function reservationTickets(eventId: string, selections: TicketSelection[], tiers: TicketTier[] = []): Raw[] {
|
|
220
|
+
const tickets = selections
|
|
221
|
+
.filter((s) => s.quantity > 0)
|
|
222
|
+
.map((s) => {
|
|
223
|
+
const tier = tiers.find((t) => t.id === s.tierId);
|
|
224
|
+
if (tier && !guestPriceValid(tier, s.guestPrice)) {
|
|
225
|
+
throw new Error(tier.minPrice ? `Enter an amount of at least ${tier.minPrice} for ${tier.name}.` : `Enter an amount for ${tier.name}.`);
|
|
226
|
+
}
|
|
227
|
+
const ticketInfo: Raw = {};
|
|
228
|
+
if (s.optionId) ticketInfo.pricingOptionId = s.optionId;
|
|
229
|
+
if (tier?.pricingType === "GUEST" && s.guestPrice) ticketInfo.guestPrice = String(Number(s.guestPrice).toFixed(2));
|
|
230
|
+
return { eventId, ticketDefinitionId: s.tierId, quantity: s.quantity, ...(Object.keys(ticketInfo).length ? { ticketInfo } : {}) };
|
|
231
|
+
});
|
|
232
|
+
if (!tickets.length) throw new Error("Pick at least one ticket first.");
|
|
233
|
+
return tickets;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Visitor copy for the application error codes registration can answer with. */
|
|
237
|
+
const ERROR_COPY: Record<string, string> = {
|
|
238
|
+
GUEST_LIMIT_EXCEEDED: "This event is full.",
|
|
239
|
+
MEMBER_ALREADY_REGISTERED: "You're already registered for this event.",
|
|
240
|
+
MEMBER_EMAIL_ALREADY_REGISTERED: "You're already registered for this event.",
|
|
241
|
+
INVALID_FORM_RESPONSE: "Please fill in the required fields.",
|
|
242
|
+
UNEXPECTED_RSVP_STATUS: "Registration isn't open for this event.",
|
|
243
|
+
EVENT_NOT_FOUND: "This event is no longer available.",
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* One visitor-facing message out of any failure. SDK errors carry a JSON envelope as their message
|
|
248
|
+
* (`{ message, details: { applicationError: { code } } }`) plus `details` on the error object; the
|
|
249
|
+
* REST client sets `code`/`details` the same way. Known codes get copy; the payment gate (403
|
|
250
|
+
* NO_PAYMENT_METHOD_CONFIGURED until the site has a premium plan AND a payment method — not a
|
|
251
|
+
* permissions bug, never elevate) gets its owner-facing line; anything else is Wix's message.
|
|
252
|
+
*/
|
|
253
|
+
export function errorMessage(e: unknown): string {
|
|
254
|
+
const err = e as Raw | null;
|
|
255
|
+
let message = e instanceof Error ? e.message : typeof e === "string" ? e : "";
|
|
256
|
+
let code: string | undefined = err?.details?.applicationError?.code ?? err?.code;
|
|
257
|
+
try {
|
|
258
|
+
const parsed = JSON.parse(message);
|
|
259
|
+
if (parsed && typeof parsed === "object") {
|
|
260
|
+
message = typeof parsed.message === "string" ? parsed.message : message;
|
|
261
|
+
code = code ?? parsed.details?.applicationError?.code;
|
|
262
|
+
}
|
|
263
|
+
} catch {
|
|
264
|
+
/* a plain message */
|
|
265
|
+
}
|
|
266
|
+
if (code && ERROR_COPY[code]) return ERROR_COPY[code];
|
|
267
|
+
if (/payment method|not configured|premium/i.test(message) || code === "NO_PAYMENT_METHOD_CONFIGURED") {
|
|
268
|
+
return "Ticket sales aren't switched on yet — the organizer needs to connect a payment method in the dashboard.";
|
|
269
|
+
}
|
|
270
|
+
return message || "Something went wrong — please try again.";
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** The reservation failure as an Error with visitor copy (see errorMessage). */
|
|
274
|
+
export function reservationError(e: unknown): Error {
|
|
275
|
+
return new Error(errorMessage(e));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** The reservation id out of either transport's response; throws when the hold didn't happen. */
|
|
279
|
+
export function reservationId(reservation: Raw | null | undefined): string {
|
|
280
|
+
const id = tierId(reservation);
|
|
281
|
+
if (!id) throw new Error("Those tickets couldn't be reserved — they may have just sold out.");
|
|
282
|
+
return id;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Where the hosted checkout returns to. Defaults are the Astro routes; a static site passes its file paths. */
|
|
286
|
+
export interface CheckoutPaths {
|
|
287
|
+
/** Success landing — Wix appends `?orderNumber=&eventId=`. Default `/event-confirmation`. */
|
|
288
|
+
confirmation?: string;
|
|
289
|
+
/** Back here on abandon. Default `/events/<slug>`. */
|
|
290
|
+
event?: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The redirect session's callbacks. `origin` is the published https host (window.location.origin
|
|
295
|
+
* in a browser) — an http or server-derived origin isn't on the redirect allowlist and 403s the
|
|
296
|
+
* return; {} when unknown (SSR).
|
|
297
|
+
*/
|
|
298
|
+
export function checkoutCallbacks(origin: string, slug: string, paths: CheckoutPaths = {}): Raw {
|
|
299
|
+
if (!origin) return {};
|
|
300
|
+
return {
|
|
301
|
+
thankYouPageUrl: `${origin}${paths.confirmation ?? "/event-confirmation"}`,
|
|
302
|
+
postFlowUrl: `${origin}${paths.event ?? `/events/${encodeURIComponent(slug)}`}`,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** The redirect result; throws when Wix returned no URL. */
|
|
307
|
+
export function redirectResult(session: Raw | null | undefined): RegistrationResult {
|
|
308
|
+
const url = session?.redirectSession?.fullUrl;
|
|
309
|
+
if (!url) throw new Error("Checkout couldn't start — please try again.");
|
|
310
|
+
return { kind: "redirect", url };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ---- RSVP ---------------------------------------------------------------------------------------
|
|
314
|
+
|
|
315
|
+
/** The RSVP form's answers, keyed by input name (CHECKBOX answers are string arrays). */
|
|
316
|
+
export type RsvpValues = Record<string, string | string[]>;
|
|
317
|
+
|
|
318
|
+
/** What every RSVP form has (the system controls Wix creates) — used when the FORM fieldset is missing. */
|
|
319
|
+
export const DEFAULT_RSVP_FORM: RsvpForm = {
|
|
320
|
+
controls: [
|
|
321
|
+
{
|
|
322
|
+
id: "name",
|
|
323
|
+
type: "NAME",
|
|
324
|
+
system: true,
|
|
325
|
+
inputs: [
|
|
326
|
+
{ name: "firstName", label: "First name", mandatory: true, type: "TEXT", options: [], maxLength: 0 },
|
|
327
|
+
{ name: "lastName", label: "Last name", mandatory: true, type: "TEXT", options: [], maxLength: 0 },
|
|
328
|
+
],
|
|
329
|
+
},
|
|
330
|
+
{ id: "email", type: "INPUT", system: true, inputs: [{ name: "email", label: "Email", mandatory: true, type: "TEXT", options: [], maxLength: 0 }] },
|
|
331
|
+
],
|
|
332
|
+
guestControl: null,
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/** The form to render: the organizer's, else the built-in one. */
|
|
336
|
+
export function rsvpFormOf(event: Pick<EventDetail, "rsvpForm">): RsvpForm {
|
|
337
|
+
return event.rsvpForm ?? DEFAULT_RSVP_FORM;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Which inputs are the built-in guest identity: the system NAME control's two inputs (first, last)
|
|
342
|
+
* and the system email input. Create RSVP requires them at the top level of the body.
|
|
343
|
+
*/
|
|
344
|
+
export function builtInInputs(form: RsvpForm): { firstName: string; lastName: string; email: string } {
|
|
345
|
+
const name = form.controls.find((c) => c.type === "NAME") ?? form.controls.find((c) => c.system && c.inputs.length >= 2);
|
|
346
|
+
const emailControl =
|
|
347
|
+
form.controls.find((c) => c.system && c.type !== "NAME" && c.inputs.some((i) => /mail/i.test(i.name) || /mail/i.test(i.label))) ??
|
|
348
|
+
form.controls.find((c) => c.system && c.type !== "NAME");
|
|
349
|
+
const emailInput = emailControl?.inputs.find((i) => /mail/i.test(i.name) || /mail/i.test(i.label)) ?? emailControl?.inputs[0];
|
|
350
|
+
return { firstName: name?.inputs[0]?.name ?? "firstName", lastName: name?.inputs[1]?.name ?? "lastName", email: emailInput?.name ?? "email" };
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const filled = (v: string | string[] | undefined): boolean => (Array.isArray(v) ? v.some((x) => x.trim()) : typeof v === "string" && v.trim().length > 0);
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Whether the answers can be submitted: the built-in identity always; every mandatory input when
|
|
357
|
+
* attending (Create RSVP enforces mandatory values for `YES` only); a guest count within the
|
|
358
|
+
* control's range.
|
|
359
|
+
*/
|
|
360
|
+
export function canSubmitRsvp(form: RsvpForm, values: RsvpValues, guestCount: number, attending = true): boolean {
|
|
361
|
+
const ids = builtInInputs(form);
|
|
362
|
+
if (![ids.firstName, ids.lastName, ids.email].every((n) => filled(values[n]))) return false;
|
|
363
|
+
if (attending) {
|
|
364
|
+
for (const c of form.controls) for (const i of c.inputs) if (i.mandatory && !filled(values[i.name])) return false;
|
|
365
|
+
}
|
|
366
|
+
if (form.guestControl && (guestCount < 0 || guestCount > form.guestControl.maxGuests)) return false;
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** One form input's answer as Create RSVP wants it (`values` for TEXT_ARRAY inputs, `value` otherwise); null when unanswered. */
|
|
371
|
+
export function inputValueOf(input: RsvpFormInput, values: RsvpValues): Raw | null {
|
|
372
|
+
const v = values[input.name];
|
|
373
|
+
if (!filled(v)) return null;
|
|
374
|
+
if (input.type === "TEXT_ARRAY") return { inputName: input.name, values: (Array.isArray(v) ? v : [v as string]).filter((x) => x.trim()) };
|
|
375
|
+
return { inputName: input.name, value: Array.isArray(v) ? v.join(", ") : v };
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* The Create RSVP body: the built-in identity at the top level (required fields), the whole form
|
|
380
|
+
* as `form.inputValues` (only defined input names, only answered ones), `additionalGuestDetails`
|
|
381
|
+
* only when the form has a guest control. "NO" only when the event's rsvpResponseType is
|
|
382
|
+
* "YES_AND_NO".
|
|
383
|
+
*/
|
|
384
|
+
export function rsvpBody(
|
|
385
|
+
eventId: string,
|
|
386
|
+
form: RsvpForm,
|
|
387
|
+
values: RsvpValues,
|
|
388
|
+
status: "YES" | "NO",
|
|
389
|
+
guests: { guestCount: number; guestNames: string[] } = { guestCount: 0, guestNames: [] },
|
|
390
|
+
): Raw {
|
|
391
|
+
const ids = builtInInputs(form);
|
|
392
|
+
const str = (v: string | string[] | undefined): string => (Array.isArray(v) ? v.join(" ") : (v ?? "")).trim();
|
|
393
|
+
const inputValues = form.controls.flatMap((c) => c.inputs.map((i) => inputValueOf(i, values))).filter((x): x is Raw => x !== null);
|
|
394
|
+
const body: Raw = {
|
|
395
|
+
eventId,
|
|
396
|
+
status,
|
|
397
|
+
firstName: str(values[ids.firstName]),
|
|
398
|
+
lastName: str(values[ids.lastName]),
|
|
399
|
+
email: str(values[ids.email]),
|
|
400
|
+
form: { inputValues },
|
|
401
|
+
};
|
|
402
|
+
if (form.guestControl) {
|
|
403
|
+
const guestCount = Math.max(0, Math.min(Math.trunc(guests.guestCount) || 0, form.guestControl.maxGuests));
|
|
404
|
+
body.additionalGuestDetails = { guestCount, guestNames: guests.guestNames.slice(0, guestCount).map((n) => n.trim()).filter(Boolean) };
|
|
405
|
+
}
|
|
406
|
+
return body;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** A full event with a waitlist answers status "WAITLIST" — tell the guest they're waitlisted, not confirmed. */
|
|
410
|
+
export function rsvpResult(rsvp: Raw | null | undefined, sent: "YES" | "NO"): RegistrationResult {
|
|
411
|
+
const status = rsvp?.status;
|
|
412
|
+
return { kind: "rsvpConfirmed", status: status === "YES" || status === "NO" || status === "WAITLIST" ? status : sent };
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export type CheckoutEvent = Pick<EventDetail, "id" | "slug">;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// The registration flow for one event as a framework-free store — the logic behind
|
|
2
|
+
// useEventRegistration, usable from React (the hook wraps it), from a static page's event view,
|
|
3
|
+
// from Vue/Svelte, or as the specification for a port. Branched on event.registrationType:
|
|
4
|
+
// TICKETING loads the tier picker (quantities per tier or per pricing option, a named price for
|
|
5
|
+
// donation tiers, Wix's running totals) and checkout() reserves → redirects to Wix's hosted
|
|
6
|
+
// checkout; RSVP renders the ORGANIZER'S form (event.rsvpForm) and submits it in place. All
|
|
7
|
+
// correctness (the visitor-public tier read, the reservation payload, the redirect callbacks,
|
|
8
|
+
// rsvpV2, the form body) lives in the data layer — this store orchestrates; the page owns how it
|
|
9
|
+
// looks.
|
|
10
|
+
//
|
|
11
|
+
// One store per event surface: createRegistrationStore(event), not a singleton. A static site
|
|
12
|
+
// passes `paths` so the hosted checkout returns to its files (`event-confirmation.html`).
|
|
13
|
+
import { fetchTicketTiers, startTicketCheckout, submitRsvp, type CheckoutPaths } from "./registration";
|
|
14
|
+
import {
|
|
15
|
+
canSubmitRsvp,
|
|
16
|
+
clampQuantity,
|
|
17
|
+
errorMessage,
|
|
18
|
+
guestPriceValid,
|
|
19
|
+
rsvpFormOf,
|
|
20
|
+
selectionKey,
|
|
21
|
+
selectionTotals,
|
|
22
|
+
ticketCount as countTickets,
|
|
23
|
+
type RsvpValues,
|
|
24
|
+
} from "./registration-core";
|
|
25
|
+
import type { EventDetail, RegistrationResult, RsvpForm, SelectionTotals, TicketSelection, TicketTier } from "./types";
|
|
26
|
+
|
|
27
|
+
export type { RsvpValues };
|
|
28
|
+
|
|
29
|
+
export interface RegistrationStoreOptions {
|
|
30
|
+
/** Where the hosted checkout returns to; defaults are the Astro routes. */
|
|
31
|
+
paths?: CheckoutPaths;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RegistrationState {
|
|
35
|
+
/** TICKETING: tiers for the picker — null while loading (skeletons), [] honest empty. Other types: []. */
|
|
36
|
+
tiers: TicketTier[] | null;
|
|
37
|
+
/** Selected quantity per selection key — `tierId`, or `${tierId}:${optionId}` for a pricing option (0 when untouched). */
|
|
38
|
+
quantities: Record<string, number>;
|
|
39
|
+
/** GUEST (donation) tiers: the amount the visitor typed, per tier id. */
|
|
40
|
+
guestPrices: Record<string, string>;
|
|
41
|
+
/** The current selection as line items (quantity > 0 only). */
|
|
42
|
+
selections: TicketSelection[];
|
|
43
|
+
ticketCount: number;
|
|
44
|
+
/** The event's cap on one order — the picker refuses more (`+` disabled at the cap). */
|
|
45
|
+
ticketLimitPerOrder: number;
|
|
46
|
+
/** Wix's running totals for the selection (formatted); null with nothing selected. The hosted checkout is authoritative. */
|
|
47
|
+
totals: SelectionTotals | null;
|
|
48
|
+
/** True when ≥ 1 ticket is selected, within the order cap, and every donation tier has a valid amount — gate the checkout CTA on this. */
|
|
49
|
+
canCheckout: boolean;
|
|
50
|
+
/** RSVP: the form to render — the organizer's (event.rsvpForm) or the built-in name + email. */
|
|
51
|
+
rsvpForm: RsvpForm;
|
|
52
|
+
/** RSVP answers keyed by input name (CHECKBOX answers are arrays). */
|
|
53
|
+
rsvpValues: RsvpValues;
|
|
54
|
+
/** RSVP: additional guests (only meaningful when rsvpForm.guestControl is set). */
|
|
55
|
+
guestCount: number;
|
|
56
|
+
guestNames: string[];
|
|
57
|
+
/** True when the built-in identity and every mandatory input are filled — gate the RSVP CTA on this. */
|
|
58
|
+
canRsvp: boolean;
|
|
59
|
+
submitting: boolean;
|
|
60
|
+
/** Set after an RSVP completes (kind "rsvpConfirmed"; status may be "WAITLIST"). */
|
|
61
|
+
confirmed: RegistrationResult | null;
|
|
62
|
+
error: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface RegistrationStore {
|
|
66
|
+
getState(): RegistrationState;
|
|
67
|
+
subscribe(listener: () => void): () => void;
|
|
68
|
+
/** Load the tiers of a TICKETING event. Call once when mounted (a browser). */
|
|
69
|
+
start(): void;
|
|
70
|
+
/** Stop reacting; drop a late response. */
|
|
71
|
+
stop(): void;
|
|
72
|
+
/** Clamped to 0..limitPerCheckout (0 = sold out); ignored for tiers not on sale. `optionId` for an OPTIONS tier. Clears `error`. */
|
|
73
|
+
setQuantity(tierId: string, quantity: number, optionId?: string): void;
|
|
74
|
+
/** GUEST tiers: the amount the visitor pays (a decimal string). Clears `error`. */
|
|
75
|
+
setGuestPrice(tierId: string, value: string): void;
|
|
76
|
+
/** Answer one RSVP input by name (an array for CHECKBOX inputs). */
|
|
77
|
+
setRsvpValue(inputName: string, value: string | string[]): void;
|
|
78
|
+
/** RSVP: how many additional guests (0..guestControl.maxGuests) and their names. */
|
|
79
|
+
setGuestCount(count: number): void;
|
|
80
|
+
setGuestName(index: number, name: string): void;
|
|
81
|
+
/** Reserves + redirects to the Wix-hosted checkout. On "redirect" the browser is navigating. Throws (and sets .error) on refusal. */
|
|
82
|
+
checkout(): Promise<RegistrationResult>;
|
|
83
|
+
/** attending=false only when event.rsvpResponseType is "YES_AND_NO". Throws (and sets .error) on refusal. */
|
|
84
|
+
rsvp(attending?: boolean): Promise<RegistrationResult>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function createRegistrationStore(event: EventDetail, { paths }: RegistrationStoreOptions = {}): RegistrationStore {
|
|
88
|
+
const ticketed = event.registrationType === "TICKETING";
|
|
89
|
+
const rsvpForm = rsvpFormOf(event);
|
|
90
|
+
let tiers: TicketTier[] | null = ticketed ? null : [];
|
|
91
|
+
let quantities: Record<string, number> = {};
|
|
92
|
+
let guestPrices: Record<string, string> = {};
|
|
93
|
+
let rsvpValues: RsvpValues = {};
|
|
94
|
+
let guestCount = 0;
|
|
95
|
+
let guestNames: string[] = [];
|
|
96
|
+
let submitting = false;
|
|
97
|
+
let confirmed: RegistrationResult | null = null;
|
|
98
|
+
let error: string | null = null;
|
|
99
|
+
let started = false;
|
|
100
|
+
const listeners = new Set<() => void>();
|
|
101
|
+
let snapshot: RegistrationState | null = null;
|
|
102
|
+
const emit = () => {
|
|
103
|
+
snapshot = null;
|
|
104
|
+
for (const fn of listeners) fn();
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
function currentSelections(): TicketSelection[] {
|
|
108
|
+
return Object.entries(quantities)
|
|
109
|
+
.filter(([, q]) => q > 0)
|
|
110
|
+
.map(([key, quantity]) => {
|
|
111
|
+
const [tierId, optionId] = key.split(":");
|
|
112
|
+
const tier = (tiers ?? []).find((t) => t.id === tierId);
|
|
113
|
+
return {
|
|
114
|
+
tierId,
|
|
115
|
+
quantity,
|
|
116
|
+
...(optionId ? { optionId } : {}),
|
|
117
|
+
...(tier?.pricingType === "GUEST" ? { guestPrice: guestPrices[tierId] ?? "" } : {}),
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function getState(): RegistrationState {
|
|
123
|
+
if (snapshot) return snapshot;
|
|
124
|
+
const selections = currentSelections();
|
|
125
|
+
const ticketCount = countTickets(selections);
|
|
126
|
+
const guestPricesValid = selections.every((s) => {
|
|
127
|
+
const tier = (tiers ?? []).find((t) => t.id === s.tierId);
|
|
128
|
+
return !tier || guestPriceValid(tier, s.guestPrice);
|
|
129
|
+
});
|
|
130
|
+
snapshot = {
|
|
131
|
+
tiers,
|
|
132
|
+
quantities,
|
|
133
|
+
guestPrices,
|
|
134
|
+
selections,
|
|
135
|
+
ticketCount,
|
|
136
|
+
ticketLimitPerOrder: event.ticketLimitPerOrder,
|
|
137
|
+
totals: selectionTotals(tiers ?? [], selections, event.taxSettings),
|
|
138
|
+
canCheckout: ticketCount > 0 && ticketCount <= event.ticketLimitPerOrder && guestPricesValid,
|
|
139
|
+
rsvpForm,
|
|
140
|
+
rsvpValues,
|
|
141
|
+
guestCount,
|
|
142
|
+
guestNames,
|
|
143
|
+
canRsvp: canSubmitRsvp(rsvpForm, rsvpValues, guestCount, true),
|
|
144
|
+
submitting,
|
|
145
|
+
confirmed,
|
|
146
|
+
error,
|
|
147
|
+
};
|
|
148
|
+
return snapshot;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function run(op: () => Promise<RegistrationResult>): Promise<RegistrationResult> {
|
|
152
|
+
submitting = true;
|
|
153
|
+
error = null;
|
|
154
|
+
emit();
|
|
155
|
+
try {
|
|
156
|
+
const result = await op();
|
|
157
|
+
if (result.kind === "redirect") {
|
|
158
|
+
if (typeof window !== "undefined") window.location.href = result.url;
|
|
159
|
+
} else {
|
|
160
|
+
confirmed = result;
|
|
161
|
+
}
|
|
162
|
+
return result;
|
|
163
|
+
} catch (e) {
|
|
164
|
+
error = errorMessage(e);
|
|
165
|
+
throw e;
|
|
166
|
+
} finally {
|
|
167
|
+
submitting = false;
|
|
168
|
+
emit();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
getState,
|
|
174
|
+
subscribe(fn) {
|
|
175
|
+
listeners.add(fn);
|
|
176
|
+
return () => listeners.delete(fn);
|
|
177
|
+
},
|
|
178
|
+
start() {
|
|
179
|
+
if (started) return;
|
|
180
|
+
started = true;
|
|
181
|
+
if (!ticketed) return;
|
|
182
|
+
fetchTicketTiers(event)
|
|
183
|
+
.then((t) => {
|
|
184
|
+
if (!started) return;
|
|
185
|
+
tiers = t;
|
|
186
|
+
emit();
|
|
187
|
+
})
|
|
188
|
+
.catch((e) => {
|
|
189
|
+
if (!started) return;
|
|
190
|
+
tiers = [];
|
|
191
|
+
error = errorMessage(e);
|
|
192
|
+
emit();
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
stop() {
|
|
196
|
+
started = false;
|
|
197
|
+
},
|
|
198
|
+
setQuantity(tierId, quantity, optionId) {
|
|
199
|
+
const tier = (tiers ?? []).find((t) => t.id === tierId);
|
|
200
|
+
if (!tier || !tier.available) return;
|
|
201
|
+
if (optionId && !tier.options.some((o) => o.id === optionId)) return;
|
|
202
|
+
const key = selectionKey(tierId, optionId);
|
|
203
|
+
const clamped = clampQuantity(tier, quantity);
|
|
204
|
+
// The event caps one order: never let the total pass it (Wix's reservation would refuse with an opaque error).
|
|
205
|
+
const others = Object.entries(quantities).reduce((sum, [k, q]) => (k === key ? sum : sum + q), 0);
|
|
206
|
+
const capped = Math.max(0, Math.min(clamped, event.ticketLimitPerOrder - others));
|
|
207
|
+
quantities = { ...quantities, [key]: capped };
|
|
208
|
+
error = capped < clamped ? `Up to ${event.ticketLimitPerOrder} tickets per order.` : null; // a stale error never outlives a selection change
|
|
209
|
+
emit();
|
|
210
|
+
},
|
|
211
|
+
setGuestPrice(tierId, value) {
|
|
212
|
+
guestPrices = { ...guestPrices, [tierId]: value };
|
|
213
|
+
error = null;
|
|
214
|
+
emit();
|
|
215
|
+
},
|
|
216
|
+
setRsvpValue(inputName, value) {
|
|
217
|
+
rsvpValues = { ...rsvpValues, [inputName]: value };
|
|
218
|
+
emit();
|
|
219
|
+
},
|
|
220
|
+
setGuestCount(count) {
|
|
221
|
+
const max = rsvpForm.guestControl?.maxGuests ?? 0;
|
|
222
|
+
guestCount = Math.max(0, Math.min(Math.trunc(count) || 0, max));
|
|
223
|
+
guestNames = guestNames.slice(0, guestCount);
|
|
224
|
+
emit();
|
|
225
|
+
},
|
|
226
|
+
setGuestName(index, name) {
|
|
227
|
+
if (index < 0 || index >= guestCount) return;
|
|
228
|
+
const next = guestNames.slice();
|
|
229
|
+
while (next.length < guestCount) next.push("");
|
|
230
|
+
next[index] = name;
|
|
231
|
+
guestNames = next;
|
|
232
|
+
emit();
|
|
233
|
+
},
|
|
234
|
+
checkout: () => run(() => startTicketCheckout(event, currentSelections(), paths, tiers ?? [])),
|
|
235
|
+
rsvp: (attending = true) => run(() => submitRsvp(event, rsvpValues, attending ? "YES" : "NO", { guestCount, guestNames })),
|
|
236
|
+
};
|
|
237
|
+
}
|